diff options
author | Rich Felker <dalias@aerifal.cx> | 2011-04-20 15:25:28 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2011-04-20 15:25:28 -0400 |
commit | 23573509244d4d5b4dc6d114b5807f72418f3411 (patch) | |
tree | a64ae975f50c00941fa8ac0df9ef9a7e10c0ea85 | |
parent | 1c76683cb4377a481dc1085b63170bb276512267 (diff) | |
download | musl-23573509244d4d5b4dc6d114b5807f72418f3411.tar.gz musl-23573509244d4d5b4dc6d114b5807f72418f3411.tar.xz musl-23573509244d4d5b4dc6d114b5807f72418f3411.zip |
support posix_madvise (previous a stub)
the check against MADV_DONTNEED to because linux MADV_DONTNEED semantics conflict dangerously with the POSIX semantics
-rw-r--r-- | src/mman/posix_madvise.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mman/posix_madvise.c b/src/mman/posix_madvise.c index 4727ad75..b76f1a75 100644 --- a/src/mman/posix_madvise.c +++ b/src/mman/posix_madvise.c @@ -1,6 +1,8 @@ +#define _GNU_SOURCE #include <sys/mman.h> 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); } |