diff options
65 files changed, 104 insertions, 33 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 diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index 5a0899fe90..ebe358d524 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -1550,6 +1550,7 @@ GLIBC_2.17 pthread_setaffinity_np F GLIBC_2.17 pthread_setcancelstate F GLIBC_2.17 pthread_setcanceltype F GLIBC_2.17 pthread_setconcurrency F +GLIBC_2.17 pthread_setname_np F GLIBC_2.17 pthread_setschedparam F GLIBC_2.17 pthread_setspecific F GLIBC_2.17 pthread_sigmask F @@ -2416,6 +2417,7 @@ GLIBC_2.34 pthread_rwlockattr_setpshared F GLIBC_2.34 pthread_setaffinity_np F GLIBC_2.34 pthread_setattr_default_np F GLIBC_2.34 pthread_setconcurrency F +GLIBC_2.34 pthread_setname_np F GLIBC_2.34 pthread_setspecific F GLIBC_2.34 pthread_spin_destroy F GLIBC_2.34 pthread_spin_init F diff --git a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist index 0272714fce..c95d8d7e0f 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist @@ -1,6 +1,5 @@ GLIBC_2.17 __errno_location F GLIBC_2.17 pthread_create F -GLIBC_2.17 pthread_setname_np F GLIBC_2.17 pthread_setschedprio F GLIBC_2.17 pthread_sigqueue F GLIBC_2.18 __libpthread_version_placeholder F diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index 25d8603bc0..003eddb0e4 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -1824,6 +1824,7 @@ GLIBC_2.12 pthread_getname_np F GLIBC_2.12 pthread_mutex_consistent F GLIBC_2.12 pthread_mutexattr_getrobust F GLIBC_2.12 pthread_mutexattr_setrobust F +GLIBC_2.12 pthread_setname_np F GLIBC_2.12 recvmmsg F GLIBC_2.12 sys_errlist D 0x458 GLIBC_2.12 sys_nerr D 0x4 @@ -2507,6 +2508,7 @@ GLIBC_2.34 pthread_rwlockattr_setpshared F GLIBC_2.34 pthread_setaffinity_np F GLIBC_2.34 pthread_setattr_default_np F GLIBC_2.34 pthread_setconcurrency F +GLIBC_2.34 pthread_setname_np F GLIBC_2.34 pthread_setspecific F GLIBC_2.34 pthread_spin_destroy F GLIBC_2.34 pthread_spin_init F diff --git a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist index 7b143cd3d7..c002d68e5a 100644 --- a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist @@ -4,7 +4,7 @@ GLIBC_2.1 pthread_create F GLIBC_2.1.1 __libpthread_version_placeholder F GLIBC_2.1.2 __libpthread_version_placeholder F GLIBC_2.11 pthread_sigqueue F -GLIBC_2.12 pthread_setname_np F +GLIBC_2.12 __libpthread_version_placeholder F GLIBC_2.18 __libpthread_version_placeholder F GLIBC_2.2 __libpthread_version_placeholder F GLIBC_2.2.3 __libpthread_version_placeholder F diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist index 088f9056c6..6e00b62a37 100644 --- a/sysdeps/unix/sysv/linux/arc/libc.abilist +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist @@ -1496,6 +1496,7 @@ GLIBC_2.32 pthread_setattr_default_np F GLIBC_2.32 pthread_setcancelstate F GLIBC_2.32 pthread_setcanceltype F GLIBC_2.32 pthread_setconcurrency F +GLIBC_2.32 pthread_setname_np F GLIBC_2.32 pthread_setschedparam F GLIBC_2.32 pthread_setspecific F GLIBC_2.32 pthread_sigmask F |
