From 7d0e8cb1e213eacb091c0731a92f43677c0915e6 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. llvm-svn: 359758 --- llvm/lib/Support/Unix/Memory.inc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/llvm/lib/Support/Unix/Memory.inc b/llvm/lib/Support/Unix/Memory.inc index d03ba6e..b8f5df5 100644 --- a/llvm/lib/Support/Unix/Memory.inc +++ b/llvm/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.7.4