From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 0CA143849AC0 for ; Fri, 19 Apr 2024 11:47:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0CA143849AC0 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0CA143849AC0 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713527272; cv=none; b=LJgtjUa0ugg1oLEPM3wj3sEh2PkuobCjgE41Ux4uIafUXd4pqiAIlrFlXmkAPyAKczRptUDQVJi/y7IaduY6KtglOach0wR4WGrA2KpxNc2UDnYMctn7W8/UMfb/9F7cw/dKWuiee2PjFVGJaKK0uKJvhWO+4iXEwKE2m4HrKBo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713527272; c=relaxed/simple; bh=Tm5RrjlG9PQTmtClh6SCESULR3WQpqtQGK3m+jEJtQE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=nVy5eO4QcGd7li8ogO4xCSZGtIXBhzDOmuMet+vWaRaztXy/jtFsV2fNd+ze7O5Hu0krP/HajHtwpCmf6u1St1rxZn13bOhh5byqbqovxKbxqrg2f2Kz4ad2bYN8AL8sLzwvoVitxi61cLXPCWqipZNXn18zohgdVeyVk0fYOjo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713527269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=lpfSJfZckYypbkMyJIKScjN/7MMZdyk50+rBxFgKMck=; b=e3UW1CMu2j2MN/Uj92kJgWsa311X1RQ69iM1XZzP+b0BkrAfzHZdxk1psVvIKFno8tCkqx 0hLQuz3UK5bcnRtqv/1vedoR+h6iJvZ44b6yIsOpoCJNcTgT2dfyvv8SxpMAtRhRJj2mp9 u51UiaM/fNbCaQohBfaGGUvx4bVlIAg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-374-uz2TP3MZMpuL5jVEAQT-nQ-1; Fri, 19 Apr 2024 07:47:48 -0400 X-MC-Unique: uz2TP3MZMpuL5jVEAQT-nQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 231729023C2 for ; Fri, 19 Apr 2024 11:47:48 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8F25E40357A7 for ; Fri, 19 Apr 2024 11:47:47 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH v2] nptl: Fix tst-cancel30 on kernels without ppoll_time64 support Date: Fri, 19 Apr 2024 13:47:45 +0200 Message-ID: <877cgt8tge.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Fall back to ppoll if ppoll_time64 fails with ENOSYS. Fixes commit 370da8a121c3ba9eeb2f13da15fc0f21f4136b25 ("nptl: Fix tst-cancel30 on sparc64"). --- 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 . */ +#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; base-commit: 0997c3d0c87433ac8c78043aaa9b6b7e91df2882