diff options
author | rgrimes <rgrimes@FreeBSD.org> | 1994-05-25 09:21:21 +0000 |
---|---|---|
committer | rgrimes <rgrimes@FreeBSD.org> | 1994-05-25 09:21:21 +0000 |
commit | 2469c867a164210ce96143517059f21db7f1fd17 (patch) | |
tree | 9179427ac860211c445df663fd2b86267366bfba /sys/vm/vm_unix.c | |
parent | cb0aba89af15a48e2655e898a503946ac4cb42ae (diff) | |
download | FreeBSD-src-2469c867a164210ce96143517059f21db7f1fd17.zip FreeBSD-src-2469c867a164210ce96143517059f21db7f1fd17.tar.gz |
The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.
Reviewed by: Rodney W. Grimes
Submitted by: John Dyson and David Greenman
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 3d49ea7..ee6ddf6 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) |