libc: Add madvise stub
This commit is contained in:
parent
7db6e0163a
commit
2134dcc5ec
@ -14,6 +14,9 @@
|
|||||||
#define MS_ASYNC 2
|
#define MS_ASYNC 2
|
||||||
#define MS_INVALIDATE 4
|
#define MS_INVALIDATE 4
|
||||||
|
|
||||||
|
#define MADV_NORMAL 0
|
||||||
|
#define MADV_RANDOM 1
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
@ -28,6 +31,9 @@ extern "C"
|
|||||||
/* Write modified shared memory back to its associated file. */
|
/* Write modified shared memory back to its associated file. */
|
||||||
int msync(void* addr, size_t len, int flags);
|
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. */
|
/* Create a new POSIX shared memory object. */
|
||||||
int shm_open(const char* name, int oflag, mode_t mode);
|
int shm_open(const char* name, int oflag, mode_t mode);
|
||||||
|
|
||||||
|
@ -28,6 +28,12 @@ extern "C"
|
|||||||
__errno_return(rc, int);
|
__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)
|
int shm_open(const char* name, int oflag, mode_t mode)
|
||||||
{
|
{
|
||||||
char buf[BUFSIZ];
|
char buf[BUFSIZ];
|
||||||
|
Loading…
Reference in New Issue
Block a user