3 #include "pthread_impl.h"
5 int timer_gettime(timer_t t
, struct itimerspec
*val
)
8 pthread_t td
= (void *)((uintptr_t)t
<< 1);
9 t
= (void *)(uintptr_t)(td
->timer_id
& INT_MAX
);
11 #ifdef SYS_timer_gettime64
13 if (sizeof(time_t) > 4)
14 r
= __syscall(SYS_timer_gettime64
, t
, val
);
15 if (SYS_timer_gettime
== SYS_timer_gettime64
|| r
!=-ENOSYS
)
16 return __syscall_ret(r
);
18 r
= __syscall(SYS_timer_gettime
, t
, val32
);
20 val
->it_interval
.tv_sec
= val32
[0];
21 val
->it_interval
.tv_nsec
= val32
[1];
22 val
->it_value
.tv_sec
= val32
[2];
23 val
->it_value
.tv_nsec
= val32
[3];
25 return __syscall_ret(r
);
27 return syscall(SYS_timer_gettime
, t
, val
);