From b4c3446836285fc3d1465dc9b8c587c8f50e4922 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Mon, 23 Nov 2020 13:47:18 -0300 Subject: nptl: Return EINVAL for invalid clock for pthread_clockjoin_np The align the GNU extension with the others one that accept specify which clock to wait for (such as pthread_mutex_clocklock). Check on x86_64-linux-gnu. Reviewed-by: Lukasz Majewski --- nptl/pthread_clockjoin.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nptl/pthread_clockjoin.c') diff --git a/nptl/pthread_clockjoin.c b/nptl/pthread_clockjoin.c index 0baba1e83d..3d54fe588f 100644 --- a/nptl/pthread_clockjoin.c +++ b/nptl/pthread_clockjoin.c @@ -17,12 +17,16 @@ . */ #include +#include #include "pthreadP.h" int __pthread_clockjoin_np64 (pthread_t threadid, void **thread_return, clockid_t clockid, const struct __timespec64 *abstime) { + if (!futex_abstimed_supported_clockid (clockid)) + return EINVAL; + return __pthread_clockjoin_ex (threadid, thread_return, clockid, abstime, true); } -- cgit 1.4.1