diff options
author | lloyd <[email protected]> | 2008-08-27 15:18:09 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-08-27 15:18:09 +0000 |
commit | 999e3f574b058ad4c19007eb9b2768709bcb62e7 (patch) | |
tree | 34d5c2698f5eb510f98c1e77ab1e39a9e10301ee /modules/alloc_mmap | |
parent | 1b20697d57f26f98d226885fd9b755c8c1807344 (diff) |
Cleaner flags: define MAP_NOSYNC to zero ifndef, always use it
Diffstat (limited to 'modules/alloc_mmap')
-rw-r--r-- | modules/alloc_mmap/mmap_mem.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/alloc_mmap/mmap_mem.cpp b/modules/alloc_mmap/mmap_mem.cpp index e22c2dac5..e9ea17a53 100644 --- a/modules/alloc_mmap/mmap_mem.cpp +++ b/modules/alloc_mmap/mmap_mem.cpp @@ -87,13 +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"); - int flags = MAP_SHARED; - -#ifdef MAP_NOSYNC - flags |= MAP_NOSYNC; +#ifndef MAP_NOSYNC + #define MAP_NOSYNC 0 #endif - void* ptr = ::mmap(0, n, PROT_READ | PROT_WRITE, flags, + void* ptr = ::mmap(0, n, + PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_NOSYNC, file.get_fd(), 0); if(ptr == static_cast<void*>(MAP_FAILED)) |