[nolibc] Move GetPageSize to the individual platforms.

GetPageSize wraps sysconf(_SC_PAGESIZE) on POSIX platforms, but
sysconf resides in libc.  To make this libc-independent on Linux,
move the wrapper to sanitizer_mac.cc and return the Linux-specific
constant EXEC_PAGESIZE in the sanitizer_linux.cc implementation.

llvm-svn: 182303
This commit is contained in:
Peter Collingbourne
2013-05-20 17:05:29 +00:00
parent 885b4b71be
commit b69b8a4a8f
3 changed files with 8 additions and 4 deletions

View File

@@ -613,6 +613,10 @@ bool ThreadLister::GetDirectoryEntries() {
return true;
}
uptr GetPageSize() {
return EXEC_PAGESIZE;
}
// Match full names of the form /path/to/base_name{-,.}*
bool LibraryNameIs(const char *full_name, const char *base_name) {
const char *name = full_name;

View File

@@ -170,6 +170,10 @@ void PrepareForSandboxing() {
// Nothing here for now.
}
uptr GetPageSize() {
return sysconf(_SC_PAGESIZE);
}
// ----------------- sanitizer_procmaps.h
MemoryMappingLayout::MemoryMappingLayout(bool cache_enabled) {

View File

@@ -35,10 +35,6 @@
namespace __sanitizer {
// ------------- sanitizer_common.h
uptr GetPageSize() {
return sysconf(_SC_PAGESIZE);
}
uptr GetMmapGranularity() {
return GetPageSize();
}