From patchwork Wed Jan 29 01:33:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 105587 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 C27673857C47 for ; Wed, 29 Jan 2025 01:40:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C27673857C47 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 0B8593857C6C for ; Wed, 29 Jan 2025 01:33:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0B8593857C6C 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 0B8593857C6C 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=1738114437; cv=none; b=cGCVHPQ3rH+YZ4dCG0nKdyJVv5AkVjiByFDZrJ06oKwinpDVQWwkog41btTxIyERSqPru7c1uJczbi9HeBDhi7kebalf28RVXkbtXXUiTgzQS/P7l+cQypmOIvVy1sALdfV2gsjqf1hGkoV+v1Yim0AKH4/pZJzO1F4Zcw2SP+M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1738114437; c=relaxed/simple; bh=mYB3H7L/GvgGKFN6dcp1NlAfbjXEzAYvLeO97vV1LVE=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=xODkvAtoG0QMSPz2mPXjwSd4by/00HGaWkm8u27N877HcTrTV7EnNHiFCCDRh/DSbMAHEiAhW42PrPuocJRFBiyHIDpr+xFjA65ZYmOukpp29mQaINUN67s9l7PGDB2/shhmqCV4xfaBU2D0/d+3oGSER3omClK0kAXotM7RXdA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B8593857C6C Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id C6583A49C6; Wed, 29 Jan 2025 02:33:44 +0100 (CET) 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 5EgmXw78OaNU; Wed, 29 Jan 2025 02:33:44 +0100 (CET) Received: from begin (aamiens-653-1-40-48.w83-192.abo.wanadoo.fr [83.192.199.48]) (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 51398A5DA3; Wed, 29 Jan 2025 02:33:44 +0100 (CET) Received: from samy by begin with local (Exim 4.98) (envelope-from ) id 1tcwxb-0000000AtUB-3U2H; Wed, 29 Jan 2025 02:33:43 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: gfleury , commit-hurd@gnu.org Subject: [hurd,commited 7/7] htl: move pthread_setcanceltype into libc. Date: Wed, 29 Jan 2025 02:33:42 +0100 Message-ID: <20250129013342.2596522-8-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250129013342.2596522-1-samuel.thibault@ens-lyon.org> References: <20250129013342.2596522-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: <20250103103750.870897-7-gfleury@disroot.org> --- htl/Makefile | 2 +- htl/Versions | 3 ++- htl/forward.c | 2 -- htl/pt-initialize.c | 1 - htl/pt-setcanceltype.c | 8 ++++++-- sysdeps/htl/pthread-functions.h | 2 -- sysdeps/htl/pthreadP.h | 3 +++ sysdeps/mach/hurd/i386/libc.abilist | 1 + sysdeps/mach/hurd/i386/libpthread.abilist | 1 - sysdeps/mach/hurd/x86_64/libpthread.abilist | 1 - 10 files changed, 13 insertions(+), 11 deletions(-) diff --git a/htl/Makefile b/htl/Makefile index 5b0b6023b0..d4418ab9f9 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -51,7 +51,6 @@ libpthread-routines := \ pt-spin-inlines \ pt-cleanup \ pt-setcancelstate \ - pt-setcanceltype \ pt-testcancel \ pt-cancel \ pt-mutex-transfer-np \ @@ -204,6 +203,7 @@ routines := \ pt-nthreads \ pt-pthread_self \ pt-self pt-equal \ + pt-setcanceltype \ pt-setschedparam \ pt-sigmask \ pt-sigstate \ diff --git a/htl/Versions b/htl/Versions index 2ebf554cfa..6801d12182 100644 --- a/htl/Versions +++ b/htl/Versions @@ -56,6 +56,7 @@ libc { pthread_mutexattr_setprotocol; pthread_mutexattr_setpshared; pthread_mutexattr_settype; + pthread_setcanceltype; pthread_sigmask; } @@ -231,7 +232,7 @@ libpthread { pthread_rwlockattr_destroy; pthread_rwlockattr_getpshared; pthread_rwlockattr_init; pthread_rwlockattr_setpshared; - pthread_setcancelstate; pthread_setcanceltype; + pthread_setcancelstate; pthread_setconcurrency; pthread_setschedprio; pthread_setspecific; diff --git a/htl/forward.c b/htl/forward.c index 636902919e..9455df7316 100644 --- a/htl/forward.c +++ b/htl/forward.c @@ -62,7 +62,5 @@ FORWARD (__pthread_setcancelstate, (int state, int *oldstate), (state, oldstate), 0) strong_alias (__pthread_setcancelstate, pthread_setcancelstate); -FORWARD (pthread_setcanceltype, (int type, int *oldtype), (type, oldtype), 0) - FORWARD2 (__pthread_get_cleanup_stack, struct __pthread_cancelation_handler **, (void), (), return &__pthread_cleanup_stack); diff --git a/htl/pt-initialize.c b/htl/pt-initialize.c index 5854bc4967..eba9e12d73 100644 --- a/htl/pt-initialize.c +++ b/htl/pt-initialize.c @@ -29,7 +29,6 @@ static const struct pthread_functions pthread_functions = { .ptr___pthread_exit = __pthread_exit, .ptr___pthread_setcancelstate = __pthread_setcancelstate, - .ptr_pthread_setcanceltype = __pthread_setcanceltype, .ptr___pthread_get_cleanup_stack = __pthread_get_cleanup_stack, .ptr_pthread_once = __pthread_once, .ptr_pthread_rwlock_rdlock = __pthread_rwlock_rdlock, diff --git a/htl/pt-setcanceltype.c b/htl/pt-setcanceltype.c index f9474f9c39..0b76fbfbd6 100644 --- a/htl/pt-setcanceltype.c +++ b/htl/pt-setcanceltype.c @@ -17,7 +17,7 @@ . */ #include - +#include #include int @@ -42,5 +42,9 @@ __pthread_setcanceltype (int type, int *oldtype) return 0; } +libc_hidden_def (__pthread_setcanceltype) +versioned_symbol (libc, __pthread_setcanceltype, pthread_setcanceltype, GLIBC_2_21); -weak_alias (__pthread_setcanceltype, pthread_setcanceltype); +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21) +compat_symbol (libc, __pthread_setcanceltype, pthread_setcanceltype, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h index 45f15c2641..9788085b83 100644 --- a/sysdeps/htl/pthread-functions.h +++ b/sysdeps/htl/pthread-functions.h @@ -23,7 +23,6 @@ void __pthread_exit (void *) __attribute__ ((__noreturn__)); int __pthread_setcancelstate (int, int *); -int __pthread_setcanceltype (int, int *); struct __pthread_cancelation_handler **__pthread_get_cleanup_stack (void); int __pthread_once (pthread_once_t *, void (*) (void)); int __pthread_rwlock_rdlock (pthread_rwlock_t *); @@ -44,7 +43,6 @@ struct pthread_functions { void (*ptr___pthread_exit) (void *) __attribute__ ((__noreturn__)); int (*ptr___pthread_setcancelstate) (int, int *); - int (*ptr_pthread_setcanceltype) (int, int *); struct __pthread_cancelation_handler **(*ptr___pthread_get_cleanup_stack) (void); int (*ptr_pthread_once) (pthread_once_t *, void (*) (void)); int (*ptr_pthread_rwlock_rdlock) (pthread_rwlock_t *); diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index c39c7f117b..889a63200d 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -118,6 +118,9 @@ extern int __pthread_cond_clockwait (pthread_cond_t *cond, libc_hidden_proto (__pthread_cond_clockwait); extern int __pthread_cond_destroy (pthread_cond_t *cond); libc_hidden_proto (__pthread_cond_destroy); + +extern int __pthread_setcanceltype (int __type, int *__oldtype); +libc_hidden_proto (__pthread_setcanceltype); extern int __pthread_sigmask (int, const sigset_t *, sigset_t *); libc_hidden_proto (__pthread_sigmask); diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 17656eb119..c26eddba3d 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -82,6 +82,7 @@ GLIBC_2.12 pthread_mutexattr_setprotocol F GLIBC_2.12 pthread_mutexattr_setpshared F GLIBC_2.12 pthread_mutexattr_settype F GLIBC_2.12 pthread_self F +GLIBC_2.12 pthread_setcanceltype F GLIBC_2.12 pthread_setschedparam F GLIBC_2.12 pthread_sigmask F GLIBC_2.13 __fentry__ F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 0877c0a84b..30b598ffd9 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -57,7 +57,6 @@ GLIBC_2.12 pthread_rwlockattr_getpshared F GLIBC_2.12 pthread_rwlockattr_init F GLIBC_2.12 pthread_rwlockattr_setpshared F GLIBC_2.12 pthread_setcancelstate F -GLIBC_2.12 pthread_setcanceltype F GLIBC_2.12 pthread_setconcurrency F GLIBC_2.12 pthread_setschedprio F GLIBC_2.12 pthread_setspecific F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index f4cee89580..800b7935fb 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -79,7 +79,6 @@ GLIBC_2.38 pthread_rwlockattr_getpshared F GLIBC_2.38 pthread_rwlockattr_init F GLIBC_2.38 pthread_rwlockattr_setpshared F GLIBC_2.38 pthread_setcancelstate F -GLIBC_2.38 pthread_setcanceltype F GLIBC_2.38 pthread_setconcurrency F GLIBC_2.38 pthread_setschedprio F GLIBC_2.38 pthread_setspecific F