From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2178) id 788DD384641C; Thu, 25 Apr 2024 11:06:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 788DD384641C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1714043204; bh=QiW52vuiEeVTva6FpS2WzflGZe0iogzpyKmy5UTWUe0=; h=From:To:Subject:Date:From; b=l3CnxlvcNahD5T2lNMwsB26uOKwSE2Rs94U6n6XsmQq1td5PnZ1r/VObHmMo7t6kl ApJSPj9CWGMrpIWd0785MIq3WzcrJat1ZSp2STkyLBI5qbIPdzlk3nmPj6FnytlhCW KrEsT7+dj64fPQX1zTwa+qVKCAiM+qpeQXo6dHwg= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc/release/2.39/master] nptl: Fix tst-cancel30 on kernels without ppoll_time64 support X-Act-Checkin: glibc X-Git-Author: Florian Weimer X-Git-Refname: refs/heads/release/2.39/master X-Git-Oldrev: 31da30f23cddd36db29d5b6a1c7619361b271fb4 X-Git-Newrev: e828914cf9f2fc2caa5bced0fc6a03cb78324979 Message-Id: <20240425110644.788DD384641C@sourceware.org> Date: Thu, 25 Apr 2024 11:06:44 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e828914cf9f2fc2caa5bced0fc6a03cb78324979 commit e828914cf9f2fc2caa5bced0fc6a03cb78324979 Author: Florian Weimer Date: Tue Apr 23 21:16:32 2024 +0200 nptl: Fix tst-cancel30 on kernels without ppoll_time64 support Fall back to ppoll if ppoll_time64 fails with ENOSYS. Fixes commit 370da8a121c3ba9eeb2f13da15fc0f21f4136b25 ("nptl: Fix tst-cancel30 on sparc64"). Reviewed-by: Adhemerval Zanella (cherry picked from commit f4724843ada64a51d66f65d3199fe431f9d4c254) Diff: --- sysdeps/pthread/tst-cancel30.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sysdeps/pthread/tst-cancel30.c b/sysdeps/pthread/tst-cancel30.c index 3030660e5f..94ad6281bc 100644 --- a/sysdeps/pthread/tst-cancel30.c +++ b/sysdeps/pthread/tst-cancel30.c @@ -18,6 +18,7 @@ License along with the GNU C Library; if not, see . */ +#include #include #include #include @@ -46,13 +47,19 @@ tf (void *arg) /* Wait indefinitely for cancellation, which only works if asynchronous cancellation is enabled. */ -#if defined SYS_ppoll || defined SYS_ppoll_time64 -# ifndef SYS_ppoll_time64 -# define SYS_ppoll_time64 SYS_ppoll +#ifdef SYS_ppoll_time64 + long int ret = syscall (SYS_ppoll_time64, NULL, 0, NULL, NULL); + (void) ret; +# ifdef SYS_ppoll + if (ret == -1 && errno == ENOSYS) + syscall (SYS_ppoll, NULL, 0, NULL, NULL); # endif - syscall (SYS_ppoll_time64, NULL, 0, NULL, NULL); #else +# ifdef SYS_ppoll + syscall (SYS_ppoll, NULL, 0, NULL, NULL); +# else for (;;); +# endif #endif return 0;