Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-03-26 22:17:15 +0400
committerCorinna Vinschen <corinna@vinschen.de>2001-03-26 22:17:15 +0400
commit1636a5a1e8cdd9f50c30fb768d11a29ca3072e2f (patch)
tree1d30827416b62395d8b0985446250c8799e37812 /winsup
parentaa73152ef735cc584a0fadc817263d5739e5021c (diff)
* mmap.cc (mmap): Outflank copy-on-write problem on 9x by
setting access mode to FILE_MAP_READ when read access is requested.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/mmap.cc5
2 files changed, 10 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 247ef594f..1b4ab11d6 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,11 @@
+Mon Mar 26 18:48:00 2001 Corinna Vinschen <corinna@vinschen.de>
+
+ * mmap.cc (mmap): Outflank copy-on-write problem on 9x by
+ setting access mode to FILE_MAP_READ when read access is requested.
+
Sun Mar 25 20:12:21 2001 Christopher Faylor <cgf@cygnus.com>
+
* dlfcn.cc (check_access): Eliminate.
(check_path_access): Use passed in path_conv buf.
(get_full_path_of_dll): Use passed in name buf to avoid a static. Rip
diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc
index e1fc2d621..9c9c75c50 100644
--- a/winsup/cygwin/mmap.cc
+++ b/winsup/cygwin/mmap.cc
@@ -380,7 +380,10 @@ mmap (caddr_t addr, size_t len, int prot, int flags, int fd, off_t off)
}
DWORD access = (prot & PROT_WRITE) ? FILE_MAP_WRITE : FILE_MAP_READ;
- if (flags & MAP_PRIVATE)
+ /* copy-on-write doesn't work correctly on 9x. To have at least read
+ access we use *READ mapping on 9x when appropriate. It will still
+ fail when needing write access, though. */
+ if ((flags & MAP_PRIVATE) && (os_being_run == winNT || !(prot & PROT_READ)))
access = FILE_MAP_COPY;
SetResourceLock(LOCK_MMAP_LIST,READ_LOCK|WRITE_LOCK," mmap");