-/* $OpenBSD: uvm_mmap.c,v 1.134 2016/06/08 15:38:28 deraadt Exp $ */
+/* $OpenBSD: uvm_mmap.c,v 1.135 2016/07/13 15:57:35 kettenis Exp $ */
/* $NetBSD: uvm_mmap.c,v 1.49 2001/02/18 21:19:08 chs Exp $ */
/*
/* MAP_PRIVATE mappings can always write to */
maxprot |= PROT_WRITE;
}
- if ((flags & MAP_ANON) != 0 ||
+ if ((flags & MAP_ANON) != 0 || (flags & __MAP_NOFAULT) == 0 ||
((flags & MAP_PRIVATE) != 0 && (prot & PROT_WRITE) != 0)) {
if (p->p_rlimit[RLIMIT_DATA].rlim_cur < size ||
p->p_rlimit[RLIMIT_DATA].rlim_cur - size <
is_anon: /* label for SunOS style /dev/zero */
- if ((flags & MAP_ANON) != 0 ||
+ if ((flags & MAP_ANON) != 0 || (flags & __MAP_NOFAULT) == 0 ||
((flags & MAP_PRIVATE) != 0 && (prot & PROT_WRITE) != 0)) {
if (p->p_rlimit[RLIMIT_DATA].rlim_cur < size ||
p->p_rlimit[RLIMIT_DATA].rlim_cur - size <