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.129.124]) by sourceware.org (Postfix) with ESMTPS id 1DE573849AC7 for ; Fri, 19 Apr 2024 10:25:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1DE573849AC7 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 1DE573849AC7 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713522334; cv=none; b=wCnjnOxpcCp0eNKKe2IBWpG7V+Cx7PQ0QhCfrHdK55QEDvnW5cWQGQNAsj9tMFCtXufB62aApmo0wIMtNhAo3jYTrwuK+ZrRLZdbyc4SLBEkeld6P1sAvhMXo92iUmxLfWTfwoP+a4T5GJq32vJ6jKj8OV0yoZYhF8xFKXGNqT4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713522334; c=relaxed/simple; bh=rDCA3ze01tMeQOWupugrThNi1IiN4JUl0elBCNK2760=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=aKWdjyhnT/btr2FYauvzYDiZAzHJ2YB3TpsQ0aoCkqnAvzaiWHogSnwrK1XP/k1dfZMJlAQ5zn2m10/0/wyca1cbQSKvHnhtF3YQ0qyy2ao6MyGuWfh0X40GG+SjAX/aCl4z8GXGYw7ra3HqhiqGXdMRB5HkCSx3erJz2aqn9Ok= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713522331; 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=oZfu0bXxtdoKSByFuB5ERaQIDcLnPy42jX8SDMWXf38=; b=V6ofXQcd86I77CxChZHD4w2NwKHWmp1wnqAoT6ZohLDHYFYt5+nTeaUtxEB1e3BU7Kfs2h juZ3vykSiTObXyv5Ghtl14/7RpuEz1vEkKD585RwrvEt6MzYr2WEDIg7sRlGckJQwEFA+j V8Vjm26oxHj1Dk07pCX0LO567/XshHg= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-537-0YdGE4gyPleBP2cjaddOtg-1; Fri, 19 Apr 2024 06:25:30 -0400 X-MC-Unique: 0YdGE4gyPleBP2cjaddOtg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (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 428943C12835 for ; Fri, 19 Apr 2024 10:25:30 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B8FF3C271AF for ; Fri, 19 Apr 2024 10:25:29 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH] nptl: Fix tst-cancel30 on kernels without ppoll_time64 support Date: Fri, 19 Apr 2024 12:25:28 +0200 Message-ID: <87bk658x9j.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.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-12.0 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"). --- sysdeps/pthread/tst-cancel30.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sysdeps/pthread/tst-cancel30.c b/sysdeps/pthread/tst-cancel30.c index 3030660e5f..09071a80ab 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,18 @@ 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); +# 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