diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2021-01-20 14:32:23 -0300 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2021-11-24 10:27:51 +0100 |
commit | a2539f5b1d4547389578ae08a952d984568f251e (patch) | |
tree | da72317171c8010177e80271c62d0d767269b930 | |
parent | 53c8f3f1255f4e45084476c9c23d63e99516ad3b (diff) | |
download | glibc-a2539f5b1d4547389578ae08a952d984568f251e.tar glibc-a2539f5b1d4547389578ae08a952d984568f251e.tar.gz glibc-a2539f5b1d4547389578ae08a952d984568f251e.tar.bz2 glibc-a2539f5b1d4547389578ae08a952d984568f251e.zip |
support: Add xpthread_kill
Checked on x86_64-linux-gnu.
(cherry picked from commit 0280b390fbd4c55a708985829d58a639475bbffb)
-rw-r--r-- | support/Makefile | 1 | ||||
-rw-r--r-- | support/xpthread_kill.c | 26 | ||||
-rw-r--r-- | support/xthread.h | 2 |
3 files changed, 29 insertions, 0 deletions
diff --git a/support/Makefile b/support/Makefile index 4154863511..3d3aff5ff9 100644 --- a/support/Makefile +++ b/support/Makefile @@ -135,6 +135,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 05f8d4a7d9..cb1fc30da0 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); + /* Set the stack size in ATTR to a small value, but still large enough to cover most internal glibc stack usage. */ void support_set_small_thread_stack_size (pthread_attr_t *attr); |