-#define MAP_FIXED 0x0010 /* [MF|SHM] interpret addr exactly */
-#ifndef _POSIX_C_SOURCE
-#define MAP_RENAME 0x0020 /* Sun: rename private pages to file */
-#define MAP_NORESERVE 0x0040 /* Sun: don't reserve needed swap area */
-#define MAP_RESERVED0080 0x0080 /* previously unimplemented MAP_INHERIT */
-#define MAP_NOEXTEND 0x0100 /* for MAP_FILE, don't change file size */
-#define MAP_HASSEMAPHORE 0x0200 /* region may contain semaphores */
-#endif /* !_POSIX_C_SOURCE */
+#define MAP_FIXED 0x0010 /* [MF|SHM] interpret addr exactly */
+#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
+#define MAP_RENAME 0x0020 /* Sun: rename private pages to file */
+#define MAP_NORESERVE 0x0040 /* Sun: don't reserve needed swap area */
+#define MAP_RESERVED0080 0x0080 /* previously unimplemented MAP_INHERIT */
+#define MAP_NOEXTEND 0x0100 /* for MAP_FILE, don't change file size */
+#define MAP_HASSEMAPHORE 0x0200 /* region may contain semaphores */
+#define MAP_NOCACHE 0x0400 /* don't cache pages for this mapping */
+#define MAP_JIT 0x0800 /* Allocate a region that will be used for JIT purposes */
+
+/*
+ * Mapping type
+ */
+#define MAP_FILE 0x0000 /* map from file (default) */
+#define MAP_ANON 0x1000 /* allocated from memory, swap space */
+#define MAP_ANONYMOUS MAP_ANON
+
+/*
+ * The MAP_RESILIENT_* flags can be used when the caller wants to map some
+ * possibly unreliable memory and be able to access it safely, possibly
+ * getting the wrong contents rather than raising any exception.
+ * For safety reasons, such mappings have to be read-only (PROT_READ access
+ * only).
+ *
+ * MAP_RESILIENT_CODESIGN:
+ * accessing this mapping will not generate code-signing violations,
+ * even if the contents are tainted.
+ * MAP_RESILIENT_MEDIA:
+ * accessing this mapping will not generate an exception if the contents
+ * are not available (unreachable removable or remote media, access beyond
+ * end-of-file, ...). Missing contents will be replaced with zeroes.
+ */
+#define MAP_RESILIENT_CODESIGN 0x2000 /* no code-signing failures */
+#define MAP_RESILIENT_MEDIA 0x4000 /* no backing-store failures */
+
+#if !defined(CONFIG_EMBEDDED)
+#define MAP_32BIT 0x8000 /* Return virtual addresses <4G only: Requires entitlement */
+#endif /* !defined(CONFIG_EMBEDDED) */
+
+#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */