From 68ea0dc2fca0ad45fd31277d8fab17cd4c2f0e45 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 29 Jan 2001 13:39:17 +0000 Subject: [PATCH] * mmap.cc (mmap): Remove obsolete check for MAP_SHARED|MAP_ANON as being invalid. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/mmap.cc | 14 ++------------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 54acfbca2..7611e3d4f 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +Mon Jan 29 14:30:00 2001 Corinna Vinschen + + * mmap.cc (mmap): Remove obsolete check for MAP_SHARED|MAP_ANON as + being invalid. + Mon Jan 29 10:23:00 2001 Corinna Vinschen * mmap.cc (mmap_record::find_empty): Fix loop condition. diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc index e05d014f5..5f07efd98 100644 --- a/winsup/cygwin/mmap.cc +++ b/winsup/cygwin/mmap.cc @@ -336,7 +336,6 @@ mmap (caddr_t addr, size_t len, int prot, int flags, int fd, off_t off) if (off % getpagesize () || (!(flags & MAP_SHARED) && !(flags & MAP_PRIVATE)) || ((flags & MAP_SHARED) && (flags & MAP_PRIVATE)) - || ((flags & MAP_SHARED) && (flags & MAP_ANONYMOUS)) || ((flags & MAP_FIXED) && ((DWORD)addr % granularity)) || !len) { @@ -409,17 +408,8 @@ mmap (caddr_t addr, size_t len, int prot, int flags, int fd, off_t off) gran_len = fsiz; } else if (fh->get_device () == FH_ZERO) - { - /* mmap /dev/zero is like MAP_ANONYMOUS. */ - if (flags & MAP_SHARED) - { - set_errno (EINVAL); - syscall_printf ("-1 = mmap(): EINVAL"); - ReleaseResourceLock(LOCK_MMAP_LIST,READ_LOCK|WRITE_LOCK," mmap"); - return MAP_FAILED; - } - fd = -1; - } + /* mmap /dev/zero is like MAP_ANONYMOUS. */ + fd = -1; } if (fd == -1) {