From def2dae16254ab9b38ed80ebc1578be61a56c15c Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Wed, 24 Apr 2013 01:47:19 -0600 Subject: [PATCH] Hurd: define MAP_NORESERVE as no-op when missing 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/DiskIO/Mmapped/MmappedFile.cc b/src/DiskIO/Mmapped/MmappedFile.cc index 5ae8c50a94..82a4d68b52 100644 --- a/src/DiskIO/Mmapped/MmappedFile.cc +++ b/src/DiskIO/Mmapped/MmappedFile.cc @@ -21,6 +21,11 @@ #include #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 -- 2.47.2