From df7d0dfb9c686df31149d09008ba92834bed9803 Mon Sep 17 00:00:00 2001 From: Jens Gustedt Date: Mon, 1 Sep 2014 00:46:23 +0200 Subject: use weak symbols for the POSIX functions that will be used by C threads The intent of this is to avoid name space pollution of the C threads implementation. This has two sides to it. First we have to provide symbols that wouldn't pollute the name space for the C threads implementation. Second we have to clean up some internal uses of POSIX functions such that they don't implicitly drag in such symbols. --- src/mman/mprotect.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mman') diff --git a/src/mman/mprotect.c b/src/mman/mprotect.c index f488486d..535787b9 100644 --- a/src/mman/mprotect.c +++ b/src/mman/mprotect.c @@ -2,10 +2,12 @@ #include "libc.h" #include "syscall.h" -int mprotect(void *addr, size_t len, int prot) +int __mprotect(void *addr, size_t len, int 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); } + +weak_alias(__mprotect, mprotect); -- cgit v1.2.1