OSDN Git Service
(root)
/
android-x86
/
external-musl-libc.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
4727ad7
..
b76f1a7
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);
}