aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-07-18 14:36:10 +0000
committerlloyd <[email protected]>2008-07-18 14:36:10 +0000
commit96a21f9f163a7305e823b5f3dfd3a19ea76a09a7 (patch)
tree7395b1abadc3db40b207cf847b4c23643db96cd6 /modules
parent51b77904aff48a0f0daf1908482447d7b28e308c (diff)
parent5096a1a709299ff46119913bfbc061f2587544ad (diff)
merge of '8ef9c5a39f68223d7f1930004418feab96dfa7ea'
and 'f46ce6653eec85ec92213d559a2260b0e2ee43ba'
Diffstat (limited to 'modules')
-rw-r--r--modules/alloc_mmap/mmap_mem.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/alloc_mmap/mmap_mem.cpp b/modules/alloc_mmap/mmap_mem.cpp
index 5955f9e22..e22c2dac5 100644
--- a/modules/alloc_mmap/mmap_mem.cpp
+++ b/modules/alloc_mmap/mmap_mem.cpp
@@ -87,7 +87,13 @@ void* MemoryMapping_Allocator::alloc_block(u32bit n)
if(::write(file.get_fd(), "\0", 1) != 1)
throw MemoryMapping_Failed("Could not write to file");
- void* ptr = ::mmap(0, n, PROT_READ | PROT_WRITE, MAP_SHARED,
+ int flags = MAP_SHARED;
+
+#ifdef MAP_NOSYNC
+ flags |= MAP_NOSYNC;
+#endif
+
+ void* ptr = ::mmap(0, n, PROT_READ | PROT_WRITE, flags,
file.get_fd(), 0);
if(ptr == static_cast<void*>(MAP_FAILED))