projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1c76683
)
support posix_madvise (previous a stub)
author
Rich Felker
<dalias@aerifal.cx>
Wed, 20 Apr 2011 19:25:28 +0000
(15:25 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Wed, 20 Apr 2011 19:25:28 +0000
(15:25 -0400)
the check against MADV_DONTNEED to because linux MADV_DONTNEED
semantics conflict dangerously with the POSIX semantics
src/mman/posix_madvise.c
patch
|
blob
|
history
diff --git
a/src/mman/posix_madvise.c
b/src/mman/posix_madvise.c
index 4727ad750e6c0af33b2285f11dc0f2e5f433acdf..b76f1a75a3f696e45984f8c8095bf0efdb42a0cf 100644
(file)
--- 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);
}