about summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-05-17 09:59:14 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-05-17 10:25:12 +0200
commit8bc6a6d73c7f9004bfa3e81a717300e6d39ac448 (patch)
tree313572811e475ce4c17c2cf5df127df6b5a22952 /nptl
parent7b300ec7f9a5a271f2169aa6e924184a41b3a9a8 (diff)
downloadglibc-8bc6a6d73c7f9004bfa3e81a717300e6d39ac448.tar.gz
glibc-8bc6a6d73c7f9004bfa3e81a717300e6d39ac448.tar.xz
glibc-8bc6a6d73c7f9004bfa3e81a717300e6d39ac448.zip
nptl: Move pthread_setname_np into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

Add __libpthread_version_placeholder@@GLIBC_2.12 for the targets
that need it.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'nptl')
-rw-r--r--nptl/Makefile2
-rw-r--r--nptl/Versions7
-rw-r--r--nptl/libpthread-compat.c5
-rw-r--r--nptl/pthread_setname.c11
4 files changed, 21 insertions, 4 deletions
diff --git a/nptl/Makefile b/nptl/Makefile
index a33f495653..5a271fed87 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -174,6 +174,7 @@ routines = \
   pthread_setcancelstate \
   pthread_setcanceltype \
   pthread_setconcurrency \
+  pthread_setname \
   pthread_setschedparam \
   pthread_setspecific \
   pthread_sigmask \
@@ -209,7 +210,6 @@ libpthread-routines = \
   nptl-init \
   pt-interp \
   pthread_create \
-  pthread_setname \
   pthread_setschedprio \
   pthread_sigqueue \
   version \
diff --git a/nptl/Versions b/nptl/Versions
index 289063edf7..d9a5c0ee88 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -191,6 +191,7 @@ libc {
     pthread_mutex_consistent;
     pthread_mutexattr_getrobust;
     pthread_mutexattr_setrobust;
+    pthread_setname_np;
   }
   GLIBC_2.18 {
     pthread_getattr_default_np;
@@ -330,6 +331,7 @@ libc {
     pthread_rwlockattr_setpshared;
     pthread_setattr_default_np;
     pthread_setconcurrency;
+    pthread_setname_np;
     pthread_setspecific;
     pthread_spin_destroy;
     pthread_spin_init;
@@ -473,9 +475,12 @@ libpthread {
   };
 
   GLIBC_2.12 {
-    pthread_setname_np;
+    __libpthread_version_placeholder;
   };
 
+  GLIBC_2.13 {
+  }
+
   GLIBC_2.18 {
     __libpthread_version_placeholder;
   }
diff --git a/nptl/libpthread-compat.c b/nptl/libpthread-compat.c
index a0c0102fd8..b1bee36f36 100644
--- a/nptl/libpthread-compat.c
+++ b/nptl/libpthread-compat.c
@@ -80,6 +80,11 @@ compat_symbol (libpthread, __libpthread_version_placeholder_1,
 	       __libpthread_version_placeholder, GLIBC_2_4);
 #endif
 
+#if SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_13)
+compat_symbol (libpthread, __libpthread_version_placeholder_1,
+	       __libpthread_version_placeholder, GLIBC_2_12);
+#endif
+
 #if SHLIB_COMPAT (libpthread, GLIBC_2_18, GLIBC_2_19) \
   && ABI_libpthread_GLIBC_2_18 != ABI_libpthread_GLIBC_2_0
 compat_symbol (libpthread, __libpthread_version_placeholder_1,
diff --git a/nptl/pthread_setname.c b/nptl/pthread_setname.c
index 61a39fbc58..6d2d8a1723 100644
--- a/nptl/pthread_setname.c
+++ b/nptl/pthread_setname.c
@@ -28,7 +28,7 @@
 
 
 int
-pthread_setname_np (pthread_t th, const char *name)
+__pthread_setname_np (pthread_t th, const char *name)
 {
   const struct pthread *pd = (const struct pthread *) th;
 
@@ -40,7 +40,7 @@ pthread_setname_np (pthread_t th, const char *name)
     return ERANGE;
 
   if (pd == THREAD_SELF)
-    return prctl (PR_SET_NAME, name) ? errno : 0;
+    return __prctl (PR_SET_NAME, name) ? errno : 0;
 
 #define FMT "/proc/self/task/%u/comm"
   char fname[sizeof (FMT) + 8];
@@ -61,3 +61,10 @@ pthread_setname_np (pthread_t th, const char *name)
 
   return res;
 }
+versioned_symbol (libc, __pthread_setname_np, pthread_setname_np,
+                  GLIBC_2_34);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_34)
+compat_symbol (libpthread, __pthread_setname_np, pthread_setname_np,
+               GLIBC_2_12);
+#endif