summaryrefslogtreecommitdiff
path: root/libc/stdlib/malloc-standard/malloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdlib/malloc-standard/malloc.h')
-rw-r--r--libc/stdlib/malloc-standard/malloc.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/libc/stdlib/malloc-standard/malloc.h b/libc/stdlib/malloc-standard/malloc.h
index 46858332d..0b8bbef31 100644
--- a/libc/stdlib/malloc-standard/malloc.h
+++ b/libc/stdlib/malloc-standard/malloc.h
@@ -350,8 +350,17 @@ extern pthread_mutex_t __malloc_lock;
#define MAP_ANONYMOUS MAP_ANON
#endif
-#define MMAP(addr, size, prot, flags) \
- (mmap((addr), (size), (prot), (flags)|MAP_ANONYMOUS, -1, 0))
+#ifdef __ARCH_HAS_MMU__
+
+#define MMAP(addr, size, prot) \
+ (mmap((addr), (size), (prot), MAP_PRIVATE|MAP_ANONYMOUS, 0, 0))
+
+#else
+
+#define MMAP(addr, size, prot) \
+ (mmap((addr), (size), (prot), MAP_SHARED|MAP_ANONYMOUS, 0, 0))
+
+#endif
/* ----------------------- Chunk representations ----------------------- */