From 40733239a79b5fd1c761e03942044a1b5a39bc36 Mon Sep 17 00:00:00 2001 From: Ruediger Meier Date: Thu, 18 Feb 2016 16:37:13 +0100 Subject: include: provide MAP_ANONYMOUS on OSX Hope there are no side effect when defining _DARWIN_C_SOURCE globally. Signed-off-by: Ruediger Meier --- include/c.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/c.h') diff --git a/include/c.h b/include/c.h index ca028baee..aec34394d 100644 --- a/include/c.h +++ b/include/c.h @@ -355,4 +355,12 @@ static inline int xusleep(useconds_t usec) */ #define UL_GETPW_BUFSIZ (16 * 1024) +/* + * Darwin or other BSDs may only have MAP_ANON. To get it on Darwin we must + * define _DARWIN_C_SOURCE before including sys/mman.h. We do this in config.h. + */ +#if !defined MAP_ANONYMOUS && defined MAP_ANON +# define MAP_ANONYMOUS (MAP_ANON) +#endif + #endif /* UTIL_LINUX_C_H */ -- cgit v1.2.3-55-g7522