diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:52:46 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:52:46 +0000 |
commit | de3c15eac1431a50c71a557257adb42105ade1d9 (patch) | |
tree | 7e7c47166d2ee8f4567d8fd02bfb4dd98aa1888c /apt-pkg/contrib/mmap.cc | |
parent | 3eeeb009e1c8198d91f0925694e84304cf3d84a6 (diff) |
Fix for hurd
Author: jgg
Date: 1999-02-05 02:26:13 GMT
Fix for hurd
Diffstat (limited to 'apt-pkg/contrib/mmap.cc')
-rw-r--r-- | apt-pkg/contrib/mmap.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc index 0ac202aef..fdeb344d5 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.10 1998/11/23 07:03:08 jgg Exp $ +// $Id: mmap.cc,v 1.11 1999/02/05 02:26:13 jgg Exp $ /* ###################################################################### MMap Class - Provides 'real' mmap or a faked mmap using read(). @@ -106,9 +106,11 @@ bool MMap::Close(bool DoClose, bool DoSync) not return till all IO is complete */ bool MMap::Sync() { +#ifdef _POSIX_SYNCHRONIZED_IO if ((Flags & ReadOnly) != ReadOnly) if (msync((char *)Base,iSize,MS_SYNC) != 0) return _error->Error("msync","Unable to write mmap"); +#endif return true; } /*}}}*/ @@ -117,9 +119,11 @@ bool MMap::Sync() /* */ bool MMap::Sync(unsigned long Start,unsigned long Stop) { +#ifdef _POSIX_SYNCHRONIZED_IO if ((Flags & ReadOnly) != ReadOnly) if (msync((char *)Base+(int)(Start/PAGE_SIZE)*PAGE_SIZE,Stop - Start,MS_SYNC) != 0) return _error->Error("msync","Unable to write mmap"); +#endif return true; } /*}}}*/ |