From a65cc965dba79ec7febf0309527f778fb91b5c81 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Thu, 2 May 2019 05:58:09 +0000 Subject: [PATCH] [Support] Don't check MAP_ANONYMOUS, just use MAP_ANON Though being marked "deprecated" by the Linux man-pages project (MAP_ANON is a synonym of MAP_ANONYMOUS), it is the mostly widely available macro - many systems that don't provide MAP_ANONYMOUS have MAP_ANON. MAP_ANON is also used here and there in compiler-rt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359758 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Unix/Memory.inc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/Support/Unix/Memory.inc b/lib/Support/Unix/Memory.inc index d03ba6e8484..b8f5df5f72e 100644 --- a/lib/Support/Unix/Memory.inc +++ b/lib/Support/Unix/Memory.inc @@ -93,14 +93,7 @@ Memory::allocateMappedMemory(size_t NumBytes, int fd = -1; - int MMFlags = MAP_PRIVATE | -#ifdef MAP_ANONYMOUS - MAP_ANONYMOUS -#else - MAP_ANON -#endif - ; // Ends statement above - + int MMFlags = MAP_PRIVATE | MAP_ANON; int Protect = getPosixProtectionFlags(PFlags); #if defined(__NetBSD__) && defined(PROT_MPROTECT) -- 2.50.1