implement semtimedop

this is a Linux-specific extension to the sysv semaphore api.
This commit is contained in:
Rich Felker 2013-11-09 00:18:57 -05:00
parent f5980e330a
commit 4571f9f856
2 changed files with 14 additions and 0 deletions

View File

@ -1,6 +1,7 @@
#define IPCOP_semop 1 #define IPCOP_semop 1
#define IPCOP_semget 2 #define IPCOP_semget 2
#define IPCOP_semctl 3 #define IPCOP_semctl 3
#define IPCOP_semtimedop 4
#define IPCOP_msgsnd 11 #define IPCOP_msgsnd 11
#define IPCOP_msgrcv 12 #define IPCOP_msgrcv 12
#define IPCOP_msgget 13 #define IPCOP_msgget 13

13
src/ipc/semtimedop.c Normal file
View File

@ -0,0 +1,13 @@
#define _GNU_SOURCE
#include <sys/sem.h>
#include "syscall.h"
#include "ipc.h"
int semtimedop(int id, struct sembuf *buf, size_t n, const struct timespec *ts)
{
#ifdef SYS_semop
return syscall(SYS_semtimedop, id, buf, n, ts);
#else
return syscall(SYS_ipc, IPCOP_semtimedop, id, n, 0, buf, ts);
#endif
}