From bd5969fc876a10b18613302db7087ef3c40f18e1 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 7 Mar 2024 17:28:00 -0500 Subject: lib: Add mlibc Signed-off-by: Ian Moffett --- lib/mlibc/options/posix/include/sys/mman.h | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 lib/mlibc/options/posix/include/sys/mman.h (limited to 'lib/mlibc/options/posix/include/sys/mman.h') diff --git a/lib/mlibc/options/posix/include/sys/mman.h b/lib/mlibc/options/posix/include/sys/mman.h new file mode 100644 index 0000000..784878e --- /dev/null +++ b/lib/mlibc/options/posix/include/sys/mman.h @@ -0,0 +1,47 @@ +#ifndef _SYS_MMAN_H +#define _SYS_MMAN_H + +#include +#include +#include +#include +#include + +#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 -- cgit v1.2.3