aboutsummaryrefslogtreecommitdiff
path: root/nptl
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-04-23 09:48:36 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-04-23 09:51:57 +0200
commit1ec4cd5ab42d6b16a81176b7051384a2221159e3 (patch)
tree0e3258f9d5151dab707ac94ad5bc443ae0bea183 /nptl
parent0bdd79794526114313135c528969bb25be88c1a3 (diff)
downloadglibc-1ec4cd5ab42d6b16a81176b7051384a2221159e3.tar
glibc-1ec4cd5ab42d6b16a81176b7051384a2221159e3.tar.gz
glibc-1ec4cd5ab42d6b16a81176b7051384a2221159e3.tar.bz2
glibc-1ec4cd5ab42d6b16a81176b7051384a2221159e3.zip
nptl: Move pthread_mutexattr_setrobust into libc
And pthread_mutexattr_getrobust_np as a compat symbol. The symbols were moved using scripts/move-symbol-to-libc.py.
Diffstat (limited to 'nptl')
-rw-r--r--nptl/Makefile2
-rw-r--r--nptl/Versions6
-rw-r--r--nptl/libpthread-compat.c5
-rw-r--r--nptl/pthread_mutexattr_setrobust.c17
4 files changed, 24 insertions, 6 deletions
diff --git a/nptl/Makefile b/nptl/Makefile
index 1565beb84f..27588a87dd 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -113,6 +113,7 @@ routines = \
pthread_mutexattr_setprioceiling \
pthread_mutexattr_setprotocol \
pthread_mutexattr_setpshared \
+ pthread_mutexattr_setrobust \
pthread_once \
pthread_rwlock_rdlock \
pthread_rwlock_unlock \
@@ -172,7 +173,6 @@ libpthread-routines = \
pthread_getname \
pthread_join \
pthread_join_common \
- pthread_mutexattr_setrobust \
pthread_mutexattr_settype \
pthread_rwlock_clockrdlock \
pthread_rwlock_clockwrlock \
diff --git a/nptl/Versions b/nptl/Versions
index e2909143e7..97eb60548d 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -105,10 +105,12 @@ libc {
pthread_mutexattr_getrobust_np;
pthread_mutexattr_setprioceiling;
pthread_mutexattr_setprotocol;
+ pthread_mutexattr_setrobust_np;
}
GLIBC_2.12 {
pthread_mutex_consistent;
pthread_mutexattr_getrobust;
+ pthread_mutexattr_setrobust;
}
# C11 thread symbols.
GLIBC_2.28 {
@@ -158,6 +160,7 @@ libc {
pthread_mutexattr_setprioceiling;
pthread_mutexattr_setprotocol;
pthread_mutexattr_setpshared;
+ pthread_mutexattr_setrobust;
pthread_once;
pthread_rwlock_rdlock;
pthread_rwlock_unlock;
@@ -342,7 +345,7 @@ libpthread {
}
GLIBC_2.4 {
- pthread_mutexattr_setrobust_np;
+ __libpthread_version_placeholder;
};
GLIBC_2.11 {
@@ -351,7 +354,6 @@ libpthread {
GLIBC_2.12 {
pthread_getname_np;
- pthread_mutexattr_setrobust;
pthread_setname_np;
};
diff --git a/nptl/libpthread-compat.c b/nptl/libpthread-compat.c
index 359a38173d..761ca8d41c 100644
--- a/nptl/libpthread-compat.c
+++ b/nptl/libpthread-compat.c
@@ -55,3 +55,8 @@ compat_symbol (libpthread, __libpthread_version_placeholder_1,
compat_symbol (libpthread, __libpthread_version_placeholder_1,
__libpthread_version_placeholder, GLIBC_2_3_2);
#endif
+
+#if (SHLIB_COMPAT (libpthread, GLIBC_2_4, GLIBC_2_5))
+compat_symbol (libpthread, __libpthread_version_placeholder_1,
+ __libpthread_version_placeholder, GLIBC_2_4);
+#endif
diff --git a/nptl/pthread_mutexattr_setrobust.c b/nptl/pthread_mutexattr_setrobust.c
index 1b39ded7c2..a7b119244d 100644
--- a/nptl/pthread_mutexattr_setrobust.c
+++ b/nptl/pthread_mutexattr_setrobust.c
@@ -18,10 +18,10 @@
#include <errno.h>
#include <pthreadP.h>
-
+#include <shlib-compat.h>
int
-pthread_mutexattr_setrobust (pthread_mutexattr_t *attr, int robustness)
+__pthread_mutexattr_setrobust (pthread_mutexattr_t *attr, int robustness)
{
if (robustness != PTHREAD_MUTEX_STALLED_NP
&& __builtin_expect (robustness != PTHREAD_MUTEX_ROBUST_NP, 0))
@@ -38,4 +38,15 @@ pthread_mutexattr_setrobust (pthread_mutexattr_t *attr, int robustness)
return 0;
}
-weak_alias (pthread_mutexattr_setrobust, pthread_mutexattr_setrobust_np)
+versioned_symbol (libc, __pthread_mutexattr_setrobust,
+ pthread_mutexattr_setrobust, GLIBC_2_34);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_4, GLIBC_2_34)
+compat_symbol (libpthread, __pthread_mutexattr_setrobust,
+ pthread_mutexattr_setrobust_np, GLIBC_2_4);
+#endif
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_34)
+compat_symbol (libpthread, __pthread_mutexattr_setrobust,
+ pthread_mutexattr_setrobust, GLIBC_2_12);
+#endif