path: root/src/time/timer_settime.c
diff options
authorRich Felker <>2011-03-29 13:01:25 -0400
committerRich Felker <>2011-03-29 13:01:25 -0400
commit80c4dcd2535a2d7f01eb539b0358dc51b0c0e122 (patch)
tree45bd30741a6f37bd0191467663dfbe5fb108c471 /src/time/timer_settime.c
parentbf619d82c82052741323aa63c107fbd346c8aaba (diff)
implement POSIX timers
this implementation is superior to the glibc/nptl implementation, in that it gives true realtime behavior. there is no risk of timer expiration events being lost due to failed thread creation or failed malloc, because the thread is created as time creation time, and reused until the timer is deleted.
Diffstat (limited to 'src/time/timer_settime.c')
1 files changed, 7 insertions, 0 deletions
diff --git a/src/time/timer_settime.c b/src/time/timer_settime.c
new file mode 100644
index 00000000..d109570b
--- /dev/null
+++ b/src/time/timer_settime.c
@@ -0,0 +1,7 @@
+#include <time.h>
+#include "pthread_impl.h"
+int timer_settime(timer_t t, int flags, const struct itimerspec *val, struct itimerspec *old)
+ return syscall(SYS_timer_settime, t->timerid, flags, val, old);