diff options
author | Jay Foad <jay.foad@gmail.com> | 2009-05-23 17:57:59 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2009-05-23 17:57:59 +0000 |
commit | c1fca9fb3a6c0e0b3b546927c238e85e9a47f33f (patch) | |
tree | 36ae02d4ed6304f8eed5374eb16140ebf3adc5ca /llvm/lib/System/Unix | |
parent | be6a9a151adb3e9b47f45a10d31f451fd461720f (diff) | |
download | bcm5719-llvm-c1fca9fb3a6c0e0b3b546927c238e85e9a47f33f.tar.gz bcm5719-llvm-c1fca9fb3a6c0e0b3b546927c238e85e9a47f33f.zip |
Work around a page size issue on Cygwin.
llvm-svn: 72332
Diffstat (limited to 'llvm/lib/System/Unix')
-rw-r--r-- | llvm/lib/System/Unix/Process.inc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/System/Unix/Process.inc b/llvm/lib/System/Unix/Process.inc index e4f37a1ff59..74b9bb8b142 100644 --- a/llvm/lib/System/Unix/Process.inc +++ b/llvm/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); |