From ca83b3dd3e3a4e6aed265b266d4862de0571a1a9 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Wed, 1 Jun 2005 18:34:41 +0000 Subject: use vm_dused for rlimit. much happier with mmap. tested by several over past week. as a bonus, kills 5 XXXs. --- sys/uvm/uvm_mmap.c | 11 ++--------- 1 file 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; } -- cgit v1.2.3