kernel-posix-timers.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * kernel-posix-timers.h - kernel-dependent definitions for POSIX timers.
  3. */
  4. #include <features.h>
  5. #include <setjmp.h>
  6. #include <signal.h>
  7. #include <sys/types.h>
  8. #ifdef __UCLIBC_HAS_THREADS__
  9. #include <pthread.h>
  10. #endif
  11. #ifdef __UCLIBC_HAS_THREADS_NATIVE__
  12. /* Nonzero if the system calls are not available. */
  13. extern int __no_posix_timers attribute_hidden;
  14. /* Callback to start helper thread. */
  15. extern void __start_helper_thread (void) attribute_hidden;
  16. /* Control variable for helper thread creation. */
  17. extern pthread_once_t __helper_once attribute_hidden;
  18. /* TID of the helper thread. */
  19. extern pid_t __helper_tid attribute_hidden;
  20. #endif
  21. /* Type of timers in the kernel */
  22. typedef int kernel_timer_t;
  23. /* Internal representation of timer */
  24. struct timer {
  25. /* Notification mechanism */
  26. int sigev_notify;
  27. /* Timer ID returned by the kernel */
  28. kernel_timer_t ktimerid;
  29. /*
  30. * All new elements must be added after ktimerid. And if the thrfunc
  31. * element is not the third element anymore the memory allocation in
  32. * timer_create needs to be changed.
  33. */
  34. /* Parameters for the thread to be started for SIGEV_THREAD */
  35. void (*thrfunc) (sigval_t);
  36. sigval_t sival;
  37. #ifdef __UCLIBC_HAS_THREADS__
  38. pthread_attr_t attr;
  39. #endif
  40. };