Explicitly set MAP_PRIVATE to avoid [EINVAL] after r271635.

X-MFC-With:	r271635
Reviewed by:	jhb
This commit is contained in:
Bryan Drewery 2014-09-17 20:26:27 +00:00
parent 7a9f047ba7
commit 7eccb93c02

View File

@ -268,7 +268,7 @@ __elf_fdnlist(fd, list)
}
/* mmap section header table */
base = mmap(NULL, (size_t)shdr_size, PROT_READ, 0, fd,
base = mmap(NULL, (size_t)shdr_size, PROT_READ, MAP_PRIVATE, fd,
(off_t)ehdr.e_shoff);
if (base == MAP_FAILED)
return (-1);
@ -301,7 +301,7 @@ __elf_fdnlist(fd, list)
* making the memory allocation permanent as with malloc/free
* (i.e., munmap will return it to the system).
*/
base = mmap(NULL, (size_t)symstrsize, PROT_READ, 0, fd,
base = mmap(NULL, (size_t)symstrsize, PROT_READ, MAP_PRIVATE, fd,
(off_t)symstroff);
if (base == MAP_FAILED)
goto done;