public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH v2] nptl: Fix tst-cancel30 on kernels without ppoll_time64 support
Date: Tue, 23 Apr 2024 16:03:43 -0300	[thread overview]
Message-ID: <8032d246-70d7-4dc6-a192-6e2897cd6818@linaro.org> (raw)
In-Reply-To: <877cgt8tge.fsf@oldenburg.str.redhat.com>



On 19/04/24 08:47, Florian Weimer wrote:
> Fall back to ppoll if ppoll_time64 fails with ENOSYS.
> Fixes commit 370da8a121c3ba9eeb2f13da15fc0f21f4136b25 ("nptl: Fix
> tst-cancel30 on sparc64").

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> 
> ---
> v2: Fix build failure on 32-bit RISC-V.
>  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
>     <https://www.gnu.org/licenses/>.  */
>  
> +#include <errno.h>
>  #include <support/check.h>
>  #include <support/xstdio.h>
>  #include <support/xthread.h>
> @@ -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;
> 
> base-commit: 0997c3d0c87433ac8c78043aaa9b6b7e91df2882
> 

      reply	other threads:[~2024-04-23 19:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19 11:47 Florian Weimer
2024-04-23 19:03 ` Adhemerval Zanella Netto [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8032d246-70d7-4dc6-a192-6e2897cd6818@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).