about summary refs log tree commit diff
path: root/src/ipc/semtimedop.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2013-11-09 00:18:57 -0500
committerRich Felker <dalias@aerifal.cx>2013-11-09 00:18:57 -0500
commit4571f9f856d8d6c1643b516c27f861dbab66ec00 (patch)
tree47bbf196fa16bd9b5d9eb7b55f069fbfa49051ea /src/ipc/semtimedop.c
parentf5980e330a331b83f99a25c522aae00170dff131 (diff)
downloadmusl-4571f9f856d8d6c1643b516c27f861dbab66ec00.tar.gz
musl-4571f9f856d8d6c1643b516c27f861dbab66ec00.tar.xz
musl-4571f9f856d8d6c1643b516c27f861dbab66ec00.zip
implement semtimedop
this is a Linux-specific extension to the sysv semaphore api.
Diffstat (limited to 'src/ipc/semtimedop.c')
-rw-r--r--src/ipc/semtimedop.c13
1 files changed, 13 insertions, 0 deletions
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 <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
+}