From 23573509244d4d5b4dc6d114b5807f72418f3411 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 20 Apr 2011 15:25:28 -0400 Subject: [PATCH] support posix_madvise (previous a stub) the check against MADV_DONTNEED to because linux MADV_DONTNEED semantics conflict dangerously with the POSIX semantics --- src/mman/posix_madvise.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 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); } -- 2.25.1