diff options
Diffstat (limited to 'nptl')
-rw-r--r-- | nptl/Makefile | 3 | ||||
-rw-r--r-- | nptl/Versions | 5 | ||||
-rw-r--r-- | nptl/pthreadP.h | 1 | ||||
-rw-r--r-- | nptl/pthread_getaffinity.c | 21 |
4 files changed, 20 insertions, 10 deletions
diff --git a/nptl/Makefile b/nptl/Makefile index 76f7d60584..7edad1c0c9 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -57,6 +57,7 @@ routines = \ pthread_condattr_destroy \ pthread_condattr_init \ pthread_equal \ + pthread_getaffinity \ pthread_getschedparam \ pthread_self \ pthread_setschedparam \ @@ -149,7 +150,7 @@ libpthread-routines = nptl-init nptlfreeres vars events version pt-interp \ sigaction \ herrno res pt-allocrtsig \ pthread_kill_other_threads \ - pthread_getaffinity pthread_setaffinity \ + pthread_setaffinity \ pthread_attr_getaffinity \ pthread_mutexattr_getrobust pthread_mutexattr_setrobust \ pthread_mutex_consistent \ diff --git a/nptl/Versions b/nptl/Versions index a799e63606..637d100a9e 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -31,6 +31,7 @@ libc { } GLIBC_2.3.3 { pthread_attr_setaffinity_np; + pthread_getaffinity_np; } GLIBC_2.3.4 { pthread_attr_setaffinity_np; @@ -41,6 +42,7 @@ libc { } GLIBC_2.32 { pthread_attr_setaffinity_np; + pthread_getaffinity_np; pthread_sigmask; } GLIBC_PRIVATE { @@ -53,6 +55,7 @@ libc { # Used by the C11 threads implementation. __pthread_cond_destroy; __pthread_cond_init; __pthread_attr_setaffinity_np; + __pthread_getaffinity_np; # For pthread_getattr_np. } } @@ -226,7 +229,7 @@ libpthread { __pthread_cleanup_routine; # affinity interfaces without size parameter - pthread_getaffinity_np; pthread_setaffinity_np; + pthread_setaffinity_np; pthread_attr_getaffinity_np; } diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index 42730a46df..ac0135422b 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -520,6 +520,7 @@ extern int __pthread_cond_wait_2_0 (pthread_cond_2_0_t *cond, extern int __pthread_getaffinity_np (pthread_t th, size_t cpusetsize, cpu_set_t *cpuset); +libc_hidden_proto (__pthread_getaffinity_np) #if IS_IN (libpthread) /* Special versions which use non-exported functions. */ diff --git a/nptl/pthread_getaffinity.c b/nptl/pthread_getaffinity.c index cf6ecfe01f..6ebd1ded2d 100644 --- a/nptl/pthread_getaffinity.c +++ b/nptl/pthread_getaffinity.c @@ -27,7 +27,7 @@ int -__pthread_getaffinity_new (pthread_t th, size_t cpusetsize, cpu_set_t *cpuset) +__pthread_getaffinity_np (pthread_t th, size_t cpusetsize, cpu_set_t *cpuset) { const struct pthread *pd = (const struct pthread *) th; @@ -41,18 +41,23 @@ __pthread_getaffinity_new (pthread_t th, size_t cpusetsize, cpu_set_t *cpuset) return 0; } -strong_alias (__pthread_getaffinity_new, __pthread_getaffinity_np) -versioned_symbol (libpthread, __pthread_getaffinity_new, - pthread_getaffinity_np, GLIBC_2_3_4); - +libc_hidden_def (__pthread_getaffinity_np) +versioned_symbol (libc, __pthread_getaffinity_np, pthread_getaffinity_np, + GLIBC_2_32); + +#if SHLIB_COMPAT (libc, GLIBC_2_3_4, GLIBC_2_32) +strong_alias (__pthread_getaffinity_np, __pthread_getaffinity_alias) +compat_symbol (libc, __pthread_getaffinity_alias, pthread_getaffinity_np, + GLIBC_2_3_4); +#endif -#if SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_3_4) +#if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4) int __pthread_getaffinity_old (pthread_t th, cpu_set_t *cpuset) { /* The old interface by default assumed a 1024 processor bitmap. */ - return __pthread_getaffinity_new (th, 128, cpuset); + return __pthread_getaffinity_np (th, 128, cpuset); } -compat_symbol (libpthread, __pthread_getaffinity_old, pthread_getaffinity_np, +compat_symbol (libc, __pthread_getaffinity_old, pthread_getaffinity_np, GLIBC_2_3_3); #endif |