diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-09-19 00:16:48 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-09-19 00:16:48 +0200 |
commit | 8968cc85b696f305b8afe11c0a753ea1209f7abc (patch) | |
tree | ff19314b49a1741a245720c3739cfe50b5da4dfd | |
parent | 23412596845e219b242a763f333fa60954cad84b (diff) |
Fix pthread_kill and pthread_self visibility from raise
* pthreadP.h: New file.
* sysdeps/generic/pt-kill.c (pthread_kill): Rename to __pthread_kill.
pthread_kill: New strong alias.
* sysdeps/hurd/pt-kill.c: Likewise.
* sysdeps/generic/raise.c: Include <pthreadP.h> instead of <pthread.h>.
Make __pthread_kill and __pthread_self weak.
(raise): Use __pthread_kill and __pthread_self instead of pthread_kill
and pthread_self.
-rw-r--r-- | Versions | 1 | ||||
-rw-r--r-- | pthreadP.h | 26 | ||||
-rw-r--r-- | sysdeps/generic/pt-kill.c | 5 | ||||
-rw-r--r-- | sysdeps/generic/raise.c | 10 | ||||
-rw-r--r-- | sysdeps/hurd/pt-kill.c | 3 |
5 files changed, 37 insertions, 8 deletions
@@ -94,6 +94,7 @@ libpthread { __pthread_key_create; pthread_kill; + __pthread_kill; pthread_mutex_destroy; pthread_mutex_getprioceiling; pthread_mutex_init; pthread_mutex_lock; pthread_mutex_setprioceiling; diff --git a/pthreadP.h b/pthreadP.h new file mode 100644 index 0000000..f1fd625 --- /dev/null +++ b/pthreadP.h @@ -0,0 +1,26 @@ +/* Copyright (C) 2016 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 + <http://www.gnu.org/licenses/>. */ + +#ifndef _PTHREADP_H +#define _PTHREADP_H 1 + +#include <pthread.h> + +extern pthread_t __pthread_self (void); +extern int __pthread_kill (pthread_t threadid, int signo); + +#endif /* pthreadP.h */ diff --git a/sysdeps/generic/pt-kill.c b/sysdeps/generic/pt-kill.c index 0dfac34..fc83f93 100644 --- a/sysdeps/generic/pt-kill.c +++ b/sysdeps/generic/pt-kill.c @@ -18,10 +18,11 @@ License along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <pthreadP.h> #include "sig-internal.h" int -pthread_kill (pthread_t tid, int signo) +__pthread_kill (pthread_t tid, int signo) { siginfo_t si; memset (&si, 0, sizeof (si)); @@ -29,4 +30,4 @@ pthread_kill (pthread_t tid, int signo) return pthread_kill_siginfo_np (tid, si); } - +strong_alias (__pthread_kill, pthread_kill) diff --git a/sysdeps/generic/raise.c b/sysdeps/generic/raise.c index f086665..cc18b39 100644 --- a/sysdeps/generic/raise.c +++ b/sysdeps/generic/raise.c @@ -18,12 +18,12 @@ License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include <pthread.h> +#include <pthreadP.h> #include <signal.h> #include <unistd.h> -#pragma weak pthread_kill -#pragma weak pthread_self +#pragma weak __pthread_kill +#pragma weak __pthread_self int raise (int signo) { @@ -31,10 +31,10 @@ raise (int signo) "the effect of the raise() function shall be equivalent to calling: pthread_kill(pthread_self(), sig);" */ - if (pthread_kill) + if (__pthread_kill) { int err; - err = pthread_kill (pthread_self (), signo); + err = __pthread_kill (__pthread_self (), signo); if (err) { errno = err; diff --git a/sysdeps/hurd/pt-kill.c b/sysdeps/hurd/pt-kill.c index 49dfd7d..6aaf241 100644 --- a/sysdeps/hurd/pt-kill.c +++ b/sysdeps/hurd/pt-kill.c @@ -25,7 +25,7 @@ #include <pt-internal.h> int -pthread_kill (pthread_t thread, int sig) +__pthread_kill (pthread_t thread, int sig) { struct __pthread *pthread; struct hurd_signal_detail detail; @@ -49,3 +49,4 @@ pthread_kill (pthread_t thread, int sig) __spin_lock (&ss->lock); return _hurd_raise_signal (ss, sig, &detail); } +strong_alias (__pthread_kill, pthread_kill) |