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.
This commit is contained in:
Rich Felker 2012-09-22 08:02:42 -04:00
parent 0b3e2257fa
commit fce46bf980
4 changed files with 12 additions and 2 deletions

View File

@ -10,3 +10,5 @@ struct ipc_perm
long __pad1;
long __pad2;
};
#define IPC_64 0x100

View File

@ -10,3 +10,5 @@ struct ipc_perm
long __pad1;
long __pad2;
};
#define IPC_64 0x100

View File

@ -10,3 +10,5 @@ struct ipc_perm
long __pad1;
long __pad2;
};
#define IPC_64 0x100

View 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
}