summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2005-06-01 18:34:41 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2005-06-01 18:34:41 +0000
commitca83b3dd3e3a4e6aed265b266d4862de0571a1a9 (patch)
tree660b4ad150a4fb5271fdd03e8393e8e22f3647f9 /sys
parenta721914325d4528b21fcae9290c80dd9905ce3c3 (diff)
use vm_dused for rlimit. much happier with mmap. tested by several
over past week. as a bonus, kills 5 XXXs.
Diffstat (limited to 'sys')
-rw-r--r--sys/uvm/uvm_mmap.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/sys/uvm/uvm_mmap.c b/sys/uvm/uvm_mmap.c
index 73f7ca37f31..eb143f03293 100644
--- a/sys/uvm/uvm_mmap.c
+++ b/sys/uvm/uvm_mmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_mmap.c,v 1.56 2005/05/24 21:11:47 tedu Exp $ */
+/* $OpenBSD: uvm_mmap.c,v 1.57 2005/06/01 18:34:40 tedu Exp $ */
/* $NetBSD: uvm_mmap.c,v 1.49 2001/02/18 21:19:08 chs Exp $ */
/*
@@ -584,17 +584,10 @@ sys_mmap(p, v, retval)
pos = 0;
}
- /*
- * XXX (in)sanity check. We don't do proper datasize checking
- * XXX for anonymous (or private writable) mmap(). However,
- * XXX know that if we're trying to allocate more than the amount
- * XXX remaining under our current data size limit, _that_ should
- * XXX be disallowed.
- */
if ((flags & MAP_ANON) != 0 ||
((flags & MAP_PRIVATE) != 0 && (prot & PROT_WRITE) != 0)) {
if (size >
- (p->p_rlimit[RLIMIT_DATA].rlim_cur - ctob(p->p_vmspace->vm_dsize))) {
+ (p->p_rlimit[RLIMIT_DATA].rlim_cur - ctob(p->p_vmspace->vm_dused))) {
error = ENOMEM;
goto out;
}