summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lib/posix/posix.nim12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/posix/posix.nim b/lib/posix/posix.nim
index 17bcc420e..5bd43fe9c 100644
--- a/lib/posix/posix.nim
+++ b/lib/posix/posix.nim
@@ -1375,8 +1375,6 @@ var
     ## Share changes.
   MAP_PRIVATE* {.importc, header: "<sys/mman.h>".}: cint
     ## Changes are private.
-  MAP_POPULATE* {.importc, header: "<sys/mman.h>".}: cint
-    ## Populate (prefault) page tables for a mapping.
   MAP_FIXED* {.importc, header: "<sys/mman.h>".}: cint
     ## Interpret addr exactly.
   MS_ASYNC* {.importc, header: "<sys/mman.h>".}: cint
@@ -1581,6 +1579,16 @@ var
   MSG_OOB* {.importc, header: "<sys/socket.h>".}: cint
     ## Out-of-band data.
 
+
+when defined(linux):
+  var
+    MAP_POPULATE* {.importc, header: "<sys/mman.h>".}: cint
+      ## Populate (prefault) page tables for a mapping.
+else:
+  var
+    MAP_POPULATE*: cint = 0
+
+
 when defined(macosx):
   var
     MSG_HAVEMORE* {.importc, header: "<sys/socket.h>".}: cint