aboutsummaryrefslogtreecommitdiff
path: root/nptl
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-05-11 11:08:00 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-05-11 11:10:03 +0200
commit249bd833a08e2689e28ff9a094730f0b048a8442 (patch)
tree2106800f8ef1cfc6bfb73e7391400b7cb2b06ae2 /nptl
parentd2af73a348c4a230792d190c774a431fe5c31515 (diff)
downloadglibc-249bd833a08e2689e28ff9a094730f0b048a8442.zip
glibc-249bd833a08e2689e28ff9a094730f0b048a8442.tar.gz
glibc-249bd833a08e2689e28ff9a094730f0b048a8442.tar.bz2
nptl: Move pthread_setattr_default_np into libc
The symbol was moved using scripts/move-symbol-to-libc.py. The export of __default_pthread_attr_freeres is temporary. There is a minor regression in freeres coverage because in the dynamic case, __default_pthread_attr_freeres is no longer called if libpthread is not linked in. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'nptl')
-rw-r--r--nptl/Makefile2
-rw-r--r--nptl/Versions8
-rw-r--r--nptl/pthreadP.h2
-rw-r--r--nptl/pthread_setattr_default_np.c10
4 files changed, 16 insertions, 6 deletions
diff --git a/nptl/Makefile b/nptl/Makefile
index 7b3c56f..2ef09fb 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -145,6 +145,7 @@ routines = \
pthread_rwlockattr_setkind_np \
pthread_rwlockattr_setpshared \
pthread_self \
+ pthread_setattr_default_np \
pthread_setcancelstate \
pthread_setcanceltype \
pthread_setschedparam \
@@ -203,7 +204,6 @@ libpthread-routines = \
pthread_join \
pthread_join_common \
pthread_setaffinity \
- pthread_setattr_default_np \
pthread_setconcurrency \
pthread_setname \
pthread_setschedprio \
diff --git a/nptl/Versions b/nptl/Versions
index 4c1c4ee..de025e1 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -167,6 +167,9 @@ libc {
pthread_mutexattr_getrobust;
pthread_mutexattr_setrobust;
}
+ GLIBC_2.18 {
+ pthread_setattr_default_np;
+ }
# C11 thread symbols.
GLIBC_2.28 {
call_once;
@@ -230,8 +233,8 @@ libc {
pthread_barrier_wait;
pthread_barrierattr_destroy;
pthread_barrierattr_getpshared;
- pthread_barrierattr_setpshared;
pthread_barrierattr_init;
+ pthread_barrierattr_setpshared;
pthread_cond_clockwait;
pthread_condattr_getclock;
pthread_condattr_getpshared;
@@ -273,6 +276,7 @@ libc {
pthread_rwlockattr_init;
pthread_rwlockattr_setkind_np;
pthread_rwlockattr_setpshared;
+ pthread_setattr_default_np;
pthread_setspecific;
pthread_spin_destroy;
pthread_spin_init;
@@ -299,6 +303,7 @@ libc {
}
GLIBC_PRIVATE {
__default_pthread_attr;
+ __default_pthread_attr_freeres;
__default_pthread_attr_lock;
__futex_abstimed_wait64;
__futex_abstimed_wait_cancelable64;
@@ -436,7 +441,6 @@ libpthread {
GLIBC_2.18 {
pthread_getattr_default_np;
- pthread_setattr_default_np;
}
# C11 thread symbols.
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index d9a6137..8466332 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -203,7 +203,7 @@ libc_hidden_proto (__default_pthread_attr)
extern int __default_pthread_attr_lock;
libc_hidden_proto (__default_pthread_attr_lock)
/* Called from __libc_freeres to deallocate the default attribute. */
-extern void __default_pthread_attr_freeres (void) attribute_hidden;
+extern void __default_pthread_attr_freeres (void);
/* Size and alignment of static TLS block. */
extern size_t __static_tls_size attribute_hidden;
diff --git a/nptl/pthread_setattr_default_np.c b/nptl/pthread_setattr_default_np.c
index fcf1873..bfdb93b 100644
--- a/nptl/pthread_setattr_default_np.c
+++ b/nptl/pthread_setattr_default_np.c
@@ -20,10 +20,10 @@
#include <stdlib.h>
#include <pthreadP.h>
#include <string.h>
-
+#include <shlib-compat.h>
int
-pthread_setattr_default_np (const pthread_attr_t *in)
+__pthread_setattr_default_np (const pthread_attr_t *in)
{
const struct pthread_attr *real_in;
int ret;
@@ -81,6 +81,12 @@ pthread_setattr_default_np (const pthread_attr_t *in)
lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
return ret;
}
+versioned_symbol (libc, __pthread_setattr_default_np,
+ pthread_setattr_default_np, GLIBC_2_34);
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_18, GLIBC_2_34)
+compat_symbol (libc, __pthread_setattr_default_np,
+ pthread_setattr_default_np, GLIBC_2_18);
+#endif
/* This is placed in the same file as pthread_setattr_default_np
because only this function can trigger allocation of attribute