timerfd.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* Copyright (C) 2008, 2012 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, see
  13. <http://www.gnu.org/licenses/>. */
  14. #ifndef _SYS_TIMERFD_H
  15. #define _SYS_TIMERFD_H 1
  16. #include <time.h>
  17. /* Get the platform-dependent flags. */
  18. #include <bits/timerfd.h>
  19. /* Bits to be set in the FLAGS parameter of `timerfd_settime'. */
  20. enum
  21. {
  22. TFD_TIMER_ABSTIME = 1 << 0
  23. #define TFD_TIMER_ABSTIME TFD_TIMER_ABSTIME
  24. };
  25. __BEGIN_DECLS
  26. /* Return file descriptor for new interval timer source. */
  27. extern int timerfd_create (clockid_t __clock_id, int __flags) __THROW;
  28. /* Set next expiration time of interval timer source UFD to UTMR. If
  29. FLAGS has the TFD_TIMER_ABSTIME flag set the timeout value is
  30. absolute. Optionally return the old expiration time in OTMR. */
  31. extern int timerfd_settime (int __ufd, int __flags,
  32. const struct itimerspec *__utmr,
  33. struct itimerspec *__otmr) __THROW;
  34. /* Return the next expiration time of UFD. */
  35. extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW;
  36. __END_DECLS
  37. #endif /* sys/timerfd.h */