diff --git a/userspace/libraries/LibC/include/sys/mman.h b/userspace/libraries/LibC/include/sys/mman.h index 9c168fe0..c3cf4820 100644 --- a/userspace/libraries/LibC/include/sys/mman.h +++ b/userspace/libraries/LibC/include/sys/mman.h @@ -32,6 +32,12 @@ __BEGIN_DECLS #define POSIX_MADV_SEQUENTIAL 4 #define POSIX_MADV_WILLNEED 5 +#define MADV_DONTNEED POSIX_MADV_DONTNEED +#define MADV_NORMAL POSIX_MADV_NORMAL +#define MADV_RANDOM POSIX_MADV_RANDOM +#define MADV_SEQUENTIAL POSIX_MADV_SEQUENTIAL +#define MADV_WILLNEED POSIX_MADV_WILLNEED + #define POSIX_TYPED_MEM_ALLOCATE 0x01 #define POSIX_TYPED_MEM_ALLOCATE_CONTIG 0x02 #define POSIX_TYPED_MEM_MAP_ALLOCATABLE 0x04 @@ -71,6 +77,8 @@ int posix_typed_mem_open(const char* name, int oflag, int tflag); int shm_open(const char* name, int oflag, mode_t mode); int shm_unlink(const char* name); +#define madvise posix_madvise + __END_DECLS #endif diff --git a/userspace/libraries/LibC/sys/mman.cpp b/userspace/libraries/LibC/sys/mman.cpp index b53c8252..4dc38ae2 100644 --- a/userspace/libraries/LibC/sys/mman.cpp +++ b/userspace/libraries/LibC/sys/mman.cpp @@ -28,6 +28,14 @@ int msync(void* addr, size_t len, int flags) return syscall(SYS_MSYNC, addr, len, flags); } +int posix_madvise(void* addr, size_t len, int advice) +{ + (void)addr; + (void)len; + (void)advice; + fprintf(stddbg, "TODO: posix_madvise"); + return 0; +} #include