vm_mmap.c (249645144d24e86f021b30c8637a8e900076f1c0) | vm_mmap.c (2589f2499de03fe756d249d14d9024dc9faca817) |
---|---|
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. --- 285 unchanged lines hidden (view full) --- 294 flags |= MAP_NOSYNC; 295 vp = (struct vnode *) fp->f_data; 296 if (vp->v_type != VREG && vp->v_type != VCHR) 297 return (EINVAL); 298 /* 299 * XXX hack to handle use of /dev/zero to map anon memory (ala 300 * SunOS). 301 */ | 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. --- 285 unchanged lines hidden (view full) --- 294 flags |= MAP_NOSYNC; 295 vp = (struct vnode *) fp->f_data; 296 if (vp->v_type != VREG && vp->v_type != VCHR) 297 return (EINVAL); 298 /* 299 * XXX hack to handle use of /dev/zero to map anon memory (ala 300 * SunOS). 301 */ |
302 if (vp->v_type == VCHR && iszerodev(vp->v_rdev)) { | 302 if ((vp->v_type == VCHR) && 303 (vp->v_rdev->si_devsw->d_flags & D_MMAP_ANON)) { |
303 handle = NULL; 304 maxprot = VM_PROT_ALL; 305 flags |= MAP_ANON; 306 pos = 0; 307 } else { 308 /* 309 * cdevs does not provide private mappings of any kind. 310 */ --- 852 unchanged lines hidden --- | 304 handle = NULL; 305 maxprot = VM_PROT_ALL; 306 flags |= MAP_ANON; 307 pos = 0; 308 } else { 309 /* 310 * cdevs does not provide private mappings of any kind. 311 */ --- 852 unchanged lines hidden --- |