fix broken semctl on systems that don't use IPC_64 flag
authorRich Felker <dalias@aerifal.cx>
Sat, 22 Sep 2012 12:02:42 +0000 (08:02 -0400)
committerRich Felker <dalias@aerifal.cx>
Sat, 22 Sep 2012 12:02:42 +0000 (08:02 -0400)
not tested on mips and arm; they may still be broken. x86_64 should be
ok now.

arch/arm/bits/ipc.h
arch/i386/bits/ipc.h
arch/mips/bits/ipc.h
src/ipc/semctl.c

index 51ad44275158a9bb598af758365c179a09f2fe97..b748d3b742c0f167058a528584a13fdae9133248 100644 (file)
@@ -10,3 +10,5 @@ struct ipc_perm
        long __pad1;
        long __pad2;
 };
+
+#define IPC_64 0x100
index 51ad44275158a9bb598af758365c179a09f2fe97..b748d3b742c0f167058a528584a13fdae9133248 100644 (file)
@@ -10,3 +10,5 @@ struct ipc_perm
        long __pad1;
        long __pad2;
 };
+
+#define IPC_64 0x100
index 51ad44275158a9bb598af758365c179a09f2fe97..b748d3b742c0f167058a528584a13fdae9133248 100644 (file)
@@ -10,3 +10,5 @@ struct ipc_perm
        long __pad1;
        long __pad2;
 };
+
+#define IPC_64 0x100
index a210e20baa12f01e6854b057f5fea96f0f517661..9de5b1d7c2958b0dc397225e83e6a68d243117e0 100644 (file)
@@ -3,6 +3,10 @@
 #include "syscall.h"
 #include "ipc.h"
 
+#ifndef IPC_64
+#define IPC_64 0
+#endif
+
 int semctl(int id, int num, int cmd, ...)
 {
        long arg;
@@ -11,8 +15,8 @@ int semctl(int id, int num, int cmd, ...)
        arg = va_arg(ap, long);
        va_end(ap);
 #ifdef SYS_semctl
-       return syscall(SYS_semctl, id, num, cmd | 0x100, arg);
+       return syscall(SYS_semctl, id, num, cmd | IPC_64, arg);
 #else
-       return syscall(SYS_ipc, IPCOP_semctl, id, num, cmd | 0x100, &arg);
+       return syscall(SYS_ipc, IPCOP_semctl, id, num, cmd | IPC_64, &arg);
 #endif
 }