[llvm-commits] [llvm] r72332 - /llvm/trunk/lib/System/Unix/Process.inc
Jay Foad
jay.foad at gmail.com
Sat May 23 10:58:01 PDT 2009
Author: foad
Date: Sat May 23 12:57:59 2009
New Revision: 72332
URL: http://llvm.org/viewvc/llvm-project?rev=72332&view=rev
Log:
Work around a page size issue on Cygwin.
Modified:
llvm/trunk/lib/System/Unix/Process.inc
Modified: llvm/trunk/lib/System/Unix/Process.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Process.inc?rev=72332&r1=72331&r2=72332&view=diff
==============================================================================
--- llvm/trunk/lib/System/Unix/Process.inc (original)
+++ llvm/trunk/lib/System/Unix/Process.inc Sat May 23 12:57:59 2009
@@ -42,7 +42,12 @@
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);
More information about the llvm-commits
mailing list