diff options
author | Ruediger Meier | 2016-02-18 16:37:13 +0100 |
---|---|---|
committer | Ruediger Meier | 2016-02-18 16:54:05 +0100 |
commit | 40733239a79b5fd1c761e03942044a1b5a39bc36 (patch) | |
tree | d6950ac0d46f322f4ea0255d6746331bdea780a2 /include/c.h | |
parent | lib: rename strmode() and setmode() (diff) | |
download | kernel-qcow2-util-linux-40733239a79b5fd1c761e03942044a1b5a39bc36.tar.gz kernel-qcow2-util-linux-40733239a79b5fd1c761e03942044a1b5a39bc36.tar.xz kernel-qcow2-util-linux-40733239a79b5fd1c761e03942044a1b5a39bc36.zip |
include: provide MAP_ANONYMOUS on OSX
Hope there are no side effect when defining _DARWIN_C_SOURCE
globally.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'include/c.h')
-rw-r--r-- | include/c.h | 8 |
1 files changed, 8 insertions, 0 deletions
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 */ |