support posix_madvise (previous a stub)
the check against MADV_DONTNEED to because linux MADV_DONTNEED semantics conflict dangerously with the POSIX semantics
This commit is contained in:
parent
1c76683cb4
commit
2357350924
1 changed files with 3 additions and 1 deletions
|
|
@ -1,6 +1,8 @@
|
||||||
|
#define _GNU_SOURCE
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
|
||||||
int posix_madvise(void *addr, size_t len, int advice)
|
int posix_madvise(void *addr, size_t len, int advice)
|
||||||
{
|
{
|
||||||
return 0;
|
if (advice == MADV_DONTNEED) return 0;
|
||||||
|
return -__syscall(SYS_madvise, addr, len, advice);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue