libc: Add msync wrapper
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
84c1ac4cee
commit
53d9f5c6fc
@ -10,6 +10,10 @@
|
|||||||
|
|
||||||
#define MAP_FAILED (void*)-1
|
#define MAP_FAILED (void*)-1
|
||||||
|
|
||||||
|
#define MS_SYNC 1
|
||||||
|
#define MS_ASYNC 2
|
||||||
|
#define MS_INVALIDATE 4
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
@ -21,6 +25,9 @@ extern "C"
|
|||||||
/* Remove a memory mapping. */
|
/* Remove a memory mapping. */
|
||||||
int munmap(void* addr, size_t len);
|
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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -18,6 +18,9 @@
|
|||||||
|
|
||||||
#define _POSIX_CHOWN_RESTRICTED 200112L
|
#define _POSIX_CHOWN_RESTRICTED 200112L
|
||||||
#define _POSIX_SHELL 200112L
|
#define _POSIX_SHELL 200112L
|
||||||
|
#define _POSIX_MAPPED_FILES 200112L
|
||||||
|
#define _POSIX_SYNCHRONIZED_IO 200112L
|
||||||
|
#define _POSIX_SAVED_IDS 200112L
|
||||||
#define _POSIX_VDISABLE (-2)
|
#define _POSIX_VDISABLE (-2)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -19,4 +19,10 @@ extern "C"
|
|||||||
long rc = syscall(SYS_munmap, addr, len);
|
long rc = syscall(SYS_munmap, addr, len);
|
||||||
__errno_return(rc, int);
|
__errno_return(rc, int);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int msync(void* addr, size_t len, int)
|
||||||
|
{
|
||||||
|
long rc = syscall(SYS_msync, addr, len);
|
||||||
|
__errno_return(rc, int);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user