diff options
| author | Rodney W. Grimes <rgrimes@FreeBSD.org> | 1994-05-25 09:21:21 +0000 |
|---|---|---|
| committer | Rodney W. Grimes <rgrimes@FreeBSD.org> | 1994-05-25 09:21:21 +0000 |
| commit | 26f9a76710a312a951848542b9ca1f44100450e2 (patch) | |
| tree | 9179427ac860211c445df663fd2b86267366bfba /sys/vm/vm_unix.c | |
| parent | dbda0ec78e324aced444959e2c98b89b79f22812 (diff) | |
Notes
Diffstat (limited to 'sys/vm/vm_unix.c')
| -rw-r--r-- | sys/vm/vm_unix.c | 41 |
1 files changed, 7 insertions, 34 deletions
diff --git a/sys/vm/vm_unix.c b/sys/vm/vm_unix.c index 3d49ea717184..ee6ddf6ab536 100644 --- a/sys/vm/vm_unix.c +++ b/sys/vm/vm_unix.c @@ -50,9 +50,12 @@ #include <vm/vm.h> +extern int swap_pager_full; + struct obreak_args { char *nsiz; }; + /* ARGSUSED */ int obreak(p, uap, retval) @@ -72,9 +75,11 @@ obreak(p, uap, retval) old = round_page(old + ctob(vm->vm_dsize)); diff = new - old; if (diff > 0) { + if (swap_pager_full) { + return(ENOMEM); + } rv = vm_allocate(&vm->vm_map, &old, diff, FALSE); if (rv != KERN_SUCCESS) { - uprintf("sbrk: grow failed, return = %d\n", rv); return(ENOMEM); } vm->vm_dsize += btoc(diff); @@ -82,7 +87,6 @@ obreak(p, uap, retval) diff = -diff; rv = vm_deallocate(&vm->vm_map, new, diff); if (rv != KERN_SUCCESS) { - uprintf("sbrk: shrink failed, return = %d\n", rv); return(ENOMEM); } vm->vm_dsize -= btoc(diff); @@ -90,41 +94,10 @@ obreak(p, uap, retval) return(0); } -/* - * Enlarge the "stack segment" to include the specified - * stack pointer for the process. - */ -int -grow(p, sp) - struct proc *p; - unsigned sp; -{ - register struct vmspace *vm = p->p_vmspace; - register int si; - - /* - * For user defined stacks (from sendsig). - */ - if (sp < (unsigned)vm->vm_maxsaddr) - return (0); - /* - * For common case of already allocated (from trap). - */ - if (sp >= USRSTACK - ctob(vm->vm_ssize)) - return (1); - /* - * Really need to check vs limit and increment stack size if ok. - */ - si = clrnd(btoc(USRSTACK-sp) - vm->vm_ssize); - if (vm->vm_ssize + si > btoc(p->p_rlimit[RLIMIT_STACK].rlim_cur)) - return (0); - vm->vm_ssize += si; - return (1); -} - struct ovadvise_args { int anom; }; + /* ARGSUSED */ int ovadvise(p, uap, retval) |
