// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: mmap.cc,v 1.12 1999/03/18 03:20:24 doogie Exp $
+// $Id: mmap.cc,v 1.14 1999/03/18 04:32:46 jgg Exp $
/* ######################################################################
MMap Class - Provides 'real' mmap or a faked mmap using read().
/* */
bool MMap::Sync(unsigned long Start,unsigned long Stop)
{
- static int PAGE_SIZE = getpagesize();
-
-#ifdef _POSIX_SYNCHRONIZED_IO
+#ifdef _POSIX_SYNCHRONIZED_IO
+ unsigned long PSize = sysconf(_SC_PAGESIZE);
if ((Flags & ReadOnly) != ReadOnly)
- if (msync((char *)Base+(int)(Start/PAGE_SIZE)*PAGE_SIZE,Stop - Start,MS_SYNC) != 0)
+ if (msync((char *)Base+(int)(Start/PSize)*PSize,Stop - Start,MS_SYNC) != 0)
return _error->Error("msync","Unable to write mmap");
#endif
return true;