summaryrefslogtreecommitdiff
path: root/lib/Support/SystemUtils.cpp
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2004-06-18 15:34:07 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2004-06-18 15:34:07 +0000
commitb48730372594d6a476d0a32c4ce12d963ee3812a (patch)
tree35f35488db571b736bd5106ccd5f508d695419c7 /lib/Support/SystemUtils.cpp
parent0ed24ad96875969749d653b3cfc8154ae3046c74 (diff)
downloadllvm-b48730372594d6a476d0a32c4ce12d963ee3812a.tar.gz
llvm-b48730372594d6a476d0a32c4ce12d963ee3812a.tar.bz2
llvm-b48730372594d6a476d0a32c4ce12d963ee3812a.tar.xz
Use the machine-independent method of querying the page size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14233 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/SystemUtils.cpp')
-rw-r--r--lib/Support/SystemUtils.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Support/SystemUtils.cpp b/lib/Support/SystemUtils.cpp
index 076e3a7b93..f016db2b99 100644
--- a/lib/Support/SystemUtils.cpp
+++ b/lib/Support/SystemUtils.cpp
@@ -17,6 +17,7 @@
#include "Config/sys/types.h"
#include "Config/sys/stat.h"
#include "Config/fcntl.h"
+#include "Config/pagesize.h"
#include "Config/sys/wait.h"
#include "Config/sys/mman.h"
#include "Config/unistd.h"
@@ -283,7 +284,7 @@ void *llvm::AllocateRWXMemory(unsigned NumBytes) {
return P;
#elif defined(HAVE_MMAP)
- static const long pageSize = sysconf(_SC_PAGESIZE);
+ static const long pageSize = GetPageSize();
unsigned NumPages = (NumBytes+pageSize-1)/pageSize;
/* FIXME: This should use the proper autoconf flags */