summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/vm/vm_unix.c')
-rw-r--r--sys/vm/vm_unix.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/vm/vm_unix.c b/sys/vm/vm_unix.c
index bf932fd..1d02f39 100644
--- a/sys/vm/vm_unix.c
+++ b/sys/vm/vm_unix.c
@@ -107,6 +107,11 @@ obreak(td, uap)
goto done;
}
if (new > old) {
+ if (vm->vm_map.size + (new - old) >
+ td->td_proc->p_rlimit[RLIMIT_VMEM].rlim_cur) {
+ error = ENOMEM;
+ goto done;
+ }
rv = vm_map_insert(&vm->vm_map, NULL, 0, old, new,
VM_PROT_ALL, VM_PROT_ALL, 0);
if (rv != KERN_SUCCESS) {
OpenPOWER on IntegriCloud