2023-01-13 21:06:27 +01:00
|
|
|
/* sys/mman.h: Memory allocation and deallocation. */
|
|
|
|
|
2023-03-12 15:32:09 +01:00
|
|
|
#ifndef _SYS_MMAN_H
|
|
|
|
#define _SYS_MMAN_H
|
2023-01-13 19:08:02 +01:00
|
|
|
|
|
|
|
#include <bits/mmap-flags.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
2023-01-13 19:27:53 +01:00
|
|
|
#define PAGE_SIZE 4096UL
|
2023-01-13 19:08:02 +01:00
|
|
|
|
|
|
|
#define MAP_FAILED (void*)-1
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
2023-03-14 20:43:15 +01: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 19:08:02 +01:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|