avoid malloc of deps arrays for ldso and vdso
[musl.git] / src / time / timer_gettime.c
blobed6d8d65ce1ac0b488002e5a9503b1fbd84ddea3
1 #include <time.h>
2 #include <limits.h>
3 #include "pthread_impl.h"
5 int timer_gettime(timer_t t, struct itimerspec *val)
7 if ((intptr_t)t < 0) {
8 pthread_t td = (void *)((uintptr_t)t << 1);
9 t = (void *)(uintptr_t)(td->timer_id & INT_MAX);
11 return syscall(SYS_timer_gettime, t, val);