Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
David Ahern | 87419c9 | 2013-10-29 10:43:16 -0600 | [diff] [blame] | 2 | /* |
3 | * test for timerfd functions used by perf-kvm-stat-live | ||||
4 | */ | ||||
5 | #include <sys/timerfd.h> | ||||
6 | |||||
7 | int main(void) | ||||
8 | { | ||||
9 | struct itimerspec new_value; | ||||
10 | |||||
11 | int fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK); | ||||
12 | if (fd < 0) | ||||
13 | return 1; | ||||
14 | |||||
15 | if (timerfd_settime(fd, 0, &new_value, NULL) != 0) | ||||
16 | return 1; | ||||
17 | |||||
18 | return 0; | ||||
19 | } |