* mmap.cc (mmap): Outflank copy-on-write problem on 9x by
setting access mode to FILE_MAP_READ when read access is requested.
This commit is contained in:
@ -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");
|
||||
|
Reference in New Issue
Block a user