projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
inline syscalls for microblaze
[musl]
/
src
/
mman
/
mprotect.c
diff --git
a/src/mman/mprotect.c
b/src/mman/mprotect.c
index
11d5e23
..
5ab2d8b
100644
(file)
--- a/
src/mman/mprotect.c
+++ b/
src/mman/mprotect.c
@@
-1,7
+1,11
@@
#include <sys/mman.h>
#include <sys/mman.h>
+#include <limits.h>
#include "syscall.h"
int mprotect(void *addr, size_t len, int prot)
{
#include "syscall.h"
int mprotect(void *addr, size_t len, int prot)
{
- return syscall3(__NR_mprotect, (long)addr, len, prot);
+ size_t start, end;
+ start = (size_t)addr & -PAGE_SIZE;
+ end = (size_t)((char *)addr + len + PAGE_SIZE-1) & -PAGE_SIZE;
+ return syscall(SYS_mprotect, start, end-start, prot);
}
}