libc: Add msync wrapper
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
apio 2023-08-02 22:44:54 +02:00
parent 84c1ac4cee
commit 53d9f5c6fc
Signed by: apio
GPG Key ID: B8A7D06E42258954
3 changed files with 16 additions and 0 deletions

View File

@ -10,6 +10,10 @@
#define MAP_FAILED (void*)-1
#define MS_SYNC 1
#define MS_ASYNC 2
#define MS_INVALIDATE 4
#ifdef __cplusplus
extern "C"
{
@ -21,6 +25,9 @@ extern "C"
/* Remove a memory mapping. */
int munmap(void* addr, size_t len);
/* Write modified shared memory back to its associated file. */
int msync(void* addr, size_t len, int flags);
#ifdef __cplusplus
}
#endif

View File

@ -18,6 +18,9 @@
#define _POSIX_CHOWN_RESTRICTED 200112L
#define _POSIX_SHELL 200112L
#define _POSIX_MAPPED_FILES 200112L
#define _POSIX_SYNCHRONIZED_IO 200112L
#define _POSIX_SAVED_IDS 200112L
#define _POSIX_VDISABLE (-2)
#ifdef __cplusplus

View File

@ -19,4 +19,10 @@ extern "C"
long rc = syscall(SYS_munmap, addr, len);
__errno_return(rc, int);
}
int msync(void* addr, size_t len, int)
{
long rc = syscall(SYS_msync, addr, len);
__errno_return(rc, int);
}
}