diff options
author | Florian Weimer <fweimer@redhat.com> | 2021-05-17 09:59:14 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2021-05-17 10:25:12 +0200 |
commit | c924e44acddc7b1e259da21ee101085006071cef (patch) | |
tree | ff36bdfdb252331c5358987795345033cbb6491d /nptl | |
parent | 310e59e64cbc95bff299825b2b7f38b88f82ba4e (diff) | |
download | glibc-c924e44acddc7b1e259da21ee101085006071cef.tar.gz glibc-c924e44acddc7b1e259da21ee101085006071cef.tar.xz glibc-c924e44acddc7b1e259da21ee101085006071cef.zip |
nptl: Move pthread_getname_np into libc
The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'nptl')
-rw-r--r-- | nptl/Makefile | 2 | ||||
-rw-r--r-- | nptl/Versions | 3 | ||||
-rw-r--r-- | nptl/pthread_getname.c | 14 |
3 files changed, 13 insertions, 6 deletions
diff --git a/nptl/Makefile b/nptl/Makefile index 9c810b2b6c..516410cb84 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -117,6 +117,7 @@ routines = \ pthread_getattr_np \ pthread_getconcurrency \ pthread_getcpuclockid \ + pthread_getname \ pthread_getschedparam \ pthread_getspecific \ pthread_join \ @@ -207,7 +208,6 @@ libpthread-routines = \ nptl-init \ pt-interp \ pthread_create \ - pthread_getname \ pthread_setaffinity \ pthread_setname \ pthread_setschedprio \ diff --git a/nptl/Versions b/nptl/Versions index 9afbb028f2..8c8c3b040d 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -185,6 +185,7 @@ libc { pthread_mutexattr_setrobust_np; } GLIBC_2.12 { + pthread_getname_np; pthread_mutex_consistent; pthread_mutexattr_getrobust; pthread_mutexattr_setrobust; @@ -287,6 +288,7 @@ libc { pthread_getattr_default_np; pthread_getconcurrency; pthread_getcpuclockid; + pthread_getname_np; pthread_getspecific; pthread_join; pthread_key_create; @@ -470,7 +472,6 @@ libpthread { }; GLIBC_2.12 { - pthread_getname_np; pthread_setname_np; }; diff --git a/nptl/pthread_getname.c b/nptl/pthread_getname.c index d796844e86..8ac814366a 100644 --- a/nptl/pthread_getname.c +++ b/nptl/pthread_getname.c @@ -23,12 +23,11 @@ #include <string.h> #include <unistd.h> #include <sys/prctl.h> - #include <not-cancel.h> - +#include <shlib-compat.h> int -pthread_getname_np (pthread_t th, char *buf, size_t len) +__pthread_getname_np (pthread_t th, char *buf, size_t len) { const struct pthread *pd = (const struct pthread *) th; @@ -39,7 +38,7 @@ pthread_getname_np (pthread_t th, char *buf, size_t len) return ERANGE; if (pd == THREAD_SELF) - return prctl (PR_GET_NAME, buf) ? errno : 0; + return __prctl (PR_GET_NAME, buf) ? errno : 0; #define FMT "/proc/self/task/%u/comm" char fname[sizeof (FMT) + 8]; @@ -67,3 +66,10 @@ pthread_getname_np (pthread_t th, char *buf, size_t len) return res; } +versioned_symbol (libc, __pthread_getname_np, pthread_getname_np, + GLIBC_2_34); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_34) +compat_symbol (libpthread, __pthread_getname_np, pthread_getname_np, + GLIBC_2_12); +#endif |