From 42a24823a16e4a627f45156903240424f43f04a3 Mon Sep 17 00:00:00 2001 From: Misha Brukman Date: Fri, 18 Jun 2004 15:34:07 +0000 Subject: Use the machine-independent method of querying the page size. llvm-svn: 14233 --- llvm/lib/Support/SystemUtils.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Support/SystemUtils.cpp') diff --git a/llvm/lib/Support/SystemUtils.cpp b/llvm/lib/Support/SystemUtils.cpp index 076e3a7..f016db2 100644 --- a/llvm/lib/Support/SystemUtils.cpp +++ b/llvm/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 */ -- cgit v1.1