forked from 0ad/0ad
janwas
0bb0df5b2c
- remove headers always included from PCH - nommgr.h is only included ifdef REDEFINED_NEW (allows leaving out the mmgr stuff) - in lib/*.cpp, moved the corresponding include file to right behind the PCH (catches headers that aren't compilable by themselves) - byte_order no longer depends on SDL - add debug_level (another means of filtering debug output; needed for thesis) - split posix stuff up into subdirs (lib/posix and sysdep/win/wposix). makes including only some of the modules (e.g. sockets, time) much easier. This was SVN commit r4728.
38 lines
1.2 KiB
C
38 lines
1.2 KiB
C
#ifndef INCLUDED_WMMAN
|
|
#define INCLUDED_WMMAN
|
|
|
|
//
|
|
// <sys/mman.h>
|
|
//
|
|
|
|
// mmap prot flags
|
|
#define PROT_NONE 0x00
|
|
#define PROT_READ 0x01
|
|
#define PROT_WRITE 0x02
|
|
#define PROT_EXEC 0x04
|
|
|
|
// mmap flags
|
|
#define MAP_SHARED 0x01 // writes change the underlying file
|
|
#define MAP_PRIVATE 0x02 // writes do not affect the file (copy-on-write)
|
|
#define MAP_FIXED 0x04
|
|
// .. non-portable
|
|
#define MAP_ANONYMOUS 0x10
|
|
#define MAP_NORESERVE 0x20
|
|
|
|
// note: we need a means of only "reserving" virtual address ranges
|
|
// for the fixed-address expandable array mechanism. the non-portable
|
|
// MAP_NORESERVE flag says that no space in the page file need be reserved.
|
|
// the caller can still try to access the entire mapping, but might get
|
|
// SIGBUS if there isn't enough room to commit a page. Linux currently
|
|
// doesn't commit mmap-ed regions anyway, but we specify this flag to
|
|
// make sure of that in the future.
|
|
|
|
#define MAP_FAILED ((void*)-1L)
|
|
|
|
extern void* mmap(void* start, size_t len, int prot, int flags, int fd, off_t offset);
|
|
extern int munmap(void* start, size_t len);
|
|
|
|
extern int mprotect(void* addr, size_t len, int prot);
|
|
|
|
#endif // #ifndef INCLUDED_WMMAN
|