From 7b300ec7f9a5a271f2169aa6e924184a41b3a9a8 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Mon, 17 May 2021 09:59:14 +0200 Subject: nptl: Move pthread_setaffinity_np into libc The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella --- nptl/Makefile | 2 +- nptl/Versions | 5 +++-- nptl/libpthread-compat.c | 5 +++++ nptl/pthread_setaffinity.c | 10 +++++++--- 4 files changed, 16 insertions(+), 6 deletions(-) (limited to 'nptl') diff --git a/nptl/Makefile b/nptl/Makefile index 516410cb84..a33f495653 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -169,6 +169,7 @@ routines = \ pthread_rwlockattr_setkind_np \ pthread_rwlockattr_setpshared \ pthread_self \ + pthread_setaffinity \ pthread_setattr_default_np \ pthread_setcancelstate \ pthread_setcanceltype \ @@ -208,7 +209,6 @@ libpthread-routines = \ nptl-init \ pt-interp \ pthread_create \ - pthread_setaffinity \ pthread_setname \ pthread_setschedprio \ pthread_sigqueue \ diff --git a/nptl/Versions b/nptl/Versions index 8c8c3b040d..289063edf7 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -166,12 +166,14 @@ libc { pthread_condattr_getclock; pthread_condattr_setclock; pthread_getaffinity_np; + pthread_setaffinity_np; pthread_timedjoin_np; pthread_tryjoin_np; } GLIBC_2.3.4 { pthread_attr_getaffinity_np; pthread_attr_setaffinity_np; + pthread_setaffinity_np; } GLIBC_2.4 { pthread_mutex_consistent_np; @@ -454,12 +456,11 @@ libpthread { } GLIBC_2.3.3 { - pthread_setaffinity_np; + __libpthread_version_placeholder; } GLIBC_2.3.4 { pthread_getaffinity_np; - pthread_setaffinity_np; pthread_setschedprio; } diff --git a/nptl/libpthread-compat.c b/nptl/libpthread-compat.c index 18069870d1..a0c0102fd8 100644 --- a/nptl/libpthread-compat.c +++ b/nptl/libpthread-compat.c @@ -70,6 +70,11 @@ compat_symbol (libpthread, __libpthread_version_placeholder_1, __libpthread_version_placeholder, GLIBC_2_3_2); #endif +#if (SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_3_4)) +compat_symbol (libpthread, __libpthread_version_placeholder_1, + __libpthread_version_placeholder, GLIBC_2_3_3); +#endif + #if (SHLIB_COMPAT (libpthread, GLIBC_2_4, GLIBC_2_5)) compat_symbol (libpthread, __libpthread_version_placeholder_1, __libpthread_version_placeholder, GLIBC_2_4); diff --git a/nptl/pthread_setaffinity.c b/nptl/pthread_setaffinity.c index e0226ea890..3bfdc63e19 100644 --- a/nptl/pthread_setaffinity.c +++ b/nptl/pthread_setaffinity.c @@ -37,11 +37,15 @@ __pthread_setaffinity_new (pthread_t th, size_t cpusetsize, ? INTERNAL_SYSCALL_ERRNO (res) : 0); } -versioned_symbol (libpthread, __pthread_setaffinity_new, - pthread_setaffinity_np, GLIBC_2_3_4); +versioned_symbol (libc, __pthread_setaffinity_new, + pthread_setaffinity_np, GLIBC_2_34); +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_3_4, GLIBC_2_34) +compat_symbol (libpthread, __pthread_setaffinity_new, + pthread_setaffinity_np, GLIBC_2_3_4); +#endif -#if SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_3_4) +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_3_4) int __pthread_setaffinity_old (pthread_t th, cpu_set_t *cpuset) { -- cgit 1.4.1