summaryrefslogblamecommitdiff
path: root/src/ipc/semctl.c
blob: a210e20baa12f01e6854b057f5fea96f0f517661 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                         
                 
                                                              
     
                                                                          

      
#include <sys/sem.h>
#include <stdarg.h>
#include "syscall.h"
#include "ipc.h"

int semctl(int id, int num, int cmd, ...)
{
	long arg;
	va_list ap;
	va_start(ap, cmd);
	arg = va_arg(ap, long);
	va_end(ap);
#ifdef SYS_semctl
	return syscall(SYS_semctl, id, num, cmd | 0x100, arg);
#else
	return syscall(SYS_ipc, IPCOP_semctl, id, num, cmd | 0x100, &arg);
#endif
}