default type is MAP_FILE if none given.

This commit is contained in:
chopps 1994-03-23 01:54:02 +00:00
parent a28a03c947
commit b8f74df1a5
1 changed files with 7 additions and 2 deletions

View File

@ -37,7 +37,7 @@
* *
* from: Utah Hdr: vm_mmap.c 1.3 90/01/21 * from: Utah Hdr: vm_mmap.c 1.3 90/01/21
* from: @(#)vm_mmap.c 7.5 (Berkeley) 6/28/91 * from: @(#)vm_mmap.c 7.5 (Berkeley) 6/28/91
* $Id: vm_mmap.c,v 1.18 1994/01/08 04:22:40 mycroft Exp $ * $Id: vm_mmap.c,v 1.19 1994/03/23 01:54:02 chopps Exp $
*/ */
/* /*
@ -148,9 +148,14 @@ smmap(p, uap, retval)
#endif #endif
/* /*
* Make sure one of the sharing types is specified * Make sure one of the sharing types is specified
* if none given default to MAP_FILE.
*/ */
mtype = flags & MAP_TYPE; mtype = flags & MAP_TYPE;
switch (mtype) { switch (mtype) {
case 0:
mtype = MAP_FILE;
flags |= MAP_FILE;
break;
case MAP_FILE: case MAP_FILE:
case MAP_ANON: case MAP_ANON:
break; break;
@ -214,7 +219,7 @@ smmap(p, uap, retval)
maxprot = VM_PROT_NONE; maxprot = VM_PROT_NONE;
if (fp->f_flag & FREAD) if (fp->f_flag & FREAD)
maxprot |= VM_PROT_READ|VM_PROT_EXECUTE; maxprot |= VM_PROT_READ|VM_PROT_EXECUTE;
if (uap->flags & MAP_SHARED) { if (flags & MAP_SHARED) {
if (fp->f_flag & FWRITE) if (fp->f_flag & FWRITE)
maxprot |= VM_PROT_WRITE; maxprot |= VM_PROT_WRITE;
} else } else