From patchwork Sat Aug 16 00:13:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 118446 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2E4F13858C39 for ; Sat, 16 Aug 2025 00:22:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E4F13858C39 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (domu-toccata.ens-lyon.fr [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id 299583858405 for ; Sat, 16 Aug 2025 00:14:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 299583858405 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bounce.ens-lyon.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 299583858405 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.77.166.138 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755303262; cv=none; b=awoETQeKZ5ChI12BVb+8T01RZ/El+ONy2lmFs+KY7HHH7sZt4yG1mt0lhdz3jC0JXTWDHwKZVqckMAjJg6M8rdiLFR8Jj/1s4eDepSjJ8wktf7iXvBdXUcUCQlqHCEzh4TuIU3Tp3VNTQgBGQY4YiJpUIdF0P9hl52jXW7YTlj4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755303262; c=relaxed/simple; bh=FMNCuajDLYB8JlGmV+j8TehTfHM4MizcSkwq+KdzxTw=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=d4e/97S1B02TCfsfilq5BDGxubgpTyNwrNkNynIUoBavK9dgtuhSLvzNtsJ4RvYg0vn0Hmhl49TE9xVseatH+RzmTB36wOhtYPVcY1+mX4lLkg24nNb8q50O00bcAZkVea6xBYwyFORGWOMH213RKV80qdkiyPD9bO4oKJ7gU/Y= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 299583858405 Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 1DF77A49CB; Sat, 16 Aug 2025 02:14:08 +0200 (CEST) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EqZZcA7yjWxX; Sat, 16 Aug 2025 02:14:07 +0200 (CEST) Received: from begin (165.21.205.77.rev.sfr.net [77.205.21.165]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id 75CCAA5DC3; Sat, 16 Aug 2025 02:14:07 +0200 (CEST) Received: from samy by begin with local (Exim 4.98.2) (envelope-from ) id 1un4Yg-00000000WyA-2wmk; Sat, 16 Aug 2025 02:14:06 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd,commited 11/19] htl: move pthread_testcancel into libc. Date: Sat, 16 Aug 2025 02:13:57 +0200 Message-ID: <20250816001405.126154-12-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250816001405.126154-1-samuel.thibault@ens-lyon.org> References: <20250816001405.126154-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS, SPF_PASS, 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 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org From: gfleury Message-ID: <20250815181500.107433-12-gfleury@disroot.org> --- htl/Makefile | 2 +- htl/Versions | 5 +++-- htl/pt-testcancel.c | 9 ++++++++- sysdeps/htl/pthreadP.h | 1 + sysdeps/mach/hurd/i386/libc.abilist | 2 ++ sysdeps/mach/hurd/i386/libpthread.abilist | 1 - sysdeps/mach/hurd/x86_64/libc.abilist | 2 ++ sysdeps/mach/hurd/x86_64/libpthread.abilist | 1 - 8 files changed, 17 insertions(+), 6 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 0acd3a8868..ecfa3c1779 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -32,7 +32,6 @@ libpthread-routines := \ pt-initialize \ pt-join \ pt-spin-inlines \ - pt-testcancel \ pt-mutex-transfer-np \ pt-hurd-cond-wait \ pt-hurd-cond-timedwait \ @@ -204,6 +203,7 @@ routines := \ pt-sigstate \ pt-sigstate-destroy \ pt-stack-alloc \ + pt-testcancel \ pt-thread-alloc \ pt-thread-start \ pt-thread-terminate \ diff --git a/htl/Versions b/htl/Versions index 06977e677b..0f22745914 100644 --- a/htl/Versions +++ b/htl/Versions @@ -93,6 +93,7 @@ libc { pthread_setschedprio; pthread_setspecific; pthread_sigmask; + pthread_testcancel; pthread_yield; } @@ -201,6 +202,7 @@ libc { pthread_kill; pthread_setconcurrency; pthread_setschedprio; + pthread_testcancel; pthread_yield; } @@ -255,6 +257,7 @@ libc { __pthread_sigstate_destroy; __pthread_sigmask; __pthread_stack_alloc; + __pthread_testcancel; __pthread_timedblock; __pthread_timedblock_intr; __pthread_thread_alloc; @@ -296,8 +299,6 @@ libpthread { pthread_mutex_transfer_np; - pthread_testcancel; - sem_close; sem_destroy; sem_getvalue; sem_init; sem_open; sem_post; sem_timedwait; sem_trywait; sem_unlink; sem_wait; diff --git a/htl/pt-testcancel.c b/htl/pt-testcancel.c index 4eef765f30..0332f6dd74 100644 --- a/htl/pt-testcancel.c +++ b/htl/pt-testcancel.c @@ -20,6 +20,7 @@ #include #include +#include void __pthread_testcancel (void) @@ -34,4 +35,10 @@ __pthread_testcancel (void) if (cancelled) __pthread_exit (PTHREAD_CANCELED); } -strong_alias (__pthread_testcancel, pthread_testcancel) + +libc_hidden_def (__pthread_testcancel) +versioned_symbol (libc, __pthread_testcancel, pthread_testcancel, GLIBC_2_43); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43) +compat_symbol (libpthread, __pthread_testcancel, pthread_testcancel, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index 1538fdee72..dd9d77776f 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -212,6 +212,7 @@ libc_hidden_proto (__pthread_attr_setstack) int __pthread_attr_getstack (const pthread_attr_t *, void **, size_t *); libc_hidden_proto (__pthread_attr_getstack) void __pthread_testcancel (void); +libc_hidden_proto (__pthread_testcancel) int __pthread_attr_init (pthread_attr_t *attr); int __pthread_condattr_init (pthread_condattr_t *attr); int __pthread_setconcurrency (int __new_level); diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 6056958fcd..a676cd0f75 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -120,6 +120,7 @@ GLIBC_2.12 pthread_setschedparam F GLIBC_2.12 pthread_setschedprio F GLIBC_2.12 pthread_setspecific F GLIBC_2.12 pthread_sigmask F +GLIBC_2.12 pthread_testcancel F GLIBC_2.12 pthread_yield F GLIBC_2.13 __fentry__ F GLIBC_2.14 syncfs F @@ -2647,6 +2648,7 @@ GLIBC_2.43 pthread_getcpuclockid F GLIBC_2.43 pthread_kill F GLIBC_2.43 pthread_setconcurrency F GLIBC_2.43 pthread_setschedprio F +GLIBC_2.43 pthread_testcancel F GLIBC_2.43 pthread_yield F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index afb9e6064d..044fb1c355 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -30,7 +30,6 @@ GLIBC_2.12 pthread_spin_init F GLIBC_2.12 pthread_spin_lock F GLIBC_2.12 pthread_spin_trylock F GLIBC_2.12 pthread_spin_unlock F -GLIBC_2.12 pthread_testcancel F GLIBC_2.12 sem_close F GLIBC_2.12 sem_destroy F GLIBC_2.12 sem_getvalue F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index b17e1980b5..dff8eee881 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -1612,6 +1612,7 @@ GLIBC_2.38 pthread_setschedparam F GLIBC_2.38 pthread_setschedprio F GLIBC_2.38 pthread_setspecific F GLIBC_2.38 pthread_sigmask F +GLIBC_2.38 pthread_testcancel F GLIBC_2.38 pthread_yield F GLIBC_2.38 ptrace F GLIBC_2.38 ptsname F @@ -2329,6 +2330,7 @@ GLIBC_2.43 pthread_getcpuclockid F GLIBC_2.43 pthread_kill F GLIBC_2.43 pthread_setconcurrency F GLIBC_2.43 pthread_setschedprio F +GLIBC_2.43 pthread_testcancel F GLIBC_2.43 pthread_yield F HURD_CTHREADS_0.3 __cthread_getspecific F HURD_CTHREADS_0.3 __cthread_keycreate F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index f1fef475ad..66f06f82b3 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -50,7 +50,6 @@ GLIBC_2.38 pthread_spin_init F GLIBC_2.38 pthread_spin_lock F GLIBC_2.38 pthread_spin_trylock F GLIBC_2.38 pthread_spin_unlock F -GLIBC_2.38 pthread_testcancel F GLIBC_2.38 pthread_timedjoin_np F GLIBC_2.38 pthread_tryjoin_np F GLIBC_2.38 sem_clockwait F