1 /* 2 * sys/mman.h 3 * mman-win32 4 */ 5 6 #ifndef _SYS_MMAN_H_ 7 #define _SYS_MMAN_H_ 8 9 #ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. 10 #define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. 11 #endif 12 13 /* All the headers include this file. */ 14 #ifndef _MSC_VER 15 #include <_mingw.h> 16 #endif 17 18 #include <sys/types.h> 19 20 #ifdef __cplusplus 21 extern "C" { 22 #endif 23 24 #define PROT_NONE 0 25 #define PROT_READ 1 26 #define PROT_WRITE 2 27 #define PROT_EXEC 4 28 29 #define MAP_FILE 0 30 #define MAP_SHARED 1 31 #define MAP_PRIVATE 2 32 #define MAP_TYPE 0xf 33 #define MAP_FIXED 0x10 34 #define MAP_ANONYMOUS 0x20 35 #define MAP_ANON MAP_ANONYMOUS 36 37 #define MAP_FAILED ((void *)-1) 38 39 /* Flags for msync. */ 40 #define MS_ASYNC 1 41 #define MS_SYNC 2 42 #define MS_INVALIDATE 4 43 44 void* mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off); 45 int munmap(void *addr, size_t len); 46 int mprotect(void *addr, size_t len, int prot); 47 int msync(void *addr, size_t len, int flags); 48 int mlock(const void *addr, size_t len); 49 int munlock(const void *addr, size_t len); 50 51 #ifdef __cplusplus 52 }; 53 #endif 54 55 #endif /* _SYS_MMAN_H_ */ 56