summaryrefslogtreecommitdiffstats
path: root/include/c.h
diff options
context:
space:
mode:
authorRuediger Meier2016-02-18 16:37:13 +0100
committerRuediger Meier2016-02-18 16:54:05 +0100
commit40733239a79b5fd1c761e03942044a1b5a39bc36 (patch)
treed6950ac0d46f322f4ea0255d6746331bdea780a2 /include/c.h
parentlib: rename strmode() and setmode() (diff)
downloadkernel-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.h8
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 */