|
@@ -1,6 +1,6 @@
|
|
|
// -*- mode: cpp; mode: fold -*-
|
|
// -*- mode: cpp; mode: fold -*-
|
|
|
// Description /*{{{*/
|
|
// Description /*{{{*/
|
|
|
-// $Id: mmap.cc,v 1.11 1999/02/05 02:26:13 jgg Exp $
|
|
|
|
|
|
|
+// $Id: mmap.cc,v 1.12 1999/03/18 03:20:24 doogie Exp $
|
|
|
/* ######################################################################
|
|
/* ######################################################################
|
|
|
|
|
|
|
|
MMap Class - Provides 'real' mmap or a faked mmap using read().
|
|
MMap Class - Provides 'real' mmap or a faked mmap using read().
|
|
@@ -31,7 +31,6 @@
|
|
|
|
|
|
|
|
#include <sys/mman.h>
|
|
#include <sys/mman.h>
|
|
|
#include <sys/stat.h>
|
|
#include <sys/stat.h>
|
|
|
-#include <sys/user.h>
|
|
|
|
|
#include <unistd.h>
|
|
#include <unistd.h>
|
|
|
#include <fcntl.h>
|
|
#include <fcntl.h>
|
|
|
/*}}}*/
|
|
/*}}}*/
|
|
@@ -119,6 +118,8 @@ bool MMap::Sync()
|
|
|
/* */
|
|
/* */
|
|
|
bool MMap::Sync(unsigned long Start,unsigned long Stop)
|
|
bool MMap::Sync(unsigned long Start,unsigned long Stop)
|
|
|
{
|
|
{
|
|
|
|
|
+ static int PAGE_SIZE = getpagesize();
|
|
|
|
|
+
|
|
|
#ifdef _POSIX_SYNCHRONIZED_IO
|
|
#ifdef _POSIX_SYNCHRONIZED_IO
|
|
|
if ((Flags & ReadOnly) != ReadOnly)
|
|
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/PAGE_SIZE)*PAGE_SIZE,Stop - Start,MS_SYNC) != 0)
|