[parisc-linux-cvs] diff for fakeroot fix from Thomas Bogendoerfer <tsbogend@alpha.franken.de>

Paul Bame bame@fc.hp.com
Fri, 30 Nov 2001 16:18:16 -0700


Index: syscall.S
===================================================================
RCS file: /var/cvs/linux/arch/parisc/kernel/syscall.S,v
retrieving revision 1.72
diff -u -r1.72 syscall.S
--- syscall.S	2001/11/23 21:54:28	1.72
+++ syscall.S	2001/11/30 22:44:29
@@ -577,7 +577,7 @@
 	ENTRY_DIFF(recvmsg)
 	ENTRY_SAME(semop)		/* 185 */
 	ENTRY_SAME(semget)
-	ENTRY_SAME(semctl_broken)
+	ENTRY_DIFF(semctl_broken)
 	ENTRY_DIFF(msgsnd)
 	ENTRY_DIFF(msgrcv)
 	ENTRY_SAME(msgget)		/* 190 */
Index: sys_parisc32.c
===================================================================
RCS file: /var/cvs/linux/arch/parisc/kernel/sys_parisc32.c,v
retrieving revision 1.24
diff -u -r1.24 sys_parisc32.c
--- sys_parisc32.c	2001/11/23 21:54:28	1.24
+++ sys_parisc32.c	2001/11/30 22:44:29
@@ -3040,3 +3040,20 @@
 	return sys_lseek(fd, offset, origin);
 }
 
+asmlinkage long sys32_semctl_broken(int semid, int semnum, int cmd, union semun arg)
+{
+        union semun u;
+	
+	cmd &= ~IPC_64; /* should be removed together with the _broken suffix */
+
+        if (cmd == SETVAL) {
+                /* Ugh.  arg is a union of int,ptr,ptr,ptr, so is 8 bytes.
+                 * The int should be in the first 4, but our argument
+                 * frobbing has left it in the last 4.
+                 */
+                u.val = *((int *)&arg + 1);
+                return sys_semctl (semid, semnum, cmd, u);
+	}
+	return sys_semctl (semid, semnum, cmd, arg);
+}
+