mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-01 10:06:57 +03:00
nptl: Move pthread_attr_setaffinity_np into libc
This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> The symbol did not previously exist in libc, so a new GLIBC_2.32 symbol is needed, to get correct dependency for binaries which use the symbol but no longer link against libpthread. The abilist updates were performed by: git ls-files 'sysdeps/unix/sysv/linux/**/libc.abilist' \ | while read x ; do echo "GLIBC_2.32 pthread_attr_setaffinity_np F" >> $x done python3 scripts/move-symbol-to-libc.py pthread_attr_setaffinity_np Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
@ -25,8 +25,8 @@
|
||||
|
||||
|
||||
int
|
||||
__pthread_attr_setaffinity_new (pthread_attr_t *attr, size_t cpusetsize,
|
||||
const cpu_set_t *cpuset)
|
||||
__pthread_attr_setaffinity_np (pthread_attr_t *attr, size_t cpusetsize,
|
||||
const cpu_set_t *cpuset)
|
||||
{
|
||||
struct pthread_attr *iattr;
|
||||
|
||||
@ -55,17 +55,25 @@ __pthread_attr_setaffinity_new (pthread_attr_t *attr, size_t cpusetsize,
|
||||
|
||||
return 0;
|
||||
}
|
||||
versioned_symbol (libpthread, __pthread_attr_setaffinity_new,
|
||||
pthread_attr_setaffinity_np, GLIBC_2_3_4);
|
||||
libc_hidden_def (__pthread_attr_setaffinity_np)
|
||||
versioned_symbol (libc, __pthread_attr_setaffinity_np,
|
||||
pthread_attr_setaffinity_np, GLIBC_2_32);
|
||||
|
||||
|
||||
#if SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_3_4)
|
||||
#if SHLIB_COMPAT (libc, GLIBC_2_3_4, GLIBC_2_32)
|
||||
/* Compat symbol with the old libc version. */
|
||||
strong_alias (__pthread_attr_setaffinity_np, __pthread_attr_setaffinity_alias)
|
||||
compat_symbol (libc, __pthread_attr_setaffinity_alias,
|
||||
pthread_attr_setaffinity_np, GLIBC_2_3_4);
|
||||
#endif
|
||||
|
||||
#if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)
|
||||
int
|
||||
__pthread_attr_setaffinity_old (pthread_attr_t *attr, cpu_set_t *cpuset)
|
||||
{
|
||||
/* The old interface by default assumed a 1024 processor bitmap. */
|
||||
return __pthread_attr_setaffinity_new (attr, 128, cpuset);
|
||||
return __pthread_attr_setaffinity_np (attr, 128, cpuset);
|
||||
}
|
||||
compat_symbol (libpthread, __pthread_attr_setaffinity_old,
|
||||
compat_symbol (libc, __pthread_attr_setaffinity_old,
|
||||
pthread_attr_setaffinity_np, GLIBC_2_3_3);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user