(bal/tim) [acconfig.h configure.ac monitor_mm.c servconf.c
openbsd-compat/Makefile.in] support compression on platforms that
have no/broken MAP_ANON. Moved code to openbsd-compat/xmmap.c
Based on patch from nalin@redhat.com of code extracted from Owl's package
diff --git a/monitor_mm.c b/monitor_mm.c
index f72a180..fb5f2c8 100644
--- a/monitor_mm.c
+++ b/monitor_mm.c
@@ -91,15 +91,9 @@
*/
mm->mmalloc = mmalloc;
-#ifdef HAVE_MMAP_ANON_SHARED
- address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED,
- -1, 0);
+ address = xmmap(size);
if (address == MAP_FAILED)
fatal("mmap(%lu): %s", (u_long)size, strerror(errno));
-#else
- fatal("%s: UsePrivilegeSeparation=yes and Compression=yes not supported",
- __func__);
-#endif
mm->address = address;
mm->size = size;
@@ -137,7 +131,7 @@
mm_freelist(mm->mmalloc, &mm->rb_free);
mm_freelist(mm->mmalloc, &mm->rb_allocated);
-#ifdef HAVE_MMAP_ANON_SHARED
+#ifdef HAVE_MMAP
if (munmap(mm->address, mm->size) == -1)
fatal("munmap(%p, %lu): %s", mm->address, (u_long)mm->size,
strerror(errno));