diff options
Diffstat (limited to 'libpthread/nptl/sysdeps/pthread/pthread_cond_timedwait.c')
-rw-r--r-- | libpthread/nptl/sysdeps/pthread/pthread_cond_timedwait.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/libpthread/nptl/sysdeps/pthread/pthread_cond_timedwait.c b/libpthread/nptl/sysdeps/pthread/pthread_cond_timedwait.c index f06b69e2f..ce738b1a1 100644 --- a/libpthread/nptl/sysdeps/pthread/pthread_cond_timedwait.c +++ b/libpthread/nptl/sysdeps/pthread/pthread_cond_timedwait.c @@ -95,17 +95,34 @@ __pthread_cond_timedwait ( while (1) { - struct timespec rt; + struct timespec rt = {.tv_sec = 0, .tv_nsec = 0}; +#if defined(__UCLIBC_USE_TIME64__) + struct __ts64_struct __rt64; +#endif { #ifdef __NR_clock_gettime INTERNAL_SYSCALL_DECL (err); -# ifndef __ASSUME_POSIX_TIMERS +# if !defined(__ASSUME_POSIX_TIMERS) || defined(__UCLIBC_USE_TIME64__) int ret = # endif +#if defined(__UCLIBC_USE_TIME64__) && defined(__NR_clock_gettime64) + INTERNAL_SYSCALL (clock_gettime64, err, 2, + (cond->__data.__nwaiters + & ((1 << COND_NWAITERS_SHIFT) - 1)), + &__rt64); + + if (ret == 0) { + rt.tv_sec = __rt64.tv_sec; + rt.tv_nsec = __rt64.tv_nsec; + } + +#else INTERNAL_SYSCALL (clock_gettime, err, 2, (cond->__data.__nwaiters & ((1 << COND_NWAITERS_SHIFT) - 1)), &rt); +#endif + # ifndef __ASSUME_POSIX_TIMERS if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (ret, err), 0)) { |