From 4571f9f856d8d6c1643b516c27f861dbab66ec00 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 9 Nov 2013 00:18:57 -0500 Subject: [PATCH] implement semtimedop this is a Linux-specific extension to the sysv semaphore api. --- src/ipc/ipc.h | 1 + src/ipc/semtimedop.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 src/ipc/semtimedop.c diff --git a/src/ipc/ipc.h b/src/ipc/ipc.h index 54875823..30ab939a 100644 --- a/src/ipc/ipc.h +++ b/src/ipc/ipc.h @@ -1,6 +1,7 @@ #define IPCOP_semop 1 #define IPCOP_semget 2 #define IPCOP_semctl 3 +#define IPCOP_semtimedop 4 #define IPCOP_msgsnd 11 #define IPCOP_msgrcv 12 #define IPCOP_msgget 13 diff --git a/src/ipc/semtimedop.c b/src/ipc/semtimedop.c new file mode 100644 index 00000000..a3b511b6 --- /dev/null +++ b/src/ipc/semtimedop.c @@ -0,0 +1,13 @@ +#define _GNU_SOURCE +#include +#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 +} -- 2.25.1