patch-2.1.79 linux/arch/ppc/kernel/syscalls.c

Next file: linux/arch/ppc/kernel/time.c
Previous file: linux/arch/ppc/kernel/smp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.78/linux/arch/ppc/kernel/syscalls.c linux/arch/ppc/kernel/syscalls.c
@@ -32,6 +32,8 @@
 #include <linux/mman.h>
 #include <linux/sys.h>
 #include <linux/ipc.h>
+#include <linux/utsname.h>
+
 #include <asm/uaccess.h>
 #include <asm/ipc.h>
 
@@ -149,7 +151,7 @@
 			break;
 			}
 		case 1:	/* iBCS2 emulator entry point */
-			if (get_fs() != get_ds())
+			if (!segment_eq(get_fs(), get_ds()))
 				break;
 			ret = sys_shmat (first, (char *) ptr, second,
 					 (ulong *) third);
@@ -206,7 +208,8 @@
 		if (fd >= NR_OPEN || !(file = current->files->fd[fd]))
 			goto out;
 	}
-	flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
+	
+	/*flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);*/
 	ret = do_mmap(file, addr, len, prot, flags, offset);
 out:
 	unlock_kernel();
@@ -236,4 +239,42 @@
 			return -EFAULT;
 	}
 	return sys_select(n, inp, outp, exp, tvp);
+}
+
+asmlinkage int sys_pause(void)
+{
+	current->state = TASK_INTERRUPTIBLE;
+	schedule();
+	return -ERESTARTNOHAND;
+}
+
+asmlinkage int sys_uname(struct old_utsname * name)
+{
+	if (name && !copy_to_user(name, &system_utsname, sizeof (*name)))
+		return 0;
+	return -EFAULT;
+}
+
+asmlinkage int sys_olduname(struct oldold_utsname * name)
+{
+	int error;
+
+	if (!name)
+		return -EFAULT;
+	if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname)))
+		return -EFAULT;
+  
+	error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN);
+	error -= __put_user(0,name->sysname+__OLD_UTS_LEN);
+	error -= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN);
+	error -= __put_user(0,name->nodename+__OLD_UTS_LEN);
+	error -= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN);
+	error -= __put_user(0,name->release+__OLD_UTS_LEN);
+	error -= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN);
+	error -= __put_user(0,name->version+__OLD_UTS_LEN);
+	error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN);
+	error = __put_user(0,name->machine+__OLD_UTS_LEN);
+	error = error ? -EFAULT : 0;
+
+	return error;
 }

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