patch-2.1.132 linux/ipc/shm.c

Next file: linux/kernel/ksyms.c
Previous file: linux/init/main.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.131/linux/ipc/shm.c linux/ipc/shm.c
@@ -126,6 +126,8 @@
 	return (unsigned int) shp->u.shm_perm.seq * SHMMNI + id;
 }
 
+int shmmax = SHMMAX;
+
 asmlinkage int sys_shmget (key_t key, int size, int shmflg)
 {
 	struct shmid_kernel *shp;
@@ -133,7 +135,7 @@
 
 	down(&current->mm->mmap_sem);
 	lock_kernel();
-	if (size < 0 || size > SHMMAX) {
+	if (size < 0 || size > shmmax) {
 		err = -EINVAL;
 	} else if (key == IPC_PRIVATE) {
 		err = newseg(key, shmflg, size);
@@ -228,7 +230,7 @@
 		if (!buf)
 			goto out;
 		shminfo.shmmni = SHMMNI;
-		shminfo.shmmax = SHMMAX;
+		shminfo.shmmax = shmmax;
 		shminfo.shmmin = SHMMIN;
 		shminfo.shmall = SHMALL;
 		shminfo.shmseg = SHMSEG;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov