1 #include "time32.h" 2 #include <time.h> 3 #include <threads.h> 4 #include <errno.h> 5 __thrd_sleep_time32(const struct timespec32 * req32,struct timespec32 * rem32)6int __thrd_sleep_time32(const struct timespec32 *req32, struct timespec32 *rem32) 7 { 8 struct timespec rem; 9 int ret = thrd_sleep((&(struct timespec){ 10 .tv_sec = req32->tv_sec, .tv_nsec = req32->tv_nsec}), &rem); 11 if (ret<0 && errno==EINTR && rem32) { 12 rem32->tv_sec = rem.tv_sec; 13 rem32->tv_nsec = rem.tv_nsec; 14 } 15 return ret; 16 } 17