From patchwork Sun Aug 17 10:40:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gfleury X-Patchwork-Id: 118474 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 5F59E3858402 for ; Sun, 17 Aug 2025 10:42:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5F59E3858402 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=EbZI7fT0 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id A4F053858D26 for ; Sun, 17 Aug 2025 10:40:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A4F053858D26 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A4F053858D26 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755427239; cv=none; b=IwuMNp9rJa1dUjLdiJoPMqMDet1dAGbJP5UfUpRMYXuy2DhyVrGJ0F9yeyv0hvUwby+KjUpsZVNqao3uRmKefpHYSXxCDAgnsRQrI6o2cbWtjiqhbdpQlUoka/7uDJc+Sn3trfMbp9fnkzWT288XhTzY+RpJxOysdkgBW+L5Fwg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755427239; c=relaxed/simple; bh=qJc4SHCMuM4FrkLgR0vIbNInc31ba3eX9p1cAgPJnLQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=GDePuPbRtHnMvrj7lSuU06HTcqwPz66/59+iipXyBKpgYqNOgEMKQ3Lyqh7kutKrvafrw0bViBjbt+m4al1ZBTeTiNwZlNBGl2ZRFAYhtfT+cufBWaPhqtUV212k5RFxgWK9DDnQJ3g18uQLjyBdcRBQeNmSubI61CnhefOZLi8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A4F053858D26 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id C840925C7B; Sun, 17 Aug 2025 12:40:38 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id tExJ_ML74HDi; Sun, 17 Aug 2025 12:40:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1755427238; bh=qJc4SHCMuM4FrkLgR0vIbNInc31ba3eX9p1cAgPJnLQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EbZI7fT0DjmaFMR2hnBGusqZe7IthBaQlSBV8ny52GP7GGrcZQnSSEB7UAu1uysYC 5YYU/TLKIjD/QZQ6Hvl3I/SjkbfXxi+CJRL77YKf3gISjjPykkHtmfnWbZTD7Tob7y X5LIeCUESnvhXLoOzpFX1baduVy9Ihq+cbjVDzE6GD4lJT36vgE9yVsyc4liHk0xmU NtG3IrmrWfqo7JdwUfCTnRQhxIrZRH3ien87MquOyeFsAEbjPtjbyKftOC3VJGByDK ndtSW3Vd1WIaHu94VbvVPBkBNk4IgG/mJdQN0uXf+japD46u7sStVbp1RVWA0qjQ7R Op7K7ZWfiD7aA== From: gfleury To: libc-alpha@sourceware.org Cc: gfleury Subject: [PATCH 1/7] htl: move sem_destroy into libc. Date: Sun, 17 Aug 2025 12:40:16 +0200 Message-ID: <20250817104023.91919-2-gfleury@disroot.org> In-Reply-To: <20250817104023.91919-1-gfleury@disroot.org> References: <20250817104023.91919-1-gfleury@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, 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 --- 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 ec48f8b9..e4a3adc9 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 5570a2b6..48e7fcea 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 89b162d6..daecf1a7 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 1e545481..80bf6408 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 8a056c89..99fdf00e 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 1bf1bcab..b3d402f0 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 5caa7bcf..a03bebdf 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 10:40:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gfleury X-Patchwork-Id: 118476 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 E5F613858D1E for ; Sun, 17 Aug 2025 10:43:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E5F613858D1E Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=aKgrJ1cI X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id 4BD453858D29 for ; Sun, 17 Aug 2025 10:40:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4BD453858D29 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4BD453858D29 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755427241; cv=none; b=QYJkpdjdKSicSKjznJ2UtjkbA3HG6/O6UtEUvgYapdcoa8nUjOT/ogZ9jgP5ViZ6FcDV6ktRKWajIoEWSLeGpwZEBSQ+CI0G75pACGhJUjDdP94TLUEVKxZyFOm8HuLCEYIE/FaJg326pJSVD5z8Ns589svUJkCYlISSvuppB7o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755427241; c=relaxed/simple; bh=ZLDbANzK+2TY+2SNwdA7KynMzUI+E5QakSupHO2wE5c=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=AT1waQDwpwKW8RxUvfKWJrWvwrDpJ4zcfBDfW16VsPk5I4DeGz07lLhUc2usJpQI10vCa+ZdySB6ywnrTKrlq/ZwxMwvBAlPjCQBeLQwmC1ljCwcdbrt5lePUZttQS+++fhcx0xIXiKNNKd6laNCNzyvf491yJRxOP25arrHmxo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4BD453858D29 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 4C56125C7A; Sun, 17 Aug 2025 12:40:40 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id LMpoJBkzstsg; Sun, 17 Aug 2025 12:40:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1755427239; bh=ZLDbANzK+2TY+2SNwdA7KynMzUI+E5QakSupHO2wE5c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=aKgrJ1cI4qc0DTE4mYYYDjpUWnGi2FPsyMN51eN8VX1zWm7Z65/QPbqmE1vOtCvNs gMVfFWX8nJbhOUscf4v/SO21otHMoC4yUjJu0A6phqu3wf/j/tHWpaEa3uB3Cd1y5h jqbzPUMgMGutTiVzZnyPqR5cOGqTfrTiwqvMue0sK6UG3IZ+9E6G7JngAAWBic8cG0 9bGUAhipT/mDhzplBC8Mal7qxSVOK9mSb2aFJKtyOZUXpdGSsOZM78UQPjRmTHCpJV oM937zgUkDNoDibEAdbPwfjDh7Ng7YAErtpamqOzNI+aMbxtZL2r0BgLHpJuJrWib8 ynJ2vKJL8695Q== From: gfleury To: libc-alpha@sourceware.org Cc: gfleury Subject: [PATCH 2/7] htl: move sem_getvalue into libc. Date: Sun, 17 Aug 2025 12:40:17 +0200 Message-ID: <20250817104023.91919-3-gfleury@disroot.org> In-Reply-To: <20250817104023.91919-1-gfleury@disroot.org> References: <20250817104023.91919-1-gfleury@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, 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 --- 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 e4a3adc9..8991a312 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 48e7fcea..5ede53de 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 a1f7bca9..799ddacc 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 80bf6408..74f1fc96 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 99fdf00e..310f7ecf 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 b3d402f0..dd18c695 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 a03bebdf..41c18cc9 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 10:40:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gfleury X-Patchwork-Id: 118475 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 CBAEF3858C62 for ; Sun, 17 Aug 2025 10:43:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CBAEF3858C62 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=dnaruRca X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id BF6E73858C51 for ; Sun, 17 Aug 2025 10:40:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BF6E73858C51 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BF6E73858C51 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755427243; cv=none; b=ZpIIHxGi7k2GeRKH5DUUNYqjhO/GRSDw2eqOO055hh/ZUBjEl9S/3/tLSUG8id1XAiWUGU6f5G1paaX0xBIdWthW5EWpS7olDg1Gco2v1/DDW2uikMZp3NIzQAhvVH5VP48B1/PZEoacwfSSArZ734XkktoE8epOzfjJOepppPU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755427243; c=relaxed/simple; bh=p7373XsyAai3uprirB0gOBOpkjuyg6W2+ukjQJEibKY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=EVCadgV62O0EauT2UNXKkyFaASKIfcVnS7/a+CZxzP6kgDbFpVcMFaA9373p9uxgAaj80TBRUaR5wULHpsi9/sk2PThOc1qxgTLoIiCQwuaZjFly04mUXq1ylbd1L2AXEiCB2NkfbnE8yYVUhVAQqSKyb95/ly0r2QkyfPQonXQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF6E73858C51 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id C9CE925DCA; Sun, 17 Aug 2025 12:40:41 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 71UbiMxCYILT; Sun, 17 Aug 2025 12:40:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1755427241; bh=p7373XsyAai3uprirB0gOBOpkjuyg6W2+ukjQJEibKY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=dnaruRca9gt9kIsjxTCViULtJDV2tcR3AqyUqL7lZzHvZjoPsJhpU5zXf9R9knn7e ZiPvsuHd5fXhG5FEj7RbuZPC0Lk4ZtNAN6PqzyzujsJaWrwwpUxaerk5fHDbQZR9NV JLm+2VvC/5Y1sb3D0ZtoSDI7bpkMacX+N+Sb327AeYqyh6iSHuvK42zT29XjOv0X5b 6St533kUhtfJ8PIFtNZL9hd+zBO2Xk+xh81LD9zRKajSDgVf3B0Vis+LJFEsESM98E HRp8sts0huRLwCfCh+vf3JOzTrDQ1LxoYV4khn/iePWDbvoC6YF7U1fT/I3eKjnUyp kMqcClYBD7GDw== From: gfleury To: libc-alpha@sourceware.org Cc: gfleury Subject: [PATCH 3/7] htl: move sem_init into libc. Date: Sun, 17 Aug 2025 12:40:18 +0200 Message-ID: <20250817104023.91919-4-gfleury@disroot.org> In-Reply-To: <20250817104023.91919-1-gfleury@disroot.org> References: <20250817104023.91919-1-gfleury@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, 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 --- 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 8991a312..33dfdc53 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 5ede53de..764faa01 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 952be427..e818c07f 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 74f1fc96..02bc296f 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 310f7ecf..8d043280 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 dd18c695..3fc43370 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 41c18cc9..a612aa9a 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 10:40:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gfleury X-Patchwork-Id: 118477 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 820203858CB6 for ; Sun, 17 Aug 2025 10:44:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 820203858CB6 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=DWkC3F1b X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id A52FD3858C56 for ; Sun, 17 Aug 2025 10:40:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A52FD3858C56 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A52FD3858C56 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755427244; cv=none; b=unell0JBzVPJF5WrJm5dCYAnneyZSTyKA9eeTjsbpCskptJc06BcUf9WbJXhWNTa6OOhDDoo8lbZXzzEL0ELrhNaM/nZrJs+BgnGh/ga+1MfQnQH1GBV3iV/m3dGKcUb/cMMIrnuEDsS9yU7oMjiPyIyFYKmD++ExkQzpAtJwUI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755427244; c=relaxed/simple; bh=V/EbfyjIoCwBZdePHHli3yuMUwPd7Thee9eqwNfjeRw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=jxmKHrBeHt7Z4IqKYW/3P0ILQOLDG0+sagV6aIpWiWXLyoSbZI3zW5dyqrDf9GLNrW3nfDdXhhZeXM/VX+hvZY/vBAaEt3D6+u8wEiObqb6g92XW6AkuE/SSliOe3n4XfHPByHlICypkJ9BzGEPtdwkFSmViof96wdtkKhc3Lz8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A52FD3858C56 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id C275D25CEA; Sun, 17 Aug 2025 12:40:43 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id UTy2YdSQvCoS; Sun, 17 Aug 2025 12:40:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1755427243; bh=V/EbfyjIoCwBZdePHHli3yuMUwPd7Thee9eqwNfjeRw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DWkC3F1bQMT2ISJC/Yay4J2RSTsuhc5/o3L0M1AW2z8gvjgLoKFZYZdNpZOHv3fqG qbVky/MFzZVkuPfvozcuig8lPFumQIL6ooKf9qbIZUwybUcm7TlkyllmVO85t5zZe7 /1NgfdqEApIqyRJfhBTVnC5I5gIALu3D+IkY4+jrIQiIlofwBGsgo+U69OKVeBOAap 0HXfPJ9A/ewGYjwXs8QqZdXNwr41M/Ym+1fnCskaqlj9/NEMz96yPUfcnLzz+VWPGP sWyIb+CKrgFsYVfFVZUDt9SNFS0W60bqIH4RmKsXO7jegr6NIN85k/Hsh0G8KL1oy6 xf02xq4RD0IgA== From: gfleury To: libc-alpha@sourceware.org Cc: gfleury Subject: [PATCH 4/7] htl: move sem_open, sem_close into libc. Date: Sun, 17 Aug 2025 12:40:19 +0200 Message-ID: <20250817104023.91919-5-gfleury@disroot.org> In-Reply-To: <20250817104023.91919-1-gfleury@disroot.org> References: <20250817104023.91919-1-gfleury@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, 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 --- 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 33dfdc53..9c702eee 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 \ @@ -208,9 +205,12 @@ routines := \ pt-timedblock-intr \ pt-wakeup \ pt-yield \ + sem_close \ sem-destroy \ sem-getvalue \ sem-init \ + sem_open \ + sem_routines \ # routines shared-only-routines = forward diff --git a/htl/Versions b/htl/Versions index 764faa01..5b83e1ce 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 02bc296f..9764b605 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 8d043280..c7e8bc5a 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 3fc43370..e64bf542 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 a612aa9a..ee0fac30 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 e989ed8f..6e80bb0a 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 e5eacb5f..992786e0 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 62089359..fb6a555b 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 10:40:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gfleury X-Patchwork-Id: 118478 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 A4B523858C5E for ; Sun, 17 Aug 2025 10:46:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A4B523858C5E Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=fLU256xz X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id 625D73858CB6 for ; Sun, 17 Aug 2025 10:40:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 625D73858CB6 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 625D73858CB6 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755427246; cv=none; b=tc+pyuAoJIkk10eXlXEeamFEDdeYAFnOv9ogfy3uVo27q776dixL1QentTW6x5jv+SaMDOaSKbyIpJcpnhZ7QxavXYObFYwLNHeK8RyIqdiVoPVH3JXqqGbfDv3pwCrHCgLbNaiZXN9UQHuAHuXl/pBa7/9DWDmHsidb0JFnv7A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755427246; c=relaxed/simple; bh=ExRiptCBsgTV3aZkRXUsPj/w/SXrLRbX4yvrwncztYI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=V/ZZnV9Yk+VY0XJ79qL4vqtNsMRwI393JwMs2hIe1IfFNUtHaP035zkJCc3nN3GpPJZU00Z0gmknJ5kWWLs2OyPtML3TIQBd5PU/aPPOt9SdePFJ9wqx9pKYCFSERkxZBRAEhWgLXjuSv8nJxUXxbY8TTtOinXeA44GXwfLJxC8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 625D73858CB6 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 8CCAF25BB3; Sun, 17 Aug 2025 12:40:45 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id CCurRTwsUmbq; Sun, 17 Aug 2025 12:40:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1755427244; bh=ExRiptCBsgTV3aZkRXUsPj/w/SXrLRbX4yvrwncztYI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fLU256xzBtMHAeMa8i4B4MZExQZkSr5yyfCEJR0xvG5obdAa7BINGanrsEUkdcLzQ iAFo7ogbkl/T00II08bLvMkebh+2quJRm1qfz7mxTVTSwvtnWmNMpS/ENy7fU/thEC fcQhEgTfknIEbYOnTGAzyPEOIPEyAha6WT0F9Ob8yRz4yX4H1vLf8CudiIACNW7eXQ p7K4Mg5PLEKpz4dyCMBsk4LIwz1JRpO94BazAICSvTuxf4GZ5cfM7YnLqBP/34PBEZ 62sjH+uJwC0CNvJTBi4JbsMAt4CBMQsDUnMyO8O3CLQzXNGM7lN/GHM0a8Rosm/fIF 1Ukv1BgIZ6wDg== From: gfleury To: libc-alpha@sourceware.org Cc: gfleury Subject: [PATCH 5/7] htl: move sem_post into libc. Date: Sun, 17 Aug 2025 12:40:20 +0200 Message-ID: <20250817104023.91919-6-gfleury@disroot.org> In-Reply-To: <20250817104023.91919-1-gfleury@disroot.org> References: <20250817104023.91919-1-gfleury@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, 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 --- 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 9c702eee..9f9f5ed7 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 \ @@ -210,6 +209,7 @@ routines := \ sem-getvalue \ sem-init \ sem_open \ + sem-post \ sem_routines \ # routines shared-only-routines = forward diff --git a/htl/Versions b/htl/Versions index 5b83e1ce..ff1d5b93 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 58fa2bf3..5e5d3c18 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 36f20f97..419a5ec2 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 9764b605..661bbf95 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 c7e8bc5a..07dd7537 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 e64bf542..6fa0e6f0 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 ee0fac30..38cf0d25 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 10:40:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gfleury X-Patchwork-Id: 118479 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 6AD133858C2D for ; Sun, 17 Aug 2025 10:47:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6AD133858C2D Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (2048-bit key, secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=DT8AevTk X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id 568C13858D26 for ; Sun, 17 Aug 2025 10:40:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 568C13858D26 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 568C13858D26 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755427249; cv=none; b=oL5vgglw6L0zjAWb2QXQaRAXcCe1KWkvPoONKHurtdcfOGuEkCOAFZbJRrQjesaFteTVVKRpIXTIdKF3XsRIU6VoKf6YqL5zSiRIEgo7LQ1ragb6oSAX+FuLqh6jj79qwRn1dOAk785y40DOt6Yzv2c2F0xI/UFS3fWrmaovclU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755427249; c=relaxed/simple; bh=y4jLG+RYIvTmJN05MPg4kGob0Mc57cHru5vF9NdrQME=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=M3QDs9PeR7oX/ioRLQtOg38PZ9lB/zwwevKq9DWYMaAyU+YTQksrp0+x2aNTrGY/bp/2ffGa4tzRl8mUotXdweqFTAx3Vuwo2G+PFldqLZ/xg3c7dGgfJEpp+OMKPm61YMxT94vxnYpHHCbgZeQf5KwZH8JnN8q89TjTm/aZxR0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 568C13858D26 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 6CCEA25C7A; Sun, 17 Aug 2025 12:40:48 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Q-HnYX6yKlds; Sun, 17 Aug 2025 12:40:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1755427247; bh=y4jLG+RYIvTmJN05MPg4kGob0Mc57cHru5vF9NdrQME=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DT8AevTktooJnWDgOpTZQnBMvgO0BbrCOm4x5RNSfrJtCk3abu2nsMjZMT6OpPrg5 pgIRBQ/VrUMEbtZIx1fpBUsZ/GayCNgQZHavmY4WjiwdDmD9us/H6lhyVmcUDmBujY cU4M421MVczGs7DjjEoTmYWr1PjnAuCR1PFj8lSQGL5XCqBMpOfekVd31aAEEHTbom Gmarb8mR037ky7S/OMx77YAcCAWs3nclqmBcGvnOqJIjwVjK5liECiHBtNVVQnh5DF lWcFg/gx5AacWDwwEBPXAmvbyr3uhcaD4G9M5fG7eOrfnX8hWNPtxVqQldFz4DJaPK gB35SWwx5QHMg== From: gfleury To: libc-alpha@sourceware.org Cc: gfleury Subject: [PATCH 6/7] htl: move sem_{clockwait, timedwait, wait, trywait} into libc. Date: Sun, 17 Aug 2025 12:40:21 +0200 Message-ID: <20250817104023.91919-7-gfleury@disroot.org> In-Reply-To: <20250817104023.91919-1-gfleury@disroot.org> References: <20250817104023.91919-1-gfleury@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, 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 --- htl/Makefile | 8 ++++---- htl/Versions | 13 ++++++++++--- hurd/hurdlock.c | 1 + hurd/hurdlock.h | 1 + sysdeps/htl/include/semaphore.h | 10 ++++++++++ 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, 65 insertions(+), 19 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 9f9f5ed7..edb763d8 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 \ @@ -211,6 +207,10 @@ routines := \ sem_open \ sem-post \ sem_routines \ + sem-timedwait \ + sem-trywait \ + sem-wait \ + sem-waitfast \ # routines shared-only-routines = forward diff --git a/htl/Versions b/htl/Versions index ff1d5b93..c22b1b07 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 c771662e..1cb6981a 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 0cfccc56..532a07d5 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 5e5d3c18..be972124 100644 --- a/sysdeps/htl/include/semaphore.h +++ b/sysdeps/htl/include/semaphore.h @@ -6,4 +6,14 @@ extern __typeof (sem_post) __sem_post; libc_hidden_proto (__sem_post) #endif +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 diff --git a/sysdeps/htl/sem-timedwait.c b/sysdeps/htl/sem-timedwait.c index 4931dde5..8f2b4d3f 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 38846bf9..0d1e9cd5 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 97c873dc..c2fc7a93 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 661bbf95..8eabddce 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 07dd7537..483d7927 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 6fa0e6f0..c0d37712 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_timedwait 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 38cf0d25..4c9ba3b7 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 10:40:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gfleury X-Patchwork-Id: 118480 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 B24C33858CB6 for ; Sun, 17 Aug 2025 10:48:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B24C33858CB6 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=EbaAlHJr X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id A2B923858C40 for ; Sun, 17 Aug 2025 10:40:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A2B923858C40 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=disroot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A2B923858C40 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755427250; cv=none; b=MykE3g97LgJzb89Qc2jqbCJvw5uZcno5BE6UP5uxgNuIbuiLLBqnZDeYif0zlFqy2tu7pHEiOvNIM5dl0l2yHJaTfMSXK00MGYW021jpZNJ04HScKfaDF2cTD2Ych7nZQehEtjmZ8UUcTI78SFpBBf38jC3HyuTpma0u/E3DP3A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755427250; c=relaxed/simple; bh=gN+o/LaoEY6LVyyl0jxUOguDMHn6f6mTswP0RJ00wRo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=e7PrKzFCgy/dtsEzUdyrODt0AZKKN+PDHmIMD4BfSVd0OzUeI8V2sevPhK9UGq7Qes0wC+sVEIxTtwrO9bB4LU1XwNo7UWXmcKusvBRg+0lhCNHDYjjki06lZnSHPegrWF6avM+xs5WjP43InxZcpBHZQhBoL/G1Y/dZkmPEzqc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A2B923858C40 Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id C3EBC25CA7; Sun, 17 Aug 2025 12:40:49 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id h2VOewwQ-9pg; Sun, 17 Aug 2025 12:40:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1755427249; bh=gN+o/LaoEY6LVyyl0jxUOguDMHn6f6mTswP0RJ00wRo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EbaAlHJrLj0wV0JSaZX/RZ/Gfe/SG8A/CSB9tMhdM3k++3dC1ZJQJNaTKbk9eimhf mwB37uhw0oc8JJ4EkS5dK7ErCFJMaWh7M09oJfYYC17y3wUX10u0K+qCnh5XMsxBso y8CY2ETx6aq980ohYwb9gRPb5SY/D5nDbBmDkLzamdzQGQUpEVHt1RPZlvF8ECl/57 KHfGogKY8u+pz2F04LY+0OYi/doLBV3ReOpiTnSRHXn6ySw8eIqypAQBHxXymUTWrX ZbsOd+qfBhqhIdh9YPx0/4iHiqIEwjvniOGXaj4U0AJHKG9ZDioLfhTuf2ZkepkdOT xFhckQoMzEDYQ== From: gfleury To: libc-alpha@sourceware.org Cc: gfleury Subject: [PATCH 7/7] htl: move sem_unlink into libc. Date: Sun, 17 Aug 2025 12:40:22 +0200 Message-ID: <20250817104023.91919-8-gfleury@disroot.org> In-Reply-To: <20250817104023.91919-1-gfleury@disroot.org> References: <20250817104023.91919-1-gfleury@disroot.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, 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 --- 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 edb763d8..fc1dee79 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 \ @@ -209,6 +208,7 @@ routines := \ sem_routines \ sem-timedwait \ sem-trywait \ + sem_unlink \ sem-wait \ sem-waitfast \ # routines diff --git a/htl/Versions b/htl/Versions index c22b1b07..f5ea540d 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 8eabddce..b3fe4245 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 483d7927..a05cacf9 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 c0d37712..c725bc3c 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 4c9ba3b7..0b1dcf1e 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 428a93ae..bf09bfd1 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