From a4ceda9b219d82c3bc4f071b1ee9ae60b5decf24 Mon Sep 17 00:00:00 2001 From: leleliu008 Date: Fri, 30 Aug 2024 12:24:09 +0800 Subject: [PATCH] MAP_POPULATE is Linux-specific and not declared on NetBSD https://www.man7.org/linux/man-pages/man2/mmap.2.html https://man.netbsd.org/mmap.2 Signed-off-by: leleliu008 --- src/file_reader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/file_reader.cpp b/src/file_reader.cpp index 0efaeaef..1d7a6f7f 100644 --- a/src/file_reader.cpp +++ b/src/file_reader.cpp @@ -143,7 +143,7 @@ class MMapException : std::exception {}; char* mmapReadOnly(int fd, offset_type offset, size_type size) { -#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__HAIKU__) +#if defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__HAIKU__) const auto MAP_FLAGS = MAP_PRIVATE; #elif defined(__FreeBSD__) const auto MAP_FLAGS = MAP_PRIVATE|MAP_PREFAULT_READ;