mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 05:32:28 +08:00
[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:
@@ -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;
|
||||
|
||||
@@ -170,6 +170,10 @@ void PrepareForSandboxing() {
|
||||
// Nothing here for now.
|
||||
}
|
||||
|
||||
uptr GetPageSize() {
|
||||
return sysconf(_SC_PAGESIZE);
|
||||
}
|
||||
|
||||
// ----------------- sanitizer_procmaps.h
|
||||
|
||||
MemoryMappingLayout::MemoryMappingLayout(bool cache_enabled) {
|
||||
|
||||
@@ -35,10 +35,6 @@
|
||||
namespace __sanitizer {
|
||||
|
||||
// ------------- sanitizer_common.h
|
||||
uptr GetPageSize() {
|
||||
return sysconf(_SC_PAGESIZE);
|
||||
}
|
||||
|
||||
uptr GetMmapGranularity() {
|
||||
return GetPageSize();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user