From patchwork Sun Aug 17 23:26:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 118497 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 4DB823858422 for ; Sun, 17 Aug 2025 23:27:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4DB823858422 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id DF0A53858D33 for ; Sun, 17 Aug 2025 23:26:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DF0A53858D33 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 DF0A53858D33 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=1755473188; cv=none; b=WKbnstk9MQ/jSuQjDI0foktkdtbxLeot7vVZSJD0uervZBGNzBw48IGM0Kl8SOtH4mzWupXOVEkPKB3bvcjr5HMi+1XVtuz7/G5pChJnwMVz1AeP0pe7eX/prUCwtZSSkmgw130gFtkwWuyqPQdNufxymSsJ+0I/hgq7hxP79f0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755473188; c=relaxed/simple; bh=BYs2aoUflfqsxjJcaga0CHnKQMWmuDz0akDnehB4aPo=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=nrTylVhZ2gReFnZDgW2N74b+z88jTjtUjTco22QEcp8emIbSKQ98No70S9PdTNBqKrNP1zauO690Oivnw+BuAmA2wBHdlWZ3BLAfjseRrTLz7MivvwDQ1cBP9VFMUnov13TUzkFENbo1FMbqGr0+eu+dnHO3y+wtCpnw78qtp38= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DF0A53858D33 Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id D23A4A49BD; Mon, 18 Aug 2025 01:26:26 +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 mYbxSdnuMp9i; Mon, 18 Aug 2025 01:26:26 +0200 (CEST) Received: from begin (97.22.205.77.rev.sfr.net [77.205.22.97]) (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 7DF51A0528; Mon, 18 Aug 2025 01:26:26 +0200 (CEST) Received: from samy by begin with local (Exim 4.98.2) (envelope-from ) id 1unmld-00000002wC5-2QxI; Mon, 18 Aug 2025 01:26:25 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd,commited 1/7] htl: move sem_destroy into libc. Date: Mon, 18 Aug 2025 01:26:18 +0200 Message-ID: <20250817232624.700329-2-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250817232624.700329-1-samuel.thibault@ens-lyon.org> References: <20250817232624.700329-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.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: <20250817104023.91919-2-gfleury@disroot.org> --- htl/Makefile | 2 +- htl/Versions | 4 +++- sysdeps/htl/sem-destroy.c | 6 +++++- 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 - 7 files changed, 13 insertions(+), 5 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index ec48f8b91a..e4a3adc99c 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -35,7 +35,6 @@ libpthread-routines := \ pt-getname-np \ pt-setname-np \ sem_close \ - sem-destroy \ sem-getvalue \ sem-init \ sem_open \ @@ -211,6 +210,7 @@ routines := \ pt-timedblock-intr \ pt-wakeup \ pt-yield \ + sem-destroy \ # routines shared-only-routines = forward diff --git a/htl/Versions b/htl/Versions index 5570a2b631..48e7fcead4 100644 --- a/htl/Versions +++ b/htl/Versions @@ -101,6 +101,7 @@ libc { pthread_sigmask; pthread_testcancel; pthread_yield; + sem_destroy; } GLIBC_2.21 { @@ -219,6 +220,7 @@ libc { pthread_timedjoin_np; pthread_tryjoin_np; pthread_yield; + sem_destroy; } GLIBC_PRIVATE { @@ -311,7 +313,7 @@ libpthread { pthread_create; - sem_close; sem_destroy; sem_getvalue; sem_init; sem_open; sem_post; + sem_close; sem_getvalue; sem_init; sem_open; sem_post; sem_timedwait; sem_trywait; sem_unlink; sem_wait; pthread_spin_destroy; pthread_spin_init; pthread_spin_lock; diff --git a/sysdeps/htl/sem-destroy.c b/sysdeps/htl/sem-destroy.c index 89b162d64c..daecf1a7e4 100644 --- a/sysdeps/htl/sem-destroy.c +++ b/sysdeps/htl/sem-destroy.c @@ -21,6 +21,7 @@ #include #include +#include int __sem_destroy (sem_t *sem) @@ -40,4 +41,7 @@ __sem_destroy (sem_t *sem) return 0; } -strong_alias (__sem_destroy, sem_destroy); +versioned_symbol (libc, __sem_destroy, sem_destroy, GLIBC_2_43); +# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43) +compat_symbol (libpthread, __sem_destroy, sem_destroy, GLIBC_2_12); +#endif diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 1e5454818a..80bf6408ef 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -128,6 +128,7 @@ 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.12 sem_destroy F GLIBC_2.13 __fentry__ F GLIBC_2.14 syncfs F GLIBC_2.15 __fdelt_chk F @@ -2666,6 +2667,7 @@ GLIBC_2.43 pthread_testcancel F GLIBC_2.43 pthread_timedjoin_np F GLIBC_2.43 pthread_tryjoin_np F GLIBC_2.43 pthread_yield F +GLIBC_2.43 sem_destroy F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F GLIBC_2.5 inet6_opt_find F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 8a056c89ff..99fdf00e14 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -25,7 +25,6 @@ GLIBC_2.12 pthread_spin_lock F GLIBC_2.12 pthread_spin_trylock F GLIBC_2.12 pthread_spin_unlock F GLIBC_2.12 sem_close F -GLIBC_2.12 sem_destroy F GLIBC_2.12 sem_getvalue F GLIBC_2.12 sem_init F GLIBC_2.12 sem_open F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index 1bf1bcabe4..b3d402f059 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -1759,6 +1759,7 @@ GLIBC_2.38 seed48 F GLIBC_2.38 seed48_r F GLIBC_2.38 seekdir F GLIBC_2.38 select F +GLIBC_2.38 sem_destroy F GLIBC_2.38 semctl F GLIBC_2.38 semget F GLIBC_2.38 semop F @@ -2347,6 +2348,7 @@ GLIBC_2.43 pthread_testcancel F GLIBC_2.43 pthread_timedjoin_np F GLIBC_2.43 pthread_tryjoin_np F GLIBC_2.43 pthread_yield F +GLIBC_2.43 sem_destroy F HURD_CTHREADS_0.3 __cthread_getspecific F HURD_CTHREADS_0.3 __cthread_keycreate F HURD_CTHREADS_0.3 __cthread_setspecific F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index 5caa7bcfb9..a03bebdf9e 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -45,7 +45,6 @@ GLIBC_2.38 pthread_spin_trylock F GLIBC_2.38 pthread_spin_unlock F GLIBC_2.38 sem_clockwait F GLIBC_2.38 sem_close F -GLIBC_2.38 sem_destroy F GLIBC_2.38 sem_getvalue F GLIBC_2.38 sem_init F GLIBC_2.38 sem_open F From patchwork Sun Aug 17 23:26:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 118500 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 3756D385841D for ; Sun, 17 Aug 2025 23:28:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3756D385841D X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id D8C503858D1E for ; Sun, 17 Aug 2025 23:26:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D8C503858D1E 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 D8C503858D1E 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=1755473188; cv=none; b=PS4Ta7JJbdD5p4w9XbjclNF8o0voMr1dbXKfj+BUqB+rUHOgsuNpVGTH0Tzd4dutiHo7k2yLi8057/GrA0UB9/Gx9aN2Ui4ArvkL1T5tyKH3aBXjgp3FEwtIBvyr380xjfUGlibKggah0tGfyFFDT40DZHF1aYT6maPf+fb1iM0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755473188; c=relaxed/simple; bh=KpKI069GywyHWuPilULBKLcaErzxC5OS7NkMbtnsLJs=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=xbIGrvBM9yQZdj//XNBC0tzE6Vq51HAgh4Xe+NNp0W79ac4NXFfIQvgJ34nLkMGppSEdU2x07SEa5jtE30H+VKNPjV/GmJ6SeKpI/Iy6CEsx+Pq8eDZ4ZJNISC1imD0ovsWgSW4f0VaGIt6P0uTRnoQB7m5XVOu4DWDs2eo9P3U= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D8C503858D1E Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id D2124A1C99; Mon, 18 Aug 2025 01:26:26 +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 4iNPYsTuosaS; Mon, 18 Aug 2025 01:26:26 +0200 (CEST) Received: from begin (97.22.205.77.rev.sfr.net [77.205.22.97]) (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 9B4E7A054D; Mon, 18 Aug 2025 01:26:26 +0200 (CEST) Received: from samy by begin with local (Exim 4.98.2) (envelope-from ) id 1unmld-00000002wC8-2eBc; Mon, 18 Aug 2025 01:26:25 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd,commited 2/7] htl: move sem_getvalue into libc. Date: Mon, 18 Aug 2025 01:26:19 +0200 Message-ID: <20250817232624.700329-3-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250817232624.700329-1-samuel.thibault@ens-lyon.org> References: <20250817232624.700329-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 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: <20250817104023.91919-3-gfleury@disroot.org> --- htl/Makefile | 2 +- htl/Versions | 4 +++- sysdeps/htl/sem-getvalue.c | 6 +++++- 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 - 7 files changed, 13 insertions(+), 5 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index e4a3adc99c..8991a312d0 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -35,7 +35,6 @@ libpthread-routines := \ pt-getname-np \ pt-setname-np \ sem_close \ - sem-getvalue \ sem-init \ sem_open \ sem-post \ @@ -211,6 +210,7 @@ routines := \ pt-wakeup \ pt-yield \ sem-destroy \ + sem-getvalue \ # routines shared-only-routines = forward diff --git a/htl/Versions b/htl/Versions index 48e7fcead4..5ede53de16 100644 --- a/htl/Versions +++ b/htl/Versions @@ -102,6 +102,7 @@ libc { pthread_testcancel; pthread_yield; sem_destroy; + sem_getvalue; } GLIBC_2.21 { @@ -221,6 +222,7 @@ libc { pthread_tryjoin_np; pthread_yield; sem_destroy; + sem_getvalue; } GLIBC_PRIVATE { @@ -313,7 +315,7 @@ libpthread { pthread_create; - sem_close; sem_getvalue; sem_init; sem_open; sem_post; + sem_close; sem_init; sem_open; sem_post; sem_timedwait; sem_trywait; sem_unlink; sem_wait; pthread_spin_destroy; pthread_spin_init; pthread_spin_lock; diff --git a/sysdeps/htl/sem-getvalue.c b/sysdeps/htl/sem-getvalue.c index a1f7bca9cb..799ddacc9b 100644 --- a/sysdeps/htl/sem-getvalue.c +++ b/sysdeps/htl/sem-getvalue.c @@ -18,6 +18,7 @@ #include #include +#include int __sem_getvalue (sem_t *restrict sem, int *restrict value) @@ -33,4 +34,7 @@ __sem_getvalue (sem_t *restrict sem, int *restrict value) return 0; } -strong_alias (__sem_getvalue, sem_getvalue); +versioned_symbol (libc, __sem_getvalue, sem_getvalue, GLIBC_2_43); +# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43) +compat_symbol (libpthread, __sem_getvalue, sem_getvalue, GLIBC_2_12); +#endif diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 80bf6408ef..74f1fc960d 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -129,6 +129,7 @@ GLIBC_2.12 pthread_sigmask F GLIBC_2.12 pthread_testcancel F GLIBC_2.12 pthread_yield F GLIBC_2.12 sem_destroy F +GLIBC_2.12 sem_getvalue F GLIBC_2.13 __fentry__ F GLIBC_2.14 syncfs F GLIBC_2.15 __fdelt_chk F @@ -2668,6 +2669,7 @@ GLIBC_2.43 pthread_timedjoin_np F GLIBC_2.43 pthread_tryjoin_np F GLIBC_2.43 pthread_yield F GLIBC_2.43 sem_destroy F +GLIBC_2.43 sem_getvalue F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F GLIBC_2.5 inet6_opt_find F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 99fdf00e14..310f7ecfdc 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -25,7 +25,6 @@ GLIBC_2.12 pthread_spin_lock F GLIBC_2.12 pthread_spin_trylock F GLIBC_2.12 pthread_spin_unlock F GLIBC_2.12 sem_close F -GLIBC_2.12 sem_getvalue F GLIBC_2.12 sem_init F GLIBC_2.12 sem_open F GLIBC_2.12 sem_post F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index b3d402f059..dd18c69576 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -1760,6 +1760,7 @@ GLIBC_2.38 seed48_r F GLIBC_2.38 seekdir F GLIBC_2.38 select F GLIBC_2.38 sem_destroy F +GLIBC_2.38 sem_getvalue F GLIBC_2.38 semctl F GLIBC_2.38 semget F GLIBC_2.38 semop F @@ -2349,6 +2350,7 @@ GLIBC_2.43 pthread_timedjoin_np F GLIBC_2.43 pthread_tryjoin_np F GLIBC_2.43 pthread_yield F GLIBC_2.43 sem_destroy F +GLIBC_2.43 sem_getvalue F HURD_CTHREADS_0.3 __cthread_getspecific F HURD_CTHREADS_0.3 __cthread_keycreate F HURD_CTHREADS_0.3 __cthread_setspecific F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index a03bebdf9e..41c18cc945 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -45,7 +45,6 @@ GLIBC_2.38 pthread_spin_trylock F GLIBC_2.38 pthread_spin_unlock F GLIBC_2.38 sem_clockwait F GLIBC_2.38 sem_close F -GLIBC_2.38 sem_getvalue F GLIBC_2.38 sem_init F GLIBC_2.38 sem_open F GLIBC_2.38 sem_post F From patchwork Sun Aug 17 23:26:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 118498 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 061543858286 for ; Sun, 17 Aug 2025 23:27:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 061543858286 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id 1293E3858C31 for ; Sun, 17 Aug 2025 23:26:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1293E3858C31 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 1293E3858C31 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=1755473188; cv=none; b=E2YhNs4pMldx1vwWpMvAHEDQWeaGtNQze4TpcPnUnGyqIp0XNmphKSh6Phrdo9cD/bD/w9tyAeWpNOQ3eYAGtdJuPjStNxlFGUgmOlrMkg5UjO9A+kJ4Hs69s8/tAqk7Zo64s221MwmeL4UbpwYaGnmCbhi1+JZ7A0suIirHiyk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755473188; c=relaxed/simple; bh=Svh4cHxWQLkGVF1spFiY6OR2FLAZoKdzynNNxC4cNHA=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=TAaYSiZk9iZu0OJhZjX6Z0dI4E3W/tl5G/hloCX23Iv9Zo9mY+7ykrtVKT7dWZDQ8VkE/NXAw3y3tCF4VjNA9I4vxh3O59O177hO4Plz49I9/2IAuxJylHongNcT1Dk/KEmuKWo1TUcoHp1HauoFvoy5c2l5ujkt9I0InIc0fos= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1293E3858C31 Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 05704A0528; Mon, 18 Aug 2025 01:26:27 +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 MZpcvB2wswaS; Mon, 18 Aug 2025 01:26:26 +0200 (CEST) Received: from begin (97.22.205.77.rev.sfr.net [77.205.22.97]) (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 A026EA0596; Mon, 18 Aug 2025 01:26:26 +0200 (CEST) Received: from samy by begin with local (Exim 4.98.2) (envelope-from ) id 1unmld-00000002wCB-2rf0; Mon, 18 Aug 2025 01:26:25 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd,commited 3/7] htl: move sem_init into libc. Date: Mon, 18 Aug 2025 01:26:20 +0200 Message-ID: <20250817232624.700329-4-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250817232624.700329-1-samuel.thibault@ens-lyon.org> References: <20250817232624.700329-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.7 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: <20250817104023.91919-4-gfleury@disroot.org> --- htl/Makefile | 2 +- htl/Versions | 4 +++- sysdeps/htl/sem-init.c | 6 +++++- 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 - 7 files changed, 13 insertions(+), 5 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 8991a312d0..33dfdc53ac 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -35,7 +35,6 @@ libpthread-routines := \ pt-getname-np \ pt-setname-np \ sem_close \ - sem-init \ sem_open \ sem-post \ sem-timedwait \ @@ -211,6 +210,7 @@ routines := \ pt-yield \ sem-destroy \ sem-getvalue \ + sem-init \ # routines shared-only-routines = forward diff --git a/htl/Versions b/htl/Versions index 5ede53de16..764faa016d 100644 --- a/htl/Versions +++ b/htl/Versions @@ -103,6 +103,7 @@ libc { pthread_yield; sem_destroy; sem_getvalue; + sem_init; } GLIBC_2.21 { @@ -223,6 +224,7 @@ libc { pthread_yield; sem_destroy; sem_getvalue; + sem_init; } GLIBC_PRIVATE { @@ -315,7 +317,7 @@ libpthread { pthread_create; - sem_close; sem_init; sem_open; sem_post; + sem_close; sem_open; sem_post; sem_timedwait; sem_trywait; sem_unlink; sem_wait; pthread_spin_destroy; pthread_spin_init; pthread_spin_lock; diff --git a/sysdeps/htl/sem-init.c b/sysdeps/htl/sem-init.c index 952be42766..e818c07fd6 100644 --- a/sysdeps/htl/sem-init.c +++ b/sysdeps/htl/sem-init.c @@ -21,6 +21,7 @@ #include #include +#include int __sem_init (sem_t *sem, int pshared, unsigned value) @@ -36,4 +37,7 @@ __sem_init (sem_t *sem, int pshared, unsigned value) return 0; } -strong_alias (__sem_init, sem_init); +versioned_symbol (libc, __sem_init, sem_init, GLIBC_2_43); +# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43) +compat_symbol (libpthread, __sem_init, sem_init, GLIBC_2_12); +#endif diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 74f1fc960d..02bc296fae 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -130,6 +130,7 @@ GLIBC_2.12 pthread_testcancel F GLIBC_2.12 pthread_yield F GLIBC_2.12 sem_destroy F GLIBC_2.12 sem_getvalue F +GLIBC_2.12 sem_init F GLIBC_2.13 __fentry__ F GLIBC_2.14 syncfs F GLIBC_2.15 __fdelt_chk F @@ -2670,6 +2671,7 @@ GLIBC_2.43 pthread_tryjoin_np F GLIBC_2.43 pthread_yield F GLIBC_2.43 sem_destroy F GLIBC_2.43 sem_getvalue F +GLIBC_2.43 sem_init F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F GLIBC_2.5 inet6_opt_find F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 310f7ecfdc..8d04328062 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -25,7 +25,6 @@ GLIBC_2.12 pthread_spin_lock F GLIBC_2.12 pthread_spin_trylock F GLIBC_2.12 pthread_spin_unlock F GLIBC_2.12 sem_close F -GLIBC_2.12 sem_init F GLIBC_2.12 sem_open F GLIBC_2.12 sem_post F GLIBC_2.12 sem_timedwait F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index dd18c69576..3fc43370b2 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -1761,6 +1761,7 @@ GLIBC_2.38 seekdir F GLIBC_2.38 select F GLIBC_2.38 sem_destroy F GLIBC_2.38 sem_getvalue F +GLIBC_2.38 sem_init F GLIBC_2.38 semctl F GLIBC_2.38 semget F GLIBC_2.38 semop F @@ -2351,6 +2352,7 @@ GLIBC_2.43 pthread_tryjoin_np F GLIBC_2.43 pthread_yield F GLIBC_2.43 sem_destroy F GLIBC_2.43 sem_getvalue F +GLIBC_2.43 sem_init F HURD_CTHREADS_0.3 __cthread_getspecific F HURD_CTHREADS_0.3 __cthread_keycreate F HURD_CTHREADS_0.3 __cthread_setspecific F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index 41c18cc945..a612aa9a11 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -45,7 +45,6 @@ GLIBC_2.38 pthread_spin_trylock F GLIBC_2.38 pthread_spin_unlock F GLIBC_2.38 sem_clockwait F GLIBC_2.38 sem_close F -GLIBC_2.38 sem_init F GLIBC_2.38 sem_open F GLIBC_2.38 sem_post F GLIBC_2.38 sem_timedwait F From patchwork Sun Aug 17 23:26:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 118499 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 676BE3857C67 for ; Sun, 17 Aug 2025 23:27:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 676BE3857C67 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id 25AC13858C36 for ; Sun, 17 Aug 2025 23:26:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 25AC13858C36 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 25AC13858C36 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=1755473188; cv=none; b=H9q9BFBXiBF+JhXsvSNQ/J7pBIjtdQSuByJnEN4cDaT6bYe0hwFiWHjHgRN6NSSsH4NJkdANyAUVTGQ5HsW7g2zEK92oLu+PmXe7oysM6uHl9SNa/XwF6tSp60AcjqrvzjW25K8sqOBYPGcWc8V5fuFuOgOJFFavTnU69BHqHd4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755473188; c=relaxed/simple; bh=17+OL4/8uP/BRMStwIkr/7ybR8p2x0eFgrqoepiA1gE=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=G1w71l6evT27p8NAMgwhsBrhxsIleEJKDcUEvbVOkuuDPGtuwybmoxmMsrYzWHXfsWEA33aYdyOU4Xs49YSbYDlvUhkS5YazyOsqeoR/oa7Ui2nsSbuxCsWV8GIBkQtvETAanPITf9F8dPsm6w6SJOZZXVCkfpj9H13EUjKGMVo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 25AC13858C36 Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 085EBA054D; Mon, 18 Aug 2025 01:26:27 +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 szujJ3ILYy7o; Mon, 18 Aug 2025 01:26:26 +0200 (CEST) Received: from begin (97.22.205.77.rev.sfr.net [77.205.22.97]) (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 A6078A1BDE; Mon, 18 Aug 2025 01:26:26 +0200 (CEST) Received: from samy by begin with local (Exim 4.98.2) (envelope-from ) id 1unmld-00000002wCE-35Oi; Mon, 18 Aug 2025 01:26:25 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd,commited 4/7] htl: move sem_open, sem_close into libc. Date: Mon, 18 Aug 2025 01:26:21 +0200 Message-ID: <20250817232624.700329-5-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250817232624.700329-1-samuel.thibault@ens-lyon.org> References: <20250817232624.700329-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 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: <20250817104023.91919-5-gfleury@disroot.org> --- htl/Makefile | 6 +++--- htl/Versions | 6 +++++- sysdeps/mach/hurd/i386/libc.abilist | 4 ++++ sysdeps/mach/hurd/i386/libpthread.abilist | 2 -- sysdeps/mach/hurd/x86_64/libc.abilist | 4 ++++ sysdeps/mach/hurd/x86_64/libpthread.abilist | 2 -- sysdeps/pthread/sem_close.c | 10 +++++++--- sysdeps/pthread/sem_open.c | 18 ++++++++---------- sysdeps/pthread/sem_routines.c | 1 + 9 files changed, 32 insertions(+), 21 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 33dfdc53ac..57327b3df4 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -34,15 +34,12 @@ libpthread-routines := \ pt-spin \ pt-getname-np \ pt-setname-np \ - sem_close \ - sem_open \ sem-post \ sem-timedwait \ sem-trywait \ sem_unlink \ sem-wait \ sem-waitfast \ - sem_routines \ cancellation \ cthreads-compat \ herrno \ @@ -211,6 +208,9 @@ routines := \ sem-destroy \ sem-getvalue \ sem-init \ + sem_close \ + sem_open \ + sem_routines \ # routines shared-only-routines = forward diff --git a/htl/Versions b/htl/Versions index 764faa016d..5b83e1ce79 100644 --- a/htl/Versions +++ b/htl/Versions @@ -101,9 +101,11 @@ libc { pthread_sigmask; pthread_testcancel; pthread_yield; + sem_close; sem_destroy; sem_getvalue; sem_init; + sem_open; } GLIBC_2.21 { @@ -222,9 +224,11 @@ libc { pthread_timedjoin_np; pthread_tryjoin_np; pthread_yield; + sem_close; sem_destroy; sem_getvalue; sem_init; + sem_open; } GLIBC_PRIVATE { @@ -317,7 +321,7 @@ libpthread { pthread_create; - sem_close; sem_open; sem_post; + sem_post; sem_timedwait; sem_trywait; sem_unlink; sem_wait; pthread_spin_destroy; pthread_spin_init; pthread_spin_lock; diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 02bc296fae..9764b6053b 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -128,9 +128,11 @@ 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.12 sem_close F GLIBC_2.12 sem_destroy F GLIBC_2.12 sem_getvalue F GLIBC_2.12 sem_init F +GLIBC_2.12 sem_open F GLIBC_2.13 __fentry__ F GLIBC_2.14 syncfs F GLIBC_2.15 __fdelt_chk F @@ -2669,9 +2671,11 @@ GLIBC_2.43 pthread_testcancel F GLIBC_2.43 pthread_timedjoin_np F GLIBC_2.43 pthread_tryjoin_np F GLIBC_2.43 pthread_yield F +GLIBC_2.43 sem_close F GLIBC_2.43 sem_destroy F GLIBC_2.43 sem_getvalue F GLIBC_2.43 sem_init F +GLIBC_2.43 sem_open F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F GLIBC_2.5 inet6_opt_find F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 8d04328062..c7e8bc5a32 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -24,8 +24,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 sem_close F -GLIBC_2.12 sem_open F GLIBC_2.12 sem_post F GLIBC_2.12 sem_timedwait F GLIBC_2.12 sem_trywait F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index 3fc43370b2..e64bf542ef 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -1759,9 +1759,11 @@ GLIBC_2.38 seed48 F GLIBC_2.38 seed48_r F GLIBC_2.38 seekdir F GLIBC_2.38 select F +GLIBC_2.38 sem_close F GLIBC_2.38 sem_destroy F GLIBC_2.38 sem_getvalue F GLIBC_2.38 sem_init F +GLIBC_2.38 sem_open F GLIBC_2.38 semctl F GLIBC_2.38 semget F GLIBC_2.38 semop F @@ -2350,9 +2352,11 @@ GLIBC_2.43 pthread_testcancel F GLIBC_2.43 pthread_timedjoin_np F GLIBC_2.43 pthread_tryjoin_np F GLIBC_2.43 pthread_yield F +GLIBC_2.43 sem_close F GLIBC_2.43 sem_destroy F GLIBC_2.43 sem_getvalue F GLIBC_2.43 sem_init F +GLIBC_2.43 sem_open F HURD_CTHREADS_0.3 __cthread_getspecific F HURD_CTHREADS_0.3 __cthread_keycreate F HURD_CTHREADS_0.3 __cthread_setspecific F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index a612aa9a11..ee0fac300c 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -44,8 +44,6 @@ GLIBC_2.38 pthread_spin_lock F GLIBC_2.38 pthread_spin_trylock F GLIBC_2.38 pthread_spin_unlock F GLIBC_2.38 sem_clockwait F -GLIBC_2.38 sem_close F -GLIBC_2.38 sem_open F GLIBC_2.38 sem_post F GLIBC_2.38 sem_timedwait F GLIBC_2.38 sem_trywait F diff --git a/sysdeps/pthread/sem_close.c b/sysdeps/pthread/sem_close.c index e989ed8f60..6e80bb0a06 100644 --- a/sysdeps/pthread/sem_close.c +++ b/sysdeps/pthread/sem_close.c @@ -18,6 +18,7 @@ #include #include "semaphoreP.h" #include +#include int __sem_close (sem_t *sem) @@ -30,11 +31,14 @@ __sem_close (sem_t *sem) return 0; } -#if PTHREAD_IN_LIBC +#ifndef __PTHREAD_HTL versioned_symbol (libc, __sem_close, sem_close, GLIBC_2_34); # if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_1_1, GLIBC_2_34) compat_symbol (libpthread, __sem_close, sem_close, GLIBC_2_1_1); # endif -#else /* !PTHREAD_IN_LIBC */ -strong_alias (__sem_close, sem_close) +#else /* __PTHREAD_HTL */ +versioned_symbol (libc, __sem_close, sem_close, GLIBC_2_43); +# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43) +compat_symbol (libpthread, __sem_close, sem_close, GLIBC_2_12); +#endif #endif diff --git a/sysdeps/pthread/sem_open.c b/sysdeps/pthread/sem_open.c index e5eacb5fed..992786e01b 100644 --- a/sysdeps/pthread/sem_open.c +++ b/sysdeps/pthread/sem_open.c @@ -25,13 +25,8 @@ #include #include #include - - -#if !PTHREAD_IN_LIBC -/* The private names are not exported from libc. */ -# define __link link -# define __unlink unlink -#endif +#include +#include #define SEM_OPEN_FLAGS (O_RDWR | O_NOFOLLOW | O_CLOEXEC) @@ -215,11 +210,14 @@ out: return result; } -#if PTHREAD_IN_LIBC +#ifndef __PTHREAD_HTL versioned_symbol (libc, __sem_open, sem_open, GLIBC_2_34); # if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_1_1, GLIBC_2_34) compat_symbol (libpthread, __sem_open, sem_open, GLIBC_2_1_1); # endif -#else /* !PTHREAD_IN_LIBC */ -strong_alias (__sem_open, sem_open) +#else /* __PTHREAD_HTL */ +versioned_symbol (libc, __sem_open, sem_open, GLIBC_2_43); +# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43) +compat_symbol (libpthread, __sem_open, sem_open, GLIBC_2_12); +#endif #endif diff --git a/sysdeps/pthread/sem_routines.c b/sysdeps/pthread/sem_routines.c index 62089359ea..fb6a555bf6 100644 --- a/sysdeps/pthread/sem_routines.c +++ b/sysdeps/pthread/sem_routines.c @@ -20,6 +20,7 @@ #include #include #include +#include /* Keeping track of currently used mappings. */ struct inuse_sem From patchwork Sun Aug 17 23:26:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 118501 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 4C9B03858402 for ; Sun, 17 Aug 2025 23:28:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C9B03858402 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id 487953858402 for ; Sun, 17 Aug 2025 23:26:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 487953858402 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 487953858402 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=1755473190; cv=none; b=r3oTt4Qg5ikp45QFjrISwkXeXTyaTnNLRA5idqvw7DFsEJDqncxQgj9D71BU/CamEvLnFlLlM9c2H2EA1Lnh7L7WOm9pWH63tf7TxRoZgFXCih/SzJWw5WBO/+vXmfkLugvSlPk0g+Sy+S6oRXYRsJkbgCMONFc2UnCB9nawneo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755473190; c=relaxed/simple; bh=V+v46BM9IID91oxtuUIKutM7aQBGzNV0b9xpv5HsCxQ=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=ezouk95nC4zDKT48e8ihOSRWYuJI4F6vw2GBOMWxMKe1PPuHKyI1ZF1T+41thCNXj7dnAjrYVOmJoX/2/kHniWYFMOitAIWRuaU8K2Ih2iP5UWpKARw2lLm6ynnU0wjgaIsrr51xQjjyfV+QSDX3duzYzSeJDRvhuYozrfwH3kQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 487953858402 Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 3046FA0596; Mon, 18 Aug 2025 01:26:27 +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 0tXJfsLxWqzJ; Mon, 18 Aug 2025 01:26:27 +0200 (CEST) Received: from begin (97.22.205.77.rev.sfr.net [77.205.22.97]) (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 B028DA1BE0; Mon, 18 Aug 2025 01:26:26 +0200 (CEST) Received: from samy by begin with local (Exim 4.98.2) (envelope-from ) id 1unmld-00000002wCH-3IlQ; Mon, 18 Aug 2025 01:26:25 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd,commited 5/7] htl: move sem_post into libc. Date: Mon, 18 Aug 2025 01:26:22 +0200 Message-ID: <20250817232624.700329-6-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250817232624.700329-1-samuel.thibault@ens-lyon.org> References: <20250817232624.700329-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.9 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: <20250817104023.91919-6-gfleury@disroot.org> --- htl/Makefile | 2 +- htl/Versions | 3 ++- sysdeps/htl/include/semaphore.h | 2 +- sysdeps/htl/sem-post.c | 8 ++++++-- 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, 14 insertions(+), 7 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 57327b3df4..b995d1a4b3 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -34,7 +34,6 @@ libpthread-routines := \ pt-spin \ pt-getname-np \ pt-setname-np \ - sem-post \ sem-timedwait \ sem-trywait \ sem_unlink \ @@ -208,6 +207,7 @@ routines := \ sem-destroy \ sem-getvalue \ sem-init \ + sem-post \ sem_close \ sem_open \ sem_routines \ diff --git a/htl/Versions b/htl/Versions index 5b83e1ce79..ff1d5b9348 100644 --- a/htl/Versions +++ b/htl/Versions @@ -106,6 +106,7 @@ libc { sem_getvalue; sem_init; sem_open; + sem_post; } GLIBC_2.21 { @@ -229,6 +230,7 @@ libc { sem_getvalue; sem_init; sem_open; + sem_post; } GLIBC_PRIVATE { @@ -321,7 +323,6 @@ libpthread { pthread_create; - sem_post; sem_timedwait; sem_trywait; sem_unlink; sem_wait; pthread_spin_destroy; pthread_spin_init; pthread_spin_lock; diff --git a/sysdeps/htl/include/semaphore.h b/sysdeps/htl/include/semaphore.h index 58fa2bf341..5e5d3c18e9 100644 --- a/sysdeps/htl/include/semaphore.h +++ b/sysdeps/htl/include/semaphore.h @@ -3,7 +3,7 @@ #ifndef _ISOMAC extern __typeof (sem_post) __sem_post; -libpthread_hidden_proto (__sem_post) +libc_hidden_proto (__sem_post) #endif #endif diff --git a/sysdeps/htl/sem-post.c b/sysdeps/htl/sem-post.c index 36f20f971b..419a5ec2c4 100644 --- a/sysdeps/htl/sem-post.c +++ b/sysdeps/htl/sem-post.c @@ -23,6 +23,7 @@ #include #include +#include int __sem_post (sem_t *sem) @@ -61,5 +62,8 @@ __sem_post (sem_t *sem) return 0; } -libpthread_hidden_def (__sem_post) -strong_alias (__sem_post, sem_post); +libc_hidden_def (__sem_post) +versioned_symbol (libc, __sem_post, sem_post, GLIBC_2_43); +# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43) +compat_symbol (libpthread, __sem_post, sem_post, GLIBC_2_12); +#endif diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 9764b6053b..661bbf9532 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -133,6 +133,7 @@ GLIBC_2.12 sem_destroy F GLIBC_2.12 sem_getvalue F GLIBC_2.12 sem_init F GLIBC_2.12 sem_open F +GLIBC_2.12 sem_post F GLIBC_2.13 __fentry__ F GLIBC_2.14 syncfs F GLIBC_2.15 __fdelt_chk F @@ -2676,6 +2677,7 @@ GLIBC_2.43 sem_destroy F GLIBC_2.43 sem_getvalue F GLIBC_2.43 sem_init F GLIBC_2.43 sem_open F +GLIBC_2.43 sem_post F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F GLIBC_2.5 inet6_opt_find F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index c7e8bc5a32..07dd75378e 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -24,7 +24,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 sem_post F GLIBC_2.12 sem_timedwait F GLIBC_2.12 sem_trywait F GLIBC_2.12 sem_unlink F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index e64bf542ef..6fa0e6f01a 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -1764,6 +1764,7 @@ GLIBC_2.38 sem_destroy F GLIBC_2.38 sem_getvalue F GLIBC_2.38 sem_init F GLIBC_2.38 sem_open F +GLIBC_2.38 sem_post F GLIBC_2.38 semctl F GLIBC_2.38 semget F GLIBC_2.38 semop F @@ -2357,6 +2358,7 @@ GLIBC_2.43 sem_destroy F GLIBC_2.43 sem_getvalue F GLIBC_2.43 sem_init F GLIBC_2.43 sem_open F +GLIBC_2.43 sem_post F HURD_CTHREADS_0.3 __cthread_getspecific F HURD_CTHREADS_0.3 __cthread_keycreate F HURD_CTHREADS_0.3 __cthread_setspecific F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index ee0fac300c..38cf0d2595 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -44,7 +44,6 @@ GLIBC_2.38 pthread_spin_lock F GLIBC_2.38 pthread_spin_trylock F GLIBC_2.38 pthread_spin_unlock F GLIBC_2.38 sem_clockwait F -GLIBC_2.38 sem_post F GLIBC_2.38 sem_timedwait F GLIBC_2.38 sem_trywait F GLIBC_2.38 sem_unlink F From patchwork Sun Aug 17 23:26:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 118503 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 C15FE3858C56 for ; Sun, 17 Aug 2025 23:30:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C15FE3858C56 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 557E13858408 for ; Sun, 17 Aug 2025 23:26:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 557E13858408 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 557E13858408 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=1755473190; cv=none; b=BeN3jhiun2KV/+Nm9rvjJeqlmg5chyyua5+f9LILK1Y7JeHTl6w14x0uwZOea0KlOkwNJZLa5ZbfjHxbYRg+u9llJ45rzYOMa7QwCTewcdeY8MQBGyABhVOktUS54lTxpB352vjMNo8irXLu1K9FVU2lpIDvgrU19eoXRVxGk48= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755473190; c=relaxed/simple; bh=20kEt48q8Jn+yjgFigdB0DUIu5jpWf4k8u6NXKqmAVs=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=EYIQrMs0XMQuUlNAAShWQWIwS7fkELpkA706PHvUPUk/DjoE5AA6dnG8bSHpUmZZC0yokt5+VOA1QEUcNgVJwoUwYD4Ccs7kGjnX5keXFvFIZaDkF91lwRsYKIAYGQETGQsDsfiAN8D4L1DYRjYE750zOTlktjU7MeENTIt4a1M= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 557E13858408 Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 319DAA1BDE; Mon, 18 Aug 2025 01:26:27 +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 JMIN8Q2LPd93; Mon, 18 Aug 2025 01:26:27 +0200 (CEST) Received: from begin (97.22.205.77.rev.sfr.net [77.205.22.97]) (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 AF11EA0512; Mon, 18 Aug 2025 01:26:26 +0200 (CEST) Received: from samy by begin with local (Exim 4.98.2) (envelope-from ) id 1unmld-00000002wCK-3WjK; Mon, 18 Aug 2025 01:26:25 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd, commited 6/7] htl: move sem_{clockwait, timedwait, wait, trywait} into libc. Date: Mon, 18 Aug 2025 01:26:23 +0200 Message-ID: <20250817232624.700329-7-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250817232624.700329-1-samuel.thibault@ens-lyon.org> References: <20250817232624.700329-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.9 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: <20250817104023.91919-7-gfleury@disroot.org> --- htl/Makefile | 8 ++++---- htl/Versions | 13 ++++++++++--- hurd/hurdlock.c | 1 + hurd/hurdlock.h | 1 + sysdeps/htl/include/semaphore.h | 11 +++++++++++ sysdeps/htl/sem-timedwait.c | 14 ++++++++++++-- sysdeps/htl/sem-trywait.c | 7 ++++++- sysdeps/htl/sem-wait.c | 6 +++++- sysdeps/mach/hurd/i386/libc.abilist | 8 ++++++++ sysdeps/mach/hurd/i386/libpthread.abilist | 4 ---- sysdeps/mach/hurd/x86_64/libc.abilist | 8 ++++++++ sysdeps/mach/hurd/x86_64/libpthread.abilist | 4 ---- 12 files changed, 66 insertions(+), 19 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index b995d1a4b3..56b29e6bfd 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -34,11 +34,7 @@ libpthread-routines := \ pt-spin \ pt-getname-np \ pt-setname-np \ - sem-timedwait \ - sem-trywait \ sem_unlink \ - sem-wait \ - sem-waitfast \ cancellation \ cthreads-compat \ herrno \ @@ -208,6 +204,10 @@ routines := \ sem-getvalue \ sem-init \ sem-post \ + sem-timedwait \ + sem-trywait \ + sem-wait \ + sem-waitfast \ sem_close \ sem_open \ sem_routines \ diff --git a/htl/Versions b/htl/Versions index ff1d5b9348..c22b1b07f3 100644 --- a/htl/Versions +++ b/htl/Versions @@ -107,6 +107,9 @@ libc { sem_init; sem_open; sem_post; + sem_timedwait; + sem_trywait; + sem_wait; } GLIBC_2.21 { @@ -147,6 +150,8 @@ libc { pthread_rwlock_clockrdlock; pthread_rwlock_clockwrlock; pthread_timedjoin_np; pthread_tryjoin_np; + + sem_clockwait; } GLIBC_2.41 { @@ -225,12 +230,16 @@ libc { pthread_timedjoin_np; pthread_tryjoin_np; pthread_yield; + sem_clockwait; sem_close; sem_destroy; sem_getvalue; sem_init; sem_open; sem_post; + sem_timedwait; + sem_trywait; + sem_wait; } GLIBC_PRIVATE { @@ -323,7 +332,7 @@ libpthread { pthread_create; - sem_timedwait; sem_trywait; sem_unlink; sem_wait; + sem_unlink; pthread_spin_destroy; pthread_spin_init; pthread_spin_lock; pthread_spin_trylock; pthread_spin_unlock; @@ -343,8 +352,6 @@ libpthread { call_once; cnd_broadcast; cnd_destroy; cnd_init; cnd_signal; cnd_timedwait; cnd_wait; tss_create; tss_delete; tss_get; tss_set; - - sem_clockwait; } GLIBC_2.40 { diff --git a/hurd/hurdlock.c b/hurd/hurdlock.c index c771662e84..1cb6981ac2 100644 --- a/hurd/hurdlock.c +++ b/hurd/hurdlock.c @@ -64,6 +64,7 @@ __lll_abstimed_wait_intr (void *ptr, int val, int mlsec = compute_reltime (tsp, clk); return mlsec < 0 ? KERN_TIMEDOUT : __lll_timed_wait_intr (ptr, val, mlsec, flags); } +libc_hidden_def (__lll_abstimed_wait_intr) int __lll_abstimed_xwait (void *ptr, int lo, int hi, diff --git a/hurd/hurdlock.h b/hurd/hurdlock.h index 0cfccc562c..532a07d5f4 100644 --- a/hurd/hurdlock.h +++ b/hurd/hurdlock.h @@ -58,6 +58,7 @@ extern int __lll_abstimed_wait (void *__ptr, int __val, /* Interruptible version. */ extern int __lll_abstimed_wait_intr (void *__ptr, int __val, const struct timespec *__tsp, int __flags, int __clk); +libc_hidden_proto (__lll_abstimed_wait_intr) /* Same as 'lll_xwait', but only block until TSP elapses, using clock CLK. */ diff --git a/sysdeps/htl/include/semaphore.h b/sysdeps/htl/include/semaphore.h index 5e5d3c18e9..b91b9b7077 100644 --- a/sysdeps/htl/include/semaphore.h +++ b/sysdeps/htl/include/semaphore.h @@ -4,6 +4,17 @@ #ifndef _ISOMAC extern __typeof (sem_post) __sem_post; libc_hidden_proto (__sem_post) + +extern int __sem_clockwait (sem_t *__sem, + clockid_t clock, + const struct timespec *__abstime); +libc_hidden_proto (__sem_clockwait) +extern int __sem_timedwait (sem_t *__sem, + const struct timespec *__abstime); +libc_hidden_proto (__sem_timedwait) + +extern int __sem_trywait (sem_t *__sem); +libc_hidden_proto (__sem_trywait) #endif #endif diff --git a/sysdeps/htl/sem-timedwait.c b/sysdeps/htl/sem-timedwait.c index 4931dde5ce..8f2b4d3f8b 100644 --- a/sysdeps/htl/sem-timedwait.c +++ b/sysdeps/htl/sem-timedwait.c @@ -25,6 +25,7 @@ #include #include +#include #if !__HAVE_64B_ATOMICS static void @@ -196,7 +197,12 @@ __sem_clockwait (sem_t *sem, clockid_t clockid, { return __sem_timedwait_internal (sem, clockid, timeout); } -weak_alias (__sem_clockwait, sem_clockwait); + +libc_hidden_def (__sem_clockwait) +versioned_symbol (libc, __sem_clockwait, sem_clockwait, GLIBC_2_43); +# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_32, GLIBC_2_43) +compat_symbol (libpthread, __sem_clockwait, sem_clockwait, GLIBC_2_32); +#endif int __sem_timedwait (sem_t *restrict sem, const struct timespec *restrict timeout) @@ -204,4 +210,8 @@ __sem_timedwait (sem_t *restrict sem, const struct timespec *restrict timeout) return __sem_timedwait_internal (sem, CLOCK_REALTIME, timeout); } -weak_alias (__sem_timedwait, sem_timedwait); +libc_hidden_def (__sem_timedwait) +versioned_symbol (libc, __sem_timedwait, sem_timedwait, GLIBC_2_43); +# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43) +compat_symbol (libpthread, __sem_timedwait, sem_timedwait, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/sem-trywait.c b/sysdeps/htl/sem-trywait.c index 38846bf9a3..0d1e9cd5a8 100644 --- a/sysdeps/htl/sem-trywait.c +++ b/sysdeps/htl/sem-trywait.c @@ -21,6 +21,7 @@ #include #include +#include int __sem_trywait (sem_t *sem) @@ -33,4 +34,8 @@ __sem_trywait (sem_t *sem) return __hurd_fail (EAGAIN); } -weak_alias (__sem_trywait, sem_trywait); +libc_hidden_def (__sem_trywait) +versioned_symbol (libc, __sem_trywait, sem_trywait, GLIBC_2_43); +# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43) +compat_symbol (libpthread, __sem_trywait, sem_trywait, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/sem-wait.c b/sysdeps/htl/sem-wait.c index 97c873dc8d..c2fc7a93f1 100644 --- a/sysdeps/htl/sem-wait.c +++ b/sysdeps/htl/sem-wait.c @@ -18,6 +18,7 @@ #include #include +#include extern int __sem_timedwait_internal (sem_t *restrict sem, clockid_t clockid, @@ -29,4 +30,7 @@ __sem_wait (sem_t *sem) return __sem_timedwait_internal (sem, CLOCK_REALTIME, 0); } -strong_alias (__sem_wait, sem_wait); +versioned_symbol (libc, __sem_wait, sem_wait, GLIBC_2_43); +# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43) +compat_symbol (libpthread, __sem_wait, sem_wait, GLIBC_2_12); +#endif diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 661bbf9532..8eabddcec6 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -134,6 +134,9 @@ GLIBC_2.12 sem_getvalue F GLIBC_2.12 sem_init F GLIBC_2.12 sem_open F GLIBC_2.12 sem_post F +GLIBC_2.12 sem_timedwait F +GLIBC_2.12 sem_trywait F +GLIBC_2.12 sem_wait F GLIBC_2.13 __fentry__ F GLIBC_2.14 syncfs F GLIBC_2.15 __fdelt_chk F @@ -2333,6 +2336,7 @@ GLIBC_2.32 pthread_rwlock_clockrdlock F GLIBC_2.32 pthread_rwlock_clockwrlock F GLIBC_2.32 pthread_timedjoin_np F GLIBC_2.32 pthread_tryjoin_np F +GLIBC_2.32 sem_clockwait F GLIBC_2.32 sigabbrev_np F GLIBC_2.32 sigdescr_np F GLIBC_2.32 strerrordesc_np F @@ -2672,12 +2676,16 @@ GLIBC_2.43 pthread_testcancel F GLIBC_2.43 pthread_timedjoin_np F GLIBC_2.43 pthread_tryjoin_np F GLIBC_2.43 pthread_yield F +GLIBC_2.43 sem_clockwait F GLIBC_2.43 sem_close F GLIBC_2.43 sem_destroy F GLIBC_2.43 sem_getvalue F GLIBC_2.43 sem_init F GLIBC_2.43 sem_open F GLIBC_2.43 sem_post F +GLIBC_2.43 sem_timedwait F +GLIBC_2.43 sem_trywait F +GLIBC_2.43 sem_wait F GLIBC_2.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F GLIBC_2.5 inet6_opt_find F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 07dd75378e..483d792727 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -24,10 +24,7 @@ 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 sem_timedwait F -GLIBC_2.12 sem_trywait F GLIBC_2.12 sem_unlink F -GLIBC_2.12 sem_wait F GLIBC_2.2.6 _IO_flockfile F GLIBC_2.2.6 _IO_ftrylockfile F GLIBC_2.2.6 _IO_funlockfile F @@ -48,7 +45,6 @@ GLIBC_2.32 mtx_lock F GLIBC_2.32 mtx_timedlock F GLIBC_2.32 mtx_trylock F GLIBC_2.32 mtx_unlock F -GLIBC_2.32 sem_clockwait F GLIBC_2.32 thrd_create F GLIBC_2.32 thrd_detach F GLIBC_2.32 thrd_exit F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index 6fa0e6f01a..de42acab3d 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -1759,12 +1759,16 @@ GLIBC_2.38 seed48 F GLIBC_2.38 seed48_r F GLIBC_2.38 seekdir F GLIBC_2.38 select F +GLIBC_2.38 sem_clockwait F GLIBC_2.38 sem_close F GLIBC_2.38 sem_destroy F GLIBC_2.38 sem_getvalue F GLIBC_2.38 sem_init F GLIBC_2.38 sem_open F GLIBC_2.38 sem_post F +GLIBC_2.38 sem_timedwait F +GLIBC_2.38 sem_trywait F +GLIBC_2.38 sem_wait F GLIBC_2.38 semctl F GLIBC_2.38 semget F GLIBC_2.38 semop F @@ -2353,12 +2357,16 @@ GLIBC_2.43 pthread_testcancel F GLIBC_2.43 pthread_timedjoin_np F GLIBC_2.43 pthread_tryjoin_np F GLIBC_2.43 pthread_yield F +GLIBC_2.43 sem_clockwait F GLIBC_2.43 sem_close F GLIBC_2.43 sem_destroy F GLIBC_2.43 sem_getvalue F GLIBC_2.43 sem_init F GLIBC_2.43 sem_open F GLIBC_2.43 sem_post F +GLIBC_2.43 sem_timedwait F +GLIBC_2.43 sem_trywait F +GLIBC_2.43 sem_wait F HURD_CTHREADS_0.3 __cthread_getspecific F HURD_CTHREADS_0.3 __cthread_keycreate F HURD_CTHREADS_0.3 __cthread_setspecific F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index 38cf0d2595..4c9ba3b7d5 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -43,11 +43,7 @@ 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 sem_clockwait F -GLIBC_2.38 sem_timedwait F -GLIBC_2.38 sem_trywait F GLIBC_2.38 sem_unlink F -GLIBC_2.38 sem_wait F GLIBC_2.38 thrd_create F GLIBC_2.38 thrd_detach F GLIBC_2.38 thrd_exit F From patchwork Sun Aug 17 23:26:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 118502 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 78C4A385840E for ; Sun, 17 Aug 2025 23:29:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 78C4A385840E X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id A03E4385840C for ; Sun, 17 Aug 2025 23:26:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A03E4385840C 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 A03E4385840C 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=1755473190; cv=none; b=MrICS6bDwH/ycCsA8ywXkqPxtiQJL9W5on3mOWJVzszmsAgjaIh+URvZmvqXD9LcwoWSxUgtgOq46dUzE6JFUpDENJ2mZXOEGx3MS92be70pFBPB3LJWLzOaEH4eB5uznFXSZ0pL95YQLSJFJaBQT8QkfLfCdMsohUs2NEJUnZI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755473190; c=relaxed/simple; bh=U6+1/JwouhTSJxSOzRu7o22xc0gJlnytRUaclnnNdWg=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=oxzkDtOT5yMDK0MNhogtNqplKXZBBAd/txj3QyhBXw8a5Ezzc2c0UCxGNRpggKBHZP8eKOul6AaFfCBG6yia0P91Tsd2CzE99ZzYqSvgzi4J0s0dFiIreS/HMdLqcGku44Ogbxk5LgCq5wsOwGCJVLTcsYNUTqXoHxmra2tN7Is= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A03E4385840C Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 527ADA0512; Mon, 18 Aug 2025 01:26:27 +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 uWE4LvAu87r0; Mon, 18 Aug 2025 01:26:27 +0200 (CEST) Received: from begin (97.22.205.77.rev.sfr.net [77.205.22.97]) (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 D0A3FA1C28; Mon, 18 Aug 2025 01:26:26 +0200 (CEST) Received: from samy by begin with local (Exim 4.98.2) (envelope-from ) id 1unmld-00000002wCO-3kSJ; Mon, 18 Aug 2025 01:26:25 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd,commited 7/7] htl: move sem_unlink into libc. Date: Mon, 18 Aug 2025 01:26:24 +0200 Message-ID: <20250817232624.700329-8-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250817232624.700329-1-samuel.thibault@ens-lyon.org> References: <20250817232624.700329-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.9 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: <20250817104023.91919-8-gfleury@disroot.org> --- htl/Makefile | 2 +- htl/Versions | 4 ++-- 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 - sysdeps/pthread/sem_unlink.c | 15 +++++++-------- 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 56b29e6bfd..979f290464 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -34,7 +34,6 @@ libpthread-routines := \ pt-spin \ pt-getname-np \ pt-setname-np \ - sem_unlink \ cancellation \ cthreads-compat \ herrno \ @@ -211,6 +210,7 @@ routines := \ sem_close \ sem_open \ sem_routines \ + sem_unlink \ # routines shared-only-routines = forward diff --git a/htl/Versions b/htl/Versions index c22b1b07f3..f5ea540def 100644 --- a/htl/Versions +++ b/htl/Versions @@ -109,6 +109,7 @@ libc { sem_post; sem_timedwait; sem_trywait; + sem_unlink; sem_wait; } @@ -239,6 +240,7 @@ libc { sem_post; sem_timedwait; sem_trywait; + sem_unlink; sem_wait; } @@ -332,8 +334,6 @@ libpthread { pthread_create; - sem_unlink; - pthread_spin_destroy; pthread_spin_init; pthread_spin_lock; pthread_spin_trylock; pthread_spin_unlock; __pthread_spin_destroy; __pthread_spin_init; diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 8eabddcec6..b3fe424501 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -136,6 +136,7 @@ GLIBC_2.12 sem_open F GLIBC_2.12 sem_post F GLIBC_2.12 sem_timedwait F GLIBC_2.12 sem_trywait F +GLIBC_2.12 sem_unlink F GLIBC_2.12 sem_wait F GLIBC_2.13 __fentry__ F GLIBC_2.14 syncfs F @@ -2685,6 +2686,7 @@ GLIBC_2.43 sem_open F GLIBC_2.43 sem_post F GLIBC_2.43 sem_timedwait F GLIBC_2.43 sem_trywait F +GLIBC_2.43 sem_unlink F GLIBC_2.43 sem_wait 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 483d792727..a05cacf93f 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -24,7 +24,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 sem_unlink F GLIBC_2.2.6 _IO_flockfile F GLIBC_2.2.6 _IO_ftrylockfile F GLIBC_2.2.6 _IO_funlockfile F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index de42acab3d..56da3c562b 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -1768,6 +1768,7 @@ GLIBC_2.38 sem_open F GLIBC_2.38 sem_post F GLIBC_2.38 sem_timedwait F GLIBC_2.38 sem_trywait F +GLIBC_2.38 sem_unlink F GLIBC_2.38 sem_wait F GLIBC_2.38 semctl F GLIBC_2.38 semget F @@ -2366,6 +2367,7 @@ GLIBC_2.43 sem_open F GLIBC_2.43 sem_post F GLIBC_2.43 sem_timedwait F GLIBC_2.43 sem_trywait F +GLIBC_2.43 sem_unlink F GLIBC_2.43 sem_wait 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 4c9ba3b7d5..0b1dcf1e8a 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -43,7 +43,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 sem_unlink F GLIBC_2.38 thrd_create F GLIBC_2.38 thrd_detach F GLIBC_2.38 thrd_exit F diff --git a/sysdeps/pthread/sem_unlink.c b/sysdeps/pthread/sem_unlink.c index 428a93ae49..bf09bfd1a6 100644 --- a/sysdeps/pthread/sem_unlink.c +++ b/sysdeps/pthread/sem_unlink.c @@ -22,11 +22,7 @@ #include #include "semaphoreP.h" #include - -#if !PTHREAD_IN_LIBC -/* The private name is not exported from libc. */ -# define __unlink unlink -#endif +#include int __sem_unlink (const char *name) @@ -44,11 +40,14 @@ __sem_unlink (const char *name) __set_errno (EACCES); return ret; } -#if PTHREAD_IN_LIBC +#ifndef __PTHREAD_HTL versioned_symbol (libc, __sem_unlink, sem_unlink, GLIBC_2_34); # if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_1_1, GLIBC_2_34) compat_symbol (libpthread, __sem_unlink, sem_unlink, GLIBC_2_1_1); # endif -#else /* !PTHREAD_IN_LIBC */ -strong_alias (__sem_unlink, sem_unlink) +#else /* __PTHREAD_HTL */ +versioned_symbol (libc, __sem_unlink, sem_unlink, GLIBC_2_43); +# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43) +compat_symbol (libpthread, __sem_unlink, sem_unlink, GLIBC_2_12); +#endif #endif