提交 fce46bf9 编写于 作者: R Rich Felker

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.
上级 0b3e2257
...@@ -10,3 +10,5 @@ struct ipc_perm ...@@ -10,3 +10,5 @@ struct ipc_perm
long __pad1; long __pad1;
long __pad2; long __pad2;
}; };
#define IPC_64 0x100
...@@ -10,3 +10,5 @@ struct ipc_perm ...@@ -10,3 +10,5 @@ struct ipc_perm
long __pad1; long __pad1;
long __pad2; long __pad2;
}; };
#define IPC_64 0x100
...@@ -10,3 +10,5 @@ struct ipc_perm ...@@ -10,3 +10,5 @@ struct ipc_perm
long __pad1; long __pad1;
long __pad2; long __pad2;
}; };
#define IPC_64 0x100
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
#include "syscall.h" #include "syscall.h"
#include "ipc.h" #include "ipc.h"
#ifndef IPC_64
#define IPC_64 0
#endif
int semctl(int id, int num, int cmd, ...) int semctl(int id, int num, int cmd, ...)
{ {
long arg; long arg;
...@@ -11,8 +15,8 @@ int semctl(int id, int num, int cmd, ...) ...@@ -11,8 +15,8 @@ int semctl(int id, int num, int cmd, ...)
arg = va_arg(ap, long); arg = va_arg(ap, long);
va_end(ap); va_end(ap);
#ifdef SYS_semctl #ifdef SYS_semctl
return syscall(SYS_semctl, id, num, cmd | 0x100, arg); return syscall(SYS_semctl, id, num, cmd | IPC_64, arg);
#else #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 #endif
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册