]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Hurd: define MAP_NORESERVE as no-op when missing
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 24 Apr 2013 07:47:19 +0000 (01:47 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 24 Apr 2013 07:47:19 +0000 (01:47 -0600)
Some systems like GNU Hurd provide teh mmap() API but lack MAP_NORESERVE
support. This option is an optimization, so we can define the macro
ourselves to nil and apparently not suffer (many) bad side effects.

src/DiskIO/Mmapped/MmappedFile.cc

index 5ae8c50a94a14a5067d552d2d5d6661b9f05086d..82a4d68b52373f64422eec314a740975db4df977 100644 (file)
 #include <errno.h>
 #endif
 
+// Some systems such as Hurd provide mmap() API but do not support MAP_NORESERVE
+#ifndef MAP_NORESERVE
+#define MAP_NORESERVE 0
+#endif
+
 CBDATA_CLASS_INIT(MmappedFile);
 
 // helper class to deal with mmap(2) offset alignment and other low-level specs