summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:53:10 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:53:10 +0000
commit4d714a4ce5147cf934ac102dcce29a8d77cf4e3f (patch)
tree2ee744b8a4446886ce74dabac16930b6c9e1258d /apt-pkg
parent0c95c765d688cd001988521315c708afb9892195 (diff)
modified apt-pkg/contrib/mmap.cc to not use the define ...
Author: doogie Date: 1999-03-18 03:20:24 GMT modified apt-pkg/contrib/mmap.cc to not use the define PAGE_SIZE by removing '#include <sys/user.h>' and adding 'static int PAGE_SIZE = getpagesize();' to msync();
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/contrib/mmap.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc
index fdeb344d5..0e8c6bdd0 100644
--- a/apt-pkg/contrib/mmap.cc
+++ b/apt-pkg/contrib/mmap.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// 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().
@@ -31,7 +31,6 @@
#include <sys/mman.h>
#include <sys/stat.h>
-#include <sys/user.h>
#include <unistd.h>
#include <fcntl.h>
/*}}}*/
@@ -119,6 +118,8 @@ bool MMap::Sync()
/* */
bool MMap::Sync(unsigned long Start,unsigned long Stop)
{
+ static int PAGE_SIZE = getpagesize();
+
#ifdef _POSIX_SYNCHRONIZED_IO
if ((Flags & ReadOnly) != ReadOnly)
if (msync((char *)Base+(int)(Start/PAGE_SIZE)*PAGE_SIZE,Stop - Start,MS_SYNC) != 0)