about summary refs log tree commit diff
path: root/src/time/timer_gettime.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/time/timer_gettime.c')
-rw-r--r--src/time/timer_gettime.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/time/timer_gettime.c b/src/time/timer_gettime.c
index 3d3156a0..2320873e 100644
--- a/src/time/timer_gettime.c
+++ b/src/time/timer_gettime.c
@@ -3,5 +3,7 @@
 
 int timer_gettime(timer_t t, struct itimerspec *val)
 {
-	return syscall(SYS_timer_gettime, t->timerid, val);
+	if ((uintptr_t)t & 1) t = (void *)((unsigned long)t / 2);
+	else t = ((pthread_t)t)->result;
+	return syscall(SYS_timer_gettime, (long)t, val);
 }