summaryrefslogtreecommitdiff
path: root/src/mman/mprotect.c
AgeCommit message (Collapse)AuthorFilesLines
2014-09-06use weak symbols for the POSIX functions that will be used by C threadsJens Gustedt1-1/+3
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.
2013-09-15support configurable page size on mips, powerpc and microblazeSzabolcs Nagy1-1/+1
PAGE_SIZE was hardcoded to 4096, which is historically what most systems use, but on several archs it is a kernel config parameter, user space can only know it at execution time from the aux vector. PAGE_SIZE and PAGESIZE are not defined on archs where page size is a runtime parameter, applications should use sysconf(_SC_PAGE_SIZE) to query it. Internally libc code defines PAGE_SIZE to libc.page_size, which is set to aux[AT_PAGESZ] in __init_libc and early in __dynlink as well. (Note that libc.page_size can be accessed without GOT, ie. before relocations are done) Some fpathconf settings are hardcoded to 4096, these should be actually queried from the filesystem using statfs.
2011-06-29work around linux bug in mprotectRich Felker1-1/+5
per POSIX: The mprotect() function shall change the access protections to be that specified by prot for those whole pages containing any part of the address space of the process starting at address addr and continuing for len bytes. on the other hand, linux mprotect fails with EINVAL if the base address and/or length is not page-aligned, so we have to align them before making the syscall.
2011-03-20global cleanup to use the new syscall interfaceRich Felker1-1/+1
2011-02-12initial check-in, version 0.5.0v0.5.0Rich Felker1-0/+7