• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * Copyright (c) International Business Machines  Corp., 2007
4  * Copyright (c) 2014 Fujitsu Ltd.
5  */
6 
7 #ifndef TIMERFD_H
8 #define TIMERFD_H
9 
10 #include <time.h>
11 #include "config.h"
12 #include "lapi/syscalls.h"
13 
14 #ifdef HAVE_SYS_TIMERFD_H
15 #include <sys/timerfd.h>
16 #endif
17 
18 #if !defined(HAVE_TIMERFD_CREATE)
timerfd_create(int clockid,int flags)19 int timerfd_create(int clockid, int flags)
20 {
21 	return ltp_syscall(__NR_timerfd_create, clockid, flags);
22 }
23 #endif
24 
25 #if !defined(HAVE_TIMERFD_GETTIME)
timerfd_settime(int fd,int flags,const struct itimerspec * new_value,struct itimerspec * old_value)26 int timerfd_settime(int fd, int flags, const struct itimerspec *new_value,
27 		    struct itimerspec *old_value)
28 {
29 	return ltp_syscall(__NR_timerfd_settime, fd, flags, new_value,
30 			   old_value);
31 }
32 #endif
33 
34 #if !defined(HAVE_TIMERFD_SETTIME)
timerfd_gettime(int fd,struct itimerspec * curr_value)35 int timerfd_gettime(int fd, struct itimerspec *curr_value)
36 {
37 	return ltp_syscall(__NR_timerfd_gettime, fd, curr_value);
38 }
39 #endif
40 
41 #endif /* TIMERFD_H */
42