1 /*
2 * Copyright (c) International Business Machines Corp., 2007
3 * Copyright (c) 2014 Fujitsu Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it would be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 */
17
18 #ifndef TIMERFD_H
19 #define TIMERFD_H
20
21 #include <time.h>
22 #include "config.h"
23 #include "lapi/syscalls.h"
24
25 #ifdef HAVE_SYS_TIMERFD_H
26 #include <sys/timerfd.h>
27 #endif
28
29 #if !defined(HAVE_TIMERFD_CREATE)
timerfd_create(int clockid,int flags)30 int timerfd_create(int clockid, int flags)
31 {
32 return ltp_syscall(__NR_timerfd_create, clockid, flags);
33 }
34 #endif
35
36 #if !defined(HAVE_TIMERFD_GETTIME)
timerfd_settime(int fd,int flags,const struct itimerspec * new_value,struct itimerspec * old_value)37 int timerfd_settime(int fd, int flags, const struct itimerspec *new_value,
38 struct itimerspec *old_value)
39 {
40 return ltp_syscall(__NR_timerfd_settime, fd, flags, new_value,
41 old_value);
42 }
43 #endif
44
45 #if !defined(HAVE_TIMERFD_SETTIME)
timerfd_gettime(int fd,struct itimerspec * curr_value)46 int timerfd_gettime(int fd, struct itimerspec *curr_value)
47 {
48 return ltp_syscall(__NR_timerfd_gettime, fd, curr_value);
49 }
50 #endif
51
52 #endif /* TIMERFD_H */
53