1
0

clock_nanosleep_time32.c 454 B

123456789101112131415
  1. #include "time32.h"
  2. #include <time.h>
  3. #include <errno.h>
  4. int __clock_nanosleep_time32(clockid_t clk, int flags, const struct timespec32 *req32, struct timespec32 *rem32)
  5. {
  6. struct timespec rem;
  7. int ret = clock_nanosleep(clk, flags, (&(struct timespec){
  8. .tv_sec = req32->tv_sec, .tv_nsec = req32->tv_nsec}), &rem);
  9. if (ret==EINTR && rem32 && !(flags & TIMER_ABSTIME)) {
  10. rem32->tv_sec = rem.tv_sec;
  11. rem32->tv_nsec = rem.tv_nsec;
  12. }
  13. return ret;
  14. }