do \
{ \
if (cancel) \
- status = futex_reltimed_wait_cancelable ( \
- (unsigned int *) futexaddr, oldval, timeout, FUTEX_PRIVATE); \
+ status = __futex_abstimed_wait_cancelable64 ( \
+ (unsigned int *) futexaddr, oldval, CLOCK_MONOTONIC, timeout, \
+ FUTEX_PRIVATE); \
else \
- status = futex_reltimed_wait ((unsigned int *) futexaddr, \
- oldval, timeout, FUTEX_PRIVATE); \
+ status = __futex_abstimed_wait64 ((unsigned int *) futexaddr, \
+ oldval, CLOCK_REALTIME, timeout, FUTEX_PRIVATE); \
if (status != EAGAIN) \
break; \
\
result = EINTR; \
else if (status == ETIMEDOUT) \
result = EAGAIN; \
+ else if (status == EOVERFLOW) \
+ result = EOVERFLOW; \
else \
assert (status == 0 || status == EAGAIN); \
\
return __futex_abstimed_wait_common64 (futex_word, expected, clockid,
abstime, private, false);
}
+libpthread_hidden_def (__futex_abstimed_wait64)
int
__futex_abstimed_wait_cancelable64 (unsigned int* futex_word,
return __futex_abstimed_wait_common64 (futex_word, expected, clockid,
abstime, private, true);
}
+libpthread_hidden_def (__futex_abstimed_wait_cancelable64)
__futex_abstimed_wait_cancelable64 (unsigned int* futex_word,
unsigned int expected, clockid_t clockid,
const struct __timespec64* abstime,
- int private) attribute_hidden;
+ int private);
+libpthread_hidden_proto (__futex_abstimed_wait_cancelable64);
int
__futex_abstimed_wait64 (unsigned int* futex_word, unsigned int expected,
clockid_t clockid,
const struct __timespec64* abstime,
- int private) attribute_hidden;
+ int private);
+libpthread_hidden_proto (__futex_abstimed_wait64);
static __always_inline int
#ifdef DONT_NEED_AIO_MISC_COND
static int
__attribute__ ((noinline))
-do_aio_misc_wait (unsigned int *cntr, const struct timespec *timeout)
+do_aio_misc_wait (unsigned int *cntr, const struct __timespec64 *timeout)
{
int result = 0;
#endif
int
-aio_suspend (const struct aiocb *const list[], int nent,
- const struct timespec *timeout)
+__aio_suspend_time64 (const struct aiocb *const list[], int nent,
+ const struct __timespec64 *timeout)
{
if (__glibc_unlikely (nent < 0))
{
break;
}
+ struct __timespec64 ts;
+ if (timeout != NULL)
+ {
+ __clock_gettime64 (CLOCK_MONOTONIC, &ts);
+ ts.tv_sec += timeout->tv_sec;
+ ts.tv_nsec += timeout->tv_nsec;
+ if (ts.tv_nsec >= 1000000000)
+ {
+ ts.tv_nsec -= 1000000000;
+ ts.tv_sec++;
+ }
+ }
/* Only if none of the entries is NULL or finished to be wait. */
if (cnt == nent && any)
pthread_cleanup_push (cleanup, &clparam);
#ifdef DONT_NEED_AIO_MISC_COND
- result = do_aio_misc_wait (&cntr, timeout);
+ result = do_aio_misc_wait (&cntr, timeout == NULL ? NULL : &ts);
#else
- if (timeout == NULL)
- result = pthread_cond_wait (&cond, &__aio_requests_mutex);
- else
- {
- /* We have to convert the relative timeout value into an
- absolute time value with pthread_cond_timedwait expects. */
- struct timespec now;
- struct timespec abstime;
-
- __clock_gettime (CLOCK_REALTIME, &now);
- abstime.tv_nsec = timeout->tv_nsec + now.tv_nsec;
- abstime.tv_sec = timeout->tv_sec + now.tv_sec;
- if (abstime.tv_nsec >= 1000000000)
- {
- abstime.tv_nsec -= 1000000000;
- abstime.tv_sec += 1;
- }
-
- result = pthread_cond_timedwait (&cond, &__aio_requests_mutex,
- &abstime);
- }
+ struct timespec ts32 = valid_timespec64_to_timespec (ts);
+ result = pthread_cond_timedwait (&cond, &__aio_requests_mutex,
+ timeout == NULL ? NULL : &ts32);
#endif
pthread_cleanup_pop (0);
return result;
}
+#if __TIMESIZE != 64
+librt_hidden_def (__aio_suspend_time64)
+
+int
+__aio_suspend (const struct aiocb *const list[], int nent,
+ const struct timespec *timeout)
+{
+ struct __timespec64 ts64;
+
+ if (timeout != NULL)
+ ts64 = valid_timespec_to_timespec64 (*timeout);
+
+ return __aio_suspend_time64 (list, nent, timeout != NULL ? &ts64 : NULL);
+}
+#endif
+weak_alias (__aio_suspend, aio_suspend)
weak_alias (aio_suspend, aio_suspend64)