[llvm] r188903 - Unix/Process.inc: Revert r72332, "Work around a page size issue on Cygwin."

NAKAMURA Takumi geek4civic at gmail.com
Wed Aug 21 06:47:12 PDT 2013


Author: chapuni
Date: Wed Aug 21 08:47:12 2013
New Revision: 188903

URL: http://llvm.org/viewvc/llvm-project?rev=188903&view=rev
Log:
Unix/Process.inc: Revert r72332, "Work around a page size issue on Cygwin."

Offset in mmap(3) should be aligned to gepagesize(), 64k, or mmap(3) would fail.

TODO: Invetigate places where 4096 would be required as pagesize, or 4096 would satisfy.

Modified:
    llvm/trunk/lib/Support/Unix/Process.inc

Modified: llvm/trunk/lib/Support/Unix/Process.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Process.inc?rev=188903&r1=188902&r2=188903&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Process.inc (original)
+++ llvm/trunk/lib/Support/Unix/Process.inc Wed Aug 21 08:47:12 2013
@@ -88,13 +88,10 @@ TimeValue self_process::get_system_time(
   return getRUsageTimes().second;
 }
 
+// On Cygwin, getpagesize() returns 64k and offset in mmap(3) should be
+// aligned to its pagesize.
 static unsigned 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
-  const int page_size = 0x1000;
-#elif defined(HAVE_GETPAGESIZE)
+#if defined(HAVE_GETPAGESIZE)
   const int page_size = ::getpagesize();
 #elif defined(HAVE_SYSCONF)
   long page_size = ::sysconf(_SC_PAGE_SIZE);





More information about the llvm-commits mailing list