test-timerfd.c 299 B

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