diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-05-11 12:51:24 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-05-11 12:51:24 +0000 |
commit | bbea4017474a3e9624426e7dba893d199f4a6a19 (patch) | |
tree | c4583410a8f77c448c2e0d0b1ee1b289d009faa4 /lib/libc/gen/nlist.c | |
parent | 47ad652748bd505566b106322933d046d7fab36d (diff) |
MAP_SHARED is better. Maybe we're trying to map /dev/ksyms.
And we'll never write to those mappings anyway.
Diffstat (limited to 'lib/libc/gen/nlist.c')
-rw-r--r-- | lib/libc/gen/nlist.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c index 19879067f54..bf3e803267d 100644 --- a/lib/libc/gen/nlist.c +++ b/lib/libc/gen/nlist.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: nlist.c,v 1.38 2001/05/11 12:33:09 art Exp $"; +static char rcsid[] = "$OpenBSD: nlist.c,v 1.39 2001/05/11 12:51:23 art Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -95,7 +95,7 @@ __aout_fdnlist(fd, list) * returns memory to the system on free this does not cause bloat. */ strsize -= sizeof(strsize); - strtab = mmap(NULL, (size_t)strsize, PROT_READ, MAP_PRIVATE|MAP_FILE, + strtab = mmap(NULL, (size_t)strsize, PROT_READ, MAP_SHARED|MAP_FILE, fd, stroff); if (strtab == MAP_FAILED) { usemalloc = 1; @@ -194,7 +194,7 @@ __ecoff_fdnlist(fd, list) BAD; } mappedsize = st.st_size; - mappedfile = mmap(NULL, mappedsize, PROT_READ, MAP_PRIVATE|MAP_FILE, + mappedfile = mmap(NULL, mappedsize, PROT_READ, MAP_SHARED|MAP_FILE, fd, 0); if (mappedfile == MAP_FAILED) BAD; @@ -334,7 +334,7 @@ __elf_fdnlist(fd, list) /* mmap section header table */ shdr = (Elf_Shdr *)mmap(NULL, (size_t)shdr_size, PROT_READ, - MAP_PRIVATE|MAP_FILE, fd, (off_t) ehdr.e_shoff); + MAP_SHARED|MAP_FILE, fd, (off_t) ehdr.e_shoff); if (shdr == MAP_FAILED) { usemalloc = 1; if ((shdr = malloc(shdr_size)) == NULL) @@ -388,7 +388,7 @@ __elf_fdnlist(fd, list) } } else { strtab = mmap(NULL, (size_t)symstrsize, PROT_READ, - MAP_PRIVATE|MAP_FILE, fd, (off_t) symstroff); + MAP_SHARED|MAP_FILE, fd, (off_t) symstroff); if (strtab == MAP_FAILED) return (-1); } |