public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org
Subject: [PATCH 7/8] support: Add xpthread_kill
Date: Tue,  2 Feb 2021 12:11:33 -0300	[thread overview]
Message-ID: <20210202151134.2123748-7-adhemerval.zanella@linaro.org> (raw)
In-Reply-To: <20210202151134.2123748-1-adhemerval.zanella@linaro.org>

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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <signal.h>
+#include <support/xthread.h>
+
+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
-- 
2.25.1


  parent reply	other threads:[~2021-02-02 15:11 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02 15:11 [PATCH 1/8] posix: Consolidate register-atfork Adhemerval Zanella
2021-02-02 15:11 ` [PATCH 2/8] linux: Use __libc_single_threaded on fork Adhemerval Zanella
2021-02-02 15:15   ` Andreas Schwab
2021-02-02 16:40     ` Adhemerval Zanella
2021-02-02 15:11 ` [PATCH 3/8] posix: Consolidate fork implementation Adhemerval Zanella
2021-03-09 10:58   ` Florian Weimer
2021-03-10 17:07     ` Adhemerval Zanella
2021-03-11 13:56   ` Andreas Schwab
2021-03-11 13:59     ` Adhemerval Zanella
2021-02-02 15:11 ` [PATCH 4/8] nptl: Move fork into libc Adhemerval Zanella
2021-03-08 13:42   ` Florian Weimer
2021-03-10 17:08     ` Adhemerval Zanella
2021-02-02 15:11 ` [PATCH 5/8] posix: Do not clobber errno by atfork handlers Adhemerval Zanella
2021-03-09 11:01   ` Florian Weimer
2021-03-10 20:10     ` Adhemerval Zanella
2021-03-11 13:25       ` Florian Weimer
2021-03-11 14:07         ` Adhemerval Zanella
2021-03-11 14:22           ` Andreas Schwab
2021-03-11 14:25             ` Florian Weimer
2021-03-11 15:29               ` Adhemerval Zanella
2021-03-11 15:32                 ` Florian Weimer
2021-03-11 17:25                   ` Adhemerval Zanella
2021-03-11 19:23                     ` Florian Weimer
2021-03-11 19:30                       ` Adhemerval Zanella
2021-02-02 15:11 ` [PATCH 6/8] Consolidate pthread_atfork Adhemerval Zanella
2021-03-09 11:09   ` Florian Weimer
2021-03-10 20:15     ` Adhemerval Zanella
2021-02-02 15:11 ` Adhemerval Zanella [this message]
2021-03-08 12:13   ` [PATCH 7/8] support: Add xpthread_kill Florian Weimer
2021-02-02 15:11 ` [PATCH 8/8] posix: Add _Fork [BZ #4737] Adhemerval Zanella
2021-02-02 15:48   ` Andreas Schwab
2021-02-02 18:22   ` Joseph Myers
2021-02-11 15:26   ` [PATCH v2] " Adhemerval Zanella
2021-02-11 16:21     ` Andreas Schwab
2021-02-11 17:10       ` Adhemerval Zanella
2021-02-11 17:33         ` Andreas Schwab
2021-02-11 17:36           ` Adhemerval Zanella
2021-03-08 13:04 ` [PATCH 1/8] posix: Consolidate register-atfork Florian Weimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210202151134.2123748-7-adhemerval.zanella@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).