Nifty idea from Jeroen van Gelderen; don't call a routine to check if
we are using the /dev/zero device, just check a flag (supplied by /dev/zero). Reviewed by: dfr
This commit is contained in:
parent
3fce691075
commit
2589f2499d
@ -299,7 +299,8 @@ mmap(p, uap)
|
||||
* XXX hack to handle use of /dev/zero to map anon memory (ala
|
||||
* SunOS).
|
||||
*/
|
||||
if (vp->v_type == VCHR && iszerodev(vp->v_rdev)) {
|
||||
if ((vp->v_type == VCHR) &&
|
||||
(vp->v_rdev->si_devsw->d_flags & D_MMAP_ANON)) {
|
||||
handle = NULL;
|
||||
maxprot = VM_PROT_ALL;
|
||||
flags |= MAP_ANON;
|
||||
|
Loading…
x
Reference in New Issue
Block a user