timerfd_gettime32.c 473 B

12345678910111213141516
  1. #include "time32.h"
  2. #include <time.h>
  3. #include <sys/timerfd.h>
  4. int __timerfd_gettime32(int t, struct itimerspec32 *val32)
  5. {
  6. struct itimerspec old;
  7. int r = timerfd_gettime(t, &old);
  8. if (r) return r;
  9. /* No range checking for consistency with settime */
  10. val32->it_interval.tv_sec = old.it_interval.tv_sec;
  11. val32->it_interval.tv_nsec = old.it_interval.tv_nsec;
  12. val32->it_value.tv_sec = old.it_value.tv_sec;
  13. val32->it_value.tv_nsec = old.it_value.tv_nsec;
  14. return 0;
  15. }