From patchwork Sun Jun 14 16:57:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1308986 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49lLJ85ZHKz9sRK for ; Mon, 15 Jun 2020 02:58:16 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8B545395C424; Sun, 14 Jun 2020 16:58:04 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from hera.aquilenet.fr (hera.aquilenet.fr [IPv6:2a0c:e300::1]) by sourceware.org (Postfix) with ESMTPS id 38C07388B026 for ; Sun, 14 Jun 2020 16:58:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 38C07388B026 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=samuel.thibault@ens-lyon.org Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 61DEB330A; Sun, 14 Jun 2020 18:58:01 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Tsr0Yp0wFgde; Sun, 14 Jun 2020 18:58:00 +0200 (CEST) Received: from function.home (unknown [IPv6:2a01:cb19:956:1b00:9eb6:d0ff:fe88:c3c7]) by hera.aquilenet.fr (Postfix) with ESMTPSA id C3C6033C7; Sun, 14 Jun 2020 18:57:58 +0200 (CEST) Received: from samy by function.home with local (Exim 4.94) (envelope-from ) id 1jkVxF-00HRMC-3b; Sun, 14 Jun 2020 18:57:57 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Subject: [hurd, commited 1/6] htl: Add noreturn attribute on __pthread_exit forward Date: Sun, 14 Jun 2020 18:57:52 +0200 Message-Id: <20200614165757.4156687-2-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200614165757.4156687-1-samuel.thibault@ens-lyon.org> References: <20200614165757.4156687-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: commit-hurd@gnu.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" * sysdeps/htl/pthread-functions.h (__pthread_exit): Add noreturn attribute. (struct pthread_functions): Add noreturn attribute on ptr___pthread_exit field. --- sysdeps/htl/pthread-functions.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h index 9cb7c2c4a5..c3480e9419 100644 --- a/sysdeps/htl/pthread-functions.h +++ b/sysdeps/htl/pthread-functions.h @@ -46,7 +46,7 @@ int __pthread_cond_wait (pthread_cond_t *, pthread_mutex_t *); int __pthread_cond_timedwait (pthread_cond_t *, pthread_mutex_t *, const struct timespec *); int __pthread_equal (pthread_t, pthread_t); -void __pthread_exit (void *); +void __pthread_exit (void *) __attribute__ ((__noreturn__)); int __pthread_getschedparam (pthread_t, int *, struct sched_param *); int __pthread_setschedparam (pthread_t, int, const struct sched_param *); @@ -102,7 +102,7 @@ struct pthread_functions int (*ptr_pthread_cond_timedwait) (pthread_cond_t *, pthread_mutex_t *, const struct timespec *); int (*ptr_pthread_equal) (pthread_t, pthread_t); - void (*ptr___pthread_exit) (void *); + void (*ptr___pthread_exit) (void *) __attribute__ ((__noreturn__)); int (*ptr_pthread_getschedparam) (pthread_t, int *, struct sched_param *); int (*ptr_pthread_setschedparam) (pthread_t, int, const struct sched_param *); From patchwork Sun Jun 14 16:57:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1308984 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49lLJ138YSz9sRk for ; Mon, 15 Jun 2020 02:58:09 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D24F4395C046; Sun, 14 Jun 2020 16:58:03 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from hera.aquilenet.fr (hera.aquilenet.fr [IPv6:2a0c:e300::1]) by sourceware.org (Postfix) with ESMTPS id 47E59388B000 for ; Sun, 14 Jun 2020 16:58:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 47E59388B000 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=samuel.thibault@ens-lyon.org Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 3A09B33F9; Sun, 14 Jun 2020 18:58:00 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XojBeL2lBKDr; Sun, 14 Jun 2020 18:57:58 +0200 (CEST) Received: from function.home (unknown [IPv6:2a01:cb19:956:1b00:9eb6:d0ff:fe88:c3c7]) by hera.aquilenet.fr (Postfix) with ESMTPSA id AB89E33C4; Sun, 14 Jun 2020 18:57:58 +0200 (CEST) Received: from samy by function.home with local (Exim 4.94) (envelope-from ) id 1jkVxF-00HRME-4O; Sun, 14 Jun 2020 18:57:57 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Subject: [hurd,commited 2/6] htl: initialize first and prevent from unloading Date: Sun, 14 Jun 2020 18:57:53 +0200 Message-Id: <20200614165757.4156687-3-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200614165757.4156687-1-samuel.thibault@ens-lyon.org> References: <20200614165757.4156687-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: commit-hurd@gnu.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" libc does not have codepaths for reverting the load of a libpthread. * htl/Makefile (LDFLAGS-pthread.so): Pass -z nodelete -z initfirst to linker. --- htl/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/htl/Makefile b/htl/Makefile index c424bd512b..326a920fb3 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -205,6 +205,7 @@ $(inst_libdir)/libpthread_syms.a: $(srcdir)/libpthread_syms.a $(+force) libc-link.so = $(common-objpfx)libc.so extra-B-pthread.so = -B$(common-objpfx)htl/ +LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst include ../Rules From patchwork Sun Jun 14 16:57:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1308985 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49lLJ56S2Gz9sRk for ; Mon, 15 Jun 2020 02:58:13 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 35E0A395C401; Sun, 14 Jun 2020 16:58:04 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from hera.aquilenet.fr (hera.aquilenet.fr [185.233.100.1]) by sourceware.org (Postfix) with ESMTPS id BC902388B01D for ; Sun, 14 Jun 2020 16:58:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BC902388B01D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=samuel.thibault@ens-lyon.org Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 70CB833C4; Sun, 14 Jun 2020 18:58:00 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Tda2CrYZHXpf; Sun, 14 Jun 2020 18:57:58 +0200 (CEST) Received: from function.home (unknown [IPv6:2a01:cb19:956:1b00:9eb6:d0ff:fe88:c3c7]) by hera.aquilenet.fr (Postfix) with ESMTPSA id A0697330A; Sun, 14 Jun 2020 18:57:58 +0200 (CEST) Received: from samy by function.home with local (Exim 4.94) (envelope-from ) id 1jkVxF-00HRMG-5D; Sun, 14 Jun 2020 18:57:57 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Subject: [hurd, commited 3/6] htl: Move cleanup stack to variable shared between libc and pthread Date: Sun, 14 Jun 2020 18:57:54 +0200 Message-Id: <20200614165757.4156687-4-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200614165757.4156687-1-samuel.thibault@ens-lyon.org> References: <20200614165757.4156687-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: commit-hurd@gnu.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" If libpthread gets loaded dynamically, the stack needs to already contain the cleanup handlers of the main thread. * htl/libc_pthread_init.c (__pthread_cleanup_stack): New per-thread variable. * htl/Versions (libc): Add __pthread_cleanup_stack as private symbol. * htl/pt-internal.h (struct __pthread): Remove cancelation_handlers field. (__pthread_cleanup_stack): Add variable declaration. * htl/pt-alloc.c (initialize_pthread): Remove initialization of cancelation_handlers field. * htl/pt-cleanup.c (__pthread_get_cleanup_stack): Return the address of __pthread_cleanup_stack instead of that of the cancelation_handlers field. * htl/forward.c: Include . (dummy_list): Remove variable. (__pthread_get_cleanup_stack): Return the address of __pthread_cleanup_stack instead of that of dummy_list. --- htl/Versions | 1 + htl/forward.c | 4 ++-- htl/libc_pthread_init.c | 2 ++ htl/pt-alloc.c | 2 -- htl/pt-cleanup.c | 2 +- htl/pt-internal.h | 4 +++- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/htl/Versions b/htl/Versions index fd9eefbaee..832cc5d814 100644 --- a/htl/Versions +++ b/htl/Versions @@ -29,6 +29,7 @@ libc { GLIBC_PRIVATE { __libc_alloca_cutoff; __libc_pthread_init; + __pthread_cleanup_stack; } } diff --git a/htl/forward.c b/htl/forward.c index dfb7b79327..544e7da058 100644 --- a/htl/forward.c +++ b/htl/forward.c @@ -23,6 +23,7 @@ #include #include #include +#include /* Pointers to the libc functions. */ struct pthread_functions __libc_pthread_functions attribute_hidden; @@ -140,6 +141,5 @@ strong_alias (__pthread_setcancelstate, pthread_setcancelstate); FORWARD (pthread_setcanceltype, (int type, int *oldtype), (type, oldtype), 0) -struct __pthread_cancelation_handler *dummy_list; FORWARD2 (__pthread_get_cleanup_stack, struct __pthread_cancelation_handler **, - (void), (), return &dummy_list); + (void), (), return &__pthread_cleanup_stack); diff --git a/htl/libc_pthread_init.c b/htl/libc_pthread_init.c index cee92f76ee..f617c4e0be 100644 --- a/htl/libc_pthread_init.c +++ b/htl/libc_pthread_init.c @@ -19,6 +19,8 @@ #include #include +__thread struct __pthread_cancelation_handler *__pthread_cleanup_stack; + void __libc_pthread_init (const struct pthread_functions *functions) { diff --git a/htl/pt-alloc.c b/htl/pt-alloc.c index d4426bb2e3..bf37aca729 100644 --- a/htl/pt-alloc.c +++ b/htl/pt-alloc.c @@ -65,8 +65,6 @@ initialize_pthread (struct __pthread *new) new->state_lock = (pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER; new->state_cond = (pthread_cond_t) PTHREAD_COND_INITIALIZER; - new->cancelation_handlers = 0; - memset (&new->res_state, '\0', sizeof (new->res_state)); new->tcb = NULL; diff --git a/htl/pt-cleanup.c b/htl/pt-cleanup.c index a9a7c95847..7e6149bda9 100644 --- a/htl/pt-cleanup.c +++ b/htl/pt-cleanup.c @@ -23,6 +23,6 @@ struct __pthread_cancelation_handler ** __pthread_get_cleanup_stack (void) { - return &_pthread_self ()->cancelation_handlers; + return &__pthread_cleanup_stack; } hidden_def(__pthread_get_cleanup_stack) diff --git a/htl/pt-internal.h b/htl/pt-internal.h index 918c207c3e..e0baa6bcda 100644 --- a/htl/pt-internal.h +++ b/htl/pt-internal.h @@ -81,7 +81,6 @@ struct __pthread int cancel_state; int cancel_type; int cancel_pending; - struct __pthread_cancelation_handler *cancelation_handlers; /* Thread stack. */ void *stackaddr; @@ -197,6 +196,9 @@ extern pthread_rwlock_t __pthread_threads_lock; #ifndef _pthread_self extern struct __pthread *_pthread_self (void); #endif + +/* Stores the stack of cleanup handlers for the thread. */ +extern __thread struct __pthread_cancelation_handler *__pthread_cleanup_stack; /* Initialize the pthreads library. */ From patchwork Sun Jun 14 16:57:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1308988 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49lLJJ1Zdkz9sRK for ; Mon, 15 Jun 2020 02:58:24 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 44B36395C800; Sun, 14 Jun 2020 16:58:07 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from hera.aquilenet.fr (hera.aquilenet.fr [185.233.100.1]) by sourceware.org (Postfix) with ESMTPS id 0721A388B01D for ; Sun, 14 Jun 2020 16:58:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0721A388B01D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=samuel.thibault@ens-lyon.org Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 0A51933C8; Sun, 14 Jun 2020 18:58:03 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HmAd_n3VciM0; Sun, 14 Jun 2020 18:58:01 +0200 (CEST) Received: from function.home (unknown [IPv6:2a01:cb19:956:1b00:9eb6:d0ff:fe88:c3c7]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 3AA6033DC; Sun, 14 Jun 2020 18:57:59 +0200 (CEST) Received: from samy by function.home with local (Exim 4.94) (envelope-from ) id 1jkVxF-00HRMI-6C; Sun, 14 Jun 2020 18:57:57 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Subject: [hurd,commited 4/6] htl: Fix cleanup support for IO locking Date: Sun, 14 Jun 2020 18:57:55 +0200 Message-Id: <20200614165757.4156687-5-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200614165757.4156687-1-samuel.thibault@ens-lyon.org> References: <20200614165757.4156687-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: commit-hurd@gnu.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" * sysdeps/htl/stdio-lock.h: New file, registers locking cleanup to htl. * sysdeps/htl/libc-lockP.h: Include . (__libc_cleanup_region_start, __libc_cleanup_end, __libc_cleanup_region_end): Override macros from with versions which register cleanup to htl. (__pthread_get_cleanup_stack): Make reference weak for skipping registration on in the static non-libpthread case. --- sysdeps/htl/libc-lockP.h | 33 +++++++++++++++++++++++ sysdeps/htl/stdio-lock.h | 57 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 sysdeps/htl/stdio-lock.h diff --git a/sysdeps/htl/libc-lockP.h b/sysdeps/htl/libc-lockP.h index 4ba3930a13..0c887d707e 100644 --- a/sysdeps/htl/libc-lockP.h +++ b/sysdeps/htl/libc-lockP.h @@ -19,6 +19,7 @@ #ifndef _BITS_LIBC_LOCKP_H #define _BITS_LIBC_LOCKP_H 1 +#include #include #include @@ -73,6 +74,36 @@ typedef pthread_key_t __libc_key_t; __libc_ptf_call (__pthread_setspecific, (KEY, VALUE), 0) +#undef __libc_cleanup_region_start +#undef __libc_cleanup_region_end +#undef __libc_cleanup_end + +#define __libc_cleanup_region_start(DOIT, FCT, ARG) \ + { \ + struct __pthread_cancelation_handler **__handlers = NULL; \ + struct __pthread_cancelation_handler __handler; \ + int _ditit = 0; \ + if (DOIT && __pthread_get_cleanup_stack != NULL) \ + { \ + __handlers = __pthread_get_cleanup_stack (); \ + __handler.__handler = FCT; \ + __handler.__arg = ARG; \ + __handler.__next = *__handlers; \ + *__handlers = &__handler; \ + _ditit = 1; \ + } + +#define __libc_cleanup_end(DOIT) \ + if (_ditit) { \ + if (DOIT) \ + __handler.__handler (__handler.__arg); \ + *__handlers = __handler.__next; \ + } + +#define __libc_cleanup_region_end(DOIT) \ + __libc_cleanup_end(DOIT) \ + } + /* Functions that are used by this file and are internal to the GNU C library. */ @@ -154,6 +185,7 @@ weak_extern (__pthread_once) weak_extern (__pthread_initialize) weak_extern (__pthread_atfork) weak_extern (__pthread_setcancelstate) +weak_extern (__pthread_get_cleanup_stack) # else # pragma weak __pthread_mutex_init # pragma weak __pthread_mutex_destroy @@ -176,6 +208,7 @@ weak_extern (__pthread_setcancelstate) # pragma weak __pthread_initialize # pragma weak __pthread_atfork # pragma weak __pthread_setcancelstate +# pragma weak __pthread_get_cleanup_stack # endif #endif diff --git a/sysdeps/htl/stdio-lock.h b/sysdeps/htl/stdio-lock.h new file mode 100644 index 0000000000..eafd53ad4a --- /dev/null +++ b/sysdeps/htl/stdio-lock.h @@ -0,0 +1,57 @@ +/* Thread package specific definitions of stream lock type. Hurd version. + Copyright (C) 2000-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _STDIO_LOCK_H +#define _STDIO_LOCK_H 1 + +#include + +__libc_lock_define_recursive (typedef, _IO_lock_t) +#define _IO_lock_t_defined 1 + +/* We need recursive (counting) mutexes. */ +# define _IO_lock_initializer _LIBC_LOCK_RECURSIVE_INITIALIZER + +#define _IO_lock_init(_name) __libc_lock_init_recursive (_name) +#define _IO_lock_fini(_name) __libc_lock_fini_recursive (_name) +#define _IO_lock_lock(_name) __libc_lock_lock_recursive (_name) +#define _IO_lock_trylock(_name) __libc_lock_trylock_recursive (_name) +#define _IO_lock_unlock(_name) __libc_lock_unlock_recursive (_name) + + +#define _IO_cleanup_region_start(_fct, _fp) \ + __libc_cleanup_region_start (((_fp)->_flags & _IO_USER_LOCK) == 0, _fct, _fp) +#define _IO_cleanup_region_start_noarg(_fct) \ + __libc_cleanup_region_start (1, _fct, NULL) +#define _IO_cleanup_region_end(_doit) \ + __libc_cleanup_region_end (_doit) + +#if defined _LIBC && IS_IN (libc) + +# define _IO_acquire_lock(_fp) \ + do { \ + _IO_cleanup_region_start((void (*) (void *)) &_IO_funlockfile, _fp); \ + _IO_flockfile (_fp); +# define _IO_release_lock(_fp) \ + _IO_funlockfile (_fp); \ + _IO_cleanup_region_end (0); \ + } while (0) + +#endif + +#endif /* stdio-lock.h */ From patchwork Sun Jun 14 16:57:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1308990 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49lLJS2lyxz9sRK for ; Mon, 15 Jun 2020 02:58:32 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0B5D4395C85D; Sun, 14 Jun 2020 16:58:08 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from hera.aquilenet.fr (hera.aquilenet.fr [IPv6:2a0c:e300::1]) by sourceware.org (Postfix) with ESMTPS id A9DE3395C800 for ; Sun, 14 Jun 2020 16:58:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A9DE3395C800 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=samuel.thibault@ens-lyon.org Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id E296D33DC; Sun, 14 Jun 2020 18:58:03 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vsmPYQvHRdhL; Sun, 14 Jun 2020 18:58:01 +0200 (CEST) Received: from function.home (unknown [IPv6:2a01:cb19:956:1b00:9eb6:d0ff:fe88:c3c7]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 2D1C233CB; Sun, 14 Jun 2020 18:57:58 +0200 (CEST) Received: from samy by function.home with local (Exim 4.94) (envelope-from ) id 1jkVxF-00HRMK-7H; Sun, 14 Jun 2020 18:57:57 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Subject: [hurd, commited 5/6] hurd: Make write and pwrite64 cancellation points Date: Sun, 14 Jun 2020 18:57:56 +0200 Message-Id: <20200614165757.4156687-6-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200614165757.4156687-1-samuel.thibault@ens-lyon.org> References: <20200614165757.4156687-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: commit-hurd@gnu.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" and add _nocancel variants. * sysdeps/mach/hurd/write.c (__libc_write): Call __write_nocancel surrounded by enabling async cancel, to replace implementation moved to... * sysdeps/mach/hurd/write_nocancel.c (__write_nocancel): ... here. * sysdeps/mach/hurd/pwrite64.c (__libc_pwrite64): Call __pwrite64_nocancel surrounded by enabling async cancel, to replace implementation moved to... * sysdeps/mach/hurd/pwrite64_nocancel.c (__pwrite64_nocancel): ... here. * sysdeps/mach/hurd/Makefile (sysdep_routines): Add write_nocancel and pwrite64_nocancel. * sysdeps/mach/hurd/not-cancel.h (__write_nocancel, __pwrite64_nocancel): Replace macros with prototypes with a hidden proto on libc. * sysdeps/mach/hurd/dl-sysdep.c (__write_nocancel): New alias, check that it is not hidden. * sysdeps/mach/hurd/Versions (libc.GLIBC_PRIVATE): Add __write_nocancel. (ld.GLIBC_PRIVATE): Add __write_nocancel. * sysdeps/mach/hurd/i386/localplt.data (__write_nocancel): Add reference. --- sysdeps/mach/hurd/Makefile | 2 +- sysdeps/mach/hurd/Versions | 2 ++ sysdeps/mach/hurd/dl-sysdep.c | 2 ++ sysdeps/mach/hurd/i386/localplt.data | 3 ++- sysdeps/mach/hurd/not-cancel.h | 10 ++++++-- sysdeps/mach/hurd/pwrite64.c | 16 ++++++------ sysdeps/mach/hurd/pwrite64_nocancel.c | 35 +++++++++++++++++++++++++++ sysdeps/mach/hurd/write.c | 13 +++++----- sysdeps/mach/hurd/write_nocancel.c | 30 +++++++++++++++++++++++ 9 files changed, 94 insertions(+), 19 deletions(-) create mode 100644 sysdeps/mach/hurd/pwrite64_nocancel.c create mode 100644 sysdeps/mach/hurd/write_nocancel.c diff --git a/sysdeps/mach/hurd/Makefile b/sysdeps/mach/hurd/Makefile index bf741058f5..8b74d3f002 100644 --- a/sysdeps/mach/hurd/Makefile +++ b/sysdeps/mach/hurd/Makefile @@ -197,7 +197,7 @@ endif ifeq (io, $(subdir)) sysdep_routines += f_setlk close_nocancel_nostatus read_nocancel \ - pread64_nocancel + pread64_nocancel write_nocancel pwrite64_nocancel endif ifeq ($(subdir),sunrpc) diff --git a/sysdeps/mach/hurd/Versions b/sysdeps/mach/hurd/Versions index ce873f33f6..d93ad1264e 100644 --- a/sysdeps/mach/hurd/Versions +++ b/sysdeps/mach/hurd/Versions @@ -11,6 +11,7 @@ libc { # Functions shared with the dynamic linker __access; __access_noerrno; __libc_read; __libc_write; __libc_lseek64; __read_nocancel; __pread64_nocancel; + __write_nocancel; __libc_lock_self0; __getcwd; _dl_init_first; @@ -51,6 +52,7 @@ ld { # functions that must be shared with libc __access; __access_noerrno; __libc_read; __libc_write; __libc_lseek64; __read_nocancel; __pread64_nocancel; + __write_nocancel; __libc_lock_self0; __getcwd; } } diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c index 1626cd5928..a4eab4c08e 100644 --- a/sysdeps/mach/hurd/dl-sysdep.c +++ b/sysdeps/mach/hurd/dl-sysdep.c @@ -396,6 +396,7 @@ libc_hidden_weak (__read) weak_alias (__read, __read_nocancel) check_no_hidden(__write); +check_no_hidden(__write_nocancel); __ssize_t weak_function __write (int fd, const void *buf, size_t nbytes) { @@ -411,6 +412,7 @@ __write (int fd, const void *buf, size_t nbytes) return nwrote; } libc_hidden_weak (__write) + weak_alias (__write, __write_nocancel) /* This is only used for printing messages (see dl-misc.c). */ check_no_hidden(__writev); diff --git a/sysdeps/mach/hurd/i386/localplt.data b/sysdeps/mach/hurd/i386/localplt.data index c9f3ca66f9..66478dee7a 100644 --- a/sysdeps/mach/hurd/i386/localplt.data +++ b/sysdeps/mach/hurd/i386/localplt.data @@ -23,7 +23,8 @@ ld.so: __read ? ld.so: __read_nocancel ld.so: __pread64 ld.so: __pread64_nocancel -ld.so: __write +ld.so: __write ? +ld.so: __write_nocancel ld.so: __writev ld.so: __libc_lseek64 ld.so: __mmap diff --git a/sysdeps/mach/hurd/not-cancel.h b/sysdeps/mach/hurd/not-cancel.h index 8a8f5a9d3c..d2c3e20019 100644 --- a/sysdeps/mach/hurd/not-cancel.h +++ b/sysdeps/mach/hurd/not-cancel.h @@ -48,8 +48,12 @@ __typeof (__read) __read_nocancel; /* Non cancellable pread syscall (LFS version). */ __typeof (__pread64) __pread64_nocancel; -#define __write_nocancel(fd, buf, n) \ - __write (fd, buf, n) +/* Non cancellable write syscall. */ +__typeof (__write) __write_nocancel; + +/* Non cancellable pwrite syscall (LFS version). */ +__typeof (__pwrite64) __pwrite64_nocancel; + #define __writev_nocancel_nostatus(fd, iov, n) \ (void) __writev (fd, iov, n) # define __waitpid_nocancel(pid, stat_loc, options) \ @@ -60,6 +64,8 @@ __typeof (__pread64) __pread64_nocancel; #if IS_IN (libc) hidden_proto (__read_nocancel) hidden_proto (__pread64_nocancel) +hidden_proto (__write_nocancel) +hidden_proto (__pwrite64_nocancel) hidden_proto (__close_nocancel_nostatus) #endif diff --git a/sysdeps/mach/hurd/pwrite64.c b/sysdeps/mach/hurd/pwrite64.c index d4f3a83982..961b231394 100644 --- a/sysdeps/mach/hurd/pwrite64.c +++ b/sysdeps/mach/hurd/pwrite64.c @@ -17,19 +17,17 @@ License along with the GNU C Library; if not, see . */ -#include -#include -#include +#include +#include ssize_t __libc_pwrite64 (int fd, const void *buf, size_t nbytes, off64_t offset) { - error_t err; - if (offset < 0) - err = EINVAL; - else - err = HURD_FD_USE (fd, _hurd_fd_write (descriptor, buf, &nbytes, offset)); - return err ? __hurd_dfail (fd, err) : nbytes; + ssize_t ret; + int cancel_oldtype = LIBC_CANCEL_ASYNC(); + ret = __pwrite64_nocancel (fd, buf, nbytes, offset); + LIBC_CANCEL_RESET (cancel_oldtype); + return ret; } #ifndef __libc_pwrite64 diff --git a/sysdeps/mach/hurd/pwrite64_nocancel.c b/sysdeps/mach/hurd/pwrite64_nocancel.c new file mode 100644 index 0000000000..f6bdbbe0b1 --- /dev/null +++ b/sysdeps/mach/hurd/pwrite64_nocancel.c @@ -0,0 +1,35 @@ +/* Write block to given position in file without changing file pointer. + Hurd version. + Copyright (C) 2001-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include +#include + +ssize_t +__pwrite64_nocancel (int fd, const void *buf, size_t nbytes, off64_t offset) +{ + error_t err; + if (offset < 0) + err = EINVAL; + else + err = HURD_FD_USE (fd, _hurd_fd_write (descriptor, buf, &nbytes, offset)); + return err ? __hurd_dfail (fd, err) : nbytes; +} +libc_hidden_weak (__pwrite64_nocancel) diff --git a/sysdeps/mach/hurd/write.c b/sysdeps/mach/hurd/write.c index 9e1ade8801..0eea22be4b 100644 --- a/sysdeps/mach/hurd/write.c +++ b/sysdeps/mach/hurd/write.c @@ -15,16 +15,17 @@ License along with the GNU C Library; if not, see . */ -#include -#include -#include +#include +#include ssize_t __libc_write (int fd, const void *buf, size_t nbytes) { - error_t err = HURD_FD_USE (fd, _hurd_fd_write (descriptor, - buf, &nbytes, -1)); - return err ? __hurd_dfail (fd, err) : nbytes; + ssize_t ret; + int cancel_oldtype = LIBC_CANCEL_ASYNC(); + ret = __write_nocancel (fd, buf, nbytes); + LIBC_CANCEL_RESET (cancel_oldtype); + return ret; } libc_hidden_def (__libc_write) weak_alias (__libc_write, __write) diff --git a/sysdeps/mach/hurd/write_nocancel.c b/sysdeps/mach/hurd/write_nocancel.c new file mode 100644 index 0000000000..ab11c9cdd1 --- /dev/null +++ b/sysdeps/mach/hurd/write_nocancel.c @@ -0,0 +1,30 @@ +/* Copyright (C) 1991-2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include +#include + +ssize_t +__write_nocancel (int fd, const void *buf, size_t nbytes) +{ + error_t err = HURD_FD_USE (fd, _hurd_fd_write (descriptor, + buf, &nbytes, -1)); + return err ? __hurd_dfail (fd, err) : nbytes; +} +libc_hidden_weak (__write_nocancel) From patchwork Sun Jun 14 16:57:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1308989 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49lLJN2jmZz9sRk for ; Mon, 15 Jun 2020 02:58:28 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9F512395C83A; Sun, 14 Jun 2020 16:58:07 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from hera.aquilenet.fr (hera.aquilenet.fr [IPv6:2a0c:e300::1]) by sourceware.org (Postfix) with ESMTPS id EFA33395C82B for ; Sun, 14 Jun 2020 16:58:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EFA33395C82B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=samuel.thibault@ens-lyon.org Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 30DCB33CB; Sun, 14 Jun 2020 18:58:04 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AI4m4grbWUME; Sun, 14 Jun 2020 18:58:03 +0200 (CEST) Received: from function.home (unknown [IPv6:2a01:cb19:956:1b00:9eb6:d0ff:fe88:c3c7]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 4EFD233EA; Sun, 14 Jun 2020 18:57:59 +0200 (CEST) Received: from samy by function.home with local (Exim 4.94) (envelope-from ) id 1jkVxF-00HRMM-8V; Sun, 14 Jun 2020 18:57:57 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Subject: [hurd,commited 6/6] htl: Enable more cancellation tests Date: Sun, 14 Jun 2020 18:57:57 +0200 Message-Id: <20200614165757.4156687-7-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200614165757.4156687-1-samuel.thibault@ens-lyon.org> References: <20200614165757.4156687-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: commit-hurd@gnu.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" * nptl/tst-cancel-self-cancelstate.c, tst-cancel-self.c, tst-cancel9.c, tst-cancelx9.c: Move to... * sysdeps/pthread: ... here. * nptl/Makefile: Move corresponding references and rules to... * sysdeps/pthread/Makefile: ... here. --- nptl/Makefile | 3 +-- sysdeps/pthread/Makefile | 8 +++++--- {nptl => sysdeps/pthread}/tst-cancel-self-cancelstate.c | 0 {nptl => sysdeps/pthread}/tst-cancel-self.c | 0 {nptl => sysdeps/pthread}/tst-cancel9.c | 0 {nptl => sysdeps/pthread}/tst-cancelx9.c | 0 6 files changed, 6 insertions(+), 5 deletions(-) rename {nptl => sysdeps/pthread}/tst-cancel-self-cancelstate.c (100%) rename {nptl => sysdeps/pthread}/tst-cancel-self.c (100%) rename {nptl => sysdeps/pthread}/tst-cancel9.c (100%) rename {nptl => sysdeps/pthread}/tst-cancelx9.c (100%) diff --git a/nptl/Makefile b/nptl/Makefile index c431ead1c0..3356f2aa11 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -278,9 +278,8 @@ tests = tst-attr2 tst-attr3 tst-default-attr \ tst-sem17 \ tst-tsd3 tst-tsd4 \ tst-cancel4 tst-cancel4_1 tst-cancel4_2 tst-cancel5 \ - tst-cancel7 tst-cancel9 tst-cancel13 \ + tst-cancel7 tst-cancel13 \ tst-cancel16 tst-cancel17 tst-cancel20 tst-cancel24 \ - tst-cancel-self tst-cancel-self-cancelstate \ tst-cleanup4 \ tst-signal3 \ tst-exec4 tst-exec5 \ diff --git a/sysdeps/pthread/Makefile b/sysdeps/pthread/Makefile index a8e83d9d16..c9ba6f8f12 100644 --- a/sysdeps/pthread/Makefile +++ b/sysdeps/pthread/Makefile @@ -51,9 +51,10 @@ tests += tst-cnd-basic tst-mtx-trylock tst-cnd-broadcast \ tst-barrier1 tst-barrier2 tst-barrier3 tst-barrier4 \ tst-basic1 tst-basic2 tst-basic3 tst-basic4 tst-basic5 tst-basic6 \ tst-basic7 \ + tst-cancel-self tst-cancel-self-cancelstate \ tst-cancel-self-canceltype tst-cancel-self-testcancel \ tst-cancel1 tst-cancel2 tst-cancel3 \ - tst-cancel6 tst-cancel8 tst-cancel10 tst-cancel11 \ + tst-cancel6 tst-cancel8 tst-cancel9 tst-cancel10 tst-cancel11 \ tst-cancel12 tst-cancel14 tst-cancel15 tst-cancel18 tst-cancel19 \ tst-cancel21 \ tst-cancel22 tst-cancel23 tst-cancel26 tst-cancel27 tst-cancel28 \ @@ -115,8 +116,8 @@ tests-nolibpthread = tst-unload CFLAGS-tst-cleanup2.c += -fno-builtin CFLAGS-tst-cleanupx2.c += -fno-builtin -tests += tst-cancelx2 tst-cancelx3 tst-cancelx6 tst-cancelx8 tst-cancelx10 \ - tst-cancelx11 tst-cancelx12 tst-cancelx14 tst-cancelx15 \ +tests += tst-cancelx2 tst-cancelx3 tst-cancelx6 tst-cancelx8 tst-cancelx9 \ + tst-cancelx10 tst-cancelx11 tst-cancelx12 tst-cancelx14 tst-cancelx15 \ tst-cancelx18 tst-cancelx21 \ tst-cleanupx0 tst-cleanupx1 tst-cleanupx2 tst-cleanupx3 @@ -155,6 +156,7 @@ CFLAGS-tst-cancelx2.c += -fexceptions CFLAGS-tst-cancelx3.c += -fexceptions CFLAGS-tst-cancelx6.c += -fexceptions CFLAGS-tst-cancelx8.c += -fexceptions +CFLAGS-tst-cancelx9.c += -fexceptions CFLAGS-tst-cancelx10.c += -fexceptions CFLAGS-tst-cancelx11.c += -fexceptions CFLAGS-tst-cancelx12.c += -fexceptions diff --git a/nptl/tst-cancel-self-cancelstate.c b/sysdeps/pthread/tst-cancel-self-cancelstate.c similarity index 100% rename from nptl/tst-cancel-self-cancelstate.c rename to sysdeps/pthread/tst-cancel-self-cancelstate.c diff --git a/nptl/tst-cancel-self.c b/sysdeps/pthread/tst-cancel-self.c similarity index 100% rename from nptl/tst-cancel-self.c rename to sysdeps/pthread/tst-cancel-self.c diff --git a/nptl/tst-cancel9.c b/sysdeps/pthread/tst-cancel9.c similarity index 100% rename from nptl/tst-cancel9.c rename to sysdeps/pthread/tst-cancel9.c diff --git a/nptl/tst-cancelx9.c b/sysdeps/pthread/tst-cancelx9.c similarity index 100% rename from nptl/tst-cancelx9.c rename to sysdeps/pthread/tst-cancelx9.c