From: Amos Jeffries Date: Fri, 26 Apr 2013 04:12:14 +0000 (-0600) Subject: GNU Hurd: define MAP_NORESERVE as no-op when missing X-Git-Tag: SQUID_3_2_10~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2cb6b52a9b72bb2e797109d539f01b083911f67;p=thirdparty%2Fsquid.git GNU Hurd: define MAP_NORESERVE as no-op when missing 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. --- diff --git a/src/DiskIO/Mmapped/MmappedFile.cc b/src/DiskIO/Mmapped/MmappedFile.cc index 2501d73e9e..7a215bec88 100644 --- a/src/DiskIO/Mmapped/MmappedFile.cc +++ b/src/DiskIO/Mmapped/MmappedFile.cc @@ -11,6 +11,11 @@ #include "DiskIO/WriteRequest.h" #include +// 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