diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2001-02-09 00:10:45 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2001-02-09 00:10:45 +0300 |
commit | 889109ab1f067163550437c266efb53710c74ab9 (patch) | |
tree | 3e66d9ae9d3dc144b4162dc33568841dca4895ad /winsup/cygwin | |
parent | db49d0b5300479a392dee7129049b387f0a7895c (diff) |
* mmap.cc (mmap): Check for reusing a mapping only on MAP_SHARED
and on MAP_PRIVATE|MAP_ANON in the special case of offset 0.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/mmap.cc | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 1fa4e2ccc..5685b3a60 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +Thu Feb 8 22:09:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap): Check for reusing a mapping only on MAP_SHARED + and on MAP_PRIVATE|MAP_ANON in the special case of offset 0. + Thu Feb 8 21:57:00 2001 Corinna Vinschen <corinna@vinschen.de> * mmap.cc (class list): Add member `hash'. diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc index e2eab3e06..42a7b6964 100644 --- a/winsup/cygwin/mmap.cc +++ b/winsup/cygwin/mmap.cc @@ -455,8 +455,9 @@ mmap (caddr_t addr, size_t len, int prot, int flags, int fd, off_t off) list *l = mmapped_areas->get_list_by_fd (fd); /* First check if this mapping matches into the chunk of another - already performed mapping. Only for MAP_SHARED mapping. */ - if (l && (flags & MAP_SHARED)) + already performed mapping. Only valid for MAP_SHARED and for + MAP_ANON in a special case of MAP_PRIVATE. */ + if (l && ((flags & MAP_SHARED) || (fd == -1 && off == 0))) { mmap_record *rec; if ((rec = l->match (off, len)) != NULL) |