timerfd.h 471 B

123456789101112131415161718192021222324252627
  1. #ifndef _SYS_TIMERFD_H
  2. #define _SYS_TIMERFD_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <time.h>
  7. #include <fcntl.h>
  8. #define TFD_NONBLOCK O_NONBLOCK
  9. #define TFD_CLOEXEC O_CLOEXEC
  10. #define TFD_TIMER_ABSTIME 1
  11. #define TFD_TIMER_CANCEL_ON_SET (1 << 1)
  12. struct itimerspec;
  13. int timerfd_create(int, int);
  14. int timerfd_settime(int, int, const struct itimerspec *, struct itimerspec *);
  15. int timerfd_gettime(int, struct itimerspec *);
  16. #ifdef __cplusplus
  17. }
  18. #endif
  19. #endif