#ifndef _SYS_MMAN_H #define _SYS_MMAN_H #include #include // for off_t /* Address returned by mmap when it fails. */ #define MAP_FAILED (void*)-1 #define PROT_NONE 0 #define PROT_READ 1 #define PROT_WRITE 2 #define PAGE_SIZE 4096 #ifdef __cplusplus extern "C" { #endif /* Maps size bytes of memory (rounded up to the nearest page-aligned size) into the current process's address * space at addr. If addr is null, the kernel will choose an address. */ void* mmap(void* addr, size_t size, int prot, int flags, int fd, off_t offset); /* Unmaps size bytes of memory (rounded up to the nearest page-aligned size) at addr from the current process's * address space. */ int munmap(void* addr, size_t size); /* Protects size bytes of memory according to the prot argument. */ int mprotect(void* addr, size_t size, int prot); #ifdef __cplusplus } #endif #endif