From patchwork Thu Mar 11 19:52:09 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: 42466 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 99398389680B; Thu, 11 Mar 2021 19:52:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 99398389680B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1615492347; bh=VUID+1t4VGihecqJdK9bqr2QKG0S2ikb8YUS+mFJkKE=; 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=nZkglHlA1ZyB4qLFIw6A3OHYjUNCUqmQl8kQ4x+uN75xDWLSXmKuWtxXGE8LpTsST r/ypM+MZhHKstVOUdrtq2KCDQooq7XOLcEzY64V5ZWFFcCOCZRYIIpqFqYhbTpRX+M /Y97aFfdlCTVoGXLPpoEaCUM5FcTLeJDXcqYwd7g= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by sourceware.org (Postfix) with ESMTPS id B57513834411 for ; Thu, 11 Mar 2021 19:52:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B57513834411 Received: by mail-qk1-x729.google.com with SMTP id l132so21946413qke.7 for ; Thu, 11 Mar 2021 11:52:22 -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=VUID+1t4VGihecqJdK9bqr2QKG0S2ikb8YUS+mFJkKE=; b=XMZsV0KzxIg4MDCFhaOGkZWLeQupR+iMGi7OeqIXsIQLDlFzrc2aMJjnaxG4TXV+ZM gWJ4yn7ryU+hQi4l89GjjvqSTgVi8Jz9Ol7CKc8stDnXb2rMGq1GtCM/SFYy2HsLBwSw dfkTCylTyw3dkbdPvHUnupBhumZOnWqt+tMqaBa0GrluUkY4CrtsXpZ44jb+VuJWExtO rjdrfZ5vFqgdB8twuYCZ1nrI0pfG0Jp6YpeNwGxsdfs3fT+zty9Hy7IKeACX/TsC43g+ Bli19qEUNo9K0t890JULxrKYOPhvV+AMe/FDi3nKsqKyjJcR1ijtpJcDFPZ4xMmt1nq2 Oqag== X-Gm-Message-State: AOAM532tT8FWLUfBnIVXZr5sYKPD1ZyAg4/qOIZvbG1jea0BxKJfxMwF LCTAAwckVkJJxns0nWEr63wD7usF1VLOJfHj X-Google-Smtp-Source: ABdhPJybEeV3/90BUXxZVzTLPHadaVEXhEI5R7E+xFkpS7lo+VwXDYWxATmp/FPu2nw9StPyv1UTww== X-Received: by 2002:a05:620a:41:: with SMTP id t1mr9290293qkt.322.1615492342160; Thu, 11 Mar 2021 11:52:22 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id b16sm2266976qtx.85.2021.03.11.11.52.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 11:52:21 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v2 7/8] support: Add xpthread_kill Date: Thu, 11 Mar 2021 16:52:09 -0300 Message-Id: <20210311195210.3153729-7-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210311195210.3153729-1-adhemerval.zanella@linaro.org> References: <20210311195210.3153729-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 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 8d63fbd5da..b1d7976fab 100644 --- a/support/Makefile +++ b/support/Makefile @@ -140,6 +140,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