use MAP_PRIVATE|MAP_FILE

This commit is contained in:
mrg 1997-12-15 04:21:33 +00:00
parent 701bf906ba
commit 1d8157e01a
2 changed files with 8 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: nlist_ecoff.c,v 1.4 1997/10/17 10:15:24 lukem Exp $ */
/* $NetBSD: nlist_ecoff.c,v 1.5 1997/12/15 04:21:33 mrg Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: nlist_ecoff.c,v 1.4 1997/10/17 10:15:24 lukem Exp $");
__RCSID("$NetBSD: nlist_ecoff.c,v 1.5 1997/12/15 04:21:33 mrg Exp $");
#endif /* not lint */
#include <sys/param.h>
@ -111,7 +111,8 @@ create_knlist_ecoff(name, db)
* Map the file in its entirety.
*/
mappedsize = st.st_size;
mappedfile = mmap(NULL, mappedsize, PROT_READ, 0, fd, 0);
mappedfile = mmap(NULL, mappedsize, PROT_READ, MAP_FILE|MAP_PRIVATE,
fd, 0);
if (mappedfile == (char *)-1)
BAD;

View File

@ -1,4 +1,4 @@
/* $NetBSD: nlist_elf32.c,v 1.5 1997/10/23 12:30:32 enami Exp $ */
/* $NetBSD: nlist_elf32.c,v 1.6 1997/12/15 04:21:34 mrg Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: nlist_elf32.c,v 1.5 1997/10/23 12:30:32 enami Exp $");
__RCSID("$NetBSD: nlist_elf32.c,v 1.6 1997/12/15 04:21:34 mrg Exp $");
#endif /* not lint */
/* If not included by nlist_elf64.c, ELFSIZE won't be defined. */
@ -137,7 +137,8 @@ ELFNAMEEND(create_knlist)(name, db)
* Map the file in its entirety.
*/
mappedsize = st.st_size;
mappedfile = mmap(NULL, mappedsize, PROT_READ, 0, fd, 0);
mappedfile = mmap(NULL, mappedsize, PROT_READ, MAP_PRIVATE|MAP_FILE,
fd, 0);
if (mappedfile == (char *)-1)
BAD;