]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
support: Add xpthread_kill
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 20 Jan 2021 17:32:23 +0000 (14:32 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 12 Mar 2021 13:20:18 +0000 (10:20 -0300)
Checked on x86_64-linux-gnu.

support/Makefile
support/xpthread_kill.c [new file with mode: 0644]
support/xthread.h

index 5904cdd412cf0bddf866ce5d2cd6fc1b168a4ee9..fc9f4936a86cebe976efa83af511ca024c32a773 100644 (file)
@@ -141,6 +141,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 (file)
index 0000000..111a75d
--- /dev/null
@@ -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));
+}
index c2086db3475e120e686a607afaae15e47f0671fb..1ba3f133adbfd47946f2ca068781895c22a773a3 100644 (file)
@@ -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