summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ipc/semctl.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/ipc/semctl.c b/src/ipc/semctl.c
index 274e2cf3..49927e2e 100644
--- a/src/ipc/semctl.c
+++ b/src/ipc/semctl.c
@@ -3,16 +3,22 @@
#include "syscall.h"
#include "ipc.h"
+struct semun {
+ int val;
+ struct semid_ds *buf;
+ unsigned short *array;
+};
+
int semctl(int id, int num, int cmd, ...)
{
- long arg;
+ struct semun arg;
va_list ap;
va_start(ap, cmd);
- arg = va_arg(ap, long);
+ arg = va_arg(ap, struct semun);
va_end(ap);
#ifdef SYS_semctl
- return syscall(SYS_semctl, id, num, cmd | IPC_64, arg);
+ return syscall(SYS_semctl, id, num, cmd | IPC_64, arg.buf);
#else
- return syscall(SYS_ipc, IPCOP_semctl, id, num, cmd | IPC_64, &arg);
+ return syscall(SYS_ipc, IPCOP_semctl, id, num, cmd | IPC_64, &arg.buf);
#endif
}