test-timerfd.c 335 B

12345678910111213141516171819
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * test for timerfd functions used by perf-kvm-stat-live
  4. */
  5. #include <sys/timerfd.h>
  6. int main(void)
  7. {
  8. struct itimerspec new_value;
  9. int fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
  10. if (fd < 0)
  11. return 1;
  12. if (timerfd_settime(fd, 0, &new_value, NULL) != 0)
  13. return 1;
  14. return 0;
  15. }