From: Rich Felker Date: Sat, 22 Sep 2012 12:02:42 +0000 (-0400) Subject: fix broken semctl on systems that don't use IPC_64 flag X-Git-Tag: v0.9.7~90 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fce46bf980a82bad9e6c083066cae4813649ebf5;p=oweals%2Fmusl.git fix broken semctl on systems that don't use IPC_64 flag not tested on mips and arm; they may still be broken. x86_64 should be ok now. --- diff --git a/arch/arm/bits/ipc.h b/arch/arm/bits/ipc.h index 51ad4427..b748d3b7 100644 --- a/arch/arm/bits/ipc.h +++ b/arch/arm/bits/ipc.h @@ -10,3 +10,5 @@ struct ipc_perm long __pad1; long __pad2; }; + +#define IPC_64 0x100 diff --git a/arch/i386/bits/ipc.h b/arch/i386/bits/ipc.h index 51ad4427..b748d3b7 100644 --- a/arch/i386/bits/ipc.h +++ b/arch/i386/bits/ipc.h @@ -10,3 +10,5 @@ struct ipc_perm long __pad1; long __pad2; }; + +#define IPC_64 0x100 diff --git a/arch/mips/bits/ipc.h b/arch/mips/bits/ipc.h index 51ad4427..b748d3b7 100644 --- a/arch/mips/bits/ipc.h +++ b/arch/mips/bits/ipc.h @@ -10,3 +10,5 @@ struct ipc_perm long __pad1; long __pad2; }; + +#define IPC_64 0x100 diff --git a/src/ipc/semctl.c b/src/ipc/semctl.c index a210e20b..9de5b1d7 100644 --- a/src/ipc/semctl.c +++ b/src/ipc/semctl.c @@ -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 }