timerfd.h 906 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * include/linux/timerfd.h
  3. *
  4. * Copyright (C) 2007 Davide Libenzi <davidel@xmailserver.org>
  5. *
  6. */
  7. #ifndef _LINUX_TIMERFD_H
  8. #define _LINUX_TIMERFD_H
  9. /* For O_CLOEXEC and O_NONBLOCK */
  10. #include <linux/fcntl.h>
  11. /*
  12. * CAREFUL: Check include/asm-generic/fcntl.h when defining
  13. * new flags, since they might collide with O_* ones. We want
  14. * to re-use O_* flags that couldn't possibly have a meaning
  15. * from eventfd, in order to leave a free define-space for
  16. * shared O_* flags.
  17. */
  18. #define TFD_TIMER_ABSTIME (1 << 0)
  19. #define TFD_TIMER_CANCEL_ON_SET (1 << 1)
  20. #define TFD_CLOEXEC O_CLOEXEC
  21. #define TFD_NONBLOCK O_NONBLOCK
  22. #define TFD_SHARED_FCNTL_FLAGS (TFD_CLOEXEC | TFD_NONBLOCK)
  23. /* Flags for timerfd_create. */
  24. #define TFD_CREATE_FLAGS TFD_SHARED_FCNTL_FLAGS
  25. /* Flags for timerfd_settime. */
  26. #define TFD_SETTIME_FLAGS (TFD_TIMER_ABSTIME | TFD_TIMER_CANCEL_ON_SET)
  27. #endif /* _LINUX_TIMERFD_H */