aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2009-05-23 17:57:59 +0000
committerJay Foad <jay.foad@gmail.com>2009-05-23 17:57:59 +0000
commitdc3e36dd1f8485f55a28fac99fa23a5bfb011e61 (patch)
treeb83b0a2c75abdac8d8e8377d962501fc30184c10
parenta9bb5d91c0090d8492df3314237c97cbbccfc02e (diff)
downloadexternal_llvm-dc3e36dd1f8485f55a28fac99fa23a5bfb011e61.zip
external_llvm-dc3e36dd1f8485f55a28fac99fa23a5bfb011e61.tar.gz
external_llvm-dc3e36dd1f8485f55a28fac99fa23a5bfb011e61.tar.bz2
Work around a page size issue on Cygwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72332 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/System/Unix/Process.inc7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/System/Unix/Process.inc b/lib/System/Unix/Process.inc
index e4f37a1..74b9bb8 100644
--- a/lib/System/Unix/Process.inc
+++ b/lib/System/Unix/Process.inc
@@ -42,7 +42,12 @@ using namespace sys;
unsigned
Process::GetPageSize()
{
-#if defined(HAVE_GETPAGESIZE)
+#if defined(__CYGWIN__)
+ // On Cygwin, getpagesize() returns 64k but the page size for the purposes of
+ // memory protection and mmap() is 4k.
+ // See http://www.cygwin.com/ml/cygwin/2009-01/threads.html#00492
+ static const int page_size = 0x1000;
+#elif defined(HAVE_GETPAGESIZE)
static const int page_size = ::getpagesize();
#elif defined(HAVE_SYSCONF)
static long page_size = ::sysconf(_SC_PAGE_SIZE);