about summary refs log tree commit diff
path: root/src/time/timer_gettime.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-03-29 13:01:25 -0400
committerRich Felker <dalias@aerifal.cx>2011-03-29 13:01:25 -0400
commit80c4dcd2535a2d7f01eb539b0358dc51b0c0e122 (patch)
tree45bd30741a6f37bd0191467663dfbe5fb108c471 /src/time/timer_gettime.c
parentbf619d82c82052741323aa63c107fbd346c8aaba (diff)
downloadmusl-80c4dcd2535a2d7f01eb539b0358dc51b0c0e122.tar.gz
musl-80c4dcd2535a2d7f01eb539b0358dc51b0c0e122.tar.xz
musl-80c4dcd2535a2d7f01eb539b0358dc51b0c0e122.zip
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_gettime.c')
-rw-r--r--src/time/timer_gettime.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/time/timer_gettime.c b/src/time/timer_gettime.c
new file mode 100644
index 00000000..3d3156a0
--- /dev/null
+++ b/src/time/timer_gettime.c
@@ -0,0 +1,7 @@
+#include <time.h>
+#include "pthread_impl.h"
+
+int timer_gettime(timer_t t, struct itimerspec *val)
+{
+	return syscall(SYS_timer_gettime, t->timerid, val);
+}