2023-01-13 20:06:27 +00:00
|
|
|
/* sys/mman.h: Memory allocation and deallocation. */
|
|
|
|
|
2023-03-12 14:32:09 +00:00
|
|
|
#ifndef _SYS_MMAN_H
|
|
|
|
#define _SYS_MMAN_H
|
2023-01-13 18:08:02 +00:00
|
|
|
|
|
|
|
#include <bits/mmap-flags.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
2023-01-13 18:27:53 +00:00
|
|
|
#define PAGE_SIZE 4096UL
|
2023-01-13 18:08:02 +00:00
|
|
|
|
|
|
|
#define MAP_FAILED (void*)-1
|
|
|
|
|
2023-08-02 20:44:54 +00:00
|
|
|
#define MS_SYNC 1
|
|
|
|
#define MS_ASYNC 2
|
|
|
|
#define MS_INVALIDATE 4
|
|
|
|
|
2023-01-13 18:08:02 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
2023-03-14 19:43:15 +00:00
|
|
|
/* Map a file into memory. */
|
|
|
|
void* mmap(void* addr, size_t len, int prot, int flags, int fd, off_t offset);
|
|
|
|
|
|
|
|
/* Remove a memory mapping. */
|
|
|
|
int munmap(void* addr, size_t len);
|
2023-01-13 18:08:02 +00:00
|
|
|
|
2023-08-02 20:44:54 +00:00
|
|
|
/* Write modified shared memory back to its associated file. */
|
|
|
|
int msync(void* addr, size_t len, int flags);
|
|
|
|
|
2023-01-13 18:08:02 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|