From 74f418b29d1e9463028f2ae4cc2a9c74d39aeaab Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Thu, 29 Oct 2020 15:34:31 -0300 Subject: nptl: Return EINVAL for pthread_mutex_clocklock/PI with CLOCK_MONOTONIC [BZ #26801] Linux futex FUTEX_LOCK_PI operation only supports CLOCK_REALTIME, so pthread_mutex_clocklock operation with priority aware mutexes may fail depending of the input timeout. Also, it is not possible to convert a CLOCK_MONOTONIC to a CLOCK_REALTIME due the possible wall clock time change which might invalid the requested timeout. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Lukasz Majewski --- sysdeps/pthread/tst-mutex9.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sysdeps/pthread/tst-mutex9.c') diff --git a/sysdeps/pthread/tst-mutex9.c b/sysdeps/pthread/tst-mutex9.c index 2d7927b7c2..bfc01f8c75 100644 --- a/sysdeps/pthread/tst-mutex9.c +++ b/sysdeps/pthread/tst-mutex9.c @@ -133,7 +133,9 @@ do_test (void) { do_test_clock (CLOCK_USE_TIMEDLOCK); do_test_clock (CLOCK_REALTIME); +#ifndef ENABLE_PI do_test_clock (CLOCK_MONOTONIC); +#endif return 0; } -- cgit 1.4.1