patch-2.2.12 linux/ipc/shm.c
Next file: linux/kernel/exit.c
Previous file: linux/include/net/tcp.h
Back to the patch index
Back to the overall index
- Lines: 12
- Date:
Wed Aug 25 17:29:53 1999
- Orig file:
v2.2.11/linux/ipc/shm.c
- Orig date:
Tue May 4 16:58:15 1999
diff -u --recursive --new-file v2.2.11/linux/ipc/shm.c linux/ipc/shm.c
@@ -401,8 +401,9 @@
/* add new mapping */
tmp = shmd->vm_end - shmd->vm_start;
- if((current->mm->total_vm << PAGE_SHIFT) + tmp
- > (unsigned long) current->rlim[RLIMIT_AS].rlim_cur)
+ if ((current->rlim[RLIMIT_AS].rlim_cur < RLIM_INFINITY) &&
+ ((current->mm->total_vm << PAGE_SHIFT) + tmp
+ > current->rlim[RLIMIT_AS].rlim_cur))
return -ENOMEM;
current->mm->total_vm += tmp >> PAGE_SHIFT;
insert_vm_struct(current->mm, shmd);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)