aboutsummaryrefslogtreecommitdiff
path: root/lib/mlibc/options/posix/include/sys/mman.h
blob: 784878e1bd80c40dc0c52422c2572c66fd62ad0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef _SYS_MMAN_H
#define _SYS_MMAN_H

#include <mlibc-config.h>
#include <abi-bits/mode_t.h>
#include <abi-bits/vm-flags.h>
#include <bits/off_t.h>
#include <bits/size_t.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifndef __MLIBC_ABI_ONLY

void *mmap(void *, size_t, int, int, int, off_t);
int mprotect(void *, size_t, int);
int munmap(void *, size_t);

int mlock(const void *, size_t);
int mlockall(int);
int munlock(const void *, size_t);
int munlockall(void);

int posix_madvise(void *, size_t, int);
int msync(void *, size_t, int);

int shm_open(const char *, int, mode_t);
int shm_unlink(const char *);

// Linux extension:
void *mremap(void *, size_t, size_t, int, ...);
int remap_file_pages(void *, size_t, int, size_t, int);

#if __MLIBC_LINUX_OPTION
int memfd_create(const char *, unsigned int);
int madvise(void *, size_t, int);
int mincore(void *, size_t, unsigned char *);
#endif /* __MLIBC_LINUX_OPTION */

#endif /* !__MLIBC_ABI_ONLY */

#ifdef __cplusplus
}
#endif

#endif // _SYS_MMAN_H