aboutsummaryrefslogtreecommitdiff
path: root/nptl
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-05-05 17:15:57 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-05-05 17:19:20 +0200
commit0197c1bc604e1d6357cfa07a75ab73bababa7f0f (patch)
tree3f620328ff2ee6ec68b296ee86d061067a6aa268 /nptl
parent7cbf1c8416b04c65dc3d253061d8a674ee3c616e (diff)
downloadglibc-0197c1bc604e1d6357cfa07a75ab73bababa7f0f.tar
glibc-0197c1bc604e1d6357cfa07a75ab73bababa7f0f.tar.gz
glibc-0197c1bc604e1d6357cfa07a75ab73bababa7f0f.tar.bz2
glibc-0197c1bc604e1d6357cfa07a75ab73bababa7f0f.zip
nptl: Move pthread_testcancel into libc
The symbol was moved using scripts/move-symbol-to-libc.py. A temporary __pthread_testcancel@@GLIBC_PRIVATE export is created because it is needed by the semaphore implementation. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'nptl')
-rw-r--r--nptl/Makefile2
-rw-r--r--nptl/Versions4
-rw-r--r--nptl/pthreadP.h2
-rw-r--r--nptl/pthread_testcancel.c14
4 files changed, 15 insertions, 7 deletions
diff --git a/nptl/Makefile b/nptl/Makefile
index 38f2715c2c..884cb69bb4 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -148,6 +148,7 @@ routines = \
pthread_spin_lock \
pthread_spin_trylock \
pthread_spin_unlock \
+ pthread_testcancel \
pthread_yield \
tpp \
unwind \
@@ -199,7 +200,6 @@ libpthread-routines = \
pthread_setname \
pthread_setschedprio \
pthread_sigqueue \
- pthread_testcancel \
pthread_timedjoin \
pthread_tryjoin \
sem_clockwait \
diff --git a/nptl/Versions b/nptl/Versions
index 0914630be3..ce09c73727 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -61,6 +61,7 @@ libc {
pthread_setschedparam;
pthread_setspecific;
pthread_sigmask;
+ pthread_testcancel;
}
GLIBC_2.1 {
pthread_attr_init;
@@ -245,6 +246,7 @@ libc {
pthread_spin_lock;
pthread_spin_trylock;
pthread_spin_unlock;
+ pthread_testcancel;
thrd_exit;
tss_create;
tss_delete;
@@ -284,6 +286,7 @@ libc {
__pthread_keys;
__pthread_mutex_unlock_usercnt;
__pthread_setcancelstate;
+ __pthread_testcancel;
__pthread_tpp_change_priority;
__pthread_unwind;
__sched_fifo_max_prio;
@@ -307,7 +310,6 @@ libpthread {
pthread_detach;
pthread_join;
pthread_sigmask;
- pthread_testcancel;
sem_destroy;
sem_getvalue;
sem_init;
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index 0ce63672c4..d480639740 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -570,6 +570,7 @@ libc_hidden_proto (__pthread_setcanceltype)
extern int __pthread_enable_asynccancel (void) attribute_hidden;
extern void __pthread_disable_asynccancel (int oldtype) attribute_hidden;
extern void __pthread_testcancel (void);
+libc_hidden_proto (__pthread_testcancel)
extern int __pthread_clockjoin_ex (pthread_t, void **, clockid_t,
const struct __timespec64 *, bool)
attribute_hidden;
@@ -579,7 +580,6 @@ libc_hidden_proto (__pthread_sigmask);
#if IS_IN (libpthread)
hidden_proto (__pthread_rwlock_unlock)
-hidden_proto (__pthread_testcancel)
#endif
extern int __pthread_cond_broadcast_2_0 (pthread_cond_2_0_t *cond);
diff --git a/nptl/pthread_testcancel.c b/nptl/pthread_testcancel.c
index 8ed2370afa..a9e941ddb7 100644
--- a/nptl/pthread_testcancel.c
+++ b/nptl/pthread_testcancel.c
@@ -18,12 +18,18 @@
#include <stdlib.h>
#include "pthreadP.h"
-
+#include <shlib-compat.h>
void
-__pthread_testcancel (void)
+___pthread_testcancel (void)
{
CANCELLATION_P (THREAD_SELF);
}
-strong_alias (__pthread_testcancel, pthread_testcancel)
-hidden_def (__pthread_testcancel)
+versioned_symbol (libc, ___pthread_testcancel, pthread_testcancel, GLIBC_2_34);
+versioned_symbol (libc, ___pthread_testcancel, __pthread_testcancel,
+ GLIBC_PRIVATE);
+libc_hidden_ver (___pthread_testcancel, __pthread_testcancel)
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_34)
+compat_symbol (libc, ___pthread_testcancel, pthread_testcancel, GLIBC_2_0);
+#endif