* mmap.cc (mmap): Drop usage of the same memory area if the same

region of the same file is mapped twice.
This commit is contained in:
Corinna Vinschen 2001-04-19 07:44:34 +00:00
parent a9467b6835
commit b78d6f6e7b
2 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,8 @@
Thu Apr 19 9:40:00 2001 Corinna Vinschen <corinna@vinschen.de>
* mmap.cc (mmap): Drop usage of the same memory area if the same
region of the same file is mapped twice.
Wed Apr 18 16:53:54 2001 Christopher Faylor <cgf@cygnus.com> Wed Apr 18 16:53:54 2001 Christopher Faylor <cgf@cygnus.com>
Throughout, change fdtab references to cygheap->fdtab. Throughout, change fdtab references to cygheap->fdtab.

View File

@ -499,9 +499,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); list *l = mmapped_areas->get_list_by_fd (fd);
/* First check if this mapping matches into the chunk of another /* First check if this mapping matches into the chunk of another
already performed mapping. Only valid for MAP_SHARED and for already performed mapping. Only valid for MAP_ANON in a special
MAP_ANON in a special case of MAP_PRIVATE. */ case of MAP_PRIVATE. */
if (l && ((flags & MAP_SHARED) || (fd == -1 && off == 0))) if (l && fd == -1 && off == 0)
{ {
mmap_record *rec; mmap_record *rec;
if ((rec = l->match (off, len)) != NULL) if ((rec = l->match (off, len)) != NULL)