LibC: Implement no-op posix_madvice

Also add non-posix prefixed definitions
This commit is contained in:
Bananymous 2025-04-19 02:05:24 +03:00
parent 201d752850
commit 46079a8612
2 changed files with 16 additions and 0 deletions

View File

@ -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

View File

@ -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 <BAN/Assert.h>