vm_unix.c (98833) | vm_unix.c (103767) |
---|---|
1/* 2 * Copyright (c) 1988 University of Utah. 3 * Copyright (c) 1991, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * the Systems Programming Group of the University of Utah Computer 8 * Science Department. --- 24 unchanged lines hidden (view full) --- 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * from: Utah $Hdr: vm_unix.c 1.1 89/11/07$ 39 * 40 * @(#)vm_unix.c 8.1 (Berkeley) 6/11/93 | 1/* 2 * Copyright (c) 1988 University of Utah. 3 * Copyright (c) 1991, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * the Systems Programming Group of the University of Utah Computer 8 * Science Department. --- 24 unchanged lines hidden (view full) --- 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * from: Utah $Hdr: vm_unix.c 1.1 89/11/07$ 39 * 40 * @(#)vm_unix.c 8.1 (Berkeley) 6/11/93 |
41 * $FreeBSD: head/sys/vm/vm_unix.c 98833 2002-06-26 00:29:28Z dillon $ | 41 * $FreeBSD: head/sys/vm/vm_unix.c 103767 2002-09-21 22:07:17Z jake $ |
42 */ 43 44/* 45 * Traditional sbrk/grow interface to VM 46 */ 47 48#include <sys/param.h> 49#include <sys/lock.h> --- 38 unchanged lines hidden (view full) --- 88 * Check the resource limit, but allow a process to reduce 89 * its usage, even if it remains over the limit. 90 */ 91 if (new - base > td->td_proc->p_rlimit[RLIMIT_DATA].rlim_cur && 92 new > old) { 93 error = ENOMEM; 94 goto done; 95 } | 42 */ 43 44/* 45 * Traditional sbrk/grow interface to VM 46 */ 47 48#include <sys/param.h> 49#include <sys/lock.h> --- 38 unchanged lines hidden (view full) --- 88 * Check the resource limit, but allow a process to reduce 89 * its usage, even if it remains over the limit. 90 */ 91 if (new - base > td->td_proc->p_rlimit[RLIMIT_DATA].rlim_cur && 92 new > old) { 93 error = ENOMEM; 94 goto done; 95 } |
96 if (new > VM_MAXUSER_ADDRESS) { | 96 if (new > vm_map_max(&vm->vm_map)) { |
97 error = ENOMEM; 98 goto done; 99 } 100 } else if (new < base) { 101 /* 102 * This is simply an invalid value. If someone wants to 103 * do fancy address space manipulations, mmap and munmap 104 * can do most of what the user would want. --- 49 unchanged lines hidden --- | 97 error = ENOMEM; 98 goto done; 99 } 100 } else if (new < base) { 101 /* 102 * This is simply an invalid value. If someone wants to 103 * do fancy address space manipulations, mmap and munmap 104 * can do most of what the user would want. --- 49 unchanged lines hidden --- |