aboutsummaryrefslogtreecommitdiff
path: root/rt
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2025-03-09 22:25:14 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2025-03-25 01:05:11 +0100
commitb62692d3c77617747263a4cff5ea3db1ab731df0 (patch)
tree21f7065812aa3a31b70a82e5091829ebd769d1af /rt
parente3a6e85d67f1a48dec3e2557a83d6ce1544a58cb (diff)
downloadglibc-b62692d3c77617747263a4cff5ea3db1ab731df0.tar.xz
glibc-b62692d3c77617747263a4cff5ea3db1ab731df0.zip
aio_suspend64: Fix clock discrepancy [BZ #32795]
cc5d5852c65e ("y2038: Convert aio_suspend to support 64 bit time") switched from __clock_gettime (CLOCK_REALTIME, &now); to __clock_gettime64 (CLOCK_MONOTONIC, &ts);, but pthread_cond_timedwait is based on the absolute realtime clock, so migrate to using pthread_cond_clockwait to select CLOCK_MONOTONIC. Also fix AIO_MISC_WAIT into passing CLOCK_MONOTONIC to __futex_abstimed_wait64. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'rt')
-rw-r--r--rt/aio_suspend.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/rt/aio_suspend.c b/rt/aio_suspend.c
index 2257cd80d4..0500029300 100644
--- a/rt/aio_suspend.c
+++ b/rt/aio_suspend.c
@@ -195,8 +195,9 @@ ___aio_suspend_time64 (const struct aiocb *const list[], int nent,
result = do_aio_misc_wait (&cntr, timeout == NULL ? NULL : &ts);
#else
struct timespec ts32 = valid_timespec64_to_timespec (ts);
- result = pthread_cond_timedwait (&cond, &__aio_requests_mutex,
- timeout == NULL ? NULL : &ts32);
+ result = __pthread_cond_clockwait (&cond, &__aio_requests_mutex,
+ CLOCK_MONOTONIC,
+ timeout == NULL ? NULL : &ts32);
#endif
#if PTHREAD_IN_LIBC