1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

Work around a page size issue on Cygwin.

llvm-svn: 72332
This commit is contained in:
Jay Foad 2009-05-23 17:57:59 +00:00
parent 99b1003c2e
commit ccae25d83b

View File

@ -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);