From patchwork Tue Feb 2 15:11:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41904 X-Patchwork-Delegate: azanella@linux.vnet.ibm.com 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 BB5A1398B175; Tue, 2 Feb 2021 15:11:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB5A1398B175 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1612278713; bh=MnM6LasVyPaVfXPFpElGRPYj1AR1IEZLXUoC1jNqnWA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=TdqskhBUsPar1aj91p20m8fyQGMcRPNtO097Jk7UHxkoYBqA2FPv9tXgD9K54EU2S rTuA+rHIYwsfXzuiaivrfh0wNCg2oMIXabaWU+d/d9iHBV5O3Rlv+NLSOYIU2bfiaH 4+TkHa6u/AxLj/EzO/XRCNf+YXvt0GzSj6SToSR0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) by sourceware.org (Postfix) with ESMTPS id D1F41398B169 for ; Tue, 2 Feb 2021 15:11:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D1F41398B169 Received: by mail-qv1-xf2a.google.com with SMTP id a1so9981701qvd.13 for ; Tue, 02 Feb 2021 07:11:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MnM6LasVyPaVfXPFpElGRPYj1AR1IEZLXUoC1jNqnWA=; b=OSkpa2tyg2G9x/ZL/pR+22FMVYdMoromZ1qC9ctJs9R05NypmG0Q1+NVDyAihBxFdU h11Q4JnNba8ewK1VVjXEFvMuIVajRISEZ3tSlrG4/fz3jiQyVohMK15oxnn8sQN4w5vN BW70wtrpjk+2k7xy3Bk6Lvutr+Hv7ehYiaoAM5HV50rlg+8Mnct4SNEy8g1ubR5neiFg +wpSSUhGZToCY8y2k8Q09lGrh4STkDxJ5HVFaJ2j/l5p/iC+1X68gvZEQT4bjmE6Dh6r AHGM3LMtui6hQXpkcVGsOetj06JA6DsOu7tco5XQ7r+WuOzQccFhTEbCV49pAoRre7qJ pZxg== X-Gm-Message-State: AOAM530/M9pqmUBDpeEmAZxFDAX3F+kQ3LRVMWPQ7iYyx0rnSOkDXX78 IW9j/0Gd8B1hIPZcubQ6uOY4QW3FX+FLWw== X-Google-Smtp-Source: ABdhPJwwwN7T6RSd9k0lnvTr319UHhEw/UxwbO1hdzTAiyM7KXYQ+dLWiJPltAI0D7poTUvipQLu7Q== X-Received: by 2002:ad4:48c8:: with SMTP id v8mr20395426qvx.38.1612278710305; Tue, 02 Feb 2021 07:11:50 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id z20sm16617267qki.93.2021.02.02.07.11.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 07:11:49 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 7/8] support: Add xpthread_kill Date: Tue, 2 Feb 2021 12:11:33 -0300 Message-Id: <20210202151134.2123748-7-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210202151134.2123748-1-adhemerval.zanella@linaro.org> References: <20210202151134.2123748-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked on x86_64-linux-gnu. --- support/Makefile | 1 + support/xpthread_kill.c | 26 ++++++++++++++++++++++++++ support/xthread.h | 2 ++ 3 files changed, 29 insertions(+) create mode 100644 support/xpthread_kill.c diff --git a/support/Makefile b/support/Makefile index bb9889efb4..112befe272 100644 --- a/support/Makefile +++ b/support/Makefile @@ -139,6 +139,7 @@ libsupport-routines = \ xpthread_join \ xpthread_key_create \ xpthread_key_delete \ + xpthread_kill \ xpthread_mutex_consistent \ xpthread_mutex_destroy \ xpthread_mutex_init \ diff --git a/support/xpthread_kill.c b/support/xpthread_kill.c new file mode 100644 index 0000000000..111a75d85e --- /dev/null +++ b/support/xpthread_kill.c @@ -0,0 +1,26 @@ +/* pthread_kill with error checking. + Copyright (C) 2021 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 + +void +xpthread_kill (pthread_t thr, int signo) +{ + xpthread_check_return ("pthread_kill", pthread_kill (thr, signo)); +} diff --git a/support/xthread.h b/support/xthread.h index c2086db347..1ba3f133ad 100644 --- a/support/xthread.h +++ b/support/xthread.h @@ -75,6 +75,8 @@ void xpthread_attr_setstacksize (pthread_attr_t *attr, void xpthread_attr_setguardsize (pthread_attr_t *attr, size_t guardsize); +void xpthread_kill (pthread_t thr, int signo); + /* Return the stack size used on support_set_small_thread_stack_size. */ size_t support_small_thread_stack_size (void); /* Set the stack size in ATTR to a small value, but still large enough