vm_mmap.c (29d0dcddabe2e065416423a79fb2b29d6ceb6307) | vm_mmap.c (7022f954c365c359af0127b57b96ec9659958bc3) |
---|---|
1/*- 2 * Copyright (c) 1988 University of Utah. 3 * Copyright (c) 1991, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * the Systems Programming Group of the University of Utah Computer 8 * Science Department. --- 218 unchanged lines hidden (view full) --- 227 prot = uap->prot & VM_PROT_ALL; 228 flags = uap->flags; 229 pos = uap->pos; 230 231 fp = NULL; 232 233 /* Make sure mapping fits into numeric range, etc. */ 234 if ((uap->len == 0 && !SV_CURPROC_FLAG(SV_AOUT) && | 1/*- 2 * Copyright (c) 1988 University of Utah. 3 * Copyright (c) 1991, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * the Systems Programming Group of the University of Utah Computer 8 * Science Department. --- 218 unchanged lines hidden (view full) --- 227 prot = uap->prot & VM_PROT_ALL; 228 flags = uap->flags; 229 pos = uap->pos; 230 231 fp = NULL; 232 233 /* Make sure mapping fits into numeric range, etc. */ 234 if ((uap->len == 0 && !SV_CURPROC_FLAG(SV_AOUT) && |
235 curproc->p_osrel >= __FreeBSD_version_MAP_ANON) || | 235 curproc->p_osrel >= P_OSREL_MAP_ANON) || |
236 ((flags & MAP_ANON) && (uap->fd != -1 || pos != 0))) 237 return (EINVAL); 238 239 if (flags & MAP_STACK) { 240 if ((uap->fd != -1) || 241 ((prot & (PROT_READ | PROT_WRITE)) != (PROT_READ | PROT_WRITE))) 242 return (EINVAL); 243 flags |= MAP_ANON; --- 1294 unchanged lines hidden --- | 236 ((flags & MAP_ANON) && (uap->fd != -1 || pos != 0))) 237 return (EINVAL); 238 239 if (flags & MAP_STACK) { 240 if ((uap->fd != -1) || 241 ((prot & (PROT_READ | PROT_WRITE)) != (PROT_READ | PROT_WRITE))) 242 return (EINVAL); 243 flags |= MAP_ANON; --- 1294 unchanged lines hidden --- |