timer_settime.c 679 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * timer_settime.c - set the timer.
  3. */
  4. #include <errno.h>
  5. #include <stdlib.h>
  6. #include <time.h>
  7. #include <sys/syscall.h>
  8. #include "kernel-posix-timers.h"
  9. #ifdef __NR_timer_settime
  10. #define __NR___syscall_timer_settime __NR_timer_settime
  11. static __inline__ _syscall4(int, __syscall_timer_settime, kernel_timer_t, ktimerid,
  12. int, flags, const void *, value, void *, ovalue);
  13. /* Set the expiration time for a timer */
  14. int timer_settime(timer_t timerid, int flags, const struct itimerspec *value,
  15. struct itimerspec *ovalue)
  16. {
  17. struct timer *kt = (struct timer *)timerid;
  18. /* Set timeout */
  19. return __syscall_timer_settime(kt->ktimerid, flags, value, ovalue);
  20. }
  21. #endif