]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
GNU Hurd: define MAP_NORESERVE as no-op when missing
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 26 Apr 2013 04:12:14 +0000 (22:12 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 26 Apr 2013 04:12:14 +0000 (22:12 -0600)
Some systems like GNU Hurd provide the 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 2501d73e9e7f6023750a64bbbbc1a38ac8dfb817..7a215bec88ca42faba2048b10d6b5bee6a97b6ed 100644 (file)
 #include "DiskIO/WriteRequest.h"
 #include <sys/mman.h>
 
+// 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