1 /*
2  * timerfd_create() / timerfd_settime() / timerfd_gettime() for uClibc
3  *
4  * Copyright (C) 2009 Stephan Raue <stephan@openelec.tv>
5  *
6  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
7  */
8 
9 #include <sys/syscall.h>
10 #include <sys/timerfd.h>
11 
12 #if defined(__UCLIBC_USE_TIME64__)
13 #include "internal/time64_helpers.h"
14 #endif
15 
16 /*
17  * timerfd_create()
18  */
19 #ifdef __NR_timerfd_create
_syscall2(int,timerfd_create,int,clockid,int,flags)20 _syscall2(int, timerfd_create, int, clockid, int, flags)
21 #endif
22 
23 /*
24  * timerfd_settime()
25  */
26 #if defined(__NR_timerfd_settime) || defined(__NR_timerfd_settime64)
27 #if defined(__UCLIBC_USE_TIME64__) && defined(__NR_timerfd_settime64)
28 int timerfd_settime(int ufd, int flags, const struct itimerspec *utmr, struct itimerspec *otmr)
29 {
30     return INLINE_SYSCALL(timerfd_settime64, 4, ufd, flags, TO_ITS64_P(utmr), otmr);
31 }
32 #else
33 _syscall4(int, timerfd_settime, int, ufd, int, flags, const struct itimerspec *, utmr, struct itimerspec *, otmr)
34 #endif
35 #endif
36 
37 /*
38  * timerfd_gettime()
39  */
40 #if defined(__NR_timerfd_gettime) || defined(__NR_timerfd_gettime64)
41 #if defined(__UCLIBC_USE_TIME64__) && defined(__NR_timerfd_gettime64)
42 _syscall2_64(int, timerfd_gettime, int, ufd, struct itimerspec *, otmr)
43 #else
44 _syscall2(int, timerfd_gettime, int, ufd, struct itimerspec *, otmr)
45 #endif
46 #endif
47