libc: Add madvise stub

This commit is contained in:
apio 2023-10-15 13:09:56 +02:00
parent 7db6e0163a
commit 2134dcc5ec
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 12 additions and 0 deletions

View File

@ -14,6 +14,9 @@
#define MS_ASYNC 2
#define MS_INVALIDATE 4
#define MADV_NORMAL 0
#define MADV_RANDOM 1
#ifdef __cplusplus
extern "C"
{
@ -28,6 +31,9 @@ extern "C"
/* Write modified shared memory back to its associated file. */
int msync(void* addr, size_t len, int flags);
/* Give advice about the use of memory. */
int madvise(void* addr, size_t length, int advice);
/* Create a new POSIX shared memory object. */
int shm_open(const char* name, int oflag, mode_t mode);

View File

@ -28,6 +28,12 @@ extern "C"
__errno_return(rc, int);
}
int madvise(void*, size_t, int)
{
// FIXME: Use this information to improve performance.
return 0;
}
int shm_open(const char* name, int oflag, mode_t mode)
{
char buf[BUFSIZ];