Fix -Warray-parameter warning for __sigsetjmp
[uclibc-ng.git] / librt / timer_gettime.c
blobe13f44642afa01d76e628045a18c7a03b985f07a
1 /*
2 * timer_gettime.c - get the timer value.
3 */
5 #include <errno.h>
6 #include <stdlib.h>
7 #include <time.h>
8 #include <sys/syscall.h>
10 #include "kernel-posix-timers.h"
12 #ifdef __NR_timer_gettime
14 #define __NR___syscall_timer_gettime __NR_timer_gettime
15 static __inline__ _syscall2(int, __syscall_timer_gettime, kernel_timer_t, ktimerid,
16 void *, value);
18 /* Get the amount of time left on a timer */
19 int timer_gettime(timer_t timerid, struct itimerspec *value)
21 struct timer *kt = (struct timer *)timerid;
23 /* Get timeout from the kernel */
24 return __syscall_timer_gettime(kt->ktimerid, value);
27 #endif