nptl: Return EINVAL for pthread_mutex_clocklock/PI with CLOCK_MONOTONIC [BZ #26801]
commit74f418b29d1e9463028f2ae4cc2a9c74d39aeaab
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 29 Oct 2020 18:34:31 +0000 (29 15:34 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 25 Nov 2020 13:46:22 +0000 (25 10:46 -0300)
treeafc76155ba0a5384bc6d142742441dc2b27cdc6a
parentb45b1c5ba1df4d0315ffdd00a040ff9bc0597a8d
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 <lukma@denx.de>
nptl/Makefile
nptl/pthread_mutex_timedlock.c
nptl/tst-mutexpi10.c [new file with mode: 0644]
sysdeps/pthread/tst-mutex5.c
sysdeps/pthread/tst-mutex9.c