blob: 78a1adf8bd230d779b2c6cedd7ac6705c5ba5d40 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#include <stdarg.h>
#include <stddef.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <syscall.h>
int semctl(int semid, int semnum, int cmd, ...)
{
va_list ap;
struct semid_ds *buf = NULL;
switch (cmd) {
case SETVAL:
case GETALL:
case SETALL:
case IPC_SET:
case IPC_STAT:
va_start(ap, cmd);
buf = va_arg(ap, struct semid_ds *);
va_end(ap);
}
return syscall(semctl, semid, semnum, cmd, buf);
}
|