patch-2.2.11 linux/mm/mmap.c

Next file: linux/mm/mremap.c
Previous file: linux/mm/memory.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.10/linux/mm/mmap.c linux/mm/mmap.c
@@ -359,8 +359,11 @@
 
 	if (len > TASK_SIZE)
 		return 0;
-	if (!addr)
-		addr = TASK_UNMAPPED_BASE;
+	if (!addr) {
+		addr = current->rlim[RLIMIT_DATA].rlim_cur;
+		if (addr >= RLIM_INFINITY)
+			addr = TASK_UNMAPPED_BASE;
+	}
 	addr = PAGE_ALIGN(addr);
 
 	for (vmm = find_vma(current->mm, addr); ; vmm = vmm->vm_next) {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)