On ports with __TIMESIZE != 64 the remaining time argument always receives
pointer to struct __timespec64 instance. This is the different behavior
when compared to 64 bit versions of clock_nanosleep and nanosleep
functions, which receive NULL.
To avoid any potential issues, we also pass NULL when *rem pointer is
NULL.
Reported-by: Andreas Schwab <schwab@suse.de>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
struct __timespec64 treq64, trem64;
treq64 = valid_timespec_to_timespec64 (*req);
- r = __clock_nanosleep_time64 (clock_id, flags, &treq64, &trem64);
+ r = __clock_nanosleep_time64 (clock_id, flags, &treq64,
+ rem != NULL ? &trem64 : NULL);
if (r == EINTR && rem != NULL && (flags & TIMER_ABSTIME) == 0)
*rem = valid_timespec64_to_timespec (trem64);
struct __timespec64 treq64, trem64;
treq64 = valid_timespec_to_timespec64 (*req);
- int ret = __nanosleep64 (&treq64, &trem64);
+ int ret = __nanosleep64 (&treq64, rem != NULL ? &trem64 : NULL);
if (ret != 0 && errno == EINTR && rem != NULL)
*rem = valid_timespec64_to_timespec (trem64);