unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 00/19] Signal mask for timer helper thread
@ 2020-05-19 10:43 Florian Weimer via Libc-alpha
  2020-05-19 10:44 ` [PATCH 01/19] manual: Add missing section and node for clockid_t wait functions Florian Weimer via Libc-alpha
                   ` (19 more replies)
  0 siblings, 20 replies; 42+ messages in thread
From: Florian Weimer via Libc-alpha @ 2020-05-19 10:43 UTC (permalink / raw)
  To: libc-alpha

This series cleans up various aspects of NPTL and eventually adds
functionality to explicitly block internal signals on new threads.

There is now a proper public interface (for non-internal signals) and
the awkward separate sigset_t * argument and a pthread_create variant is
no longer needed.

To avoid creating new symbols in libpthread, some dependent
functionality had to be moved into libc.  Since more parts of
pthread_attr_t are now dynamically allocated, it seemed prudent to
consolidate the copying of thread attributes.

Tested on x86_64-linux-gnu, i686-linux-gnu.  Built with
build-many-glibcs.py (also various intermediate steps).

Thanks,
Florian

Florian Weimer (19):
  manual: Add missing section and node for clockid_t wait functions
  nptl: Replace some stubs with the Linux implementation
  nptl: Move pthread_attr_setaffinity_np into libc
  nptl: Move pthread_getaffinity_np into libc
  nptl: Move pthread_gettattr_np into libc
  nptl: Make __pthread_attr_init, __pthread_attr_destroy available
    internally
  nptl: Add __pthread_attr_copy for copying pthread_attr_t objects
  nptl: Use __pthread_attr_copy in pthread_getattr_default_np (bug
    25999)
  nptl: Use __pthread_attr_copy in pthread_setattr_default_np
  <libc-symbols.h>: Add libpthread hidden alias support
  nptl: Add internal alias __pthread_getattr_default_np
  nptl: Use __pthread_getattr_default_np in pthread_create
  nptl: Use __pthread_attr_setaffinity_np in pthread_getattr_np
  nptl: Change type of __default_pthread_attr
  nptl: Destroy the default thread attribute as part of freeres
  nptl: Make pthread_attr_t dynamically extensible
  nptl: Add pthread_attr_setsigmask_np, pthread_attr_getsigmask_np
  manual: Add pthread_attr_setsigmask_np, pthread_attr_getsigmask_np
  Linux: Use __pthread_attr_setsigmask_internal for timer helper thread

 NEWS                                          |   4 +
 include/libc-symbols.h                        |  23 ++
 manual/threads.texi                           |  55 +++++
 nptl/Makefile                                 |  24 ++-
 nptl/Versions                                 |  29 ++-
 nptl/allocatestack.c                          |   2 +-
 nptl/libpthread-compat.c                      |   5 +
 nptl/nptl-init.c                              |   4 +-
 nptl/nptlfreeres.c                            |   1 +
 nptl/pthreadP.h                               |  35 ++-
 nptl/pthread_attr_copy.c                      |  64 ++++++
 nptl/pthread_attr_destroy.c                   |  15 +-
 nptl/pthread_attr_extension.c                 |  32 +++
 nptl/pthread_attr_getaffinity.c               |  14 +-
 nptl/pthread_attr_getsigmask.c                |  38 ++++
 nptl/pthread_attr_getstacksize.c              |   2 +-
 nptl/pthread_attr_init.c                      |   5 +-
 nptl/pthread_attr_setaffinity.c               |  45 ++--
 nptl/pthread_attr_setsigmask.c                |  34 +++
 nptl/pthread_attr_setsigmask_internal.c       |  45 ++++
 nptl/pthread_create.c                         |  63 +++---
 nptl/pthread_getaffinity.c                    |  45 +++-
 nptl/pthread_getattr_default_np.c             |  15 +-
 nptl/pthread_getattr_np.c                     |  43 ++--
 nptl/pthread_getname.c                        |  49 ++++-
 nptl/pthread_setaffinity.c                    |  37 +++-
 nptl/pthread_setattr_default_np.c             |  63 +++---
 nptl/pthread_setname.c                        |  43 +++-
 nptl/tst-pthread-attr-sigmask.c               | 204 ++++++++++++++++++
 nptl/tst-pthread-defaultattr-free.c           |  78 +++++++
 .../unix/sysv/linux => nptl}/tst-setgetname.c |   0
 .../tst-thread-affinity-pthread.c             |   0
 .../tst-thread-affinity-pthread2.c            |   0
 .../tst-thread-affinity-sched.c               |   0
 nptl/vars.c                                   |   2 +-
 sysdeps/nptl/internaltypes.h                  |  26 ++-
 sysdeps/nptl/pthread.h                        |  15 ++
 sysdeps/unix/sysv/linux/Makefile              |   5 +-
 sysdeps/unix/sysv/linux/aarch64/libc.abilist  |   8 +
 .../sysv/linux/aarch64/libpthread.abilist     |   3 -
 sysdeps/unix/sysv/linux/alpha/libc.abilist    |  10 +
 .../unix/sysv/linux/alpha/libpthread.abilist  |   6 +-
 sysdeps/unix/sysv/linux/arm/be/libc.abilist   |   8 +
 .../unix/sysv/linux/arm/be/libpthread.abilist |   3 -
 sysdeps/unix/sysv/linux/arm/le/libc.abilist   |   8 +
 .../unix/sysv/linux/arm/le/libpthread.abilist |   3 -
 sysdeps/unix/sysv/linux/createthread.c        |   9 +-
 sysdeps/unix/sysv/linux/csky/libc.abilist     |   8 +
 .../unix/sysv/linux/csky/libpthread.abilist   |   3 -
 sysdeps/unix/sysv/linux/hppa/libc.abilist     |  10 +
 .../unix/sysv/linux/hppa/libpthread.abilist   |   6 +-
 sysdeps/unix/sysv/linux/i386/libc.abilist     |  10 +
 .../unix/sysv/linux/i386/libpthread.abilist   |   6 +-
 sysdeps/unix/sysv/linux/ia64/libc.abilist     |  10 +
 .../unix/sysv/linux/ia64/libpthread.abilist   |   6 +-
 .../sysv/linux/m68k/coldfire/libc.abilist     |   8 +
 .../linux/m68k/coldfire/libpthread.abilist    |   3 -
 .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  10 +
 .../sysv/linux/m68k/m680x0/libpthread.abilist |   6 +-
 .../sysv/linux/microblaze/be/libc.abilist     |   8 +
 .../linux/microblaze/be/libpthread.abilist    |   3 -
 .../sysv/linux/microblaze/le/libc.abilist     |   8 +
 .../linux/microblaze/le/libpthread.abilist    |   3 -
 .../sysv/linux/mips/mips32/fpu/libc.abilist   |  10 +
 .../sysv/linux/mips/mips32/libpthread.abilist |   6 +-
 .../sysv/linux/mips/mips32/nofpu/libc.abilist |  10 +
 .../sysv/linux/mips/mips64/libpthread.abilist |   6 +-
 .../sysv/linux/mips/mips64/n32/libc.abilist   |  10 +
 .../sysv/linux/mips/mips64/n64/libc.abilist   |  10 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist    |   8 +
 .../unix/sysv/linux/nios2/libpthread.abilist  |   3 -
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |  10 +
 .../powerpc/powerpc32/libpthread.abilist      |   6 +-
 .../powerpc/powerpc32/nofpu/libc.abilist      |  10 +
 .../linux/powerpc/powerpc64/be/libc.abilist   |  10 +
 .../powerpc/powerpc64/be/libpthread.abilist   |   5 -
 .../linux/powerpc/powerpc64/le/libc.abilist   |   8 +
 .../powerpc/powerpc64/le/libpthread.abilist   |   3 -
 sysdeps/unix/sysv/linux/pthread_getaffinity.c |  58 -----
 sysdeps/unix/sysv/linux/pthread_getname.c     |  69 ------
 sysdeps/unix/sysv/linux/pthread_setaffinity.c |  53 -----
 sysdeps/unix/sysv/linux/pthread_setname.c     |  63 ------
 .../unix/sysv/linux/riscv/rv64/libc.abilist   |   8 +
 .../sysv/linux/riscv/rv64/libpthread.abilist  |   3 -
 .../unix/sysv/linux/s390/s390-32/libc.abilist |  10 +
 .../linux/s390/s390-32/libpthread.abilist     |   6 +-
 .../unix/sysv/linux/s390/s390-64/libc.abilist |  10 +
 .../linux/s390/s390-64/libpthread.abilist     |   6 +-
 sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  10 +
 .../unix/sysv/linux/sh/be/libpthread.abilist  |   6 +-
 sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  10 +
 .../unix/sysv/linux/sh/le/libpthread.abilist  |   6 +-
 .../sysv/linux/sparc/sparc32/libc.abilist     |  10 +
 .../linux/sparc/sparc32/libpthread.abilist    |   6 +-
 .../sysv/linux/sparc/sparc64/libc.abilist     |  10 +
 .../linux/sparc/sparc64/libpthread.abilist    |   6 +-
 sysdeps/unix/sysv/linux/timer_routines.c      |  19 +-
 .../unix/sysv/linux/x86_64/64/libc.abilist    |  10 +
 .../sysv/linux/x86_64/64/libpthread.abilist   |   5 -
 .../unix/sysv/linux/x86_64/x32/libc.abilist   |   8 +
 .../sysv/linux/x86_64/x32/libpthread.abilist  |   3 -
 101 files changed, 1289 insertions(+), 551 deletions(-)
 create mode 100644 nptl/pthread_attr_copy.c
 create mode 100644 nptl/pthread_attr_extension.c
 create mode 100644 nptl/pthread_attr_getsigmask.c
 create mode 100644 nptl/pthread_attr_setsigmask.c
 create mode 100644 nptl/pthread_attr_setsigmask_internal.c
 create mode 100644 nptl/tst-pthread-attr-sigmask.c
 create mode 100644 nptl/tst-pthread-defaultattr-free.c
 rename {sysdeps/unix/sysv/linux => nptl}/tst-setgetname.c (100%)
 rename {sysdeps/unix/sysv/linux => nptl}/tst-thread-affinity-pthread.c (100%)
 rename {sysdeps/unix/sysv/linux => nptl}/tst-thread-affinity-pthread2.c (100%)
 rename {sysdeps/unix/sysv/linux => nptl}/tst-thread-affinity-sched.c (100%)
 delete mode 100644 sysdeps/unix/sysv/linux/pthread_getaffinity.c
 delete mode 100644 sysdeps/unix/sysv/linux/pthread_getname.c
 delete mode 100644 sysdeps/unix/sysv/linux/pthread_setaffinity.c
 delete mode 100644 sysdeps/unix/sysv/linux/pthread_setname.c

-- 
2.25.4


^ permalink raw reply	[flat|nested] 42+ messages in thread

* [PATCH 01/19] manual: Add missing section and node for clockid_t wait functions
  2020-05-19 10:43 [PATCH 00/19] Signal mask for timer helper thread Florian Weimer via Libc-alpha
@ 2020-05-19 10:44 ` Florian Weimer via Libc-alpha
  2020-05-20 13:12   ` Carlos O'Donell via Libc-alpha
  2020-05-19 10:44 ` [PATCH 02/19] nptl: Replace some stubs with the Linux implementation Florian Weimer via Libc-alpha
                   ` (18 subsequent siblings)
  19 siblings, 1 reply; 42+ messages in thread
From: Florian Weimer via Libc-alpha @ 2020-05-19 10:44 UTC (permalink / raw)
  To: libc-alpha

Without this, these functions appear under the node Default Thread
Attributes, which is confusing.

Eventually, the documentation should be merged with the (yet to be
documented) standardized functions.
---
 manual/threads.texi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/manual/threads.texi b/manual/threads.texi
index 0858ef8f92..a425635179 100644
--- a/manual/threads.texi
+++ b/manual/threads.texi
@@ -625,6 +625,8 @@ the standard.
 @menu
 * Default Thread Attributes::             Setting default attributes for
 					  threads in a process.
+* Waiting with Explicit Clocks::          Functions for waiting with an
+                                          explicit clock specification.
 @end menu
 
 @node Default Thread Attributes
@@ -669,6 +671,12 @@ The system does not have sufficient memory.
 @end table
 @end deftypefun
 
+@node Waiting with Explicit Clocks
+@subsubsection Functions for Waiting According to a Specific Clock
+
+@Theglibc{} provides several waiting functions that expect an explicit
+@code{clockid_t} argument.
+
 @comment semaphore.h
 @comment POSIX-proposed
 @deftypefun int sem_clockwait (sem_t *@var{sem}, clockid_t @var{clockid},
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 02/19] nptl: Replace some stubs with the Linux implementation
  2020-05-19 10:43 [PATCH 00/19] Signal mask for timer helper thread Florian Weimer via Libc-alpha
  2020-05-19 10:44 ` [PATCH 01/19] manual: Add missing section and node for clockid_t wait functions Florian Weimer via Libc-alpha
@ 2020-05-19 10:44 ` Florian Weimer via Libc-alpha
  2020-05-20 13:27   ` Carlos O'Donell via Libc-alpha
  2020-05-19 10:44 ` [PATCH 03/19] nptl: Move pthread_attr_setaffinity_np into libc Florian Weimer via Libc-alpha
                   ` (17 subsequent siblings)
  19 siblings, 1 reply; 42+ messages in thread
From: Florian Weimer via Libc-alpha @ 2020-05-19 10:44 UTC (permalink / raw)
  To: libc-alpha

The stubs for pthread_getaffinity_np, pthread_getname_np,
pthread_setaffinity_np, pthread_setname_np are replaced, and corresponding
tests are moved.

After the removal of the NaCl port, nptl is Linux-specific, and the stubs
are no longer needed.  This effectively reverts commit
c76d1ff5149bd03210f2bb8cd64446c51618d016 ("NPTL: Add stubs for Linux-only
extension functions.").
---
 nptl/Makefile                                 |  9 ++-
 nptl/pthread_getaffinity.c                    | 42 ++++++++---
 nptl/pthread_getname.c                        | 49 +++++++++++--
 nptl/pthread_setaffinity.c                    | 37 +++++++---
 nptl/pthread_setname.c                        | 43 ++++++++++--
 .../unix/sysv/linux => nptl}/tst-setgetname.c |  0
 .../tst-thread-affinity-pthread.c             |  0
 .../tst-thread-affinity-pthread2.c            |  0
 .../tst-thread-affinity-sched.c               |  0
 sysdeps/unix/sysv/linux/Makefile              |  5 +-
 sysdeps/unix/sysv/linux/pthread_getaffinity.c | 58 ----------------
 sysdeps/unix/sysv/linux/pthread_getname.c     | 69 -------------------
 sysdeps/unix/sysv/linux/pthread_setaffinity.c | 53 --------------
 sysdeps/unix/sysv/linux/pthread_setname.c     | 63 -----------------
 14 files changed, 151 insertions(+), 277 deletions(-)
 rename {sysdeps/unix/sysv/linux => nptl}/tst-setgetname.c (100%)
 rename {sysdeps/unix/sysv/linux => nptl}/tst-thread-affinity-pthread.c (100%)
 rename {sysdeps/unix/sysv/linux => nptl}/tst-thread-affinity-pthread2.c (100%)
 rename {sysdeps/unix/sysv/linux => nptl}/tst-thread-affinity-sched.c (100%)
 delete mode 100644 sysdeps/unix/sysv/linux/pthread_getaffinity.c
 delete mode 100644 sysdeps/unix/sysv/linux/pthread_getname.c
 delete mode 100644 sysdeps/unix/sysv/linux/pthread_setaffinity.c
 delete mode 100644 sysdeps/unix/sysv/linux/pthread_setname.c

diff --git a/nptl/Makefile b/nptl/Makefile
index ef9a6eb561..5fc45b224b 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -321,14 +321,19 @@ tests = tst-attr2 tst-attr3 tst-default-attr \
 	tst-thread-exit-clobber tst-minstack-cancel tst-minstack-exit \
 	tst-minstack-throw \
 	tst-rwlock-pwn \
-	tst-unwind-thread
+	tst-unwind-thread \
+	tst-thread-affinity-pthread \
+	tst-thread-affinity-pthread2 \
+	tst-thread-affinity-sched \
+
 
 tests-container =  tst-pthread-getattr
 
 tests-internal := tst-robustpi8 tst-rwlock19 tst-rwlock20 \
 		  tst-sem11 tst-sem12 tst-sem13 \
 		  tst-barrier5 tst-signal7 tst-mutex8 tst-mutex8-static \
-		  tst-mutexpi8 tst-mutexpi8-static tst-cancel25
+		  tst-mutexpi8 tst-mutexpi8-static tst-cancel25 \
+		  tst-setgetname \
 
 xtests = tst-setuid1 tst-setuid1-static tst-setuid2 \
 	tst-mutexpp1 tst-mutexpp6 tst-mutexpp10
diff --git a/nptl/pthread_getaffinity.c b/nptl/pthread_getaffinity.c
index 2ba05b5b92..cf6ecfe01f 100644
--- a/nptl/pthread_getaffinity.c
+++ b/nptl/pthread_getaffinity.c
@@ -1,6 +1,6 @@
-/* Get the processor affinity of a thread.  Stub version.
-   Copyright (C) 2014-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2020 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -16,17 +16,43 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#include <errno.h>
+#include <limits.h>
 #include <pthreadP.h>
+#include <string.h>
+#include <sysdep.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <shlib-compat.h>
+
 
 int
-__pthread_getaffinity_np (pthread_t th, size_t cpusetsize, cpu_set_t *cpuset)
+__pthread_getaffinity_new (pthread_t th, size_t cpusetsize, cpu_set_t *cpuset)
 {
   const struct pthread *pd = (const struct pthread *) th;
 
-  if (INVALID_TD_P (pd))
-    return ESRCH;
+  int res = INTERNAL_SYSCALL_CALL (sched_getaffinity, pd->tid,
+				   MIN (INT_MAX, cpusetsize), cpuset);
+  if (INTERNAL_SYSCALL_ERROR_P (res))
+    return INTERNAL_SYSCALL_ERRNO (res);
+
+  /* Clean the rest of the memory the kernel didn't do.  */
+  memset ((char *) cpuset + res, '\0', cpusetsize - res);
+
+  return 0;
+}
+strong_alias (__pthread_getaffinity_new, __pthread_getaffinity_np)
+versioned_symbol (libpthread, __pthread_getaffinity_new,
+		  pthread_getaffinity_np, GLIBC_2_3_4);
 
-  return ENOSYS;
+
+#if SHLIB_COMPAT (libpthread, 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);
 }
-weak_alias (__pthread_getaffinity_np, pthread_getaffinity_np)
-stub_warning (pthread_getaffinity_np)
+compat_symbol (libpthread, __pthread_getaffinity_old, pthread_getaffinity_np,
+	       GLIBC_2_3_3);
+#endif
diff --git a/nptl/pthread_getname.c b/nptl/pthread_getname.c
index b771f2ef76..c78cccffd4 100644
--- a/nptl/pthread_getname.c
+++ b/nptl/pthread_getname.c
@@ -1,5 +1,5 @@
-/* pthread_getname_np -- Get thread name.  Stub version.
-   Copyright (C) 2014-2020 Free Software Foundation, Inc.
+/* pthread_getname_np -- Get  thread name.  Linux version
+   Copyright (C) 2010-2020 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -17,16 +17,53 @@
    not, see <https://www.gnu.org/licenses/>.  */
 
 #include <errno.h>
+#include <fcntl.h>
 #include <pthreadP.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/prctl.h>
+
+#include <not-cancel.h>
+
 
 int
 pthread_getname_np (pthread_t th, char *buf, size_t len)
 {
   const struct pthread *pd = (const struct pthread *) th;
 
-  if (INVALID_TD_P (pd))
-    return ESRCH;
+  /* Unfortunately the kernel headers do not export the TASK_COMM_LEN
+     macro.  So we have to define it here.  */
+#define TASK_COMM_LEN 16
+  if (len < TASK_COMM_LEN)
+    return ERANGE;
+
+  if (pd == THREAD_SELF)
+    return prctl (PR_GET_NAME, buf) ? errno : 0;
+
+#define FMT "/proc/self/task/%u/comm"
+  char fname[sizeof (FMT) + 8];
+  sprintf (fname, FMT, (unsigned int) pd->tid);
+
+  int fd = __open64_nocancel (fname, O_RDONLY);
+  if (fd == -1)
+    return errno;
+
+  int res = 0;
+  ssize_t n = TEMP_FAILURE_RETRY (__read_nocancel (fd, buf, len));
+  if (n < 0)
+    res = errno;
+  else
+    {
+      if (buf[n - 1] == '\n')
+	buf[n - 1] = '\0';
+      else if (n == len)
+	res = ERANGE;
+      else
+	buf[n] = '\0';
+    }
+
+  __close_nocancel_nostatus (fd);
 
-  return ENOSYS;
+  return res;
 }
-stub_warning (pthread_getname_np)
diff --git a/nptl/pthread_setaffinity.c b/nptl/pthread_setaffinity.c
index 29bbfb4fb2..b0bd90c324 100644
--- a/nptl/pthread_setaffinity.c
+++ b/nptl/pthread_setaffinity.c
@@ -1,6 +1,6 @@
-/* Set the processor affinity of a thread.  Stub version.
-   Copyright (C) 2014-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2020 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -16,17 +16,38 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#include <errno.h>
 #include <pthreadP.h>
+#include <sysdep.h>
+#include <sys/types.h>
+#include <shlib-compat.h>
+
 
 int
-pthread_setaffinity_np (pthread_t th,
-                        size_t cpusetsize, const cpu_set_t *cpuset)
+__pthread_setaffinity_new (pthread_t th, size_t cpusetsize,
+			   const cpu_set_t *cpuset)
 {
   const struct pthread *pd = (const struct pthread *) th;
+  int res;
+
+  res = INTERNAL_SYSCALL_CALL (sched_setaffinity, pd->tid, cpusetsize,
+			       cpuset);
+
+  return (INTERNAL_SYSCALL_ERROR_P (res)
+	  ? INTERNAL_SYSCALL_ERRNO (res)
+	  : 0);
+}
+versioned_symbol (libpthread, __pthread_setaffinity_new,
+		  pthread_setaffinity_np, GLIBC_2_3_4);
 
-  if (INVALID_TD_P (pd))
-    return ESRCH;
 
-  return ENOSYS;
+#if SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_3_4)
+int
+__pthread_setaffinity_old (pthread_t th, cpu_set_t *cpuset)
+{
+  /* The old interface by default assumed a 1024 processor bitmap.  */
+  return __pthread_setaffinity_new (th, 128, cpuset);
 }
-stub_warning (pthread_setaffinity_np)
+compat_symbol (libpthread, __pthread_setaffinity_old, pthread_setaffinity_np,
+	       GLIBC_2_3_3);
+#endif
diff --git a/nptl/pthread_setname.c b/nptl/pthread_setname.c
index adfb3e828f..29df46b77c 100644
--- a/nptl/pthread_setname.c
+++ b/nptl/pthread_setname.c
@@ -1,5 +1,5 @@
-/* pthread_setname_np -- Set thread name.  Stub version.
-   Copyright (C) 2014-2020 Free Software Foundation, Inc.
+/* pthread_setname_np -- Set  thread name.  Linux version
+   Copyright (C) 2010-2020 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -17,16 +17,47 @@
    not, see <https://www.gnu.org/licenses/>.  */
 
 #include <errno.h>
+#include <fcntl.h>
 #include <pthreadP.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/prctl.h>
+
+#include <not-cancel.h>
+
 
 int
 pthread_setname_np (pthread_t th, const char *name)
 {
   const struct pthread *pd = (const struct pthread *) th;
 
-  if (INVALID_TD_P (pd))
-    return ESRCH;
+  /* Unfortunately the kernel headers do not export the TASK_COMM_LEN
+     macro.  So we have to define it here.  */
+#define TASK_COMM_LEN 16
+  size_t name_len = strlen (name);
+  if (name_len >= TASK_COMM_LEN)
+    return ERANGE;
+
+  if (pd == THREAD_SELF)
+    return prctl (PR_SET_NAME, name) ? errno : 0;
+
+#define FMT "/proc/self/task/%u/comm"
+  char fname[sizeof (FMT) + 8];
+  sprintf (fname, FMT, (unsigned int) pd->tid);
+
+  int fd = __open64_nocancel (fname, O_RDWR);
+  if (fd == -1)
+    return errno;
+
+  int res = 0;
+  ssize_t n = TEMP_FAILURE_RETRY (__write_nocancel (fd, name, name_len));
+  if (n < 0)
+    res = errno;
+  else if (n != name_len)
+    res = EIO;
+
+  __close_nocancel_nostatus (fd);
 
-  return ENOSYS;
+  return res;
 }
-stub_warning (pthread_setname_np)
diff --git a/sysdeps/unix/sysv/linux/tst-setgetname.c b/nptl/tst-setgetname.c
similarity index 100%
rename from sysdeps/unix/sysv/linux/tst-setgetname.c
rename to nptl/tst-setgetname.c
diff --git a/sysdeps/unix/sysv/linux/tst-thread-affinity-pthread.c b/nptl/tst-thread-affinity-pthread.c
similarity index 100%
rename from sysdeps/unix/sysv/linux/tst-thread-affinity-pthread.c
rename to nptl/tst-thread-affinity-pthread.c
diff --git a/sysdeps/unix/sysv/linux/tst-thread-affinity-pthread2.c b/nptl/tst-thread-affinity-pthread2.c
similarity index 100%
rename from sysdeps/unix/sysv/linux/tst-thread-affinity-pthread2.c
rename to nptl/tst-thread-affinity-pthread2.c
diff --git a/sysdeps/unix/sysv/linux/tst-thread-affinity-sched.c b/nptl/tst-thread-affinity-sched.c
similarity index 100%
rename from sysdeps/unix/sysv/linux/tst-thread-affinity-sched.c
rename to nptl/tst-thread-affinity-sched.c
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 0326f92c40..0060435a92 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -299,8 +299,5 @@ CFLAGS-gai.c += -DNEED_NETLINK
 endif
 
 ifeq ($(subdir),nptl)
-tests += tst-align-clone tst-getpid1 \
-	tst-thread-affinity-pthread tst-thread-affinity-pthread2 \
-	tst-thread-affinity-sched
-tests-internal += tst-setgetname
+tests += tst-align-clone tst-getpid1
 endif
diff --git a/sysdeps/unix/sysv/linux/pthread_getaffinity.c b/sysdeps/unix/sysv/linux/pthread_getaffinity.c
deleted file mode 100644
index cf6ecfe01f..0000000000
--- a/sysdeps/unix/sysv/linux/pthread_getaffinity.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright (C) 2003-2020 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <limits.h>
-#include <pthreadP.h>
-#include <string.h>
-#include <sysdep.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <shlib-compat.h>
-
-
-int
-__pthread_getaffinity_new (pthread_t th, size_t cpusetsize, cpu_set_t *cpuset)
-{
-  const struct pthread *pd = (const struct pthread *) th;
-
-  int res = INTERNAL_SYSCALL_CALL (sched_getaffinity, pd->tid,
-				   MIN (INT_MAX, cpusetsize), cpuset);
-  if (INTERNAL_SYSCALL_ERROR_P (res))
-    return INTERNAL_SYSCALL_ERRNO (res);
-
-  /* Clean the rest of the memory the kernel didn't do.  */
-  memset ((char *) cpuset + res, '\0', cpusetsize - res);
-
-  return 0;
-}
-strong_alias (__pthread_getaffinity_new, __pthread_getaffinity_np)
-versioned_symbol (libpthread, __pthread_getaffinity_new,
-		  pthread_getaffinity_np, GLIBC_2_3_4);
-
-
-#if SHLIB_COMPAT (libpthread, 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);
-}
-compat_symbol (libpthread, __pthread_getaffinity_old, pthread_getaffinity_np,
-	       GLIBC_2_3_3);
-#endif
diff --git a/sysdeps/unix/sysv/linux/pthread_getname.c b/sysdeps/unix/sysv/linux/pthread_getname.c
deleted file mode 100644
index c78cccffd4..0000000000
--- a/sysdeps/unix/sysv/linux/pthread_getname.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/* pthread_getname_np -- Get  thread name.  Linux version
-   Copyright (C) 2010-2020 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation; either version 2.1 of the
-   License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, see <https://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <pthreadP.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/prctl.h>
-
-#include <not-cancel.h>
-
-
-int
-pthread_getname_np (pthread_t th, char *buf, size_t len)
-{
-  const struct pthread *pd = (const struct pthread *) th;
-
-  /* Unfortunately the kernel headers do not export the TASK_COMM_LEN
-     macro.  So we have to define it here.  */
-#define TASK_COMM_LEN 16
-  if (len < TASK_COMM_LEN)
-    return ERANGE;
-
-  if (pd == THREAD_SELF)
-    return prctl (PR_GET_NAME, buf) ? errno : 0;
-
-#define FMT "/proc/self/task/%u/comm"
-  char fname[sizeof (FMT) + 8];
-  sprintf (fname, FMT, (unsigned int) pd->tid);
-
-  int fd = __open64_nocancel (fname, O_RDONLY);
-  if (fd == -1)
-    return errno;
-
-  int res = 0;
-  ssize_t n = TEMP_FAILURE_RETRY (__read_nocancel (fd, buf, len));
-  if (n < 0)
-    res = errno;
-  else
-    {
-      if (buf[n - 1] == '\n')
-	buf[n - 1] = '\0';
-      else if (n == len)
-	res = ERANGE;
-      else
-	buf[n] = '\0';
-    }
-
-  __close_nocancel_nostatus (fd);
-
-  return res;
-}
diff --git a/sysdeps/unix/sysv/linux/pthread_setaffinity.c b/sysdeps/unix/sysv/linux/pthread_setaffinity.c
deleted file mode 100644
index b0bd90c324..0000000000
--- a/sysdeps/unix/sysv/linux/pthread_setaffinity.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Copyright (C) 2003-2020 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <pthreadP.h>
-#include <sysdep.h>
-#include <sys/types.h>
-#include <shlib-compat.h>
-
-
-int
-__pthread_setaffinity_new (pthread_t th, size_t cpusetsize,
-			   const cpu_set_t *cpuset)
-{
-  const struct pthread *pd = (const struct pthread *) th;
-  int res;
-
-  res = INTERNAL_SYSCALL_CALL (sched_setaffinity, pd->tid, cpusetsize,
-			       cpuset);
-
-  return (INTERNAL_SYSCALL_ERROR_P (res)
-	  ? INTERNAL_SYSCALL_ERRNO (res)
-	  : 0);
-}
-versioned_symbol (libpthread, __pthread_setaffinity_new,
-		  pthread_setaffinity_np, GLIBC_2_3_4);
-
-
-#if SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_3_4)
-int
-__pthread_setaffinity_old (pthread_t th, cpu_set_t *cpuset)
-{
-  /* The old interface by default assumed a 1024 processor bitmap.  */
-  return __pthread_setaffinity_new (th, 128, cpuset);
-}
-compat_symbol (libpthread, __pthread_setaffinity_old, pthread_setaffinity_np,
-	       GLIBC_2_3_3);
-#endif
diff --git a/sysdeps/unix/sysv/linux/pthread_setname.c b/sysdeps/unix/sysv/linux/pthread_setname.c
deleted file mode 100644
index 29df46b77c..0000000000
--- a/sysdeps/unix/sysv/linux/pthread_setname.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* pthread_setname_np -- Set  thread name.  Linux version
-   Copyright (C) 2010-2020 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation; either version 2.1 of the
-   License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, see <https://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <pthreadP.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/prctl.h>
-
-#include <not-cancel.h>
-
-
-int
-pthread_setname_np (pthread_t th, const char *name)
-{
-  const struct pthread *pd = (const struct pthread *) th;
-
-  /* Unfortunately the kernel headers do not export the TASK_COMM_LEN
-     macro.  So we have to define it here.  */
-#define TASK_COMM_LEN 16
-  size_t name_len = strlen (name);
-  if (name_len >= TASK_COMM_LEN)
-    return ERANGE;
-
-  if (pd == THREAD_SELF)
-    return prctl (PR_SET_NAME, name) ? errno : 0;
-
-#define FMT "/proc/self/task/%u/comm"
-  char fname[sizeof (FMT) + 8];
-  sprintf (fname, FMT, (unsigned int) pd->tid);
-
-  int fd = __open64_nocancel (fname, O_RDWR);
-  if (fd == -1)
-    return errno;
-
-  int res = 0;
-  ssize_t n = TEMP_FAILURE_RETRY (__write_nocancel (fd, name, name_len));
-  if (n < 0)
-    res = errno;
-  else if (n != name_len)
-    res = EIO;
-
-  __close_nocancel_nostatus (fd);
-
-  return res;
-}
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 03/19] nptl: Move pthread_attr_setaffinity_np into libc
  2020-05-19 10:43 [PATCH 00/19] Signal mask for timer helper thread Florian Weimer via Libc-alpha
  2020-05-19 10:44 ` [PATCH 01/19] manual: Add missing section and node for clockid_t wait functions Florian Weimer via Libc-alpha
  2020-05-19 10:44 ` [PATCH 02/19] nptl: Replace some stubs with the Linux implementation Florian Weimer via Libc-alpha
@ 2020-05-19 10:44 ` Florian Weimer via Libc-alpha
  2020-05-20 13:31   ` Carlos O'Donell via Libc-alpha
  2020-05-19 10:44 ` [PATCH 04/19] nptl: Move pthread_getaffinity_np " Florian Weimer via Libc-alpha
                   ` (16 subsequent siblings)
  19 siblings, 1 reply; 42+ messages in thread
From: Florian Weimer via Libc-alpha @ 2020-05-19 10:44 UTC (permalink / raw)
  To: libc-alpha

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
---
 nptl/Makefile                                 |  3 ++-
 nptl/Versions                                 | 12 ++++++++--
 nptl/pthreadP.h                               |  2 ++
 nptl/pthread_attr_setaffinity.c               | 22 +++++++++++++------
 sysdeps/unix/sysv/linux/aarch64/libc.abilist  |  2 ++
 .../sysv/linux/aarch64/libpthread.abilist     |  1 -
 sysdeps/unix/sysv/linux/alpha/libc.abilist    |  3 +++
 .../unix/sysv/linux/alpha/libpthread.abilist  |  2 --
 sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  2 ++
 .../unix/sysv/linux/arm/be/libpthread.abilist |  1 -
 sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  2 ++
 .../unix/sysv/linux/arm/le/libpthread.abilist |  1 -
 sysdeps/unix/sysv/linux/csky/libc.abilist     |  2 ++
 .../unix/sysv/linux/csky/libpthread.abilist   |  1 -
 sysdeps/unix/sysv/linux/hppa/libc.abilist     |  3 +++
 .../unix/sysv/linux/hppa/libpthread.abilist   |  2 --
 sysdeps/unix/sysv/linux/i386/libc.abilist     |  3 +++
 .../unix/sysv/linux/i386/libpthread.abilist   |  2 --
 sysdeps/unix/sysv/linux/ia64/libc.abilist     |  3 +++
 .../unix/sysv/linux/ia64/libpthread.abilist   |  2 --
 .../sysv/linux/m68k/coldfire/libc.abilist     |  2 ++
 .../linux/m68k/coldfire/libpthread.abilist    |  1 -
 .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  3 +++
 .../sysv/linux/m68k/m680x0/libpthread.abilist |  2 --
 .../sysv/linux/microblaze/be/libc.abilist     |  2 ++
 .../linux/microblaze/be/libpthread.abilist    |  1 -
 .../sysv/linux/microblaze/le/libc.abilist     |  2 ++
 .../linux/microblaze/le/libpthread.abilist    |  1 -
 .../sysv/linux/mips/mips32/fpu/libc.abilist   |  3 +++
 .../sysv/linux/mips/mips32/libpthread.abilist |  2 --
 .../sysv/linux/mips/mips32/nofpu/libc.abilist |  3 +++
 .../sysv/linux/mips/mips64/libpthread.abilist |  2 --
 .../sysv/linux/mips/mips64/n32/libc.abilist   |  3 +++
 .../sysv/linux/mips/mips64/n64/libc.abilist   |  3 +++
 sysdeps/unix/sysv/linux/nios2/libc.abilist    |  2 ++
 .../unix/sysv/linux/nios2/libpthread.abilist  |  1 -
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |  3 +++
 .../powerpc/powerpc32/libpthread.abilist      |  2 --
 .../powerpc/powerpc32/nofpu/libc.abilist      |  3 +++
 .../linux/powerpc/powerpc64/be/libc.abilist   |  3 +++
 .../powerpc/powerpc64/be/libpthread.abilist   |  2 --
 .../linux/powerpc/powerpc64/le/libc.abilist   |  2 ++
 .../powerpc/powerpc64/le/libpthread.abilist   |  1 -
 .../unix/sysv/linux/riscv/rv64/libc.abilist   |  2 ++
 .../sysv/linux/riscv/rv64/libpthread.abilist  |  1 -
 .../unix/sysv/linux/s390/s390-32/libc.abilist |  3 +++
 .../linux/s390/s390-32/libpthread.abilist     |  2 --
 .../unix/sysv/linux/s390/s390-64/libc.abilist |  3 +++
 .../linux/s390/s390-64/libpthread.abilist     |  2 --
 sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  3 +++
 .../unix/sysv/linux/sh/be/libpthread.abilist  |  2 --
 sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  3 +++
 .../unix/sysv/linux/sh/le/libpthread.abilist  |  2 --
 .../sysv/linux/sparc/sparc32/libc.abilist     |  3 +++
 .../linux/sparc/sparc32/libpthread.abilist    |  2 --
 .../sysv/linux/sparc/sparc64/libc.abilist     |  3 +++
 .../linux/sparc/sparc64/libpthread.abilist    |  2 --
 .../unix/sysv/linux/x86_64/64/libc.abilist    |  3 +++
 .../sysv/linux/x86_64/64/libpthread.abilist   |  2 --
 .../unix/sysv/linux/x86_64/x32/libc.abilist   |  2 ++
 .../sysv/linux/x86_64/x32/libpthread.abilist  |  1 -
 61 files changed, 108 insertions(+), 53 deletions(-)

diff --git a/nptl/Makefile b/nptl/Makefile
index 5fc45b224b..76f7d60584 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -46,6 +46,7 @@ routines = \
   pthread_attr_getschedpolicy \
   pthread_attr_getscope \
   pthread_attr_init \
+  pthread_attr_setaffinity \
   pthread_attr_setdetachstate \
   pthread_attr_setinheritsched \
   pthread_attr_setschedparam \
@@ -149,7 +150,7 @@ libpthread-routines = nptl-init nptlfreeres vars events version pt-interp \
 		      herrno res pt-allocrtsig \
 		      pthread_kill_other_threads \
 		      pthread_getaffinity pthread_setaffinity \
-		      pthread_attr_getaffinity pthread_attr_setaffinity \
+		      pthread_attr_getaffinity \
 		      pthread_mutexattr_getrobust pthread_mutexattr_setrobust \
 		      pthread_mutex_consistent \
 		      cleanup_routine unwind-forcedunwind \
diff --git a/nptl/Versions b/nptl/Versions
index f7140277f5..a799e63606 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -29,11 +29,18 @@ libc {
     pthread_cond_wait; pthread_cond_signal;
     pthread_cond_broadcast; pthread_cond_timedwait;
   }
+  GLIBC_2.3.3 {
+    pthread_attr_setaffinity_np;
+  }
+  GLIBC_2.3.4 {
+    pthread_attr_setaffinity_np;
+  }
   # C11 thread symbols.
   GLIBC_2.28 {
     thrd_current; thrd_equal; thrd_sleep; thrd_yield;
   }
   GLIBC_2.32 {
+    pthread_attr_setaffinity_np;
     pthread_sigmask;
   }
   GLIBC_PRIVATE {
@@ -45,6 +52,7 @@ libc {
     __libc_allocate_rtsig_private;
     # Used by the C11 threads implementation.
     __pthread_cond_destroy; __pthread_cond_init;
+    __pthread_attr_setaffinity_np;
   }
 }
 
@@ -219,13 +227,13 @@ libpthread {
 
     # affinity interfaces without size parameter
     pthread_getaffinity_np; pthread_setaffinity_np;
-    pthread_attr_getaffinity_np; pthread_attr_setaffinity_np;
+    pthread_attr_getaffinity_np;
   }
 
   GLIBC_2.3.4 {
     # New affinity interfaces.
     pthread_getaffinity_np; pthread_setaffinity_np;
-    pthread_attr_getaffinity_np; pthread_attr_setaffinity_np;
+    pthread_attr_getaffinity_np;
 
     pthread_setschedprio;
   }
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index c4e72f57a9..42730a46df 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -433,6 +433,8 @@ extern int __pthread_attr_getstack (const pthread_attr_t *__restrict __attr,
 				    size_t *__restrict __stacksize);
 extern int __pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
 				    size_t __stacksize);
+int __pthread_attr_setaffinity_np (pthread_attr_t *, size_t, const cpu_set_t *);
+libc_hidden_proto (__pthread_attr_setaffinity_np)
 extern int __pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
 				  const pthread_rwlockattr_t *__restrict
 				  __attr);
diff --git a/nptl/pthread_attr_setaffinity.c b/nptl/pthread_attr_setaffinity.c
index cbdee85343..a42ffd92f4 100644
--- a/nptl/pthread_attr_setaffinity.c
+++ b/nptl/pthread_attr_setaffinity.c
@@ -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
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 41bb214bb9..2bfad21106 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -1423,6 +1423,7 @@ GLIBC_2.17 pthread_attr_getschedparam F
 GLIBC_2.17 pthread_attr_getschedpolicy F
 GLIBC_2.17 pthread_attr_getscope F
 GLIBC_2.17 pthread_attr_init F
+GLIBC_2.17 pthread_attr_setaffinity_np F
 GLIBC_2.17 pthread_attr_setdetachstate F
 GLIBC_2.17 pthread_attr_setinheritsched F
 GLIBC_2.17 pthread_attr_setschedparam F
@@ -2146,4 +2147,5 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
index 48b368acb1..2c6f328caa 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
@@ -72,7 +72,6 @@ GLIBC_2.17 pthread_attr_getguardsize F
 GLIBC_2.17 pthread_attr_getstack F
 GLIBC_2.17 pthread_attr_getstackaddr F
 GLIBC_2.17 pthread_attr_getstacksize F
-GLIBC_2.17 pthread_attr_setaffinity_np F
 GLIBC_2.17 pthread_attr_setguardsize F
 GLIBC_2.17 pthread_attr_setstack F
 GLIBC_2.17 pthread_attr_setstackaddr F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index 6430af207f..c0fc196987 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -2157,6 +2157,7 @@ GLIBC_2.3.3 inet6_option_next F
 GLIBC_2.3.3 inet6_option_space F
 GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
+GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2203,6 +2204,7 @@ GLIBC_2.3.4 __vsprintf_chk F
 GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
+GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2226,6 +2228,7 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
diff --git a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
index cfffc5f529..2fb0e17408 100644
--- a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
@@ -211,7 +211,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
 GLIBC_2.3.3 __pthread_unregister_cancel_restore F
 GLIBC_2.3.3 __pthread_unwind_next F
 GLIBC_2.3.3 pthread_attr_getaffinity_np F
-GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 pthread_attr_setstack F
 GLIBC_2.3.3 pthread_attr_setstacksize F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
@@ -222,7 +221,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index f4ea1756d5..b5bc69177a 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -133,6 +133,7 @@ GLIBC_2.30 twalk_r F
 GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
@@ -1494,6 +1495,7 @@ GLIBC_2.4 pthread_attr_getschedparam F
 GLIBC_2.4 pthread_attr_getschedpolicy F
 GLIBC_2.4 pthread_attr_getscope F
 GLIBC_2.4 pthread_attr_init F
+GLIBC_2.4 pthread_attr_setaffinity_np F
 GLIBC_2.4 pthread_attr_setdetachstate F
 GLIBC_2.4 pthread_attr_setinheritsched F
 GLIBC_2.4 pthread_attr_setschedparam F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
index 050e799de8..352b22562e 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
@@ -107,7 +107,6 @@ GLIBC_2.4 pthread_attr_getguardsize F
 GLIBC_2.4 pthread_attr_getstack F
 GLIBC_2.4 pthread_attr_getstackaddr F
 GLIBC_2.4 pthread_attr_getstacksize F
-GLIBC_2.4 pthread_attr_setaffinity_np F
 GLIBC_2.4 pthread_attr_setguardsize F
 GLIBC_2.4 pthread_attr_setstack F
 GLIBC_2.4 pthread_attr_setstackaddr F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index f1456b26b2..ff6040f2d7 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -130,6 +130,7 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
@@ -1491,6 +1492,7 @@ GLIBC_2.4 pthread_attr_getschedparam F
 GLIBC_2.4 pthread_attr_getschedpolicy F
 GLIBC_2.4 pthread_attr_getscope F
 GLIBC_2.4 pthread_attr_init F
+GLIBC_2.4 pthread_attr_setaffinity_np F
 GLIBC_2.4 pthread_attr_setdetachstate F
 GLIBC_2.4 pthread_attr_setinheritsched F
 GLIBC_2.4 pthread_attr_setschedparam F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
index 050e799de8..352b22562e 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
@@ -107,7 +107,6 @@ GLIBC_2.4 pthread_attr_getguardsize F
 GLIBC_2.4 pthread_attr_getstack F
 GLIBC_2.4 pthread_attr_getstackaddr F
 GLIBC_2.4 pthread_attr_getstacksize F
-GLIBC_2.4 pthread_attr_setaffinity_np F
 GLIBC_2.4 pthread_attr_setguardsize F
 GLIBC_2.4 pthread_attr_setstack F
 GLIBC_2.4 pthread_attr_setstackaddr F
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index c54aed2f8e..ff47305e4a 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -1411,6 +1411,7 @@ GLIBC_2.29 pthread_attr_getschedparam F
 GLIBC_2.29 pthread_attr_getschedpolicy F
 GLIBC_2.29 pthread_attr_getscope F
 GLIBC_2.29 pthread_attr_init F
+GLIBC_2.29 pthread_attr_setaffinity_np F
 GLIBC_2.29 pthread_attr_setdetachstate F
 GLIBC_2.29 pthread_attr_setinheritsched F
 GLIBC_2.29 pthread_attr_setschedparam F
@@ -2090,4 +2091,5 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/csky/libpthread.abilist b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
index 977905a839..8f8b4f8751 100644
--- a/sysdeps/unix/sysv/linux/csky/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
@@ -80,7 +80,6 @@ GLIBC_2.29 pthread_attr_getguardsize F
 GLIBC_2.29 pthread_attr_getstack F
 GLIBC_2.29 pthread_attr_getstackaddr F
 GLIBC_2.29 pthread_attr_getstacksize F
-GLIBC_2.29 pthread_attr_setaffinity_np F
 GLIBC_2.29 pthread_attr_setguardsize F
 GLIBC_2.29 pthread_attr_setstack F
 GLIBC_2.29 pthread_attr_setstackaddr F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index 87373f755b..1724e42d34 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2008,6 +2008,7 @@ GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
+GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2036,6 +2037,7 @@ GLIBC_2.3.4 __vsprintf_chk F
 GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
+GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2047,6 +2049,7 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
index 558d3f0dfd..4f2ed9e841 100644
--- a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
@@ -203,7 +203,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
 GLIBC_2.3.3 __pthread_unregister_cancel_restore F
 GLIBC_2.3.3 __pthread_unwind_next F
 GLIBC_2.3.3 pthread_attr_getaffinity_np F
-GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
@@ -212,7 +211,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 1bd2e02f79..aa8df3297a 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2173,6 +2173,7 @@ GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
+GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2201,6 +2202,7 @@ GLIBC_2.3.4 __vsprintf_chk F
 GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
+GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2213,6 +2215,7 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
index f13fdce3a8..9de9705e66 100644
--- a/sysdeps/unix/sysv/linux/i386/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
@@ -211,7 +211,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
 GLIBC_2.3.3 __pthread_unregister_cancel_restore F
 GLIBC_2.3.3 __pthread_unwind_next F
 GLIBC_2.3.3 pthread_attr_getaffinity_np F
-GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
@@ -220,7 +219,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index 07e51d46bf..2effe01e12 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -2038,6 +2038,7 @@ GLIBC_2.3.3 inet6_option_next F
 GLIBC_2.3.3 inet6_option_space F
 GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
+GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2068,6 +2069,7 @@ GLIBC_2.3.4 __vsprintf_chk F
 GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
+GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2079,6 +2081,7 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
index 0c96fc3ccb..d0b122e280 100644
--- a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
@@ -203,7 +203,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
 GLIBC_2.3.3 __pthread_unregister_cancel_restore F
 GLIBC_2.3.3 __pthread_unwind_next F
 GLIBC_2.3.3 pthread_attr_getaffinity_np F
-GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 pthread_attr_setstack F
 GLIBC_2.3.3 pthread_attr_setstacksize F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
@@ -214,7 +213,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index 42ea4c24bf..285f56948f 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -134,6 +134,7 @@ GLIBC_2.30 twalk_r F
 GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0x98
@@ -1474,6 +1475,7 @@ GLIBC_2.4 pthread_attr_getschedparam F
 GLIBC_2.4 pthread_attr_getschedpolicy F
 GLIBC_2.4 pthread_attr_getscope F
 GLIBC_2.4 pthread_attr_init F
+GLIBC_2.4 pthread_attr_setaffinity_np F
 GLIBC_2.4 pthread_attr_setdetachstate F
 GLIBC_2.4 pthread_attr_setinheritsched F
 GLIBC_2.4 pthread_attr_setschedparam F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
index 050e799de8..352b22562e 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
@@ -107,7 +107,6 @@ GLIBC_2.4 pthread_attr_getguardsize F
 GLIBC_2.4 pthread_attr_getstack F
 GLIBC_2.4 pthread_attr_getstackaddr F
 GLIBC_2.4 pthread_attr_getstacksize F
-GLIBC_2.4 pthread_attr_setaffinity_np F
 GLIBC_2.4 pthread_attr_setguardsize F
 GLIBC_2.4 pthread_attr_setstack F
 GLIBC_2.4 pthread_attr_setstackaddr F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index e9358fb092..fb0b5690bf 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2117,6 +2117,7 @@ GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
+GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2145,6 +2146,7 @@ GLIBC_2.3.4 __vsprintf_chk F
 GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
+GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2159,6 +2161,7 @@ GLIBC_2.30 twalk_r F
 GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
index f13fdce3a8..9de9705e66 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
@@ -211,7 +211,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
 GLIBC_2.3.3 __pthread_unregister_cancel_restore F
 GLIBC_2.3.3 __pthread_unwind_next F
 GLIBC_2.3.3 pthread_attr_getaffinity_np F
-GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
@@ -220,7 +219,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 2cefe739c0..db490575b5 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -1426,6 +1426,7 @@ GLIBC_2.18 pthread_attr_getschedparam F
 GLIBC_2.18 pthread_attr_getschedpolicy F
 GLIBC_2.18 pthread_attr_getscope F
 GLIBC_2.18 pthread_attr_init F
+GLIBC_2.18 pthread_attr_setaffinity_np F
 GLIBC_2.18 pthread_attr_setdetachstate F
 GLIBC_2.18 pthread_attr_setinheritsched F
 GLIBC_2.18 pthread_attr_setschedparam F
@@ -2141,4 +2142,5 @@ GLIBC_2.30 twalk_r F
 GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
index 87bd3ad30e..2e90b256b4 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
@@ -72,7 +72,6 @@ GLIBC_2.18 pthread_attr_getguardsize F
 GLIBC_2.18 pthread_attr_getstack F
 GLIBC_2.18 pthread_attr_getstackaddr F
 GLIBC_2.18 pthread_attr_getstacksize F
-GLIBC_2.18 pthread_attr_setaffinity_np F
 GLIBC_2.18 pthread_attr_setguardsize F
 GLIBC_2.18 pthread_attr_setstack F
 GLIBC_2.18 pthread_attr_setstackaddr F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index 3474ef1490..9d6ea2fd12 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -1426,6 +1426,7 @@ GLIBC_2.18 pthread_attr_getschedparam F
 GLIBC_2.18 pthread_attr_getschedpolicy F
 GLIBC_2.18 pthread_attr_getscope F
 GLIBC_2.18 pthread_attr_init F
+GLIBC_2.18 pthread_attr_setaffinity_np F
 GLIBC_2.18 pthread_attr_setdetachstate F
 GLIBC_2.18 pthread_attr_setinheritsched F
 GLIBC_2.18 pthread_attr_setschedparam F
@@ -2138,4 +2139,5 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
index 87bd3ad30e..2e90b256b4 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
@@ -72,7 +72,6 @@ GLIBC_2.18 pthread_attr_getguardsize F
 GLIBC_2.18 pthread_attr_getstack F
 GLIBC_2.18 pthread_attr_getstackaddr F
 GLIBC_2.18 pthread_attr_getstacksize F
-GLIBC_2.18 pthread_attr_setaffinity_np F
 GLIBC_2.18 pthread_attr_setguardsize F
 GLIBC_2.18 pthread_attr_setstack F
 GLIBC_2.18 pthread_attr_setstackaddr F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index a6f99a7369..800f6bbc74 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2091,6 +2091,7 @@ GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
+GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2119,6 +2120,7 @@ GLIBC_2.3.4 __vsprintf_chk F
 GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
+GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2130,6 +2132,7 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
index 474ed999b3..98c3ff9e0e 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
@@ -210,7 +210,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
 GLIBC_2.3.3 __pthread_unregister_cancel_restore F
 GLIBC_2.3.3 __pthread_unwind_next F
 GLIBC_2.3.3 pthread_attr_getaffinity_np F
-GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 pthread_attr_setstack F
 GLIBC_2.3.3 pthread_attr_setstacksize F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
@@ -221,7 +220,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index 48222af11c..f5dbb73f60 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2089,6 +2089,7 @@ GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
+GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2117,6 +2118,7 @@ GLIBC_2.3.4 __vsprintf_chk F
 GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
+GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2128,6 +2130,7 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
index 474ed999b3..98c3ff9e0e 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
@@ -210,7 +210,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
 GLIBC_2.3.3 __pthread_unregister_cancel_restore F
 GLIBC_2.3.3 __pthread_unwind_next F
 GLIBC_2.3.3 pthread_attr_getaffinity_np F
-GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 pthread_attr_setstack F
 GLIBC_2.3.3 pthread_attr_setstacksize F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
@@ -221,7 +220,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index 99965cfb0f..2929249c59 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2097,6 +2097,7 @@ GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
+GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2125,6 +2126,7 @@ GLIBC_2.3.4 __vsprintf_chk F
 GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
+GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2136,6 +2138,7 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index 2c8bafc669..aec8de9427 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2089,6 +2089,7 @@ GLIBC_2.3.3 inet6_option_space F
 GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
+GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2119,6 +2120,7 @@ GLIBC_2.3.4 __vsprintf_chk F
 GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
+GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2130,6 +2132,7 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index 52cf72052c..9aeb1aaf33 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -1468,6 +1468,7 @@ GLIBC_2.21 pthread_attr_getschedparam F
 GLIBC_2.21 pthread_attr_getschedpolicy F
 GLIBC_2.21 pthread_attr_getscope F
 GLIBC_2.21 pthread_attr_init F
+GLIBC_2.21 pthread_attr_setaffinity_np F
 GLIBC_2.21 pthread_attr_setdetachstate F
 GLIBC_2.21 pthread_attr_setinheritsched F
 GLIBC_2.21 pthread_attr_setschedparam F
@@ -2179,4 +2180,5 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
index fb9c4a178a..8e3f650c0c 100644
--- a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
@@ -72,7 +72,6 @@ GLIBC_2.21 pthread_attr_getguardsize F
 GLIBC_2.21 pthread_attr_getstack F
 GLIBC_2.21 pthread_attr_getstackaddr F
 GLIBC_2.21 pthread_attr_getstacksize F
-GLIBC_2.21 pthread_attr_setaffinity_np F
 GLIBC_2.21 pthread_attr_setguardsize F
 GLIBC_2.21 pthread_attr_setstack F
 GLIBC_2.21 pthread_attr_setstackaddr F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 2ca5bbccf3..c6ad37e5d2 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2123,6 +2123,7 @@ GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
+GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2159,6 +2160,7 @@ GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
 GLIBC_2.3.4 longjmp F
 GLIBC_2.3.4 makecontext F
+GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2186,6 +2188,7 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
index 65a9ef573e..359e47b705 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
@@ -211,7 +211,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
 GLIBC_2.3.3 __pthread_unregister_cancel_restore F
 GLIBC_2.3.3 __pthread_unwind_next F
 GLIBC_2.3.3 pthread_attr_getaffinity_np F
-GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
@@ -221,7 +220,6 @@ GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 longjmp F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index e6c4d002d5..e92f31f072 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2156,6 +2156,7 @@ GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
+GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2192,6 +2193,7 @@ GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
 GLIBC_2.3.4 longjmp F
 GLIBC_2.3.4 makecontext F
+GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2219,6 +2221,7 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index 82d77b7e48..537fcbe0cb 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -1987,6 +1987,7 @@ GLIBC_2.3.3 inet6_option_next F
 GLIBC_2.3.3 inet6_option_space F
 GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
+GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2022,6 +2023,7 @@ GLIBC_2.3.4 getcontext F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
 GLIBC_2.3.4 longjmp F
+GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2049,6 +2051,7 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
index fe5bf9fd47..b58778fcf7 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
@@ -201,7 +201,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
 GLIBC_2.3.3 __pthread_unregister_cancel_restore F
 GLIBC_2.3.3 __pthread_unwind_next F
 GLIBC_2.3.3 pthread_attr_getaffinity_np F
-GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
@@ -211,7 +210,6 @@ GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 longjmp F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index 0c2513a4b3..e2874d4294 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -1512,6 +1512,7 @@ GLIBC_2.17 pthread_attr_getschedparam F
 GLIBC_2.17 pthread_attr_getschedpolicy F
 GLIBC_2.17 pthread_attr_getscope F
 GLIBC_2.17 pthread_attr_init F
+GLIBC_2.17 pthread_attr_setaffinity_np F
 GLIBC_2.17 pthread_attr_setdetachstate F
 GLIBC_2.17 pthread_attr_setinheritsched F
 GLIBC_2.17 pthread_attr_setschedparam F
@@ -2341,4 +2342,5 @@ GLIBC_2.32 __wcstoieee128_l F
 GLIBC_2.32 __wprintf_chkieee128 F
 GLIBC_2.32 __wprintfieee128 F
 GLIBC_2.32 __wscanfieee128 F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
index 48b368acb1..2c6f328caa 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
@@ -72,7 +72,6 @@ GLIBC_2.17 pthread_attr_getguardsize F
 GLIBC_2.17 pthread_attr_getstack F
 GLIBC_2.17 pthread_attr_getstackaddr F
 GLIBC_2.17 pthread_attr_getstacksize F
-GLIBC_2.17 pthread_attr_setaffinity_np F
 GLIBC_2.17 pthread_attr_setguardsize F
 GLIBC_2.17 pthread_attr_setstack F
 GLIBC_2.17 pthread_attr_setstackaddr F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index 234d34929a..f3a4babc77 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -1414,6 +1414,7 @@ GLIBC_2.27 pthread_attr_getschedparam F
 GLIBC_2.27 pthread_attr_getschedpolicy F
 GLIBC_2.27 pthread_attr_getscope F
 GLIBC_2.27 pthread_attr_init F
+GLIBC_2.27 pthread_attr_setaffinity_np F
 GLIBC_2.27 pthread_attr_setdetachstate F
 GLIBC_2.27 pthread_attr_setinheritsched F
 GLIBC_2.27 pthread_attr_setschedparam F
@@ -2108,4 +2109,5 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
index 44e3719991..3f276531fb 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
@@ -69,7 +69,6 @@ GLIBC_2.27 pthread_attr_getguardsize F
 GLIBC_2.27 pthread_attr_getstack F
 GLIBC_2.27 pthread_attr_getstackaddr F
 GLIBC_2.27 pthread_attr_getstacksize F
-GLIBC_2.27 pthread_attr_setaffinity_np F
 GLIBC_2.27 pthread_attr_setguardsize F
 GLIBC_2.27 pthread_attr_setstack F
 GLIBC_2.27 pthread_attr_setstackaddr F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index 1f06cce028..5ed93d018d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2130,6 +2130,7 @@ GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
+GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2158,6 +2159,7 @@ GLIBC_2.3.4 __vsprintf_chk F
 GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
+GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2184,6 +2186,7 @@ GLIBC_2.30 twalk_r F
 GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
index 0b2913ba2b..b7f8abece5 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
@@ -213,7 +213,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
 GLIBC_2.3.3 __pthread_unregister_cancel_restore F
 GLIBC_2.3.3 __pthread_unwind_next F
 GLIBC_2.3.3 pthread_attr_getaffinity_np F
-GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
@@ -222,7 +221,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 26c2ce32e5..66ab0f48cb 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2032,6 +2032,7 @@ GLIBC_2.3.3 inet6_option_next F
 GLIBC_2.3.3 inet6_option_space F
 GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
+GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2062,6 +2063,7 @@ GLIBC_2.3.4 __vsprintf_chk F
 GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
+GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2085,6 +2087,7 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
index 8c71cdc48d..0799bb2bf4 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
@@ -205,7 +205,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
 GLIBC_2.3.3 __pthread_unregister_cancel_restore F
 GLIBC_2.3.3 __pthread_unwind_next F
 GLIBC_2.3.3 pthread_attr_getaffinity_np F
-GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
@@ -214,7 +213,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index 7ad2e920c3..8a676b0833 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2012,6 +2012,7 @@ GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
+GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2040,6 +2041,7 @@ GLIBC_2.3.4 __vsprintf_chk F
 GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
+GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2054,6 +2056,7 @@ GLIBC_2.30 twalk_r F
 GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
index 558d3f0dfd..4f2ed9e841 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
@@ -203,7 +203,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
 GLIBC_2.3.3 __pthread_unregister_cancel_restore F
 GLIBC_2.3.3 __pthread_unwind_next F
 GLIBC_2.3.3 pthread_attr_getaffinity_np F
-GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
@@ -212,7 +211,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index d2611bf0a5..e6f7e1b02d 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2012,6 +2012,7 @@ GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
+GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2040,6 +2041,7 @@ GLIBC_2.3.4 __vsprintf_chk F
 GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
+GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2051,6 +2053,7 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
index 558d3f0dfd..4f2ed9e841 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
@@ -203,7 +203,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
 GLIBC_2.3.3 __pthread_unregister_cancel_restore F
 GLIBC_2.3.3 __pthread_unwind_next F
 GLIBC_2.3.3 pthread_attr_getaffinity_np F
-GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
@@ -212,7 +211,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index 18a528f0e9..e1ae0f6618 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2124,6 +2124,7 @@ GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
+GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2152,6 +2153,7 @@ GLIBC_2.3.4 __vsprintf_chk F
 GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
+GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2175,6 +2177,7 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
index cfffc5f529..2fb0e17408 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
@@ -211,7 +211,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
 GLIBC_2.3.3 __pthread_unregister_cancel_restore F
 GLIBC_2.3.3 __pthread_unwind_next F
 GLIBC_2.3.3 pthread_attr_getaffinity_np F
-GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 pthread_attr_setstack F
 GLIBC_2.3.3 pthread_attr_setstacksize F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
@@ -222,7 +221,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index a1d48b0f3c..67a35b3812 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2061,6 +2061,7 @@ GLIBC_2.3.3 inet6_option_next F
 GLIBC_2.3.3 inet6_option_space F
 GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
+GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2091,6 +2092,7 @@ GLIBC_2.3.4 __vsprintf_chk F
 GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
+GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2102,6 +2104,7 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
index 0c96fc3ccb..d0b122e280 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
@@ -203,7 +203,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
 GLIBC_2.3.3 __pthread_unregister_cancel_restore F
 GLIBC_2.3.3 __pthread_unwind_next F
 GLIBC_2.3.3 pthread_attr_getaffinity_np F
-GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 pthread_attr_setstack F
 GLIBC_2.3.3 pthread_attr_setstacksize F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
@@ -214,7 +213,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 6418ace78a..c48d097b7f 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2019,6 +2019,7 @@ GLIBC_2.3.3 inet6_option_next F
 GLIBC_2.3.3 inet6_option_space F
 GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
+GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2049,6 +2050,7 @@ GLIBC_2.3.4 __vsprintf_chk F
 GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
+GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2060,6 +2062,7 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
index 2888c3150b..b08f2413b1 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
@@ -203,7 +203,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
 GLIBC_2.3.3 __pthread_unregister_cancel_restore F
 GLIBC_2.3.3 __pthread_unwind_next F
 GLIBC_2.3.3 pthread_attr_getaffinity_np F
-GLIBC_2.3.3 pthread_attr_setaffinity_np F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
@@ -212,7 +211,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_attr_setaffinity_np F
 GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index edb9f2f004..83618e9254 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -1431,6 +1431,7 @@ GLIBC_2.16 pthread_attr_getschedparam F
 GLIBC_2.16 pthread_attr_getschedpolicy F
 GLIBC_2.16 pthread_attr_getscope F
 GLIBC_2.16 pthread_attr_init F
+GLIBC_2.16 pthread_attr_setaffinity_np F
 GLIBC_2.16 pthread_attr_setdetachstate F
 GLIBC_2.16 pthread_attr_setinheritsched F
 GLIBC_2.16 pthread_attr_setschedparam F
@@ -2159,4 +2160,5 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
index 5ac72e4515..58e5c764dd 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
@@ -72,7 +72,6 @@ GLIBC_2.16 pthread_attr_getguardsize F
 GLIBC_2.16 pthread_attr_getstack F
 GLIBC_2.16 pthread_attr_getstackaddr F
 GLIBC_2.16 pthread_attr_getstacksize F
-GLIBC_2.16 pthread_attr_setaffinity_np F
 GLIBC_2.16 pthread_attr_setguardsize F
 GLIBC_2.16 pthread_attr_setstack F
 GLIBC_2.16 pthread_attr_setstackaddr F
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 04/19] nptl: Move pthread_getaffinity_np into libc
  2020-05-19 10:43 [PATCH 00/19] Signal mask for timer helper thread Florian Weimer via Libc-alpha
                   ` (2 preceding siblings ...)
  2020-05-19 10:44 ` [PATCH 03/19] nptl: Move pthread_attr_setaffinity_np into libc Florian Weimer via Libc-alpha
@ 2020-05-19 10:44 ` Florian Weimer via Libc-alpha
  2020-05-20 13:52   ` Carlos O'Donell via Libc-alpha
  2020-05-19 10:44 ` [PATCH 05/19] nptl: Move pthread_gettattr_np " Florian Weimer via Libc-alpha
                   ` (15 subsequent siblings)
  19 siblings, 1 reply; 42+ messages in thread
From: Florian Weimer via Libc-alpha @ 2020-05-19 10:44 UTC (permalink / raw)
  To: libc-alpha

This is part of the libpthread removal project:

    <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>

The abilist updates were performed by:

git ls-files 'sysdeps/unix/sysv/linux/**/libc.abilist' \
  | while read x ; do
    echo "GLIBC_2.32 pthread_getaffinity_np F" >> $x
done
python3 scripts/move-symbol-to-libc.py pthread_getaffinity_np
---
 nptl/Makefile                                 |  3 ++-
 nptl/Versions                                 |  5 ++++-
 nptl/pthreadP.h                               |  1 +
 nptl/pthread_getaffinity.c                    | 21 ++++++++++++-------
 sysdeps/unix/sysv/linux/aarch64/libc.abilist  |  2 ++
 .../sysv/linux/aarch64/libpthread.abilist     |  1 -
 sysdeps/unix/sysv/linux/alpha/libc.abilist    |  3 +++
 .../unix/sysv/linux/alpha/libpthread.abilist  |  2 --
 sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  2 ++
 .../unix/sysv/linux/arm/be/libpthread.abilist |  1 -
 sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  2 ++
 .../unix/sysv/linux/arm/le/libpthread.abilist |  1 -
 sysdeps/unix/sysv/linux/csky/libc.abilist     |  2 ++
 .../unix/sysv/linux/csky/libpthread.abilist   |  1 -
 sysdeps/unix/sysv/linux/hppa/libc.abilist     |  3 +++
 .../unix/sysv/linux/hppa/libpthread.abilist   |  2 --
 sysdeps/unix/sysv/linux/i386/libc.abilist     |  3 +++
 .../unix/sysv/linux/i386/libpthread.abilist   |  2 --
 sysdeps/unix/sysv/linux/ia64/libc.abilist     |  3 +++
 .../unix/sysv/linux/ia64/libpthread.abilist   |  2 --
 .../sysv/linux/m68k/coldfire/libc.abilist     |  2 ++
 .../linux/m68k/coldfire/libpthread.abilist    |  1 -
 .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  3 +++
 .../sysv/linux/m68k/m680x0/libpthread.abilist |  2 --
 .../sysv/linux/microblaze/be/libc.abilist     |  2 ++
 .../linux/microblaze/be/libpthread.abilist    |  1 -
 .../sysv/linux/microblaze/le/libc.abilist     |  2 ++
 .../linux/microblaze/le/libpthread.abilist    |  1 -
 .../sysv/linux/mips/mips32/fpu/libc.abilist   |  3 +++
 .../sysv/linux/mips/mips32/libpthread.abilist |  2 --
 .../sysv/linux/mips/mips32/nofpu/libc.abilist |  3 +++
 .../sysv/linux/mips/mips64/libpthread.abilist |  2 --
 .../sysv/linux/mips/mips64/n32/libc.abilist   |  3 +++
 .../sysv/linux/mips/mips64/n64/libc.abilist   |  3 +++
 sysdeps/unix/sysv/linux/nios2/libc.abilist    |  2 ++
 .../unix/sysv/linux/nios2/libpthread.abilist  |  1 -
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |  3 +++
 .../powerpc/powerpc32/libpthread.abilist      |  2 --
 .../powerpc/powerpc32/nofpu/libc.abilist      |  3 +++
 .../linux/powerpc/powerpc64/be/libc.abilist   |  3 +++
 .../powerpc/powerpc64/be/libpthread.abilist   |  2 --
 .../linux/powerpc/powerpc64/le/libc.abilist   |  2 ++
 .../powerpc/powerpc64/le/libpthread.abilist   |  1 -
 .../unix/sysv/linux/riscv/rv64/libc.abilist   |  2 ++
 .../sysv/linux/riscv/rv64/libpthread.abilist  |  1 -
 .../unix/sysv/linux/s390/s390-32/libc.abilist |  3 +++
 .../linux/s390/s390-32/libpthread.abilist     |  2 --
 .../unix/sysv/linux/s390/s390-64/libc.abilist |  3 +++
 .../linux/s390/s390-64/libpthread.abilist     |  2 --
 sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  3 +++
 .../unix/sysv/linux/sh/be/libpthread.abilist  |  2 --
 sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  3 +++
 .../unix/sysv/linux/sh/le/libpthread.abilist  |  2 --
 .../sysv/linux/sparc/sparc32/libc.abilist     |  3 +++
 .../linux/sparc/sparc32/libpthread.abilist    |  2 --
 .../sysv/linux/sparc/sparc64/libc.abilist     |  3 +++
 .../linux/sparc/sparc64/libpthread.abilist    |  2 --
 .../unix/sysv/linux/x86_64/64/libc.abilist    |  3 +++
 .../sysv/linux/x86_64/64/libpthread.abilist   |  2 --
 .../unix/sysv/linux/x86_64/x32/libc.abilist   |  2 ++
 .../sysv/linux/x86_64/x32/libpthread.abilist  |  1 -
 61 files changed, 99 insertions(+), 53 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
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 2bfad21106..55499b8d3c 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -1439,6 +1439,7 @@ GLIBC_2.17 pthread_condattr_destroy F
 GLIBC_2.17 pthread_condattr_init F
 GLIBC_2.17 pthread_equal F
 GLIBC_2.17 pthread_exit F
+GLIBC_2.17 pthread_getaffinity_np F
 GLIBC_2.17 pthread_getschedparam F
 GLIBC_2.17 pthread_mutex_destroy F
 GLIBC_2.17 pthread_mutex_init F
@@ -2148,4 +2149,5 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
index 2c6f328caa..77cf95c491 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
@@ -95,7 +95,6 @@ GLIBC_2.17 pthread_condattr_setpshared F
 GLIBC_2.17 pthread_create F
 GLIBC_2.17 pthread_detach F
 GLIBC_2.17 pthread_exit F
-GLIBC_2.17 pthread_getaffinity_np F
 GLIBC_2.17 pthread_getattr_np F
 GLIBC_2.17 pthread_getconcurrency F
 GLIBC_2.17 pthread_getcpuclockid F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index c0fc196987..387b0badaa 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -2158,6 +2158,7 @@ GLIBC_2.3.3 inet6_option_space F
 GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 pthread_attr_setaffinity_np F
+GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2205,6 +2206,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
 GLIBC_2.3.4 pthread_attr_setaffinity_np F
+GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2229,6 +2231,7 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
diff --git a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
index 2fb0e17408..8d504c3cdb 100644
--- a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
@@ -216,12 +216,10 @@ GLIBC_2.3.3 pthread_attr_setstacksize F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
-GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
 GLIBC_2.30 pthread_cond_clockwait F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index b5bc69177a..2775ee0963 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -134,6 +134,7 @@ GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
@@ -1511,6 +1512,7 @@ GLIBC_2.4 pthread_condattr_destroy F
 GLIBC_2.4 pthread_condattr_init F
 GLIBC_2.4 pthread_equal F
 GLIBC_2.4 pthread_exit F
+GLIBC_2.4 pthread_getaffinity_np F
 GLIBC_2.4 pthread_getschedparam F
 GLIBC_2.4 pthread_mutex_destroy F
 GLIBC_2.4 pthread_mutex_init F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
index 352b22562e..c1313fb4bf 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
@@ -130,7 +130,6 @@ GLIBC_2.4 pthread_condattr_setpshared F
 GLIBC_2.4 pthread_create F
 GLIBC_2.4 pthread_detach F
 GLIBC_2.4 pthread_exit F
-GLIBC_2.4 pthread_getaffinity_np F
 GLIBC_2.4 pthread_getattr_np F
 GLIBC_2.4 pthread_getconcurrency F
 GLIBC_2.4 pthread_getcpuclockid F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index ff6040f2d7..0e233ff542 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -131,6 +131,7 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
@@ -1508,6 +1509,7 @@ GLIBC_2.4 pthread_condattr_destroy F
 GLIBC_2.4 pthread_condattr_init F
 GLIBC_2.4 pthread_equal F
 GLIBC_2.4 pthread_exit F
+GLIBC_2.4 pthread_getaffinity_np F
 GLIBC_2.4 pthread_getschedparam F
 GLIBC_2.4 pthread_mutex_destroy F
 GLIBC_2.4 pthread_mutex_init F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
index 352b22562e..c1313fb4bf 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
@@ -130,7 +130,6 @@ GLIBC_2.4 pthread_condattr_setpshared F
 GLIBC_2.4 pthread_create F
 GLIBC_2.4 pthread_detach F
 GLIBC_2.4 pthread_exit F
-GLIBC_2.4 pthread_getaffinity_np F
 GLIBC_2.4 pthread_getattr_np F
 GLIBC_2.4 pthread_getconcurrency F
 GLIBC_2.4 pthread_getcpuclockid F
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index ff47305e4a..dbef2ad653 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -1427,6 +1427,7 @@ GLIBC_2.29 pthread_condattr_destroy F
 GLIBC_2.29 pthread_condattr_init F
 GLIBC_2.29 pthread_equal F
 GLIBC_2.29 pthread_exit F
+GLIBC_2.29 pthread_getaffinity_np F
 GLIBC_2.29 pthread_getschedparam F
 GLIBC_2.29 pthread_mutex_destroy F
 GLIBC_2.29 pthread_mutex_init F
@@ -2092,4 +2093,5 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/csky/libpthread.abilist b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
index 8f8b4f8751..bcdea792ec 100644
--- a/sysdeps/unix/sysv/linux/csky/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
@@ -103,7 +103,6 @@ GLIBC_2.29 pthread_condattr_setpshared F
 GLIBC_2.29 pthread_create F
 GLIBC_2.29 pthread_detach F
 GLIBC_2.29 pthread_exit F
-GLIBC_2.29 pthread_getaffinity_np F
 GLIBC_2.29 pthread_getattr_default_np F
 GLIBC_2.29 pthread_getattr_np F
 GLIBC_2.29 pthread_getconcurrency F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index 1724e42d34..4405dbfe63 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2009,6 +2009,7 @@ GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
 GLIBC_2.3.3 pthread_attr_setaffinity_np F
+GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2038,6 +2039,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
 GLIBC_2.3.4 pthread_attr_setaffinity_np F
+GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2050,6 +2052,7 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
index 4f2ed9e841..a12e0308b0 100644
--- a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
@@ -206,12 +206,10 @@ GLIBC_2.3.3 pthread_attr_getaffinity_np F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
-GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
 GLIBC_2.30 pthread_cond_clockwait F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index aa8df3297a..de447796e7 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2174,6 +2174,7 @@ GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
 GLIBC_2.3.3 pthread_attr_setaffinity_np F
+GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2203,6 +2204,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
 GLIBC_2.3.4 pthread_attr_setaffinity_np F
+GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2216,6 +2218,7 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
index 9de9705e66..f84feaca66 100644
--- a/sysdeps/unix/sysv/linux/i386/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
@@ -214,12 +214,10 @@ GLIBC_2.3.3 pthread_attr_getaffinity_np F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
-GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
 GLIBC_2.30 pthread_cond_clockwait F
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index 2effe01e12..df3da1bea3 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -2039,6 +2039,7 @@ GLIBC_2.3.3 inet6_option_space F
 GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 pthread_attr_setaffinity_np F
+GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2070,6 +2071,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
 GLIBC_2.3.4 pthread_attr_setaffinity_np F
+GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2082,6 +2084,7 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
index d0b122e280..927afe3bd5 100644
--- a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
@@ -208,12 +208,10 @@ GLIBC_2.3.3 pthread_attr_setstacksize F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
-GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
 GLIBC_2.30 pthread_cond_clockwait F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index 285f56948f..deb56b3dfc 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -135,6 +135,7 @@ GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0x98
@@ -1491,6 +1492,7 @@ GLIBC_2.4 pthread_condattr_destroy F
 GLIBC_2.4 pthread_condattr_init F
 GLIBC_2.4 pthread_equal F
 GLIBC_2.4 pthread_exit F
+GLIBC_2.4 pthread_getaffinity_np F
 GLIBC_2.4 pthread_getschedparam F
 GLIBC_2.4 pthread_mutex_destroy F
 GLIBC_2.4 pthread_mutex_init F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
index 352b22562e..c1313fb4bf 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
@@ -130,7 +130,6 @@ GLIBC_2.4 pthread_condattr_setpshared F
 GLIBC_2.4 pthread_create F
 GLIBC_2.4 pthread_detach F
 GLIBC_2.4 pthread_exit F
-GLIBC_2.4 pthread_getaffinity_np F
 GLIBC_2.4 pthread_getattr_np F
 GLIBC_2.4 pthread_getconcurrency F
 GLIBC_2.4 pthread_getcpuclockid F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index fb0b5690bf..96d8a1a101 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2118,6 +2118,7 @@ GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
 GLIBC_2.3.3 pthread_attr_setaffinity_np F
+GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2147,6 +2148,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
 GLIBC_2.3.4 pthread_attr_setaffinity_np F
+GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2162,6 +2164,7 @@ GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
index 9de9705e66..f84feaca66 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
@@ -214,12 +214,10 @@ GLIBC_2.3.3 pthread_attr_getaffinity_np F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
-GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
 GLIBC_2.30 pthread_cond_clockwait F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index db490575b5..134db9a3f8 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -1442,6 +1442,7 @@ GLIBC_2.18 pthread_condattr_destroy F
 GLIBC_2.18 pthread_condattr_init F
 GLIBC_2.18 pthread_equal F
 GLIBC_2.18 pthread_exit F
+GLIBC_2.18 pthread_getaffinity_np F
 GLIBC_2.18 pthread_getschedparam F
 GLIBC_2.18 pthread_mutex_destroy F
 GLIBC_2.18 pthread_mutex_init F
@@ -2143,4 +2144,5 @@ GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
index 2e90b256b4..1af46cb44e 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
@@ -95,7 +95,6 @@ GLIBC_2.18 pthread_condattr_setpshared F
 GLIBC_2.18 pthread_create F
 GLIBC_2.18 pthread_detach F
 GLIBC_2.18 pthread_exit F
-GLIBC_2.18 pthread_getaffinity_np F
 GLIBC_2.18 pthread_getattr_default_np F
 GLIBC_2.18 pthread_getattr_np F
 GLIBC_2.18 pthread_getconcurrency F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index 9d6ea2fd12..aa5be2136d 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -1442,6 +1442,7 @@ GLIBC_2.18 pthread_condattr_destroy F
 GLIBC_2.18 pthread_condattr_init F
 GLIBC_2.18 pthread_equal F
 GLIBC_2.18 pthread_exit F
+GLIBC_2.18 pthread_getaffinity_np F
 GLIBC_2.18 pthread_getschedparam F
 GLIBC_2.18 pthread_mutex_destroy F
 GLIBC_2.18 pthread_mutex_init F
@@ -2140,4 +2141,5 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
index 2e90b256b4..1af46cb44e 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
@@ -95,7 +95,6 @@ GLIBC_2.18 pthread_condattr_setpshared F
 GLIBC_2.18 pthread_create F
 GLIBC_2.18 pthread_detach F
 GLIBC_2.18 pthread_exit F
-GLIBC_2.18 pthread_getaffinity_np F
 GLIBC_2.18 pthread_getattr_default_np F
 GLIBC_2.18 pthread_getattr_np F
 GLIBC_2.18 pthread_getconcurrency F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 800f6bbc74..8f76103289 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2092,6 +2092,7 @@ GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
 GLIBC_2.3.3 pthread_attr_setaffinity_np F
+GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2121,6 +2122,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
 GLIBC_2.3.4 pthread_attr_setaffinity_np F
+GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2133,6 +2135,7 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
index 98c3ff9e0e..14009d87e9 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
@@ -215,12 +215,10 @@ GLIBC_2.3.3 pthread_attr_setstacksize F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
-GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
 GLIBC_2.30 pthread_cond_clockwait F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index f5dbb73f60..ec6d5478e2 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2090,6 +2090,7 @@ GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
 GLIBC_2.3.3 pthread_attr_setaffinity_np F
+GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2119,6 +2120,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
 GLIBC_2.3.4 pthread_attr_setaffinity_np F
+GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2131,6 +2133,7 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
index 98c3ff9e0e..14009d87e9 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
@@ -215,12 +215,10 @@ GLIBC_2.3.3 pthread_attr_setstacksize F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
-GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
 GLIBC_2.30 pthread_cond_clockwait F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index 2929249c59..4f473ef639 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2098,6 +2098,7 @@ GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
 GLIBC_2.3.3 pthread_attr_setaffinity_np F
+GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2127,6 +2128,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
 GLIBC_2.3.4 pthread_attr_setaffinity_np F
+GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2139,6 +2141,7 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index aec8de9427..81a7044545 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2090,6 +2090,7 @@ GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 pthread_attr_setaffinity_np F
+GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2121,6 +2122,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
 GLIBC_2.3.4 pthread_attr_setaffinity_np F
+GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2133,6 +2135,7 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index 9aeb1aaf33..7ba8a9a002 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -1484,6 +1484,7 @@ GLIBC_2.21 pthread_condattr_destroy F
 GLIBC_2.21 pthread_condattr_init F
 GLIBC_2.21 pthread_equal F
 GLIBC_2.21 pthread_exit F
+GLIBC_2.21 pthread_getaffinity_np F
 GLIBC_2.21 pthread_getschedparam F
 GLIBC_2.21 pthread_mutex_destroy F
 GLIBC_2.21 pthread_mutex_init F
@@ -2181,4 +2182,5 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
index 8e3f650c0c..0c1fa0baca 100644
--- a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
@@ -95,7 +95,6 @@ GLIBC_2.21 pthread_condattr_setpshared F
 GLIBC_2.21 pthread_create F
 GLIBC_2.21 pthread_detach F
 GLIBC_2.21 pthread_exit F
-GLIBC_2.21 pthread_getaffinity_np F
 GLIBC_2.21 pthread_getattr_default_np F
 GLIBC_2.21 pthread_getattr_np F
 GLIBC_2.21 pthread_getconcurrency F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index c6ad37e5d2..6483f68273 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2124,6 +2124,7 @@ GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
 GLIBC_2.3.3 pthread_attr_setaffinity_np F
+GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2161,6 +2162,7 @@ GLIBC_2.3.4 getsourcefilter F
 GLIBC_2.3.4 longjmp F
 GLIBC_2.3.4 makecontext F
 GLIBC_2.3.4 pthread_attr_setaffinity_np F
+GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2189,6 +2191,7 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
index 359e47b705..4307193cb2 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
@@ -214,13 +214,11 @@ GLIBC_2.3.3 pthread_attr_getaffinity_np F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
-GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 longjmp F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
 GLIBC_2.3.4 siglongjmp F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index e92f31f072..405a39cbd0 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2157,6 +2157,7 @@ GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
 GLIBC_2.3.3 pthread_attr_setaffinity_np F
+GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2194,6 +2195,7 @@ GLIBC_2.3.4 getsourcefilter F
 GLIBC_2.3.4 longjmp F
 GLIBC_2.3.4 makecontext F
 GLIBC_2.3.4 pthread_attr_setaffinity_np F
+GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2222,6 +2224,7 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index 537fcbe0cb..b1286be61e 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -1988,6 +1988,7 @@ GLIBC_2.3.3 inet6_option_space F
 GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 pthread_attr_setaffinity_np F
+GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2024,6 +2025,7 @@ GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
 GLIBC_2.3.4 longjmp F
 GLIBC_2.3.4 pthread_attr_setaffinity_np F
+GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2052,6 +2054,7 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
index b58778fcf7..41a9f178a2 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
@@ -204,13 +204,11 @@ GLIBC_2.3.3 pthread_attr_getaffinity_np F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
-GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 longjmp F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
 GLIBC_2.3.4 siglongjmp F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index e2874d4294..c9016bfc8a 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -1528,6 +1528,7 @@ GLIBC_2.17 pthread_condattr_destroy F
 GLIBC_2.17 pthread_condattr_init F
 GLIBC_2.17 pthread_equal F
 GLIBC_2.17 pthread_exit F
+GLIBC_2.17 pthread_getaffinity_np F
 GLIBC_2.17 pthread_getschedparam F
 GLIBC_2.17 pthread_mutex_destroy F
 GLIBC_2.17 pthread_mutex_init F
@@ -2343,4 +2344,5 @@ GLIBC_2.32 __wprintf_chkieee128 F
 GLIBC_2.32 __wprintfieee128 F
 GLIBC_2.32 __wscanfieee128 F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
index 2c6f328caa..77cf95c491 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
@@ -95,7 +95,6 @@ GLIBC_2.17 pthread_condattr_setpshared F
 GLIBC_2.17 pthread_create F
 GLIBC_2.17 pthread_detach F
 GLIBC_2.17 pthread_exit F
-GLIBC_2.17 pthread_getaffinity_np F
 GLIBC_2.17 pthread_getattr_np F
 GLIBC_2.17 pthread_getconcurrency F
 GLIBC_2.17 pthread_getcpuclockid F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index f3a4babc77..029c60d5d8 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -1430,6 +1430,7 @@ GLIBC_2.27 pthread_condattr_destroy F
 GLIBC_2.27 pthread_condattr_init F
 GLIBC_2.27 pthread_equal F
 GLIBC_2.27 pthread_exit F
+GLIBC_2.27 pthread_getaffinity_np F
 GLIBC_2.27 pthread_getschedparam F
 GLIBC_2.27 pthread_mutex_destroy F
 GLIBC_2.27 pthread_mutex_init F
@@ -2110,4 +2111,5 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
index 3f276531fb..41a796e225 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
@@ -92,7 +92,6 @@ GLIBC_2.27 pthread_condattr_setpshared F
 GLIBC_2.27 pthread_create F
 GLIBC_2.27 pthread_detach F
 GLIBC_2.27 pthread_exit F
-GLIBC_2.27 pthread_getaffinity_np F
 GLIBC_2.27 pthread_getattr_default_np F
 GLIBC_2.27 pthread_getattr_np F
 GLIBC_2.27 pthread_getconcurrency F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index 5ed93d018d..b75ce88958 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2131,6 +2131,7 @@ GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
 GLIBC_2.3.3 pthread_attr_setaffinity_np F
+GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2160,6 +2161,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
 GLIBC_2.3.4 pthread_attr_setaffinity_np F
+GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2187,6 +2189,7 @@ GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
index b7f8abece5..1471cf4d13 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
@@ -216,12 +216,10 @@ GLIBC_2.3.3 pthread_attr_getaffinity_np F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
-GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
 GLIBC_2.30 pthread_cond_clockwait F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 66ab0f48cb..70571678c6 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2033,6 +2033,7 @@ GLIBC_2.3.3 inet6_option_space F
 GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 pthread_attr_setaffinity_np F
+GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2064,6 +2065,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
 GLIBC_2.3.4 pthread_attr_setaffinity_np F
+GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2088,6 +2090,7 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
index 0799bb2bf4..8d0b90477a 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
@@ -208,12 +208,10 @@ GLIBC_2.3.3 pthread_attr_getaffinity_np F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
-GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
 GLIBC_2.30 pthread_cond_clockwait F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index 8a676b0833..de14989270 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2013,6 +2013,7 @@ GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
 GLIBC_2.3.3 pthread_attr_setaffinity_np F
+GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2042,6 +2043,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
 GLIBC_2.3.4 pthread_attr_setaffinity_np F
+GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2057,6 +2059,7 @@ GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
index 4f2ed9e841..a12e0308b0 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
@@ -206,12 +206,10 @@ GLIBC_2.3.3 pthread_attr_getaffinity_np F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
-GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
 GLIBC_2.30 pthread_cond_clockwait F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index e6f7e1b02d..e181c5c936 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2013,6 +2013,7 @@ GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
 GLIBC_2.3.3 pthread_attr_setaffinity_np F
+GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2042,6 +2043,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
 GLIBC_2.3.4 pthread_attr_setaffinity_np F
+GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2054,6 +2056,7 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
index 4f2ed9e841..a12e0308b0 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
@@ -206,12 +206,10 @@ GLIBC_2.3.3 pthread_attr_getaffinity_np F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
-GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
 GLIBC_2.30 pthread_cond_clockwait F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index e1ae0f6618..670ed9b896 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2125,6 +2125,7 @@ GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 posix_fadvise64 F
 GLIBC_2.3.3 posix_fallocate64 F
 GLIBC_2.3.3 pthread_attr_setaffinity_np F
+GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2154,6 +2155,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
 GLIBC_2.3.4 pthread_attr_setaffinity_np F
+GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2178,6 +2180,7 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
index 2fb0e17408..8d504c3cdb 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
@@ -216,12 +216,10 @@ GLIBC_2.3.3 pthread_attr_setstacksize F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
-GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
 GLIBC_2.30 pthread_cond_clockwait F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 67a35b3812..a7980633b3 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2062,6 +2062,7 @@ GLIBC_2.3.3 inet6_option_space F
 GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 pthread_attr_setaffinity_np F
+GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2093,6 +2094,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
 GLIBC_2.3.4 pthread_attr_setaffinity_np F
+GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2105,6 +2107,7 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
index d0b122e280..927afe3bd5 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
@@ -208,12 +208,10 @@ GLIBC_2.3.3 pthread_attr_setstacksize F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
-GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
 GLIBC_2.30 pthread_cond_clockwait F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index c48d097b7f..766bfb7be3 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2020,6 +2020,7 @@ GLIBC_2.3.3 inet6_option_space F
 GLIBC_2.3.3 nftw F
 GLIBC_2.3.3 nftw64 F
 GLIBC_2.3.3 pthread_attr_setaffinity_np F
+GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 remap_file_pages F
 GLIBC_2.3.3 sched_getaffinity F
 GLIBC_2.3.3 sched_setaffinity F
@@ -2051,6 +2052,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
 GLIBC_2.3.4 getipv4sourcefilter F
 GLIBC_2.3.4 getsourcefilter F
 GLIBC_2.3.4 pthread_attr_setaffinity_np F
+GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 regexec F
 GLIBC_2.3.4 sched_getaffinity F
 GLIBC_2.3.4 sched_setaffinity F
@@ -2063,6 +2065,7 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
index b08f2413b1..1b07b47739 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
@@ -206,12 +206,10 @@ GLIBC_2.3.3 pthread_attr_getaffinity_np F
 GLIBC_2.3.3 pthread_barrierattr_getpshared F
 GLIBC_2.3.3 pthread_condattr_getclock F
 GLIBC_2.3.3 pthread_condattr_setclock F
-GLIBC_2.3.3 pthread_getaffinity_np F
 GLIBC_2.3.3 pthread_setaffinity_np F
 GLIBC_2.3.3 pthread_timedjoin_np F
 GLIBC_2.3.3 pthread_tryjoin_np F
 GLIBC_2.3.4 pthread_attr_getaffinity_np F
-GLIBC_2.3.4 pthread_getaffinity_np F
 GLIBC_2.3.4 pthread_setaffinity_np F
 GLIBC_2.3.4 pthread_setschedprio F
 GLIBC_2.30 pthread_cond_clockwait F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index 83618e9254..075f8870a1 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -1447,6 +1447,7 @@ GLIBC_2.16 pthread_condattr_destroy F
 GLIBC_2.16 pthread_condattr_init F
 GLIBC_2.16 pthread_equal F
 GLIBC_2.16 pthread_exit F
+GLIBC_2.16 pthread_getaffinity_np F
 GLIBC_2.16 pthread_getschedparam F
 GLIBC_2.16 pthread_mutex_destroy F
 GLIBC_2.16 pthread_mutex_init F
@@ -2161,4 +2162,5 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
index 58e5c764dd..6ff1703de1 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
@@ -95,7 +95,6 @@ GLIBC_2.16 pthread_condattr_setpshared F
 GLIBC_2.16 pthread_create F
 GLIBC_2.16 pthread_detach F
 GLIBC_2.16 pthread_exit F
-GLIBC_2.16 pthread_getaffinity_np F
 GLIBC_2.16 pthread_getattr_np F
 GLIBC_2.16 pthread_getconcurrency F
 GLIBC_2.16 pthread_getcpuclockid F
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 05/19] nptl: Move pthread_gettattr_np into libc
  2020-05-19 10:43 [PATCH 00/19] Signal mask for timer helper thread Florian Weimer via Libc-alpha
                   ` (3 preceding siblings ...)
  2020-05-19 10:44 ` [PATCH 04/19] nptl: Move pthread_getaffinity_np " Florian Weimer via Libc-alpha
@ 2020-05-19 10:44 ` Florian Weimer via Libc-alpha
  2020-05-20 13:57   ` Carlos O'Donell via Libc-alpha
  2020-05-19 10:44 ` [PATCH 06/19] nptl: Make __pthread_attr_init, __pthread_attr_destroy available internally Florian Weimer via Libc-alpha
                   ` (14 subsequent siblings)
  19 siblings, 1 reply; 42+ messages in thread
From: Florian Weimer via Libc-alpha @ 2020-05-19 10:44 UTC (permalink / raw)
  To: libc-alpha

This is part of the libpthread removal project:

    <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>

Use __getline instead of __getdelim to avoid a localplt failure.
Likewise for __getrlimit/getrlimit.

The abilist updates were performed by:

git ls-files 'sysdeps/unix/sysv/linux/**/libc.abilist' \
  | while read x ; do
    echo "GLIBC_2.32 pthread_getattr_np F" >> $x
done
python3 scripts/move-symbol-to-libc.py --only-linux pthread_getattr_np

The private export of __pthread_getaffinity_np is no longer needed, but
the hidden alias still necessary so that the symbol can be exported with
versioned_symbol.
---
 nptl/Makefile                                       |  2 +-
 nptl/Versions                                       |  8 +++++---
 nptl/libpthread-compat.c                            |  5 +++++
 nptl/pthread_getattr_np.c                           | 13 ++++++++++---
 sysdeps/unix/sysv/linux/aarch64/libc.abilist        |  2 ++
 sysdeps/unix/sysv/linux/aarch64/libpthread.abilist  |  1 -
 sysdeps/unix/sysv/linux/alpha/libc.abilist          |  2 ++
 sysdeps/unix/sysv/linux/alpha/libpthread.abilist    |  2 +-
 sysdeps/unix/sysv/linux/arm/be/libc.abilist         |  2 ++
 sysdeps/unix/sysv/linux/arm/be/libpthread.abilist   |  1 -
 sysdeps/unix/sysv/linux/arm/le/libc.abilist         |  2 ++
 sysdeps/unix/sysv/linux/arm/le/libpthread.abilist   |  1 -
 sysdeps/unix/sysv/linux/csky/libc.abilist           |  2 ++
 sysdeps/unix/sysv/linux/csky/libpthread.abilist     |  1 -
 sysdeps/unix/sysv/linux/hppa/libc.abilist           |  2 ++
 sysdeps/unix/sysv/linux/hppa/libpthread.abilist     |  2 +-
 sysdeps/unix/sysv/linux/i386/libc.abilist           |  2 ++
 sysdeps/unix/sysv/linux/i386/libpthread.abilist     |  2 +-
 sysdeps/unix/sysv/linux/ia64/libc.abilist           |  2 ++
 sysdeps/unix/sysv/linux/ia64/libpthread.abilist     |  2 +-
 sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist  |  2 ++
 .../sysv/linux/m68k/coldfire/libpthread.abilist     |  1 -
 sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist    |  2 ++
 .../unix/sysv/linux/m68k/m680x0/libpthread.abilist  |  2 +-
 sysdeps/unix/sysv/linux/microblaze/be/libc.abilist  |  2 ++
 .../sysv/linux/microblaze/be/libpthread.abilist     |  1 -
 sysdeps/unix/sysv/linux/microblaze/le/libc.abilist  |  2 ++
 .../sysv/linux/microblaze/le/libpthread.abilist     |  1 -
 .../unix/sysv/linux/mips/mips32/fpu/libc.abilist    |  2 ++
 .../unix/sysv/linux/mips/mips32/libpthread.abilist  |  2 +-
 .../unix/sysv/linux/mips/mips32/nofpu/libc.abilist  |  2 ++
 .../unix/sysv/linux/mips/mips64/libpthread.abilist  |  2 +-
 .../unix/sysv/linux/mips/mips64/n32/libc.abilist    |  2 ++
 .../unix/sysv/linux/mips/mips64/n64/libc.abilist    |  2 ++
 sysdeps/unix/sysv/linux/nios2/libc.abilist          |  2 ++
 sysdeps/unix/sysv/linux/nios2/libpthread.abilist    |  1 -
 .../sysv/linux/powerpc/powerpc32/fpu/libc.abilist   |  2 ++
 .../sysv/linux/powerpc/powerpc32/libpthread.abilist |  2 +-
 .../sysv/linux/powerpc/powerpc32/nofpu/libc.abilist |  2 ++
 .../sysv/linux/powerpc/powerpc64/be/libc.abilist    |  2 ++
 .../linux/powerpc/powerpc64/be/libpthread.abilist   |  1 -
 .../sysv/linux/powerpc/powerpc64/le/libc.abilist    |  2 ++
 .../linux/powerpc/powerpc64/le/libpthread.abilist   |  1 -
 sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist     |  2 ++
 .../unix/sysv/linux/riscv/rv64/libpthread.abilist   |  1 -
 sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist   |  2 ++
 .../unix/sysv/linux/s390/s390-32/libpthread.abilist |  2 +-
 sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist   |  2 ++
 .../unix/sysv/linux/s390/s390-64/libpthread.abilist |  2 +-
 sysdeps/unix/sysv/linux/sh/be/libc.abilist          |  2 ++
 sysdeps/unix/sysv/linux/sh/be/libpthread.abilist    |  2 +-
 sysdeps/unix/sysv/linux/sh/le/libc.abilist          |  2 ++
 sysdeps/unix/sysv/linux/sh/le/libpthread.abilist    |  2 +-
 sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist  |  2 ++
 .../sysv/linux/sparc/sparc32/libpthread.abilist     |  2 +-
 sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist  |  2 ++
 .../sysv/linux/sparc/sparc64/libpthread.abilist     |  2 +-
 sysdeps/unix/sysv/linux/x86_64/64/libc.abilist      |  2 ++
 .../unix/sysv/linux/x86_64/64/libpthread.abilist    |  1 -
 sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist     |  2 ++
 .../unix/sysv/linux/x86_64/x32/libpthread.abilist   |  1 -
 61 files changed, 95 insertions(+), 34 deletions(-)

diff --git a/nptl/Makefile b/nptl/Makefile
index 7edad1c0c9..0dd8800f19 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -58,6 +58,7 @@ routines = \
   pthread_condattr_init \
   pthread_equal \
   pthread_getaffinity \
+  pthread_getattr_np \
   pthread_getschedparam \
   pthread_self \
   pthread_setschedparam \
@@ -89,7 +90,6 @@ libpthread-routines = nptl-init nptlfreeres vars events version pt-interp \
 		      pthread_attr_getstackaddr pthread_attr_setstackaddr \
 		      pthread_attr_getstacksize pthread_attr_setstacksize \
 		      pthread_attr_getstack pthread_attr_setstack \
-		      pthread_getattr_np \
 		      pthread_mutex_init pthread_mutex_destroy \
 		      pthread_mutex_lock pthread_mutex_trylock \
 		      pthread_mutex_timedlock pthread_mutex_unlock \
diff --git a/nptl/Versions b/nptl/Versions
index 637d100a9e..ce08076611 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -21,6 +21,9 @@ libc {
   GLIBC_2.1 {
     pthread_attr_init;
   }
+  GLIBC_2.2.3 {
+    pthread_getattr_np;
+  }
   GLIBC_2.3.2 {
     __register_atfork;
 
@@ -43,6 +46,7 @@ libc {
   GLIBC_2.32 {
     pthread_attr_setaffinity_np;
     pthread_getaffinity_np;
+    pthread_getattr_np;
     pthread_sigmask;
   }
   GLIBC_PRIVATE {
@@ -55,7 +59,6 @@ libc {
     # Used by the C11 threads implementation.
     __pthread_cond_destroy; __pthread_cond_init;
     __pthread_attr_setaffinity_np;
-    __pthread_getaffinity_np; # For pthread_getattr_np.
   }
 }
 
@@ -197,8 +200,7 @@ libpthread {
   }
 
   GLIBC_2.2.3 {
-    # Extensions.
-    pthread_getattr_np;
+    __libpthread_version_placeholder;
   }
 
   GLIBC_2.2.6 {
diff --git a/nptl/libpthread-compat.c b/nptl/libpthread-compat.c
index 512b4c77c8..ec02b5dccf 100644
--- a/nptl/libpthread-compat.c
+++ b/nptl/libpthread-compat.c
@@ -41,6 +41,11 @@ compat_symbol_unique (libpthread,
 		      __libpthread_version_placeholder, GLIBC_2_1_2);
 #endif
 
+#if (SHLIB_COMPAT (libpthread, GLIBC_2_2_3, GLIBC_2_2_4))
+compat_symbol_unique (libpthread,
+		      __libpthread_version_placeholder, GLIBC_2_2_3);
+#endif
+
 #if (SHLIB_COMPAT (libpthread, GLIBC_2_2_6, GLIBC_2_3))
 compat_symbol_unique (libpthread,
 		      __libpthread_version_placeholder, GLIBC_2_2_6);
diff --git a/nptl/pthread_getattr_np.c b/nptl/pthread_getattr_np.c
index 644548d862..0e8911346d 100644
--- a/nptl/pthread_getattr_np.c
+++ b/nptl/pthread_getattr_np.c
@@ -30,7 +30,7 @@
 
 
 int
-pthread_getattr_np (pthread_t thread_id, pthread_attr_t *attr)
+__pthread_getattr_np (pthread_t thread_id, pthread_attr_t *attr)
 {
   struct pthread *thread = (struct pthread *) thread_id;
   struct pthread_attr *iattr = (struct pthread_attr *) attr;
@@ -84,7 +84,7 @@ pthread_getattr_np (pthread_t thread_id, pthread_attr_t *attr)
       /* We need the limit of the stack in any case.  */
       else
 	{
-	  if (getrlimit (RLIMIT_STACK, &rl) != 0)
+	  if (__getrlimit (RLIMIT_STACK, &rl) != 0)
 	    ret = errno;
 	  else
 	    {
@@ -115,7 +115,7 @@ pthread_getattr_np (pthread_t thread_id, pthread_attr_t *attr)
 
 	      while (! feof_unlocked (fp))
 		{
-		  if (__getdelim (&line, &linelen, '\n', fp) <= 0)
+		  if (__getline (&line, &linelen, fp) <= 0)
 		    break;
 
 		  uintptr_t from;
@@ -208,3 +208,10 @@ pthread_getattr_np (pthread_t thread_id, pthread_attr_t *attr)
 
   return ret;
 }
+versioned_symbol (libc, __pthread_getattr_np, pthread_getattr_np, GLIBC_2_32);
+
+#if SHLIB_COMPAT (libc, GLIBC_2_2_3, GLIBC_2_32)
+strong_alias (__pthread_getattr_np, __pthread_getattr_np_alias)
+compat_symbol (libc, __pthread_getattr_np_alias,
+	       pthread_getattr_np, GLIBC_2_2_3);
+#endif
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 55499b8d3c..6dc59b38b0 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -1440,6 +1440,7 @@ GLIBC_2.17 pthread_condattr_init F
 GLIBC_2.17 pthread_equal F
 GLIBC_2.17 pthread_exit F
 GLIBC_2.17 pthread_getaffinity_np F
+GLIBC_2.17 pthread_getattr_np F
 GLIBC_2.17 pthread_getschedparam F
 GLIBC_2.17 pthread_mutex_destroy F
 GLIBC_2.17 pthread_mutex_init F
@@ -2150,4 +2151,5 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
index 77cf95c491..c6b4ea2dc1 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
@@ -95,7 +95,6 @@ GLIBC_2.17 pthread_condattr_setpshared F
 GLIBC_2.17 pthread_create F
 GLIBC_2.17 pthread_detach F
 GLIBC_2.17 pthread_exit F
-GLIBC_2.17 pthread_getattr_np F
 GLIBC_2.17 pthread_getconcurrency F
 GLIBC_2.17 pthread_getcpuclockid F
 GLIBC_2.17 pthread_getname_np F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index 387b0badaa..fd628bcd28 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -1969,6 +1969,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
 GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
 GLIBC_2.2.3 __rpc_thread_svc_pollfd F
 GLIBC_2.2.3 fnmatch F
+GLIBC_2.2.3 pthread_getattr_np F
 GLIBC_2.2.3 sprofil F
 GLIBC_2.2.4 dl_iterate_phdr F
 GLIBC_2.2.4 getgrouplist F
@@ -2232,6 +2233,7 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
diff --git a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
index 8d504c3cdb..390b6384d0 100644
--- a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
@@ -177,7 +177,7 @@ GLIBC_2.2 pthread_yield F
 GLIBC_2.2 pwrite F
 GLIBC_2.2 pwrite64 F
 GLIBC_2.2 sem_timedwait F
-GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.3 __libpthread_version_placeholder F
 GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index 2775ee0963..d0b1cd24c9 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -135,6 +135,7 @@ GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
@@ -1513,6 +1514,7 @@ GLIBC_2.4 pthread_condattr_init F
 GLIBC_2.4 pthread_equal F
 GLIBC_2.4 pthread_exit F
 GLIBC_2.4 pthread_getaffinity_np F
+GLIBC_2.4 pthread_getattr_np F
 GLIBC_2.4 pthread_getschedparam F
 GLIBC_2.4 pthread_mutex_destroy F
 GLIBC_2.4 pthread_mutex_init F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
index c1313fb4bf..b6c26c7a50 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
@@ -130,7 +130,6 @@ GLIBC_2.4 pthread_condattr_setpshared F
 GLIBC_2.4 pthread_create F
 GLIBC_2.4 pthread_detach F
 GLIBC_2.4 pthread_exit F
-GLIBC_2.4 pthread_getattr_np F
 GLIBC_2.4 pthread_getconcurrency F
 GLIBC_2.4 pthread_getcpuclockid F
 GLIBC_2.4 pthread_getspecific F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 0e233ff542..3dde0ef8bd 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -132,6 +132,7 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
@@ -1510,6 +1511,7 @@ GLIBC_2.4 pthread_condattr_init F
 GLIBC_2.4 pthread_equal F
 GLIBC_2.4 pthread_exit F
 GLIBC_2.4 pthread_getaffinity_np F
+GLIBC_2.4 pthread_getattr_np F
 GLIBC_2.4 pthread_getschedparam F
 GLIBC_2.4 pthread_mutex_destroy F
 GLIBC_2.4 pthread_mutex_init F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
index c1313fb4bf..b6c26c7a50 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
@@ -130,7 +130,6 @@ GLIBC_2.4 pthread_condattr_setpshared F
 GLIBC_2.4 pthread_create F
 GLIBC_2.4 pthread_detach F
 GLIBC_2.4 pthread_exit F
-GLIBC_2.4 pthread_getattr_np F
 GLIBC_2.4 pthread_getconcurrency F
 GLIBC_2.4 pthread_getcpuclockid F
 GLIBC_2.4 pthread_getspecific F
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index dbef2ad653..4db9bbd971 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -1428,6 +1428,7 @@ GLIBC_2.29 pthread_condattr_init F
 GLIBC_2.29 pthread_equal F
 GLIBC_2.29 pthread_exit F
 GLIBC_2.29 pthread_getaffinity_np F
+GLIBC_2.29 pthread_getattr_np F
 GLIBC_2.29 pthread_getschedparam F
 GLIBC_2.29 pthread_mutex_destroy F
 GLIBC_2.29 pthread_mutex_init F
@@ -2094,4 +2095,5 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/csky/libpthread.abilist b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
index bcdea792ec..6ce59276a7 100644
--- a/sysdeps/unix/sysv/linux/csky/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
@@ -104,7 +104,6 @@ GLIBC_2.29 pthread_create F
 GLIBC_2.29 pthread_detach F
 GLIBC_2.29 pthread_exit F
 GLIBC_2.29 pthread_getattr_default_np F
-GLIBC_2.29 pthread_getattr_np F
 GLIBC_2.29 pthread_getconcurrency F
 GLIBC_2.29 pthread_getcpuclockid F
 GLIBC_2.29 pthread_getname_np F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index 4405dbfe63..52aa86b191 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -1829,6 +1829,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
 GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
 GLIBC_2.2.3 __rpc_thread_svc_pollfd F
 GLIBC_2.2.3 fnmatch F
+GLIBC_2.2.3 pthread_getattr_np F
 GLIBC_2.2.3 sprofil F
 GLIBC_2.2.4 dl_iterate_phdr F
 GLIBC_2.2.4 getgrouplist F
@@ -2053,6 +2054,7 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
index a12e0308b0..cabc5af858 100644
--- a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
@@ -169,7 +169,7 @@ GLIBC_2.2 sigwait F
 GLIBC_2.2 system F
 GLIBC_2.2 tcdrain F
 GLIBC_2.2 write F
-GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.3 __libpthread_version_placeholder F
 GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index de447796e7..48ee395a64 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -1982,6 +1982,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
 GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
 GLIBC_2.2.3 __rpc_thread_svc_pollfd F
 GLIBC_2.2.3 fnmatch F
+GLIBC_2.2.3 pthread_getattr_np F
 GLIBC_2.2.3 sprofil F
 GLIBC_2.2.4 dl_iterate_phdr F
 GLIBC_2.2.4 getgrouplist F
@@ -2219,6 +2220,7 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
index f84feaca66..18177307c8 100644
--- a/sysdeps/unix/sysv/linux/i386/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
@@ -177,7 +177,7 @@ GLIBC_2.2 pthread_yield F
 GLIBC_2.2 pwrite F
 GLIBC_2.2 pwrite64 F
 GLIBC_2.2 sem_timedwait F
-GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.3 __libpthread_version_placeholder F
 GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index df3da1bea3..34458f348f 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -1851,6 +1851,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
 GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
 GLIBC_2.2.3 __rpc_thread_svc_pollfd F
 GLIBC_2.2.3 fnmatch F
+GLIBC_2.2.3 pthread_getattr_np F
 GLIBC_2.2.3 sprofil F
 GLIBC_2.2.4 dl_iterate_phdr F
 GLIBC_2.2.4 getgrouplist F
@@ -2085,6 +2086,7 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
index 927afe3bd5..335f486cb5 100644
--- a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
@@ -169,7 +169,7 @@ GLIBC_2.2 sigwait F
 GLIBC_2.2 system F
 GLIBC_2.2 tcdrain F
 GLIBC_2.2 write F
-GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.3 __libpthread_version_placeholder F
 GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index deb56b3dfc..377326b12c 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -136,6 +136,7 @@ GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _Exit F
 GLIBC_2.4 _IO_2_1_stderr_ D 0x98
@@ -1493,6 +1494,7 @@ GLIBC_2.4 pthread_condattr_init F
 GLIBC_2.4 pthread_equal F
 GLIBC_2.4 pthread_exit F
 GLIBC_2.4 pthread_getaffinity_np F
+GLIBC_2.4 pthread_getattr_np F
 GLIBC_2.4 pthread_getschedparam F
 GLIBC_2.4 pthread_mutex_destroy F
 GLIBC_2.4 pthread_mutex_init F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
index c1313fb4bf..b6c26c7a50 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
@@ -130,7 +130,6 @@ GLIBC_2.4 pthread_condattr_setpshared F
 GLIBC_2.4 pthread_create F
 GLIBC_2.4 pthread_detach F
 GLIBC_2.4 pthread_exit F
-GLIBC_2.4 pthread_getattr_np F
 GLIBC_2.4 pthread_getconcurrency F
 GLIBC_2.4 pthread_getcpuclockid F
 GLIBC_2.4 pthread_getspecific F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 96d8a1a101..81eea10680 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -1938,6 +1938,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
 GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
 GLIBC_2.2.3 __rpc_thread_svc_pollfd F
 GLIBC_2.2.3 fnmatch F
+GLIBC_2.2.3 pthread_getattr_np F
 GLIBC_2.2.3 sprofil F
 GLIBC_2.2.4 dl_iterate_phdr F
 GLIBC_2.2.4 getgrouplist F
@@ -2165,6 +2166,7 @@ GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
index f84feaca66..18177307c8 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
@@ -177,7 +177,7 @@ GLIBC_2.2 pthread_yield F
 GLIBC_2.2 pwrite F
 GLIBC_2.2 pwrite64 F
 GLIBC_2.2 sem_timedwait F
-GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.3 __libpthread_version_placeholder F
 GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 134db9a3f8..ff75663747 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -1443,6 +1443,7 @@ GLIBC_2.18 pthread_condattr_init F
 GLIBC_2.18 pthread_equal F
 GLIBC_2.18 pthread_exit F
 GLIBC_2.18 pthread_getaffinity_np F
+GLIBC_2.18 pthread_getattr_np F
 GLIBC_2.18 pthread_getschedparam F
 GLIBC_2.18 pthread_mutex_destroy F
 GLIBC_2.18 pthread_mutex_init F
@@ -2145,4 +2146,5 @@ GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
index 1af46cb44e..60397187b6 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
@@ -96,7 +96,6 @@ GLIBC_2.18 pthread_create F
 GLIBC_2.18 pthread_detach F
 GLIBC_2.18 pthread_exit F
 GLIBC_2.18 pthread_getattr_default_np F
-GLIBC_2.18 pthread_getattr_np F
 GLIBC_2.18 pthread_getconcurrency F
 GLIBC_2.18 pthread_getcpuclockid F
 GLIBC_2.18 pthread_getname_np F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index aa5be2136d..e9a6375dfc 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -1443,6 +1443,7 @@ GLIBC_2.18 pthread_condattr_init F
 GLIBC_2.18 pthread_equal F
 GLIBC_2.18 pthread_exit F
 GLIBC_2.18 pthread_getaffinity_np F
+GLIBC_2.18 pthread_getattr_np F
 GLIBC_2.18 pthread_getschedparam F
 GLIBC_2.18 pthread_mutex_destroy F
 GLIBC_2.18 pthread_mutex_init F
@@ -2142,4 +2143,5 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
index 1af46cb44e..60397187b6 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
@@ -96,7 +96,6 @@ GLIBC_2.18 pthread_create F
 GLIBC_2.18 pthread_detach F
 GLIBC_2.18 pthread_exit F
 GLIBC_2.18 pthread_getattr_default_np F
-GLIBC_2.18 pthread_getattr_np F
 GLIBC_2.18 pthread_getconcurrency F
 GLIBC_2.18 pthread_getcpuclockid F
 GLIBC_2.18 pthread_getname_np F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 8f76103289..598fc488c7 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -1916,6 +1916,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
 GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
 GLIBC_2.2.3 __rpc_thread_svc_pollfd F
 GLIBC_2.2.3 fnmatch F
+GLIBC_2.2.3 pthread_getattr_np F
 GLIBC_2.2.3 sprofil F
 GLIBC_2.2.4 dl_iterate_phdr F
 GLIBC_2.2.4 getgrouplist F
@@ -2136,6 +2137,7 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
index 14009d87e9..b35d7f19ca 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
@@ -176,7 +176,7 @@ GLIBC_2.2 sem_timedwait F
 GLIBC_2.2 sem_trywait F
 GLIBC_2.2 sem_unlink F
 GLIBC_2.2 sem_wait F
-GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.3 __libpthread_version_placeholder F
 GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index ec6d5478e2..77e8d6b155 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -1914,6 +1914,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
 GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
 GLIBC_2.2.3 __rpc_thread_svc_pollfd F
 GLIBC_2.2.3 fnmatch F
+GLIBC_2.2.3 pthread_getattr_np F
 GLIBC_2.2.3 sprofil F
 GLIBC_2.2.4 dl_iterate_phdr F
 GLIBC_2.2.4 getgrouplist F
@@ -2134,6 +2135,7 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
index 14009d87e9..b35d7f19ca 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
@@ -176,7 +176,7 @@ GLIBC_2.2 sem_timedwait F
 GLIBC_2.2 sem_trywait F
 GLIBC_2.2 sem_unlink F
 GLIBC_2.2 sem_wait F
-GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.3 __libpthread_version_placeholder F
 GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index 4f473ef639..a3aad2487f 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -1912,6 +1912,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
 GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
 GLIBC_2.2.3 __rpc_thread_svc_pollfd F
 GLIBC_2.2.3 fnmatch F
+GLIBC_2.2.3 pthread_getattr_np F
 GLIBC_2.2.3 sprofil F
 GLIBC_2.2.4 dl_iterate_phdr F
 GLIBC_2.2.4 getgrouplist F
@@ -2142,6 +2143,7 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index 81a7044545..c074f612f5 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -1908,6 +1908,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
 GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
 GLIBC_2.2.3 __rpc_thread_svc_pollfd F
 GLIBC_2.2.3 fnmatch F
+GLIBC_2.2.3 pthread_getattr_np F
 GLIBC_2.2.3 sprofil F
 GLIBC_2.2.4 dl_iterate_phdr F
 GLIBC_2.2.4 getgrouplist F
@@ -2136,6 +2137,7 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index 7ba8a9a002..d1c638acb9 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -1485,6 +1485,7 @@ GLIBC_2.21 pthread_condattr_init F
 GLIBC_2.21 pthread_equal F
 GLIBC_2.21 pthread_exit F
 GLIBC_2.21 pthread_getaffinity_np F
+GLIBC_2.21 pthread_getattr_np F
 GLIBC_2.21 pthread_getschedparam F
 GLIBC_2.21 pthread_mutex_destroy F
 GLIBC_2.21 pthread_mutex_init F
@@ -2183,4 +2184,5 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
index 0c1fa0baca..924ad6e451 100644
--- a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
@@ -96,7 +96,6 @@ GLIBC_2.21 pthread_create F
 GLIBC_2.21 pthread_detach F
 GLIBC_2.21 pthread_exit F
 GLIBC_2.21 pthread_getattr_default_np F
-GLIBC_2.21 pthread_getattr_np F
 GLIBC_2.21 pthread_getconcurrency F
 GLIBC_2.21 pthread_getcpuclockid F
 GLIBC_2.21 pthread_getname_np F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 6483f68273..bfc8185b0e 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -1942,6 +1942,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
 GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
 GLIBC_2.2.3 __rpc_thread_svc_pollfd F
 GLIBC_2.2.3 fnmatch F
+GLIBC_2.2.3 pthread_getattr_np F
 GLIBC_2.2.3 sprofil F
 GLIBC_2.2.4 dl_iterate_phdr F
 GLIBC_2.2.4 getgrouplist F
@@ -2192,6 +2193,7 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
index 4307193cb2..13b41dafb6 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
@@ -177,7 +177,7 @@ GLIBC_2.2 pthread_yield F
 GLIBC_2.2 pwrite F
 GLIBC_2.2 pwrite64 F
 GLIBC_2.2 sem_timedwait F
-GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.3 __libpthread_version_placeholder F
 GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 405a39cbd0..9a889f1bc6 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -1946,6 +1946,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
 GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
 GLIBC_2.2.3 __rpc_thread_svc_pollfd F
 GLIBC_2.2.3 fnmatch F
+GLIBC_2.2.3 pthread_getattr_np F
 GLIBC_2.2.3 sprofil F
 GLIBC_2.2.4 dl_iterate_phdr F
 GLIBC_2.2.4 getgrouplist F
@@ -2225,6 +2226,7 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index b1286be61e..b69f4b126f 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -1371,6 +1371,7 @@ GLIBC_2.3 pthread_condattr_destroy F
 GLIBC_2.3 pthread_condattr_init F
 GLIBC_2.3 pthread_equal F
 GLIBC_2.3 pthread_exit F
+GLIBC_2.3 pthread_getattr_np F
 GLIBC_2.3 pthread_getschedparam F
 GLIBC_2.3 pthread_mutex_destroy F
 GLIBC_2.3 pthread_mutex_init F
@@ -2055,6 +2056,7 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
index 41a9f178a2..e9477a3584 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
@@ -114,7 +114,6 @@ GLIBC_2.3 pthread_condattr_setpshared F
 GLIBC_2.3 pthread_create F
 GLIBC_2.3 pthread_detach F
 GLIBC_2.3 pthread_exit F
-GLIBC_2.3 pthread_getattr_np F
 GLIBC_2.3 pthread_getconcurrency F
 GLIBC_2.3 pthread_getcpuclockid F
 GLIBC_2.3 pthread_getspecific F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index c9016bfc8a..a07753847d 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -1529,6 +1529,7 @@ GLIBC_2.17 pthread_condattr_init F
 GLIBC_2.17 pthread_equal F
 GLIBC_2.17 pthread_exit F
 GLIBC_2.17 pthread_getaffinity_np F
+GLIBC_2.17 pthread_getattr_np F
 GLIBC_2.17 pthread_getschedparam F
 GLIBC_2.17 pthread_mutex_destroy F
 GLIBC_2.17 pthread_mutex_init F
@@ -2345,4 +2346,5 @@ GLIBC_2.32 __wprintfieee128 F
 GLIBC_2.32 __wscanfieee128 F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
index 77cf95c491..c6b4ea2dc1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
@@ -95,7 +95,6 @@ GLIBC_2.17 pthread_condattr_setpshared F
 GLIBC_2.17 pthread_create F
 GLIBC_2.17 pthread_detach F
 GLIBC_2.17 pthread_exit F
-GLIBC_2.17 pthread_getattr_np F
 GLIBC_2.17 pthread_getconcurrency F
 GLIBC_2.17 pthread_getcpuclockid F
 GLIBC_2.17 pthread_getname_np F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index 029c60d5d8..6d5a52dc1a 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -1431,6 +1431,7 @@ GLIBC_2.27 pthread_condattr_init F
 GLIBC_2.27 pthread_equal F
 GLIBC_2.27 pthread_exit F
 GLIBC_2.27 pthread_getaffinity_np F
+GLIBC_2.27 pthread_getattr_np F
 GLIBC_2.27 pthread_getschedparam F
 GLIBC_2.27 pthread_mutex_destroy F
 GLIBC_2.27 pthread_mutex_init F
@@ -2112,4 +2113,5 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
index 41a796e225..894c474fcb 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
@@ -93,7 +93,6 @@ GLIBC_2.27 pthread_create F
 GLIBC_2.27 pthread_detach F
 GLIBC_2.27 pthread_exit F
 GLIBC_2.27 pthread_getattr_default_np F
-GLIBC_2.27 pthread_getattr_np F
 GLIBC_2.27 pthread_getconcurrency F
 GLIBC_2.27 pthread_getcpuclockid F
 GLIBC_2.27 pthread_getname_np F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index b75ce88958..ae3849d3f6 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -1941,6 +1941,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
 GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
 GLIBC_2.2.3 __rpc_thread_svc_pollfd F
 GLIBC_2.2.3 fnmatch F
+GLIBC_2.2.3 pthread_getattr_np F
 GLIBC_2.2.3 sprofil F
 GLIBC_2.2.4 dl_iterate_phdr F
 GLIBC_2.2.4 getgrouplist F
@@ -2190,6 +2191,7 @@ GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
index 1471cf4d13..0a60f1cca2 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
@@ -179,7 +179,7 @@ GLIBC_2.2 pthread_yield F
 GLIBC_2.2 pwrite F
 GLIBC_2.2 pwrite64 F
 GLIBC_2.2 sem_timedwait F
-GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.3 __libpthread_version_placeholder F
 GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 70571678c6..2eb931c02c 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -1847,6 +1847,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
 GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
 GLIBC_2.2.3 __rpc_thread_svc_pollfd F
 GLIBC_2.2.3 fnmatch F
+GLIBC_2.2.3 pthread_getattr_np F
 GLIBC_2.2.3 sprofil F
 GLIBC_2.2.4 dl_iterate_phdr F
 GLIBC_2.2.4 getgrouplist F
@@ -2091,6 +2092,7 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
index 8d0b90477a..0e99688824 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
@@ -171,7 +171,7 @@ GLIBC_2.2 sigwait F
 GLIBC_2.2 system F
 GLIBC_2.2 tcdrain F
 GLIBC_2.2 write F
-GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.3 __libpthread_version_placeholder F
 GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index de14989270..ce4f366fbb 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -1833,6 +1833,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
 GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
 GLIBC_2.2.3 __rpc_thread_svc_pollfd F
 GLIBC_2.2.3 fnmatch F
+GLIBC_2.2.3 pthread_getattr_np F
 GLIBC_2.2.3 sprofil F
 GLIBC_2.2.4 dl_iterate_phdr F
 GLIBC_2.2.4 getgrouplist F
@@ -2060,6 +2061,7 @@ GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
index a12e0308b0..cabc5af858 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
@@ -169,7 +169,7 @@ GLIBC_2.2 sigwait F
 GLIBC_2.2 system F
 GLIBC_2.2 tcdrain F
 GLIBC_2.2 write F
-GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.3 __libpthread_version_placeholder F
 GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index e181c5c936..f37a08ab09 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -1833,6 +1833,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
 GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
 GLIBC_2.2.3 __rpc_thread_svc_pollfd F
 GLIBC_2.2.3 fnmatch F
+GLIBC_2.2.3 pthread_getattr_np F
 GLIBC_2.2.3 sprofil F
 GLIBC_2.2.4 dl_iterate_phdr F
 GLIBC_2.2.4 getgrouplist F
@@ -2057,6 +2058,7 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
index a12e0308b0..cabc5af858 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
@@ -169,7 +169,7 @@ GLIBC_2.2 sigwait F
 GLIBC_2.2 system F
 GLIBC_2.2 tcdrain F
 GLIBC_2.2 write F
-GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.3 __libpthread_version_placeholder F
 GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index 670ed9b896..af3a5e2618 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -1935,6 +1935,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
 GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
 GLIBC_2.2.3 __rpc_thread_svc_pollfd F
 GLIBC_2.2.3 fnmatch F
+GLIBC_2.2.3 pthread_getattr_np F
 GLIBC_2.2.3 sprofil F
 GLIBC_2.2.4 dl_iterate_phdr F
 GLIBC_2.2.4 getgrouplist F
@@ -2181,6 +2182,7 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 _IO_fprintf F
 GLIBC_2.4 _IO_printf F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
index 8d504c3cdb..390b6384d0 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
@@ -177,7 +177,7 @@ GLIBC_2.2 pthread_yield F
 GLIBC_2.2 pwrite F
 GLIBC_2.2 pwrite64 F
 GLIBC_2.2 sem_timedwait F
-GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.3 __libpthread_version_placeholder F
 GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index a7980633b3..1fccc06f21 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -1877,6 +1877,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
 GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
 GLIBC_2.2.3 __rpc_thread_svc_pollfd F
 GLIBC_2.2.3 fnmatch F
+GLIBC_2.2.3 pthread_getattr_np F
 GLIBC_2.2.3 sprofil F
 GLIBC_2.2.4 dl_iterate_phdr F
 GLIBC_2.2.4 getgrouplist F
@@ -2108,6 +2109,7 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
index 927afe3bd5..335f486cb5 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
@@ -169,7 +169,7 @@ GLIBC_2.2 sigwait F
 GLIBC_2.2 system F
 GLIBC_2.2 tcdrain F
 GLIBC_2.2 write F
-GLIBC_2.2.3 pthread_getattr_np F
+GLIBC_2.2.3 __libpthread_version_placeholder F
 GLIBC_2.2.6 __libpthread_version_placeholder F
 GLIBC_2.28 call_once F
 GLIBC_2.28 cnd_broadcast F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 766bfb7be3..03af18babb 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -1279,6 +1279,7 @@ GLIBC_2.2.5 pthread_condattr_destroy F
 GLIBC_2.2.5 pthread_condattr_init F
 GLIBC_2.2.5 pthread_equal F
 GLIBC_2.2.5 pthread_exit F
+GLIBC_2.2.5 pthread_getattr_np F
 GLIBC_2.2.5 pthread_getschedparam F
 GLIBC_2.2.5 pthread_mutex_destroy F
 GLIBC_2.2.5 pthread_mutex_init F
@@ -2066,6 +2067,7 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
 GLIBC_2.4 __confstr_chk F
 GLIBC_2.4 __fgets_chk F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
index 1b07b47739..971269d2ef 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
@@ -94,7 +94,6 @@ GLIBC_2.2.5 pthread_condattr_setpshared F
 GLIBC_2.2.5 pthread_create F
 GLIBC_2.2.5 pthread_detach F
 GLIBC_2.2.5 pthread_exit F
-GLIBC_2.2.5 pthread_getattr_np F
 GLIBC_2.2.5 pthread_getconcurrency F
 GLIBC_2.2.5 pthread_getcpuclockid F
 GLIBC_2.2.5 pthread_getspecific F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index 075f8870a1..2da0af70d4 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -1448,6 +1448,7 @@ GLIBC_2.16 pthread_condattr_init F
 GLIBC_2.16 pthread_equal F
 GLIBC_2.16 pthread_exit F
 GLIBC_2.16 pthread_getaffinity_np F
+GLIBC_2.16 pthread_getattr_np F
 GLIBC_2.16 pthread_getschedparam F
 GLIBC_2.16 pthread_mutex_destroy F
 GLIBC_2.16 pthread_mutex_init F
@@ -2163,4 +2164,5 @@ GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_getaffinity_np F
+GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
index 6ff1703de1..b9bf4324a9 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
@@ -95,7 +95,6 @@ GLIBC_2.16 pthread_condattr_setpshared F
 GLIBC_2.16 pthread_create F
 GLIBC_2.16 pthread_detach F
 GLIBC_2.16 pthread_exit F
-GLIBC_2.16 pthread_getattr_np F
 GLIBC_2.16 pthread_getconcurrency F
 GLIBC_2.16 pthread_getcpuclockid F
 GLIBC_2.16 pthread_getname_np F
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 06/19] nptl: Make __pthread_attr_init, __pthread_attr_destroy available internally
  2020-05-19 10:43 [PATCH 00/19] Signal mask for timer helper thread Florian Weimer via Libc-alpha
                   ` (4 preceding siblings ...)
  2020-05-19 10:44 ` [PATCH 05/19] nptl: Move pthread_gettattr_np " Florian Weimer via Libc-alpha
@ 2020-05-19 10:44 ` Florian Weimer via Libc-alpha
  2020-05-20 13:59   ` Carlos O'Donell via Libc-alpha
  2020-05-19 10:44 ` [PATCH 07/19] nptl: Add __pthread_attr_copy for copying pthread_attr_t objects Florian Weimer via Libc-alpha
                   ` (13 subsequent siblings)
  19 siblings, 1 reply; 42+ messages in thread
From: Florian Weimer via Libc-alpha @ 2020-05-19 10:44 UTC (permalink / raw)
  To: libc-alpha

pthread_attr_destroy needs to be a weak alias to avoid future
linknamespace failures.
---
 nptl/Versions               | 1 +
 nptl/pthreadP.h             | 4 +++-
 nptl/pthread_attr_destroy.c | 3 ++-
 nptl/pthread_attr_init.c    | 5 +++--
 4 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/nptl/Versions b/nptl/Versions
index ce08076611..65f0c077da 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -59,6 +59,7 @@ libc {
     # Used by the C11 threads implementation.
     __pthread_cond_destroy; __pthread_cond_init;
     __pthread_attr_setaffinity_np;
+    __pthread_attr_init; __pthread_attr_destroy;
   }
 }
 
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index ac0135422b..f218b01574 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -347,7 +347,8 @@ extern int __pthread_create_2_1 (pthread_t *newthread,
 extern int __pthread_create_2_0 (pthread_t *newthread,
 				 const pthread_attr_t *attr,
 				 void *(*start_routine) (void *), void *arg);
-extern int __pthread_attr_init_2_1 (pthread_attr_t *attr);
+extern int __pthread_attr_init (pthread_attr_t *attr);
+libc_hidden_proto (__pthread_attr_init)
 extern int __pthread_attr_init_2_0 (pthread_attr_t *attr);
 
 
@@ -403,6 +404,7 @@ extern int __pthread_mutexattr_init (pthread_mutexattr_t *attr);
 extern int __pthread_mutexattr_destroy (pthread_mutexattr_t *attr);
 extern int __pthread_mutexattr_settype (pthread_mutexattr_t *attr, int kind);
 extern int __pthread_attr_destroy (pthread_attr_t *attr);
+libc_hidden_proto (__pthread_attr_destroy)
 extern int __pthread_attr_getdetachstate (const pthread_attr_t *attr,
 					  int *detachstate);
 extern int __pthread_attr_setdetachstate (pthread_attr_t *attr,
diff --git a/nptl/pthread_attr_destroy.c b/nptl/pthread_attr_destroy.c
index d20f209377..21f8026a2c 100644
--- a/nptl/pthread_attr_destroy.c
+++ b/nptl/pthread_attr_destroy.c
@@ -39,4 +39,5 @@ __pthread_attr_destroy (pthread_attr_t *attr)
 
   return 0;
 }
-strong_alias (__pthread_attr_destroy, pthread_attr_destroy)
+libc_hidden_def (__pthread_attr_destroy)
+weak_alias (__pthread_attr_destroy, pthread_attr_destroy)
diff --git a/nptl/pthread_attr_init.c b/nptl/pthread_attr_init.c
index f15cccab0a..acc22c64c4 100644
--- a/nptl/pthread_attr_init.c
+++ b/nptl/pthread_attr_init.c
@@ -29,7 +29,7 @@ int __attr_list_lock = LLL_LOCK_INITIALIZER;
 
 
 int
-__pthread_attr_init_2_1 (pthread_attr_t *attr)
+__pthread_attr_init (pthread_attr_t *attr)
 {
   struct pthread_attr *iattr;
 
@@ -48,7 +48,8 @@ __pthread_attr_init_2_1 (pthread_attr_t *attr)
 
   return 0;
 }
-versioned_symbol (libc, __pthread_attr_init_2_1, pthread_attr_init, GLIBC_2_1);
+libc_hidden_def (__pthread_attr_init)
+versioned_symbol (libc, __pthread_attr_init, pthread_attr_init, GLIBC_2_1);
 
 
 #if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_1)
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 07/19] nptl: Add __pthread_attr_copy for copying pthread_attr_t objects
  2020-05-19 10:43 [PATCH 00/19] Signal mask for timer helper thread Florian Weimer via Libc-alpha
                   ` (5 preceding siblings ...)
  2020-05-19 10:44 ` [PATCH 06/19] nptl: Make __pthread_attr_init, __pthread_attr_destroy available internally Florian Weimer via Libc-alpha
@ 2020-05-19 10:44 ` Florian Weimer via Libc-alpha
  2020-05-20 14:10   ` Carlos O'Donell via Libc-alpha
  2020-05-19 10:44 ` [PATCH 08/19] nptl: Use __pthread_attr_copy in pthread_getattr_default_np (bug 25999) Florian Weimer via Libc-alpha
                   ` (12 subsequent siblings)
  19 siblings, 1 reply; 42+ messages in thread
From: Florian Weimer via Libc-alpha @ 2020-05-19 10:44 UTC (permalink / raw)
  To: libc-alpha

Also add the private type union pthread_attr_transparent, to reduce
the amount of casting that is required.
---
 nptl/Makefile                |  1 +
 nptl/Versions                |  1 +
 nptl/pthreadP.h              |  6 ++++
 nptl/pthread_attr_copy.c     | 57 ++++++++++++++++++++++++++++++++++++
 sysdeps/nptl/internaltypes.h |  7 +++++
 5 files changed, 72 insertions(+)
 create mode 100644 nptl/pthread_attr_copy.c

diff --git a/nptl/Makefile b/nptl/Makefile
index 0dd8800f19..b4aaad0f20 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -39,6 +39,7 @@ routines = \
   old_pthread_cond_destroy \
   old_pthread_cond_init \
   pthread_atfork \
+  pthread_attr_copy \
   pthread_attr_destroy \
   pthread_attr_getdetachstate \
   pthread_attr_getinheritsched \
diff --git a/nptl/Versions b/nptl/Versions
index 65f0c077da..4c7b43354d 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -60,6 +60,7 @@ libc {
     __pthread_cond_destroy; __pthread_cond_init;
     __pthread_attr_setaffinity_np;
     __pthread_attr_init; __pthread_attr_destroy;
+    __pthread_attr_copy;
   }
 }
 
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index f218b01574..41b693d034 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -580,6 +580,12 @@ extern void __wait_lookup_done (void) attribute_hidden;
 # define PTHREAD_STATIC_FN_REQUIRE(name) __asm (".globl " #name);
 #endif
 
+/* Make a deep copy of the attribute *SOURCE in *TARGET.  *TARGET is
+   not assumed to have been initialized.  Returns 0 on success, or a
+   positive error code otherwise.  */
+int __pthread_attr_copy (pthread_attr_t *target, const pthread_attr_t *source);
+libc_hidden_proto (__pthread_attr_copy)
+
 /* Returns 0 if POL is a valid scheduling policy.  */
 static inline int
 check_sched_policy_attr (int pol)
diff --git a/nptl/pthread_attr_copy.c b/nptl/pthread_attr_copy.c
new file mode 100644
index 0000000000..77a1a43eeb
--- /dev/null
+++ b/nptl/pthread_attr_copy.c
@@ -0,0 +1,57 @@
+/* Deep copy of a pthread_attr_t object.
+   Copyright (C) 2020 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <pthreadP.h>
+#include <stdlib.h>
+
+int
+__pthread_attr_copy (pthread_attr_t *target, const pthread_attr_t *source)
+{
+  /* Avoid overwriting *TARGET until all allocations have
+     succeeded.  */
+  union pthread_attr_transparent temp;
+  temp.external = *source;
+
+  /* Force new allocation.  This function has full ownership of temp.  */
+  temp.internal.cpuset = NULL;
+  temp.internal.cpusetsize = 0;
+
+  int ret = 0;
+
+  struct pthread_attr *isource = (struct pthread_attr *) source;
+
+  /* Propagate affinity mask information.  */
+  if (isource->cpusetsize > 0)
+    ret = __pthread_attr_setaffinity_np (&temp.external,
+                                         isource->cpusetsize,
+                                         isource->cpuset);
+
+  if (ret != 0)
+    {
+      /* Deallocate because we have ownership.  */
+      __pthread_attr_destroy (&temp.external);
+      return ret;
+    }
+
+  /* Transfer ownership.  *target is not assumed to have been
+     initialized.  */
+  *target = temp.external;
+  return 0;
+}
+libc_hidden_def (__pthread_attr_copy)
diff --git a/sysdeps/nptl/internaltypes.h b/sysdeps/nptl/internaltypes.h
index 71f09b4624..6d06a76baf 100644
--- a/sysdeps/nptl/internaltypes.h
+++ b/sysdeps/nptl/internaltypes.h
@@ -49,6 +49,13 @@ struct pthread_attr
 #define ATTR_FLAG_SCHED_SET		0x0020
 #define ATTR_FLAG_POLICY_SET		0x0040
 
+/* Used to allocate a pthread_attr_t object which is also accessed
+   internally.  */
+union pthread_attr_transparent
+{
+  pthread_attr_t external;
+  struct pthread_attr internal;
+};
 
 /* Mutex attribute data structure.  */
 struct pthread_mutexattr
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 08/19] nptl: Use __pthread_attr_copy in pthread_getattr_default_np (bug 25999)
  2020-05-19 10:43 [PATCH 00/19] Signal mask for timer helper thread Florian Weimer via Libc-alpha
                   ` (6 preceding siblings ...)
  2020-05-19 10:44 ` [PATCH 07/19] nptl: Add __pthread_attr_copy for copying pthread_attr_t objects Florian Weimer via Libc-alpha
@ 2020-05-19 10:44 ` Florian Weimer via Libc-alpha
  2020-05-20 14:42   ` Carlos O'Donell via Libc-alpha
  2020-05-19 10:44 ` [PATCH 09/19] nptl: Use __pthread_attr_copy in pthread_setattr_default_np Florian Weimer via Libc-alpha
                   ` (11 subsequent siblings)
  19 siblings, 1 reply; 42+ messages in thread
From: Florian Weimer via Libc-alpha @ 2020-05-19 10:44 UTC (permalink / raw)
  To: libc-alpha

pthread_getattr_default_np needs to make a deep copy.
---
 nptl/Makefile                       |  1 +
 nptl/pthread_getattr_default_np.c   | 12 ++---
 nptl/tst-pthread-defaultattr-free.c | 78 +++++++++++++++++++++++++++++
 3 files changed, 82 insertions(+), 9 deletions(-)
 create mode 100644 nptl/tst-pthread-defaultattr-free.c

diff --git a/nptl/Makefile b/nptl/Makefile
index b4aaad0f20..e5686b20ac 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -328,6 +328,7 @@ tests = tst-attr2 tst-attr3 tst-default-attr \
 	tst-thread-affinity-pthread \
 	tst-thread-affinity-pthread2 \
 	tst-thread-affinity-sched \
+	tst-pthread-defaultattr-free \
 
 
 tests-container =  tst-pthread-getattr
diff --git a/nptl/pthread_getattr_default_np.c b/nptl/pthread_getattr_default_np.c
index cce20cbe94..a9665c5df7 100644
--- a/nptl/pthread_getattr_default_np.c
+++ b/nptl/pthread_getattr_default_np.c
@@ -16,20 +16,14 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include <errno.h>
-#include <stdlib.h>
 #include <pthreadP.h>
 
 int
 pthread_getattr_default_np (pthread_attr_t *out)
 {
-  struct pthread_attr *real_out;
-
-  real_out = (struct pthread_attr *) out;
-
   lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
-  *real_out = __default_pthread_attr;
+  int ret = __pthread_attr_copy (out,
+                                 (pthread_attr_t *) &__default_pthread_attr);
   lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
-
-  return 0;
+  return ret;
 }
diff --git a/nptl/tst-pthread-defaultattr-free.c b/nptl/tst-pthread-defaultattr-free.c
new file mode 100644
index 0000000000..5a84302380
--- /dev/null
+++ b/nptl/tst-pthread-defaultattr-free.c
@@ -0,0 +1,78 @@
+/* Test for user-after-free bug in pthread_getattr_default_np (bug 25999).
+   Copyright (C) 2020 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <pthread.h>
+#include <sched.h>
+#include <support/check.h>
+#include <support/xthread.h>
+
+static int
+do_test (void)
+{
+  /* This is a typical affinity size.  */
+  enum { cpu_count = 128 };
+  cpu_set_t *set = CPU_ALLOC (cpu_count);
+  size_t set_size = CPU_ALLOC_SIZE (cpu_count);
+  CPU_ZERO_S (set_size, set);
+  CPU_SET (1, set);
+  CPU_SET (3, set);
+
+  /* Apply the affinity mask to the default attribute.  */
+  pthread_attr_t attr;
+  xpthread_attr_init (&attr);
+  TEST_COMPARE (pthread_attr_setaffinity_np (&attr, set_size, set), 0);
+  TEST_COMPARE (pthread_setattr_default_np (&attr), 0);
+  xpthread_attr_destroy (&attr);
+
+  /* Read back the default attribute and check affinity mask.  */
+  pthread_getattr_default_np (&attr);
+  CPU_ZERO_S (set_size, set);
+  TEST_COMPARE (pthread_attr_getaffinity_np (&attr, set_size, set), 0);
+  for (int i = 0; i < cpu_count; ++i)
+    TEST_COMPARE (!!CPU_ISSET (i, set), i == 1 || i == 3);
+
+
+  /* Apply a larger CPU affinity mask to the default attribute, to
+     trigger reallocation.  */
+  {
+    cpu_set_t *large_set = CPU_ALLOC (4 * cpu_count);
+    size_t large_set_size = CPU_ALLOC_SIZE (4 * cpu_count);
+    CPU_ZERO_S (large_set_size, large_set);
+    pthread_attr_t large_attr;
+    xpthread_attr_init (&large_attr);
+    TEST_COMPARE (pthread_attr_setaffinity_np (&large_attr,
+                                               large_set_size, large_set), 0);
+    TEST_COMPARE (pthread_setattr_default_np (&large_attr), 0);
+    xpthread_attr_destroy (&large_attr);
+    CPU_FREE (large_set);
+  }
+
+  /* Read back the default attribute and check affinity mask.  */
+  CPU_ZERO_S (set_size, set);
+  TEST_COMPARE (pthread_attr_getaffinity_np (&attr, set_size, set), 0);
+  for (int i = 0; i < cpu_count; ++i)
+    TEST_COMPARE (!!CPU_ISSET (i, set), i == 1 || i == 3);
+  /* Due to bug 25999, the following caused a double-free abort.  */
+  xpthread_attr_destroy (&attr);
+
+  CPU_FREE (set);
+
+  return 0;
+}
+
+#include <support/test-driver.c>
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 09/19] nptl: Use __pthread_attr_copy in pthread_setattr_default_np
  2020-05-19 10:43 [PATCH 00/19] Signal mask for timer helper thread Florian Weimer via Libc-alpha
                   ` (7 preceding siblings ...)
  2020-05-19 10:44 ` [PATCH 08/19] nptl: Use __pthread_attr_copy in pthread_getattr_default_np (bug 25999) Florian Weimer via Libc-alpha
@ 2020-05-19 10:44 ` Florian Weimer via Libc-alpha
  2020-05-20 14:48   ` Carlos O'Donell via Libc-alpha
  2020-05-19 10:44 ` [PATCH 10/19] <libc-symbols.h>: Add libpthread hidden alias support Florian Weimer via Libc-alpha
                   ` (10 subsequent siblings)
  19 siblings, 1 reply; 42+ messages in thread
From: Florian Weimer via Libc-alpha @ 2020-05-19 10:44 UTC (permalink / raw)
  To: libc-alpha

---
 nptl/pthread_setattr_default_np.c | 53 +++++++++----------------------
 1 file changed, 15 insertions(+), 38 deletions(-)

diff --git a/nptl/pthread_setattr_default_np.c b/nptl/pthread_setattr_default_np.c
index d6a46624b5..eb5d24d3bd 100644
--- a/nptl/pthread_setattr_default_np.c
+++ b/nptl/pthread_setattr_default_np.c
@@ -26,7 +26,6 @@ int
 pthread_setattr_default_np (const pthread_attr_t *in)
 {
   const struct pthread_attr *real_in;
-  struct pthread_attr attrs;
   int ret;
 
   real_in = (struct pthread_attr *) in;
@@ -58,49 +57,27 @@ pthread_setattr_default_np (const pthread_attr_t *in)
   if (real_in->flags & ATTR_FLAG_STACKADDR)
     return EINVAL;
 
-  attrs = *real_in;
+  union pthread_attr_transparent temp;
+  ret = __pthread_attr_copy (&temp.external, in);
+  if (ret != 0)
+    return ret;
 
-  /* Now take the lock because we start writing into
+  /* Now take the lock because we start accessing
      __default_pthread_attr.  */
   lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
 
-  /* Free the cpuset if the input is 0.  Otherwise copy in the cpuset
-     contents.  */
-  size_t cpusetsize = attrs.cpusetsize;
-  if (cpusetsize == 0)
-    {
-      free (__default_pthread_attr.cpuset);
-      __default_pthread_attr.cpuset = NULL;
-    }
-  else if (cpusetsize == __default_pthread_attr.cpusetsize)
-    {
-      attrs.cpuset = __default_pthread_attr.cpuset;
-      memcpy (attrs.cpuset, real_in->cpuset, cpusetsize);
-    }
-  else
-    {
-      /* This may look wrong at first sight, but it isn't.  We're freeing
-	 __default_pthread_attr.cpuset and allocating to attrs.cpuset because
-	 we'll copy over all of attr to __default_pthread_attr later.  */
-      cpu_set_t *newp = realloc (__default_pthread_attr.cpuset,
-				 cpusetsize);
-
-      if (newp == NULL)
-	{
-	  ret = ENOMEM;
-	  goto out;
-	}
-
-      attrs.cpuset = newp;
-      memcpy (attrs.cpuset, real_in->cpuset, cpusetsize);
-    }
+  /* Preserve the previous stack size (see above).  */
+  if (temp.internal.stacksize == 0)
+    temp.internal.stacksize = __default_pthread_attr.stacksize;
+
+  /* Destroy the old attribute structure because it will be
+     overwritten.  */
+  __pthread_attr_destroy ((pthread_attr_t *) &__default_pthread_attr);
 
-  /* We don't want to accidentally set the default stacksize to zero.  */
-  if (attrs.stacksize == 0)
-    attrs.stacksize = __default_pthread_attr.stacksize;
-  __default_pthread_attr = attrs;
+  /* __default_pthread_attr takes ownership, so do not free
+     attrs.internal after this point.  */
+  __default_pthread_attr = temp.internal;
 
- out:
   lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
   return ret;
 }
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 10/19] <libc-symbols.h>: Add libpthread hidden alias support
  2020-05-19 10:43 [PATCH 00/19] Signal mask for timer helper thread Florian Weimer via Libc-alpha
                   ` (8 preceding siblings ...)
  2020-05-19 10:44 ` [PATCH 09/19] nptl: Use __pthread_attr_copy in pthread_setattr_default_np Florian Weimer via Libc-alpha
@ 2020-05-19 10:44 ` Florian Weimer via Libc-alpha
  2020-05-20 14:51   ` Carlos O'Donell via Libc-alpha
  2020-05-19 10:44 ` [PATCH 11/19] nptl: Add internal alias __pthread_getattr_default_np Florian Weimer via Libc-alpha
                   ` (9 subsequent siblings)
  19 siblings, 1 reply; 42+ messages in thread
From: Florian Weimer via Libc-alpha @ 2020-05-19 10:44 UTC (permalink / raw)
  To: libc-alpha

---
 include/libc-symbols.h | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 3555cb6f3d..b2f36bc44b 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -737,6 +737,29 @@ for linking")
 # define libresolv_hidden_data_ver(local, name)
 #endif
 
+#if IS_IN (libpthread)
+# define libpthread_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libpthread_hidden_tls_proto(name, attrs...) \
+  hidden_tls_proto (name, ##attrs)
+# define libpthread_hidden_def(name) hidden_def (name)
+# define libpthread_hidden_weak(name) hidden_weak (name)
+# define libpthread_hidden_ver(local, name) hidden_ver (local, name)
+# define libpthread_hidden_data_def(name) hidden_data_def (name)
+# define libpthread_hidden_tls_def(name) hidden_tls_def (name)
+# define libpthread_hidden_data_weak(name) hidden_data_weak (name)
+# define libpthread_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libpthread_hidden_proto(name, attrs...)
+# define libpthread_hidden_tls_proto(name, attrs...)
+# define libpthread_hidden_def(name)
+# define libpthread_hidden_weak(name)
+# define libpthread_hidden_ver(local, name)
+# define libpthread_hidden_data_def(name)
+# define libpthread_hidden_tls_def(name)
+# define libpthread_hidden_data_weak(name)
+# define libpthread_hidden_data_ver(local, name)
+#endif
+
 #if IS_IN (librt)
 # define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
 # define librt_hidden_tls_proto(name, attrs...) \
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 11/19] nptl: Add internal alias __pthread_getattr_default_np
  2020-05-19 10:43 [PATCH 00/19] Signal mask for timer helper thread Florian Weimer via Libc-alpha
                   ` (9 preceding siblings ...)
  2020-05-19 10:44 ` [PATCH 10/19] <libc-symbols.h>: Add libpthread hidden alias support Florian Weimer via Libc-alpha
@ 2020-05-19 10:44 ` Florian Weimer via Libc-alpha
  2020-06-02  3:28   ` Carlos O'Donell via Libc-alpha
  2020-05-19 10:44 ` [PATCH 12/19] nptl: Use __pthread_getattr_default_np in pthread_create Florian Weimer via Libc-alpha
                   ` (8 subsequent siblings)
  19 siblings, 1 reply; 42+ messages in thread
From: Florian Weimer via Libc-alpha @ 2020-05-19 10:44 UTC (permalink / raw)
  To: libc-alpha

---
 nptl/Versions                     | 1 +
 nptl/pthreadP.h                   | 2 ++
 nptl/pthread_getattr_default_np.c | 4 +++-
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/nptl/Versions b/nptl/Versions
index 4c7b43354d..e4696c128f 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -61,6 +61,7 @@ libc {
     __pthread_attr_setaffinity_np;
     __pthread_attr_init; __pthread_attr_destroy;
     __pthread_attr_copy;
+    __pthread_getattr_default_np;
   }
 }
 
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index 41b693d034..9c6dd41b7c 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -437,6 +437,8 @@ extern int __pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
 				    size_t __stacksize);
 int __pthread_attr_setaffinity_np (pthread_attr_t *, size_t, const cpu_set_t *);
 libc_hidden_proto (__pthread_attr_setaffinity_np)
+extern __typeof (pthread_getattr_default_np) __pthread_getattr_default_np;
+libpthread_hidden_proto (__pthread_getattr_default_np)
 extern int __pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
 				  const pthread_rwlockattr_t *__restrict
 				  __attr);
diff --git a/nptl/pthread_getattr_default_np.c b/nptl/pthread_getattr_default_np.c
index a9665c5df7..5c99f980e2 100644
--- a/nptl/pthread_getattr_default_np.c
+++ b/nptl/pthread_getattr_default_np.c
@@ -19,7 +19,7 @@
 #include <pthreadP.h>
 
 int
-pthread_getattr_default_np (pthread_attr_t *out)
+__pthread_getattr_default_np (pthread_attr_t *out)
 {
   lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
   int ret = __pthread_attr_copy (out,
@@ -27,3 +27,5 @@ pthread_getattr_default_np (pthread_attr_t *out)
   lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
   return ret;
 }
+libpthread_hidden_def (__pthread_getattr_default_np)
+weak_alias (__pthread_getattr_default_np, pthread_getattr_default_np)
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 12/19] nptl: Use __pthread_getattr_default_np in pthread_create
  2020-05-19 10:43 [PATCH 00/19] Signal mask for timer helper thread Florian Weimer via Libc-alpha
                   ` (10 preceding siblings ...)
  2020-05-19 10:44 ` [PATCH 11/19] nptl: Add internal alias __pthread_getattr_default_np Florian Weimer via Libc-alpha
@ 2020-05-19 10:44 ` Florian Weimer via Libc-alpha
  2020-06-02  3:34   ` Carlos O'Donell via Libc-alpha
  2020-05-19 10:44 ` [PATCH 13/19] nptl: Use __pthread_attr_setaffinity_np in pthread_getattr_np Florian Weimer via Libc-alpha
                   ` (7 subsequent siblings)
  19 siblings, 1 reply; 42+ messages in thread
From: Florian Weimer via Libc-alpha @ 2020-05-19 10:44 UTC (permalink / raw)
  To: libc-alpha

This removes another instance of custom attribute copying code.
---
 nptl/pthread_create.c | 32 +++++++-------------------------
 1 file changed, 7 insertions(+), 25 deletions(-)

diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index a43089065c..347d510707 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -613,32 +613,14 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr,
 
   const struct pthread_attr *iattr = (struct pthread_attr *) attr;
   struct pthread_attr default_attr;
-  bool free_cpuset = false;
+  bool destroy_default_attr = false;
   bool c11 = (attr == ATTR_C11_THREAD);
   if (iattr == NULL || c11)
     {
-      lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
-      default_attr = __default_pthread_attr;
-      size_t cpusetsize = default_attr.cpusetsize;
-      if (cpusetsize > 0)
-	{
-	  cpu_set_t *cpuset;
-	  if (__glibc_likely (__libc_use_alloca (cpusetsize)))
-	    cpuset = __alloca (cpusetsize);
-	  else
-	    {
-	      cpuset = malloc (cpusetsize);
-	      if (cpuset == NULL)
-		{
-		  lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
-		  return ENOMEM;
-		}
-	      free_cpuset = true;
-	    }
-	  memcpy (cpuset, default_attr.cpuset, cpusetsize);
-	  default_attr.cpuset = cpuset;
-	}
-      lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
+      int ret = __pthread_getattr_default_np ((pthread_attr_t *) &default_attr);
+      if (ret != 0)
+	return ret;
+      destroy_default_attr = true;
       iattr = &default_attr;
     }
 
@@ -869,8 +851,8 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr,
     }
 
  out:
-  if (__glibc_unlikely (free_cpuset))
-    free (default_attr.cpuset);
+  if (destroy_default_attr)
+    __pthread_attr_destroy ((pthread_attr_t *) &default_attr);
 
   return retval;
 }
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 13/19] nptl: Use __pthread_attr_setaffinity_np in pthread_getattr_np
  2020-05-19 10:43 [PATCH 00/19] Signal mask for timer helper thread Florian Weimer via Libc-alpha
                   ` (11 preceding siblings ...)
  2020-05-19 10:44 ` [PATCH 12/19] nptl: Use __pthread_getattr_default_np in pthread_create Florian Weimer via Libc-alpha
@ 2020-05-19 10:44 ` Florian Weimer via Libc-alpha
  2020-06-02  3:36   ` Carlos O'Donell via Libc-alpha
  2020-05-19 10:44 ` [PATCH 14/19] nptl: Change type of __default_pthread_attr Florian Weimer via Libc-alpha
                   ` (6 subsequent siblings)
  19 siblings, 1 reply; 42+ messages in thread
From: Florian Weimer via Libc-alpha @ 2020-05-19 10:44 UTC (permalink / raw)
  To: libc-alpha

This avoids duplicating the code for the affinity mask allocation
handling.
---
 nptl/pthread_getattr_np.c | 30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/nptl/pthread_getattr_np.c b/nptl/pthread_getattr_np.c
index 0e8911346d..ce437205e4 100644
--- a/nptl/pthread_getattr_np.c
+++ b/nptl/pthread_getattr_np.c
@@ -33,8 +33,13 @@ int
 __pthread_getattr_np (pthread_t thread_id, pthread_attr_t *attr)
 {
   struct pthread *thread = (struct pthread *) thread_id;
+
+  /* Prepare the new thread attribute.  */
+  int ret = __pthread_attr_init (attr);
+  if (ret != 0)
+    return ret;
+
   struct pthread_attr *iattr = (struct pthread_attr *) attr;
-  int ret = 0;
 
   lll_lock (thread->lock, LLL_PRIVATE);
 
@@ -187,25 +192,18 @@ __pthread_getattr_np (pthread_t thread_id, pthread_attr_t *attr)
       while (ret == EINVAL && size < 1024 * 1024);
 
       if (ret == 0)
-	{
-	  iattr->cpuset = cpuset;
-	  iattr->cpusetsize = size;
-	}
-      else
-	{
-	  free (cpuset);
-	  if (ret == ENOSYS)
-	    {
-	      /* There is no such functionality.  */
-	      ret = 0;
-	      iattr->cpuset = NULL;
-	      iattr->cpusetsize = 0;
-	    }
-	}
+	ret = __pthread_attr_setaffinity_np (attr, size, cpuset);
+      else if (ret == ENOSYS)
+	/* There is no such functionality.  */
+	ret = 0;
+      free (cpuset);
     }
 
   lll_unlock (thread->lock, LLL_PRIVATE);
 
+  if (ret != 0)
+    __pthread_attr_destroy (attr);
+
   return ret;
 }
 versioned_symbol (libc, __pthread_getattr_np, pthread_getattr_np, GLIBC_2_32);
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 14/19] nptl: Change type of __default_pthread_attr
  2020-05-19 10:43 [PATCH 00/19] Signal mask for timer helper thread Florian Weimer via Libc-alpha
                   ` (12 preceding siblings ...)
  2020-05-19 10:44 ` [PATCH 13/19] nptl: Use __pthread_attr_setaffinity_np in pthread_getattr_np Florian Weimer via Libc-alpha
@ 2020-05-19 10:44 ` Florian Weimer via Libc-alpha
  2020-06-02  3:39   ` Carlos O'Donell via Libc-alpha
  2020-05-19 10:44 ` [PATCH 15/19] nptl: Destroy the default thread attribute as part of freeres Florian Weimer via Libc-alpha
                   ` (5 subsequent siblings)
  19 siblings, 1 reply; 42+ messages in thread
From: Florian Weimer via Libc-alpha @ 2020-05-19 10:44 UTC (permalink / raw)
  To: libc-alpha

union pthread_attr_transparent has always the correct size, even if
pthread_attr_t has padding that is not present in struct pthread_attr.

This should not result in an observable behavioral change.  The
existing code appears to have been correct, but it was brittle because
it was not clear which functions were allowed to write to an entire
pthread_attr_t argument (e.g., by copying it).
---
 nptl/allocatestack.c              | 2 +-
 nptl/nptl-init.c                  | 4 ++--
 nptl/pthreadP.h                   | 2 +-
 nptl/pthread_attr_getstacksize.c  | 2 +-
 nptl/pthread_create.c             | 8 ++++----
 nptl/pthread_getattr_default_np.c | 3 +--
 nptl/pthread_setattr_default_np.c | 6 +++---
 nptl/vars.c                       | 2 +-
 8 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index c94980c21c..d16f3d71f8 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -425,7 +425,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
   else
     {
       lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
-      size = __default_pthread_attr.stacksize;
+      size = __default_pthread_attr.internal.stacksize;
       lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
     }
 
diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c
index 96b1444a01..d4cf20e3d1 100644
--- a/nptl/nptl-init.c
+++ b/nptl/nptl-init.c
@@ -318,8 +318,8 @@ __pthread_initialize_minimal_internal (void)
   /* Round the resource limit up to page size.  */
   limit.rlim_cur = ALIGN_UP (limit.rlim_cur, pagesz);
   lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
-  __default_pthread_attr.stacksize = limit.rlim_cur;
-  __default_pthread_attr.guardsize = GLRO (dl_pagesize);
+  __default_pthread_attr.internal.stacksize = limit.rlim_cur;
+  __default_pthread_attr.internal.guardsize = GLRO (dl_pagesize);
   lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
 
 #ifdef SHARED
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index 9c6dd41b7c..acc8e88e4a 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -199,7 +199,7 @@ enum
 
 
 /* Default pthread attributes.  */
-extern struct pthread_attr __default_pthread_attr attribute_hidden;
+extern union pthread_attr_transparent __default_pthread_attr attribute_hidden;
 extern int __default_pthread_attr_lock attribute_hidden;
 
 /* Size and alignment of static TLS block.  */
diff --git a/nptl/pthread_attr_getstacksize.c b/nptl/pthread_attr_getstacksize.c
index 346b375690..9830a635a6 100644
--- a/nptl/pthread_attr_getstacksize.c
+++ b/nptl/pthread_attr_getstacksize.c
@@ -33,7 +33,7 @@ __pthread_attr_getstacksize (const pthread_attr_t *attr, size_t *stacksize)
   if (size == 0)
     {
       lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
-      size = __default_pthread_attr.stacksize;
+      size = __default_pthread_attr.internal.stacksize;
       lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
     }
   *stacksize = size;
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index 347d510707..86fbeb5218 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -612,16 +612,16 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr,
   STACK_VARIABLES;
 
   const struct pthread_attr *iattr = (struct pthread_attr *) attr;
-  struct pthread_attr default_attr;
+  union pthread_attr_transparent default_attr;
   bool destroy_default_attr = false;
   bool c11 = (attr == ATTR_C11_THREAD);
   if (iattr == NULL || c11)
     {
-      int ret = __pthread_getattr_default_np ((pthread_attr_t *) &default_attr);
+      int ret = __pthread_getattr_default_np (&default_attr.external);
       if (ret != 0)
 	return ret;
       destroy_default_attr = true;
-      iattr = &default_attr;
+      iattr = &default_attr.internal;
     }
 
   struct pthread *pd = NULL;
@@ -852,7 +852,7 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr,
 
  out:
   if (destroy_default_attr)
-    __pthread_attr_destroy ((pthread_attr_t *) &default_attr);
+    __pthread_attr_destroy (&default_attr.external);
 
   return retval;
 }
diff --git a/nptl/pthread_getattr_default_np.c b/nptl/pthread_getattr_default_np.c
index 5c99f980e2..f3ce1c2885 100644
--- a/nptl/pthread_getattr_default_np.c
+++ b/nptl/pthread_getattr_default_np.c
@@ -22,8 +22,7 @@ int
 __pthread_getattr_default_np (pthread_attr_t *out)
 {
   lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
-  int ret = __pthread_attr_copy (out,
-                                 (pthread_attr_t *) &__default_pthread_attr);
+  int ret = __pthread_attr_copy (out, &__default_pthread_attr.external);
   lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
   return ret;
 }
diff --git a/nptl/pthread_setattr_default_np.c b/nptl/pthread_setattr_default_np.c
index eb5d24d3bd..c4cfb4e8ef 100644
--- a/nptl/pthread_setattr_default_np.c
+++ b/nptl/pthread_setattr_default_np.c
@@ -68,15 +68,15 @@ pthread_setattr_default_np (const pthread_attr_t *in)
 
   /* Preserve the previous stack size (see above).  */
   if (temp.internal.stacksize == 0)
-    temp.internal.stacksize = __default_pthread_attr.stacksize;
+    temp.internal.stacksize = __default_pthread_attr.internal.stacksize;
 
   /* Destroy the old attribute structure because it will be
      overwritten.  */
-  __pthread_attr_destroy ((pthread_attr_t *) &__default_pthread_attr);
+  __pthread_attr_destroy (&__default_pthread_attr.external);
 
   /* __default_pthread_attr takes ownership, so do not free
      attrs.internal after this point.  */
-  __default_pthread_attr = temp.internal;
+  __default_pthread_attr = temp;
 
   lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
   return ret;
diff --git a/nptl/vars.c b/nptl/vars.c
index b88300d9b4..3696020145 100644
--- a/nptl/vars.c
+++ b/nptl/vars.c
@@ -22,7 +22,7 @@
 
 /* Default thread attributes for the case when the user does not
    provide any.  */
-struct pthread_attr __default_pthread_attr attribute_hidden;
+union pthread_attr_transparent __default_pthread_attr attribute_hidden;
 
 /* Mutex protecting __default_pthread_attr.  */
 int __default_pthread_attr_lock = LLL_LOCK_INITIALIZER;
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 15/19] nptl: Destroy the default thread attribute as part of freeres
  2020-05-19 10:43 [PATCH 00/19] Signal mask for timer helper thread Florian Weimer via Libc-alpha
                   ` (13 preceding siblings ...)
  2020-05-19 10:44 ` [PATCH 14/19] nptl: Change type of __default_pthread_attr Florian Weimer via Libc-alpha
@ 2020-05-19 10:44 ` Florian Weimer via Libc-alpha
  2020-06-02  3:41   ` Carlos O'Donell via Libc-alpha
  2020-05-19 10:44 ` [PATCH 16/19] nptl: Make pthread_attr_t dynamically extensible Florian Weimer via Libc-alpha
                   ` (4 subsequent siblings)
  19 siblings, 1 reply; 42+ messages in thread
From: Florian Weimer via Libc-alpha @ 2020-05-19 10:44 UTC (permalink / raw)
  To: libc-alpha

This avoids a spurious memory leak report by valgrind.
---
 nptl/nptlfreeres.c                |  1 +
 nptl/pthreadP.h                   |  2 ++
 nptl/pthread_setattr_default_np.c | 10 ++++++++++
 3 files changed, 13 insertions(+)

diff --git a/nptl/nptlfreeres.c b/nptl/nptlfreeres.c
index dda11e5922..07aa34adfa 100644
--- a/nptl/nptlfreeres.c
+++ b/nptl/nptlfreeres.c
@@ -25,6 +25,7 @@
 void
 __libpthread_freeres (void)
 {
+  call_function_static_weak (__default_pthread_attr_freeres);
   call_function_static_weak (__nptl_stacks_freeres);
   call_function_static_weak (__shm_directory_freeres);
   call_function_static_weak (__nptl_unwind_freeres);
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index acc8e88e4a..ed30b72923 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -201,6 +201,8 @@ enum
 /* Default pthread attributes.  */
 extern union pthread_attr_transparent __default_pthread_attr attribute_hidden;
 extern int __default_pthread_attr_lock attribute_hidden;
+/* Called from __libpthread_freeres to deallocate the default attribute.  */
+extern void __default_pthread_attr_freeres (void) attribute_hidden;
 
 /* Size and alignment of static TLS block.  */
 extern size_t __static_tls_size attribute_hidden;
diff --git a/nptl/pthread_setattr_default_np.c b/nptl/pthread_setattr_default_np.c
index c4cfb4e8ef..7a1c644334 100644
--- a/nptl/pthread_setattr_default_np.c
+++ b/nptl/pthread_setattr_default_np.c
@@ -81,3 +81,13 @@ pthread_setattr_default_np (const pthread_attr_t *in)
   lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
   return ret;
 }
+
+/* This is placed in the same file as pthread_setattr_default_np
+   because only this function can trigger allocation of attribute
+   data.  This way, the function is automatically defined for all the
+   cases when it is needed in static builds.  */
+void
+__default_pthread_attr_freeres (void)
+{
+  __pthread_attr_destroy (&__default_pthread_attr.external);
+}
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 16/19] nptl: Make pthread_attr_t dynamically extensible
  2020-05-19 10:43 [PATCH 00/19] Signal mask for timer helper thread Florian Weimer via Libc-alpha
                   ` (14 preceding siblings ...)
  2020-05-19 10:44 ` [PATCH 15/19] nptl: Destroy the default thread attribute as part of freeres Florian Weimer via Libc-alpha
@ 2020-05-19 10:44 ` Florian Weimer via Libc-alpha
  2020-06-02  3:47   ` Carlos O'Donell via Libc-alpha
  2020-05-19 10:44 ` [PATCH 17/19] nptl: Add pthread_attr_setsigmask_np, pthread_attr_getsigmask_np Florian Weimer via Libc-alpha
                   ` (3 subsequent siblings)
  19 siblings, 1 reply; 42+ messages in thread
From: Florian Weimer via Libc-alpha @ 2020-05-19 10:44 UTC (permalink / raw)
  To: libc-alpha

This introduces the function __pthread_attr_extension to allocate the
extension space, which is freed by pthread_attr_destroy.
---
 nptl/Makefile                          |  1 +
 nptl/pthreadP.h                        |  6 +++++
 nptl/pthread_attr_copy.c               | 16 +++++++------
 nptl/pthread_attr_destroy.c            | 12 ++++++----
 nptl/pthread_attr_extension.c          | 32 ++++++++++++++++++++++++++
 nptl/pthread_attr_getaffinity.c        | 14 +++++------
 nptl/pthread_attr_setaffinity.c        | 23 +++++++++++-------
 nptl/pthread_create.c                  |  2 +-
 sysdeps/nptl/internaltypes.h           | 16 ++++++++++---
 sysdeps/unix/sysv/linux/createthread.c |  9 +++++---
 10 files changed, 98 insertions(+), 33 deletions(-)
 create mode 100644 nptl/pthread_attr_extension.c

diff --git a/nptl/Makefile b/nptl/Makefile
index e5686b20ac..d6f12d0371 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -41,6 +41,7 @@ routines = \
   pthread_atfork \
   pthread_attr_copy \
   pthread_attr_destroy \
+  pthread_attr_extension \
   pthread_attr_getdetachstate \
   pthread_attr_getinheritsched \
   pthread_attr_getschedparam \
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index ed30b72923..7b3153594e 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -578,6 +578,12 @@ extern void __shm_directory_freeres (void) attribute_hidden;
 
 extern void __wait_lookup_done (void) attribute_hidden;
 
+/* Allocates the extension space for ATTR.  Returns an error code on
+   memory allocation failure, zero on success.  If ATTR already has an
+   extension space, this function does nothing.  */
+int __pthread_attr_extension (struct pthread_attr *attr) attribute_hidden
+  __attribute_warn_unused_result__;
+
 #ifdef SHARED
 # define PTHREAD_STATIC_FN_REQUIRE(name)
 #else
diff --git a/nptl/pthread_attr_copy.c b/nptl/pthread_attr_copy.c
index 77a1a43eeb..eb29557505 100644
--- a/nptl/pthread_attr_copy.c
+++ b/nptl/pthread_attr_copy.c
@@ -29,18 +29,20 @@ __pthread_attr_copy (pthread_attr_t *target, const pthread_attr_t *source)
   temp.external = *source;
 
   /* Force new allocation.  This function has full ownership of temp.  */
-  temp.internal.cpuset = NULL;
-  temp.internal.cpusetsize = 0;
+  temp.internal.extension = NULL;
 
   int ret = 0;
 
   struct pthread_attr *isource = (struct pthread_attr *) source;
 
-  /* Propagate affinity mask information.  */
-  if (isource->cpusetsize > 0)
-    ret = __pthread_attr_setaffinity_np (&temp.external,
-                                         isource->cpusetsize,
-                                         isource->cpuset);
+  if (isource->extension != NULL)
+    {
+      /* Propagate affinity mask information.  */
+      if (isource->extension->cpusetsize > 0)
+        ret = __pthread_attr_setaffinity_np (&temp.external,
+                                             isource->extension->cpusetsize,
+                                             isource->extension->cpuset);
+    }
 
   if (ret != 0)
     {
diff --git a/nptl/pthread_attr_destroy.c b/nptl/pthread_attr_destroy.c
index 21f8026a2c..b6a3cca657 100644
--- a/nptl/pthread_attr_destroy.c
+++ b/nptl/pthread_attr_destroy.c
@@ -30,12 +30,16 @@ __pthread_attr_destroy (pthread_attr_t *attr)
   iattr = (struct pthread_attr *) attr;
 
 #if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_1)
-  /* In old struct pthread_attr, neither next nor cpuset are
-     present.  */
+  /* In old struct pthread_attr, the extension member is missing.  */
   if (__builtin_expect ((iattr->flags & ATTR_FLAG_OLDATTR), 0) == 0)
 #endif
-    /* The affinity CPU set might be allocated dynamically.  */
-    free (iattr->cpuset);
+    {
+      if (iattr->extension != NULL)
+        {
+          free (iattr->extension->cpuset);
+          free (iattr->extension);
+        }
+    }
 
   return 0;
 }
diff --git a/nptl/pthread_attr_extension.c b/nptl/pthread_attr_extension.c
new file mode 100644
index 0000000000..e8521b1556
--- /dev/null
+++ b/nptl/pthread_attr_extension.c
@@ -0,0 +1,32 @@
+/* Allocate the extension space for strucht pthread_attr.
+   Copyright (C) 2020 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <pthreadP.h>
+#include <stdlib.h>
+
+int
+ __pthread_attr_extension (struct pthread_attr *attr)
+{
+  if (attr->extension != NULL)
+    return 0;
+  attr->extension = calloc (sizeof (*attr->extension), 1);
+  if (attr->extension == NULL)
+    return errno;
+  return 0;
+}
diff --git a/nptl/pthread_attr_getaffinity.c b/nptl/pthread_attr_getaffinity.c
index 212c1f7c0a..9483f69ddc 100644
--- a/nptl/pthread_attr_getaffinity.c
+++ b/nptl/pthread_attr_getaffinity.c
@@ -33,22 +33,22 @@ __pthread_attr_getaffinity_new (const pthread_attr_t *attr, size_t cpusetsize,
 
   iattr = (const struct pthread_attr *) attr;
 
-  if (iattr->cpuset != NULL)
+  if (iattr->extension != NULL && iattr->extension->cpuset != NULL)
     {
       /* Check whether there are any bits set beyond the limits
 	 the user requested.  */
-      for (size_t cnt = cpusetsize; cnt < iattr->cpusetsize; ++cnt)
-	if (((char *) iattr->cpuset)[cnt] != 0)
+      for (size_t cnt = cpusetsize; cnt < iattr->extension->cpusetsize; ++cnt)
+	if (((char *) iattr->extension->cpuset)[cnt] != 0)
 	  return EINVAL;
 
       /* Copy over the cpuset from the thread attribute object.  Limit the copy
 	 to the minimum of the source and destination sizes to prevent a buffer
 	 overrun.  If the destination is larger, fill the remaining space with
 	 zeroes.  */
-      void *p = mempcpy (cpuset, iattr->cpuset,
-			 MIN (iattr->cpusetsize, cpusetsize));
-      if (cpusetsize > iattr->cpusetsize)
-	memset (p, '\0', cpusetsize - iattr->cpusetsize);
+      void *p = mempcpy (cpuset, iattr->extension->cpuset,
+			 MIN (iattr->extension->cpusetsize, cpusetsize));
+      if (cpusetsize > iattr->extension->cpusetsize)
+	memset (p, '\0', cpusetsize - iattr->extension->cpusetsize);
     }
   else
     /* We have no information.  */
diff --git a/nptl/pthread_attr_setaffinity.c b/nptl/pthread_attr_setaffinity.c
index a42ffd92f4..9f9a70dee0 100644
--- a/nptl/pthread_attr_setaffinity.c
+++ b/nptl/pthread_attr_setaffinity.c
@@ -34,23 +34,30 @@ __pthread_attr_setaffinity_np (pthread_attr_t *attr, size_t cpusetsize,
 
   if (cpuset == NULL || cpusetsize == 0)
     {
-      free (iattr->cpuset);
-      iattr->cpuset = NULL;
-      iattr->cpusetsize = 0;
+      if (iattr->extension != NULL)
+	{
+	  free (iattr->extension->cpuset);
+	  iattr->extension->cpuset = NULL;
+	  iattr->extension->cpusetsize = 0;
+	}
     }
   else
     {
-      if (iattr->cpusetsize != cpusetsize)
+      int ret = __pthread_attr_extension (iattr);
+      if (ret != 0)
+	return ret;
+
+      if (iattr->extension->cpusetsize != cpusetsize)
 	{
-	  void *newp = (cpu_set_t *) realloc (iattr->cpuset, cpusetsize);
+	  void *newp = realloc (iattr->extension->cpuset, cpusetsize);
 	  if (newp == NULL)
 	    return ENOMEM;
 
-	  iattr->cpuset = newp;
-	  iattr->cpusetsize = cpusetsize;
+	  iattr->extension->cpuset = newp;
+	  iattr->extension->cpusetsize = cpusetsize;
 	}
 
-      memcpy (iattr->cpuset, cpuset, cpusetsize);
+      memcpy (iattr->extension->cpuset, cpuset, cpusetsize);
     }
 
   return 0;
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index 86fbeb5218..f6418eb5ed 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -884,7 +884,7 @@ __pthread_create_2_0 (pthread_t *newthread, const pthread_attr_t *attr,
       new_attr.guardsize = ps;
       new_attr.stackaddr = NULL;
       new_attr.stacksize = 0;
-      new_attr.cpuset = NULL;
+      new_attr.extension = NULL;
 
       /* We will pass this value on to the real implementation.  */
       attr = (pthread_attr_t *) &new_attr;
diff --git a/sysdeps/nptl/internaltypes.h b/sysdeps/nptl/internaltypes.h
index 6d06a76baf..ca57c315d4 100644
--- a/sysdeps/nptl/internaltypes.h
+++ b/sysdeps/nptl/internaltypes.h
@@ -36,9 +36,10 @@ struct pthread_attr
   /* Stack handling.  */
   void *stackaddr;
   size_t stacksize;
-  /* Affinity map.  */
-  cpu_set_t *cpuset;
-  size_t cpusetsize;
+
+  /* Allocated via a call to __pthread_attr_extension once needed.  */
+  struct pthread_attr_extension *extension;
+  void *unused;
 };
 
 #define ATTR_FLAG_DETACHSTATE		0x0001
@@ -57,6 +58,15 @@ union pthread_attr_transparent
   struct pthread_attr internal;
 };
 
+/* Extension space for pthread attributes.  Referenced by the
+   extension member of struct pthread_attr.  */
+struct pthread_attr_extension
+{
+  /* Affinity map.  */
+  cpu_set_t *cpuset;
+  size_t cpusetsize;
+};
+
 /* Mutex attribute data structure.  */
 struct pthread_mutexattr
 {
diff --git a/sysdeps/unix/sysv/linux/createthread.c b/sysdeps/unix/sysv/linux/createthread.c
index 21f9d24f2d..6588893ba5 100644
--- a/sysdeps/unix/sysv/linux/createthread.c
+++ b/sysdeps/unix/sysv/linux/createthread.c
@@ -52,8 +52,10 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr,
   /* Determine whether the newly created threads has to be started
      stopped since we have to set the scheduling parameters or set the
      affinity.  */
+  bool need_setaffinity = (attr != NULL && attr->extension != NULL
+			   && attr->extension->cpuset != 0);
   if (attr != NULL
-      && (__glibc_unlikely (attr->cpuset != NULL)
+      && (__glibc_unlikely (need_setaffinity)
 	  || __glibc_unlikely ((attr->flags & ATTR_FLAG_NOTINHERITSCHED) != 0)))
     *stopped_start = true;
 
@@ -113,12 +115,13 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr,
       int res;
 
       /* Set the affinity mask if necessary.  */
-      if (attr->cpuset != NULL)
+      if (need_setaffinity)
 	{
 	  assert (*stopped_start);
 
 	  res = INTERNAL_SYSCALL_CALL (sched_setaffinity, pd->tid,
-				       attr->cpusetsize, attr->cpuset);
+				       attr->extension->cpusetsize,
+				       attr->extension->cpuset);
 
 	  if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (res)))
 	  err_out:
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 17/19] nptl: Add pthread_attr_setsigmask_np, pthread_attr_getsigmask_np
  2020-05-19 10:43 [PATCH 00/19] Signal mask for timer helper thread Florian Weimer via Libc-alpha
                   ` (15 preceding siblings ...)
  2020-05-19 10:44 ` [PATCH 16/19] nptl: Make pthread_attr_t dynamically extensible Florian Weimer via Libc-alpha
@ 2020-05-19 10:44 ` Florian Weimer via Libc-alpha
  2020-06-02  4:01   ` Carlos O'Donell via Libc-alpha
  2020-05-19 10:45 ` [PATCH 18/19] manual: " Florian Weimer via Libc-alpha
                   ` (2 subsequent siblings)
  19 siblings, 1 reply; 42+ messages in thread
From: Florian Weimer via Libc-alpha @ 2020-05-19 10:44 UTC (permalink / raw)
  To: libc-alpha

---
 NEWS                                          |   4 +
 nptl/Makefile                                 |   4 +
 nptl/Versions                                 |   3 +
 nptl/pthreadP.h                               |  10 +
 nptl/pthread_attr_copy.c                      |   5 +
 nptl/pthread_attr_getsigmask.c                |  38 ++++
 nptl/pthread_attr_setsigmask.c                |  34 +++
 nptl/pthread_attr_setsigmask_internal.c       |  45 ++++
 nptl/pthread_create.c                         |  25 ++-
 nptl/tst-pthread-attr-sigmask.c               | 204 ++++++++++++++++++
 sysdeps/nptl/internaltypes.h                  |   3 +
 sysdeps/nptl/pthread.h                        |  15 ++
 sysdeps/unix/sysv/linux/aarch64/libc.abilist  |   2 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist    |   2 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist   |   2 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist   |   2 +
 sysdeps/unix/sysv/linux/csky/libc.abilist     |   2 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist     |   2 +
 sysdeps/unix/sysv/linux/i386/libc.abilist     |   2 +
 sysdeps/unix/sysv/linux/ia64/libc.abilist     |   2 +
 .../sysv/linux/m68k/coldfire/libc.abilist     |   2 +
 .../unix/sysv/linux/m68k/m680x0/libc.abilist  |   2 +
 .../sysv/linux/microblaze/be/libc.abilist     |   2 +
 .../sysv/linux/microblaze/le/libc.abilist     |   2 +
 .../sysv/linux/mips/mips32/fpu/libc.abilist   |   2 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist |   2 +
 .../sysv/linux/mips/mips64/n32/libc.abilist   |   2 +
 .../sysv/linux/mips/mips64/n64/libc.abilist   |   2 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist    |   2 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |   2 +
 .../powerpc/powerpc32/nofpu/libc.abilist      |   2 +
 .../linux/powerpc/powerpc64/be/libc.abilist   |   2 +
 .../linux/powerpc/powerpc64/le/libc.abilist   |   2 +
 .../unix/sysv/linux/riscv/rv64/libc.abilist   |   2 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist |   2 +
 .../unix/sysv/linux/s390/s390-64/libc.abilist |   2 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist    |   2 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist    |   2 +
 .../sysv/linux/sparc/sparc32/libc.abilist     |   2 +
 .../sysv/linux/sparc/sparc64/libc.abilist     |   2 +
 .../unix/sysv/linux/x86_64/64/libc.abilist    |   2 +
 .../unix/sysv/linux/x86_64/x32/libc.abilist   |   2 +
 42 files changed, 442 insertions(+), 8 deletions(-)
 create mode 100644 nptl/pthread_attr_getsigmask.c
 create mode 100644 nptl/pthread_attr_setsigmask.c
 create mode 100644 nptl/pthread_attr_setsigmask_internal.c
 create mode 100644 nptl/tst-pthread-attr-sigmask.c

diff --git a/NEWS b/NEWS
index 141078c319..2508feb249 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,10 @@ Major new features:
   toolchains.  It is recommended to use GCC 8 or newer when testing
   this option.
 
+* On Linux, the pthread_attr_setsigmask_np and
+  pthread_attr_getsigmask_np functions have been added.  They allow to
+  specify the signal mask of a thread created with pthread_create.
+
 Deprecated and removed features, and other changes affecting compatibility:
 
 * The deprecated <sys/sysctl.h> header and the sysctl function have been
diff --git a/nptl/Makefile b/nptl/Makefile
index d6f12d0371..cd0ed97181 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -47,6 +47,7 @@ routines = \
   pthread_attr_getschedparam \
   pthread_attr_getschedpolicy \
   pthread_attr_getscope \
+  pthread_attr_getsigmask \
   pthread_attr_init \
   pthread_attr_setaffinity \
   pthread_attr_setdetachstate \
@@ -54,6 +55,8 @@ routines = \
   pthread_attr_setschedparam \
   pthread_attr_setschedpolicy \
   pthread_attr_setscope \
+  pthread_attr_setsigmask \
+  pthread_attr_setsigmask_internal \
   pthread_cond_destroy \
   pthread_cond_init \
   pthread_condattr_destroy \
@@ -330,6 +333,7 @@ tests = tst-attr2 tst-attr3 tst-default-attr \
 	tst-thread-affinity-pthread2 \
 	tst-thread-affinity-sched \
 	tst-pthread-defaultattr-free \
+	tst-pthread-attr-sigmask \
 
 
 tests-container =  tst-pthread-getattr
diff --git a/nptl/Versions b/nptl/Versions
index e4696c128f..aed118e717 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -44,7 +44,9 @@ libc {
     thrd_current; thrd_equal; thrd_sleep; thrd_yield;
   }
   GLIBC_2.32 {
+    pthread_attr_getsigmask_np;
     pthread_attr_setaffinity_np;
+    pthread_attr_setsigmask_np;
     pthread_getaffinity_np;
     pthread_getattr_np;
     pthread_sigmask;
@@ -62,6 +64,7 @@ libc {
     __pthread_attr_init; __pthread_attr_destroy;
     __pthread_attr_copy;
     __pthread_getattr_default_np;
+    __pthread_attr_setsigmask_internal;
   }
 }
 
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index 7b3153594e..b48ce1f050 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -528,6 +528,16 @@ extern int __pthread_getaffinity_np (pthread_t th, size_t cpusetsize,
 				     cpu_set_t *cpuset);
 libc_hidden_proto (__pthread_getaffinity_np)
 
+/* Special internal version of pthread_attr_setsigmask_np which does
+   not filter out internal signals from *SIGMASK.  This can be used to
+   launch threads with internal symbols blocked.  */
+  extern int __pthread_attr_setsigmask_internal (pthread_attr_t *attr,
+						 const sigset_t *sigmask);
+libc_hidden_proto (__pthread_attr_setsigmask_internal)
+
+extern __typeof (pthread_attr_getsigmask_np) __pthread_attr_getsigmask_np;
+libc_hidden_proto (__pthread_attr_getsigmask_np)
+
 #if IS_IN (libpthread)
 /* Special versions which use non-exported functions.  */
 extern void __pthread_cleanup_push (struct _pthread_cleanup_buffer *buffer,
diff --git a/nptl/pthread_attr_copy.c b/nptl/pthread_attr_copy.c
index eb29557505..5d0c62f65c 100644
--- a/nptl/pthread_attr_copy.c
+++ b/nptl/pthread_attr_copy.c
@@ -42,6 +42,11 @@ __pthread_attr_copy (pthread_attr_t *target, const pthread_attr_t *source)
         ret = __pthread_attr_setaffinity_np (&temp.external,
                                              isource->extension->cpusetsize,
                                              isource->extension->cpuset);
+
+      /* Propagate the signal mask information.  */
+      if (ret == 0 && isource->extension->sigmask_set)
+        ret = __pthread_attr_setsigmask_internal ((pthread_attr_t *) &temp,
+                                                  &isource->extension->sigmask);
     }
 
   if (ret != 0)
diff --git a/nptl/pthread_attr_getsigmask.c b/nptl/pthread_attr_getsigmask.c
new file mode 100644
index 0000000000..99b9812ef8
--- /dev/null
+++ b/nptl/pthread_attr_getsigmask.c
@@ -0,0 +1,38 @@
+/* Obtain the configured signal mask from a POSIX thread attribute.
+   Copyright (C) 2020 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <pthreadP.h>
+
+int
+__pthread_attr_getsigmask_np (const pthread_attr_t *attr, sigset_t *sigmask)
+{
+  struct pthread_attr *iattr = (struct pthread_attr *) attr;
+
+  if (iattr->extension == NULL || !iattr->extension->sigmask_set)
+    {
+      __sigemptyset (sigmask);
+      return PTHREAD_ATTR_NO_SIGMASK_NP;
+    }
+  else
+    {
+      *sigmask = iattr->extension->sigmask;
+      return 0;
+    }
+}
+libc_hidden_def (__pthread_attr_getsigmask_np)
+weak_alias (__pthread_attr_getsigmask_np, pthread_attr_getsigmask_np)
diff --git a/nptl/pthread_attr_setsigmask.c b/nptl/pthread_attr_setsigmask.c
new file mode 100644
index 0000000000..4574f51056
--- /dev/null
+++ b/nptl/pthread_attr_setsigmask.c
@@ -0,0 +1,34 @@
+/* Set the signal mask in a POSIX thread attribute.  Public variant.
+   Copyright (C) 2020 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <pthreadP.h>
+#include <internal-signals.h>
+
+int
+pthread_attr_setsigmask_np (pthread_attr_t *attr, const sigset_t *sigmask)
+{
+  int ret = __pthread_attr_setsigmask_internal (attr, sigmask);
+  if (ret != 0)
+    return ret;
+
+  /* Filter out internal signals.  */
+  struct pthread_attr *iattr = (struct pthread_attr *) attr;
+  __clear_internal_signals (&iattr->extension->sigmask);
+
+  return 0;
+}
diff --git a/nptl/pthread_attr_setsigmask_internal.c b/nptl/pthread_attr_setsigmask_internal.c
new file mode 100644
index 0000000000..a2941b4ee9
--- /dev/null
+++ b/nptl/pthread_attr_setsigmask_internal.c
@@ -0,0 +1,45 @@
+/* Set the signal mask in a POSIX thread attribute.  Internal variant.
+   Copyright (C) 2020 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <pthreadP.h>
+#include <internal-signals.h>
+
+int
+__pthread_attr_setsigmask_internal (pthread_attr_t *attr,
+                                    const sigset_t *sigmask)
+{
+  struct pthread_attr *iattr = (struct pthread_attr *) attr;
+
+  if (sigmask == NULL)
+    {
+      /* Mark the signal mask as unset if it is present.  */
+      if (iattr->extension != NULL)
+        iattr->extension->sigmask_set = false;
+      return 0;
+    }
+
+  int ret = __pthread_attr_extension (iattr);
+  if (ret != 0)
+    return ret;
+
+  iattr->extension->sigmask = *sigmask;
+  iattr->extension->sigmask_set = true;
+
+  return 0;
+}
+libc_hidden_def (__pthread_attr_setsigmask_internal)
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index f6418eb5ed..35a9927cf2 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -745,14 +745,23 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr,
   sigset_t original_sigmask;
   __libc_signal_block_all (&original_sigmask);
 
-  /* Conceptually, the new thread needs to inherit the signal mask of
-     this thread.  Therefore, it needs to restore the saved signal
-     mask of this thread, so save it in the startup information.  */
-  pd->sigmask = original_sigmask;
-
-  /* Reset the cancellation signal mask in case this thread is running
-     cancellation.  */
-  __sigdelset (&pd->sigmask, SIGCANCEL);
+  if (iattr->extension != NULL && iattr->extension->sigmask_set)
+    /* Use the signal mask in the attribute.  The internal signals
+       have already been filtered by the public
+       pthread_attr_setsigmask_np interface.  */
+    pd->sigmask = iattr->extension->sigmask;
+  else
+    {
+      /* Conceptually, the new thread needs to inherit the signal mask
+	 of this thread.  Therefore, it needs to restore the saved
+	 signal mask of this thread, so save it in the startup
+	 information.  */
+      pd->sigmask = original_sigmask;
+
+      /* Reset the cancellation signal mask in case this thread is
+	 running cancellation.  */
+      __sigdelset (&pd->sigmask, SIGCANCEL);
+    }
 
   /* Start the thread.  */
   if (__glibc_unlikely (report_thread_creation (pd)))
diff --git a/nptl/tst-pthread-attr-sigmask.c b/nptl/tst-pthread-attr-sigmask.c
new file mode 100644
index 0000000000..8f854d8d11
--- /dev/null
+++ b/nptl/tst-pthread-attr-sigmask.c
@@ -0,0 +1,204 @@
+/* Tests for pthread_attr_setsigmask_np, pthread_attr_getsigmask_np.
+   Copyright (C) 2020 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+/* This thread uses different masked status for SIGUSR1, SIGUSR2,
+   SIGHUP to determine if signal masks are applied to new threads as
+   expected.  */
+
+#include <signal.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <support/check.h>
+#include <support/xsignal.h>
+#include <support/xthread.h>
+#include <threads.h>
+
+typedef bool signals[_NSIG];
+
+static const char *
+masked_or_unmasked (bool masked)
+{
+  if (masked)
+    return "masked";
+  else
+    return "unmasked";
+}
+
+/* Report an error if ACTUAL_MASK does not match EXPECTED_MASK.
+   CONTEXT is used in error messages.  */
+static void
+check_sigmask (const char *context, signals expected_mask,
+               const sigset_t *actual_mask)
+{
+  for (int sig = 1; sig < _NSIG; ++sig)
+    if (sigismember (actual_mask, sig) != expected_mask[sig])
+      {
+        support_record_failure ();
+        printf ("error: %s: signal %d should be %s, but is %s\n",
+                context, sig,
+                masked_or_unmasked (sigismember (actual_mask, sig)),
+                masked_or_unmasked (expected_mask[sig]));
+      }
+}
+
+/* Report an error if the current thread signal mask does not match
+   EXPECTED_MASK.  CONTEXT is used in error messages.  */
+static void
+check_current_sigmask (const char *context, signals expected_mask)
+{
+  sigset_t actual_mask;
+  xpthread_sigmask (SIG_SETMASK, NULL, &actual_mask);
+  check_sigmask (context, expected_mask, &actual_mask);
+}
+
+/* Thread start routine which checks the current thread signal mask
+   against CLOSURE.  */
+static void *
+check_sigmask_thread_function (void *closure)
+{
+  check_current_sigmask ("on thread", closure);
+  return NULL;
+}
+
+/* Same for C11 threads.  */
+static int
+check_sigmask_thread_function_c11 (void *closure)
+{
+  check_current_sigmask ("on C11 thread", closure);
+  return 0;
+}
+
+/* Launch a POSIX thread with ATTR (which can be NULL) and check that
+   it has the expected signal mask.  */
+static void
+check_posix_thread (pthread_attr_t *attr, signals expected_mask)
+{
+  xpthread_join (xpthread_create (attr, check_sigmask_thread_function,
+                                  expected_mask));
+}
+
+/* Launch a C11 thread and check that it has the expected signal
+   mask.  */
+static void
+check_c11_thread (signals expected_mask)
+{
+  thrd_t thr;
+  TEST_VERIFY_EXIT (thrd_create (&thr, check_sigmask_thread_function_c11,
+                                 expected_mask) == thrd_success);
+  TEST_VERIFY_EXIT (thrd_join (thr, NULL) == thrd_success);
+}
+
+static int
+do_test (void)
+{
+  check_current_sigmask ("initial mask", (signals) { false, });
+  check_posix_thread (NULL, (signals) { false, });
+  check_c11_thread ((signals) { false, });
+
+  sigset_t set;
+  sigemptyset (&set);
+  sigaddset (&set, SIGUSR1);
+  xpthread_sigmask (SIG_SETMASK, &set, NULL);
+  check_current_sigmask ("SIGUSR1 masked", (signals) { [SIGUSR1] = true, });
+  /* The signal mask is inherited by the new thread.  */
+  check_posix_thread (NULL, (signals) { [SIGUSR1] = true, });
+  check_c11_thread ((signals) { [SIGUSR1] = true, });
+
+  pthread_attr_t attr;
+  xpthread_attr_init (&attr);
+  TEST_COMPARE (pthread_attr_getsigmask_np (&attr, &set),
+                PTHREAD_ATTR_NO_SIGMASK_NP);
+  /* By default, the signal mask is inherited (even with an explicit
+     thread attribute).  */
+  check_posix_thread (&attr, (signals) { [SIGUSR1] = true, });
+
+  /* Check that pthread_attr_getsigmask_np can obtain the signal
+     mask.  */
+  sigemptyset (&set);
+  sigaddset (&set, SIGUSR2);
+  TEST_COMPARE (pthread_attr_setsigmask_np (&attr, &set), 0);
+  sigemptyset (&set);
+  TEST_COMPARE (pthread_attr_getsigmask_np (&attr, &set), 0);
+  check_sigmask ("pthread_attr_getsigmask_np", (signals) { [SIGUSR2] = true, },
+                 &set);
+
+  /* Check that a thread is launched with the configured signal
+     mask.  */
+  check_current_sigmask ("SIGUSR1 masked", (signals) { [SIGUSR1] = true, });
+  check_posix_thread (&attr, (signals) { [SIGUSR2] = true, });
+  check_current_sigmask ("SIGUSR1 masked", (signals) { [SIGUSR1] = true, });
+
+  /* But C11 threads remain at inheritance.  */
+  check_c11_thread ((signals) { [SIGUSR1] = true, });
+
+  /* Check that filling the original signal set does not affect thread
+     creation.  */
+  sigfillset (&set);
+  check_posix_thread (&attr, (signals) { [SIGUSR2] = true, });
+
+  /* Check that clearing the signal in the attribute restores
+     inheritance.  */
+  TEST_COMPARE (pthread_attr_setsigmask_np (&attr, NULL), 0);
+  TEST_COMPARE (pthread_attr_getsigmask_np (&attr, &set),
+                PTHREAD_ATTR_NO_SIGMASK_NP);
+  check_posix_thread (&attr, (signals) { [SIGUSR1] = true, });
+
+  /* Mask SIGHUP via the default thread attribute.  */
+  sigemptyset (&set);
+  sigaddset (&set, SIGHUP);
+  TEST_COMPARE (pthread_attr_setsigmask_np (&attr, &set), 0);
+  TEST_COMPARE (pthread_setattr_default_np (&attr), 0);
+
+  /* Check that the mask was applied to the default attribute.  */
+  xpthread_attr_destroy (&attr);
+  TEST_COMPARE (pthread_getattr_default_np (&attr), 0);
+  sigaddset (&set, SIGHUP);
+  TEST_COMPARE (pthread_attr_getsigmask_np (&attr, &set), 0);
+  check_sigmask ("default attribute", (signals) { [SIGHUP] = true, }, &set);
+  xpthread_attr_destroy (&attr);
+
+  /* Check that the default attribute is applied.  */
+  check_posix_thread (NULL, (signals) { [SIGHUP] = true, });
+  check_c11_thread ((signals) { [SIGHUP] = true, });
+
+  /* An explicit attribute with no signal mask triggers inheritance
+     even if the default has been changed.  */
+  xpthread_attr_init (&attr);
+  check_posix_thread (&attr, (signals) { [SIGUSR1] = true, });
+
+  /* Explicitly setting the signal mask affects the new thread even
+     with a default attribute.  */
+  sigemptyset (&set);
+  sigaddset (&set, SIGUSR2);
+  TEST_COMPARE (pthread_attr_setsigmask_np (&attr, &set), 0);
+  check_posix_thread (&attr, (signals) { [SIGUSR2] = true, });
+
+  /* Resetting the default attribute brings back the old inheritance
+     behavior.  */
+  xpthread_attr_destroy (&attr);
+  xpthread_attr_init (&attr);
+  TEST_COMPARE (pthread_setattr_default_np (&attr), 0);
+  xpthread_attr_destroy (&attr);
+  check_posix_thread (NULL, (signals) { [SIGUSR1] = true, });
+  check_c11_thread ((signals) { [SIGUSR1] = true, });
+
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/nptl/internaltypes.h b/sysdeps/nptl/internaltypes.h
index ca57c315d4..65584cbb7e 100644
--- a/sysdeps/nptl/internaltypes.h
+++ b/sysdeps/nptl/internaltypes.h
@@ -65,6 +65,9 @@ struct pthread_attr_extension
   /* Affinity map.  */
   cpu_set_t *cpuset;
   size_t cpusetsize;
+
+  sigset_t sigmask;
+  bool sigmask_set;
 };
 
 /* Mutex attribute data structure.  */
diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h
index 44dd707896..8a403cbf36 100644
--- a/sysdeps/nptl/pthread.h
+++ b/sysdeps/nptl/pthread.h
@@ -27,6 +27,7 @@
 #include <bits/setjmp.h>
 #include <bits/wordsize.h>
 #include <bits/types/struct_timespec.h>
+#include <bits/types/__sigset_t.h>
 
 
 /* Detach state.  */
@@ -385,6 +386,20 @@ extern int pthread_attr_getaffinity_np (const pthread_attr_t *__attr,
 extern int pthread_getattr_default_np (pthread_attr_t *__attr)
      __THROW __nonnull ((1));
 
+/* Store *SIGMASK as the signal mask for the new thread in *ATTR.  */
+extern int pthread_attr_setsigmask_np (pthread_attr_t *__attr,
+				       const __sigset_t *sigmask);
+
+/* Store the signal mask of *ATTR in *SIGMASK.  If there is no signal
+   mask stored, return PTHREAD_ATTR_NOSIGMASK_NP.  Return zero on
+   success.  */
+extern int pthread_attr_getsigmask_np (const pthread_attr_t *__attr,
+				       __sigset_t *sigmask);
+
+/* Special return value from pthread_attr_getsigmask_np if the signal
+   mask has not been set.  */
+#define PTHREAD_ATTR_NO_SIGMASK_NP (-1)
+
 /* Set the default attributes to be used by pthread_create in this
    process.  */
 extern int pthread_setattr_default_np (const pthread_attr_t *__attr)
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 6dc59b38b0..48c790b15d 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2149,7 +2149,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index fd628bcd28..cb70cb974f 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -2231,7 +2231,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index d0b1cd24c9..573eca117e 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -133,7 +133,9 @@ GLIBC_2.30 twalk_r F
 GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 3dde0ef8bd..8a8633f0a4 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -130,7 +130,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index 4db9bbd971..3042a93084 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2093,7 +2093,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index 52aa86b191..a02a576321 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2052,7 +2052,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 48ee395a64..f0b9c9e070 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2218,7 +2218,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
index 34458f348f..1534fd7a24 100644
--- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
@@ -2084,7 +2084,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index 377326b12c..9a0ada4b52 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -134,7 +134,9 @@ GLIBC_2.30 twalk_r F
 GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 81eea10680..333c35bf16 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2164,7 +2164,9 @@ GLIBC_2.30 twalk_r F
 GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index ff75663747..824eceec11 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2144,7 +2144,9 @@ GLIBC_2.30 twalk_r F
 GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index e9a6375dfc..5a6dcdd21b 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2141,7 +2141,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 598fc488c7..6e5dbb28f1 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2135,7 +2135,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index 77e8d6b155..3ee64614b2 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2133,7 +2133,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index a3aad2487f..dc62615524 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2141,7 +2141,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index c074f612f5..8cf78bcf51 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2135,7 +2135,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index d1c638acb9..7817aeb0e2 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2182,7 +2182,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index bfc8185b0e..ca04e8f2d3 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2191,7 +2191,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 9a889f1bc6..10cb895639 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2224,7 +2224,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index b69f4b126f..96ddc448d7 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2054,7 +2054,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index a07753847d..deddb53d83 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2344,7 +2344,9 @@ GLIBC_2.32 __wcstoieee128_l F
 GLIBC_2.32 __wprintf_chkieee128 F
 GLIBC_2.32 __wprintfieee128 F
 GLIBC_2.32 __wscanfieee128 F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index 6d5a52dc1a..58217dcb13 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2111,7 +2111,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index ae3849d3f6..c22c29b35a 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2189,7 +2189,9 @@ GLIBC_2.30 twalk_r F
 GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 2eb931c02c..568f1727c4 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2090,7 +2090,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index ce4f366fbb..d9988dae90 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2059,7 +2059,9 @@ GLIBC_2.30 twalk_r F
 GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index f37a08ab09..39edeffe82 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2056,7 +2056,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index af3a5e2618..8668e15e8c 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2180,7 +2180,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 1fccc06f21..eb884afa3e 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2107,7 +2107,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 03af18babb..a208fb3556 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2065,7 +2065,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index 2da0af70d4..3eca3493e2 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2162,7 +2162,9 @@ GLIBC_2.30 getdents64 F
 GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
+GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
+GLIBC_2.32 pthread_attr_setsigmask_np F
 GLIBC_2.32 pthread_getaffinity_np F
 GLIBC_2.32 pthread_getattr_np F
 GLIBC_2.32 pthread_sigmask F
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 18/19] manual: Add pthread_attr_setsigmask_np, pthread_attr_getsigmask_np
  2020-05-19 10:43 [PATCH 00/19] Signal mask for timer helper thread Florian Weimer via Libc-alpha
                   ` (16 preceding siblings ...)
  2020-05-19 10:44 ` [PATCH 17/19] nptl: Add pthread_attr_setsigmask_np, pthread_attr_getsigmask_np Florian Weimer via Libc-alpha
@ 2020-05-19 10:45 ` Florian Weimer via Libc-alpha
  2020-05-20  7:39   ` Michael Kerrisk via Libc-alpha
  2020-06-02  4:05   ` Carlos O'Donell via Libc-alpha
  2020-05-19 10:45 ` [PATCH 19/19] Linux: Use __pthread_attr_setsigmask_internal for timer helper thread Florian Weimer via Libc-alpha
  2020-05-20 13:11 ` [PATCH 00/19] Signal mask " Carlos O'Donell via Libc-alpha
  19 siblings, 2 replies; 42+ messages in thread
From: Florian Weimer via Libc-alpha @ 2020-05-19 10:45 UTC (permalink / raw)
  To: libc-alpha; +Cc: Michael Kerrisk (man-pages)

And the PTHREAD_ATTR_NO_SIGMASK_NP constant.
---
 manual/threads.texi | 47 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/manual/threads.texi b/manual/threads.texi
index a425635179..28d7cf2abd 100644
--- a/manual/threads.texi
+++ b/manual/threads.texi
@@ -625,6 +625,7 @@ the standard.
 @menu
 * Default Thread Attributes::             Setting default attributes for
 					  threads in a process.
+* Initial Thread Signal Mask::            Setting the initial mask of threads.
 * Waiting with Explicit Clocks::          Functions for waiting with an
                                           explicit clock specification.
 @end menu
@@ -671,6 +672,52 @@ The system does not have sufficient memory.
 @end table
 @end deftypefun
 
+@node Initial Thread Signal Mask
+@subsubsection Controlling the Initial Signal Mask of a New Thread
+
+@Theglibc{} provides a way to specify the initial signal mask of a
+thread created using @code{pthread_create}, passing a thread attribute
+object configured for this purpose.
+
+These functions achieve the same effect as blocking all signals using
+@code{pthread_sigmask} before creating the thread, and setting the
+desired signal mask from the new thread, but in a more explicit
+fashion.
+
+@deftypefun int pthread_attr_setsigmask_np (pthread_attr_t *@var{attr}, const sigset_t *@var{sigmask})
+@standards{GNU, pthread.h}
+@safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{}}@acunsafe{@acsmem{}}}
+Change the initial signal mask specified by @var{attr}.  If
+@var{sigmask} is not @code{NULL}, the initial signal mask for new
+threads created with @var{attr} is set to @code{*@var{sigmask}}.  If
+@var{sigmask} is @code{NULL}, @var{attr} will no longer specify an
+explicit signal mask, so that the initial signal mask of the new
+thread is inherited from the parent thread creating the new thread.
+
+This function returns zero on success, and @code{ENOMEM} on memory
+allocation failure.
+@end deftypefun
+
+@deftypefun int pthread_attr_getsigmask_np (const pthread_attr_t *@var{attr}, sigset_t *@var{sigmask})
+@standards{GNU, pthread.h}
+@safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{}}@acunsafe{@acsmem{}}}
+Retrieve the initial signal mask stored in @var{attr} and write it ot
+@code{*@var{sigmask}}.  If the signal mask has not been set, return
+the special constant @code{PTHREAD_ATTR_NO_SIGMASK_NP}, otherwise
+return zero.
+
+Obtaining the signal mask only works if it has been previously stored
+by @code{pthread_attr_setsigmask_np}.  For example, the
+@code{pthread_getattr_np} function does not obtain the current signal
+mask of the specified thread, and @code{pthread_attr_setsigmask_np}
+will subsequently report the signal mask as unset.
+@end deftypefun
+
+@deftypevr Macro int PTHREAD_ATTR_NO_SIGMASK_NP
+The special value returned by @code{pthread_attr_setsigmask_np} to
+indicate that no signal mask has been set for the attribute.
+@end deftypevr
+
 @node Waiting with Explicit Clocks
 @subsubsection Functions for Waiting According to a Specific Clock
 
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 19/19] Linux: Use __pthread_attr_setsigmask_internal for timer helper thread
  2020-05-19 10:43 [PATCH 00/19] Signal mask for timer helper thread Florian Weimer via Libc-alpha
                   ` (17 preceding siblings ...)
  2020-05-19 10:45 ` [PATCH 18/19] manual: " Florian Weimer via Libc-alpha
@ 2020-05-19 10:45 ` Florian Weimer via Libc-alpha
  2020-06-02  4:07   ` Carlos O'Donell via Libc-alpha
  2020-05-20 13:11 ` [PATCH 00/19] Signal mask " Carlos O'Donell via Libc-alpha
  19 siblings, 1 reply; 42+ messages in thread
From: Florian Weimer via Libc-alpha @ 2020-05-19 10:45 UTC (permalink / raw)
  To: libc-alpha

timer_create needs to create threads with all signals blocked,
including SIGTIMER (which happens to equal SIGCANCEL).  Add a new
internal interface which provides an explicit way to achieve that.

Fixes commit b3cae39dcbfa2432b3f3aa28854d8ac57f0de1b8 ("nptl: Start
new threads with all signals blocked [BZ #25098]").
---
 sysdeps/unix/sysv/linux/timer_routines.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/timer_routines.c b/sysdeps/unix/sysv/linux/timer_routines.c
index 63083f6f91..86fad2a2c0 100644
--- a/sysdeps/unix/sysv/linux/timer_routines.c
+++ b/sysdeps/unix/sysv/linux/timer_routines.c
@@ -136,23 +136,24 @@ __start_helper_thread (void)
   (void) pthread_attr_init (&attr);
   (void) pthread_attr_setstacksize (&attr, __pthread_get_minstack (&attr));
 
-  /* Block all signals in the helper thread but SIGSETXID.  To do this
-     thoroughly we temporarily have to block all signals here.  The
-     helper can lose wakeups if SIGTIMER is not blocked throughout.  */
+  /* Block all signals in the helper thread but SIGSETXID.  */
   sigset_t ss;
-  __libc_signal_block_app (&ss);
-  __libc_signal_block_sigtimer (NULL);
+  __sigfillset (&ss);
+  __sigdelset (&ss, SIGSETXID);
+  int res = __pthread_attr_setsigmask_internal (&attr, &ss);
+  if (res != 0)
+    {
+      pthread_attr_destroy (&attr);
+      return;
+    }
 
   /* Create the helper thread for this timer.  */
   pthread_t th;
-  int res = pthread_create (&th, &attr, timer_helper_thread, NULL);
+  res = pthread_create (&th, &attr, timer_helper_thread, NULL);
   if (res == 0)
     /* We managed to start the helper thread.  */
     __helper_tid = ((struct pthread *) th)->tid;
 
-  /* Restore the signal mask.  */
-  __libc_signal_restore_set (&ss);
-
   /* No need for the attribute anymore.  */
   (void) pthread_attr_destroy (&attr);
 
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* Re: [PATCH 18/19] manual: Add pthread_attr_setsigmask_np, pthread_attr_getsigmask_np
  2020-05-19 10:45 ` [PATCH 18/19] manual: " Florian Weimer via Libc-alpha
@ 2020-05-20  7:39   ` Michael Kerrisk via Libc-alpha
  2020-06-03  9:26     ` Florian Weimer via Libc-alpha
  2020-06-02  4:05   ` Carlos O'Donell via Libc-alpha
  1 sibling, 1 reply; 42+ messages in thread
From: Michael Kerrisk via Libc-alpha @ 2020-05-20  7:39 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha, Michael Kerrisk-manpages

Hi Florian,

On Tue, May 19, 2020 at 2:04 PM Florian Weimer via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> And the PTHREAD_ATTR_NO_SIGMASK_NP constant.
> ---
>  manual/threads.texi | 47 +++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 47 insertions(+)
>
> diff --git a/manual/threads.texi b/manual/threads.texi
> index a425635179..28d7cf2abd 100644
> --- a/manual/threads.texi
> +++ b/manual/threads.texi
> @@ -625,6 +625,7 @@ the standard.
>  @menu
>  * Default Thread Attributes::             Setting default attributes for
>                                           threads in a process.
> +* Initial Thread Signal Mask::            Setting the initial mask of threads.
>  * Waiting with Explicit Clocks::          Functions for waiting with an
>                                            explicit clock specification.
>  @end menu
> @@ -671,6 +672,52 @@ The system does not have sufficient memory.
>  @end table
>  @end deftypefun
>
> +@node Initial Thread Signal Mask
> +@subsubsection Controlling the Initial Signal Mask of a New Thread
> +
> +@Theglibc{} provides a way to specify the initial signal mask of a
> +thread created using @code{pthread_create}, passing a thread attribute
> +object configured for this purpose.
> +
> +These functions achieve the same effect as blocking all signals using
> +@code{pthread_sigmask} before creating the thread, and setting the
> +desired signal mask from the new thread, but in a more explicit
> +fashion.

So, I'm not quite clear what's going on here. Is it like this:

First thread

Block all signals
    |
    V
Create new thread --->NEW THREAD ---> Set mask to attr value
    |
    V
Restore signal mask to original value.

If so, maybe that could be explained a bit more explicitly?

> +
> +@deftypefun int pthread_attr_setsigmask_np (pthread_attr_t *@var{attr}, const sigset_t *@var{sigmask})
> +@standards{GNU, pthread.h}
> +@safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{}}@acunsafe{@acsmem{}}}
> +Change the initial signal mask specified by @var{attr}.  If
> +@var{sigmask} is not @code{NULL}, the initial signal mask for new
> +threads created with @var{attr} is set to @code{*@var{sigmask}}.  If
> +@var{sigmask} is @code{NULL}, @var{attr} will no longer specify an
> +explicit signal mask, so that the initial signal mask of the new
> +thread is inherited from the parent thread creating the new thread.

I don't like "parent" here. Threads are peers.

s/parent thread creating the new thread/creating thread/

> +
> +This function returns zero on success, and @code{ENOMEM} on memory
> +allocation failure.
> +@end deftypefun
> +
> +@deftypefun int pthread_attr_getsigmask_np (const pthread_attr_t *@var{attr}, sigset_t *@var{sigmask})
> +@standards{GNU, pthread.h}
> +@safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{}}@acunsafe{@acsmem{}}}
> +Retrieve the initial signal mask stored in @var{attr} and write it ot

s/initial// ?
s/write/save/ ?
s/ot/to/

> +@code{*@var{sigmask}}.  If the signal mask has not been set, return
> +the special constant @code{PTHREAD_ATTR_NO_SIGMASK_NP}, otherwise
> +return zero.
> +
> +Obtaining the signal mask only works if it has been previously stored
> +by @code{pthread_attr_setsigmask_np}.  For example, the
> +@code{pthread_getattr_np} function does not obtain the current signal
> +mask of the specified thread, and @code{pthread_attr_setsigmask_np}
> +will subsequently report the signal mask as unset.
> +@end deftypefun

I see what you're trying to say above, but maybe it would be clearer
to say something like: all that these APIs are doing is manipulating
an attribute setting in an object that is used to create new threads
and pthread_attr_getsigmask_np simply retrieves that attribute setting
(and never the calling thread's signal mask).

> +@deftypevr Macro int PTHREAD_ATTR_NO_SIGMASK_NP
> +The special value returned by @code{pthread_attr_setsigmask_np} to
> +indicate that no signal mask has been set for the attribute.
> +@end deftypevr
> +
>  @node Waiting with Explicit Clocks
>  @subsubsection Functions for Waiting According to a Specific Clock

Thanks,

Michael

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 00/19] Signal mask for timer helper thread
  2020-05-19 10:43 [PATCH 00/19] Signal mask for timer helper thread Florian Weimer via Libc-alpha
                   ` (18 preceding siblings ...)
  2020-05-19 10:45 ` [PATCH 19/19] Linux: Use __pthread_attr_setsigmask_internal for timer helper thread Florian Weimer via Libc-alpha
@ 2020-05-20 13:11 ` Carlos O'Donell via Libc-alpha
  19 siblings, 0 replies; 42+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2020-05-20 13:11 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha

On 5/19/20 6:43 AM, Florian Weimer via Libc-alpha wrote:
> This series cleans up various aspects of NPTL and eventually adds
> functionality to explicitly block internal signals on new threads.

Great! I think that's a useful feature when integrated into the attributes
for the thread.

> There is now a proper public interface (for non-internal signals) and
> the awkward separate sigset_t * argument and a pthread_create variant is
> no longer needed.

Sounds great... but this patch set has gotten much bigger! :-)

> To avoid creating new symbols in libpthread, some dependent
> functionality had to be moved into libc.  Since more parts of
> pthread_attr_t are now dynamically allocated, it seemed prudent to
> consolidate the copying of thread attributes.

Agreed.

> Tested on x86_64-linux-gnu, i686-linux-gnu.  Built with
> build-many-glibcs.py (also various intermediate steps).

Testing in progress for x86_64 and i686 on my side.

I'll start reviewing some of the easy patches.

> Thanks,
> Florian
> 
> Florian Weimer (19):
>   manual: Add missing section and node for clockid_t wait functions
>   nptl: Replace some stubs with the Linux implementation
>   nptl: Move pthread_attr_setaffinity_np into libc
>   nptl: Move pthread_getaffinity_np into libc
>   nptl: Move pthread_gettattr_np into libc
>   nptl: Make __pthread_attr_init, __pthread_attr_destroy available
>     internally
>   nptl: Add __pthread_attr_copy for copying pthread_attr_t objects
>   nptl: Use __pthread_attr_copy in pthread_getattr_default_np (bug
>     25999)
>   nptl: Use __pthread_attr_copy in pthread_setattr_default_np
>   <libc-symbols.h>: Add libpthread hidden alias support
>   nptl: Add internal alias __pthread_getattr_default_np
>   nptl: Use __pthread_getattr_default_np in pthread_create
>   nptl: Use __pthread_attr_setaffinity_np in pthread_getattr_np
>   nptl: Change type of __default_pthread_attr
>   nptl: Destroy the default thread attribute as part of freeres
>   nptl: Make pthread_attr_t dynamically extensible
>   nptl: Add pthread_attr_setsigmask_np, pthread_attr_getsigmask_np
>   manual: Add pthread_attr_setsigmask_np, pthread_attr_getsigmask_np
>   Linux: Use __pthread_attr_setsigmask_internal for timer helper thread
> 
>  NEWS                                          |   4 +
>  include/libc-symbols.h                        |  23 ++
>  manual/threads.texi                           |  55 +++++
>  nptl/Makefile                                 |  24 ++-
>  nptl/Versions                                 |  29 ++-
>  nptl/allocatestack.c                          |   2 +-
>  nptl/libpthread-compat.c                      |   5 +
>  nptl/nptl-init.c                              |   4 +-
>  nptl/nptlfreeres.c                            |   1 +
>  nptl/pthreadP.h                               |  35 ++-
>  nptl/pthread_attr_copy.c                      |  64 ++++++
>  nptl/pthread_attr_destroy.c                   |  15 +-
>  nptl/pthread_attr_extension.c                 |  32 +++
>  nptl/pthread_attr_getaffinity.c               |  14 +-
>  nptl/pthread_attr_getsigmask.c                |  38 ++++
>  nptl/pthread_attr_getstacksize.c              |   2 +-
>  nptl/pthread_attr_init.c                      |   5 +-
>  nptl/pthread_attr_setaffinity.c               |  45 ++--
>  nptl/pthread_attr_setsigmask.c                |  34 +++
>  nptl/pthread_attr_setsigmask_internal.c       |  45 ++++
>  nptl/pthread_create.c                         |  63 +++---
>  nptl/pthread_getaffinity.c                    |  45 +++-
>  nptl/pthread_getattr_default_np.c             |  15 +-
>  nptl/pthread_getattr_np.c                     |  43 ++--
>  nptl/pthread_getname.c                        |  49 ++++-
>  nptl/pthread_setaffinity.c                    |  37 +++-
>  nptl/pthread_setattr_default_np.c             |  63 +++---
>  nptl/pthread_setname.c                        |  43 +++-
>  nptl/tst-pthread-attr-sigmask.c               | 204 ++++++++++++++++++
>  nptl/tst-pthread-defaultattr-free.c           |  78 +++++++
>  .../unix/sysv/linux => nptl}/tst-setgetname.c |   0
>  .../tst-thread-affinity-pthread.c             |   0
>  .../tst-thread-affinity-pthread2.c            |   0
>  .../tst-thread-affinity-sched.c               |   0
>  nptl/vars.c                                   |   2 +-
>  sysdeps/nptl/internaltypes.h                  |  26 ++-
>  sysdeps/nptl/pthread.h                        |  15 ++
>  sysdeps/unix/sysv/linux/Makefile              |   5 +-
>  sysdeps/unix/sysv/linux/aarch64/libc.abilist  |   8 +
>  .../sysv/linux/aarch64/libpthread.abilist     |   3 -
>  sysdeps/unix/sysv/linux/alpha/libc.abilist    |  10 +
>  .../unix/sysv/linux/alpha/libpthread.abilist  |   6 +-
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist   |   8 +
>  .../unix/sysv/linux/arm/be/libpthread.abilist |   3 -
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist   |   8 +
>  .../unix/sysv/linux/arm/le/libpthread.abilist |   3 -
>  sysdeps/unix/sysv/linux/createthread.c        |   9 +-
>  sysdeps/unix/sysv/linux/csky/libc.abilist     |   8 +
>  .../unix/sysv/linux/csky/libpthread.abilist   |   3 -
>  sysdeps/unix/sysv/linux/hppa/libc.abilist     |  10 +
>  .../unix/sysv/linux/hppa/libpthread.abilist   |   6 +-
>  sysdeps/unix/sysv/linux/i386/libc.abilist     |  10 +
>  .../unix/sysv/linux/i386/libpthread.abilist   |   6 +-
>  sysdeps/unix/sysv/linux/ia64/libc.abilist     |  10 +
>  .../unix/sysv/linux/ia64/libpthread.abilist   |   6 +-
>  .../sysv/linux/m68k/coldfire/libc.abilist     |   8 +
>  .../linux/m68k/coldfire/libpthread.abilist    |   3 -
>  .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  10 +
>  .../sysv/linux/m68k/m680x0/libpthread.abilist |   6 +-
>  .../sysv/linux/microblaze/be/libc.abilist     |   8 +
>  .../linux/microblaze/be/libpthread.abilist    |   3 -
>  .../sysv/linux/microblaze/le/libc.abilist     |   8 +
>  .../linux/microblaze/le/libpthread.abilist    |   3 -
>  .../sysv/linux/mips/mips32/fpu/libc.abilist   |  10 +
>  .../sysv/linux/mips/mips32/libpthread.abilist |   6 +-
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist |  10 +
>  .../sysv/linux/mips/mips64/libpthread.abilist |   6 +-
>  .../sysv/linux/mips/mips64/n32/libc.abilist   |  10 +
>  .../sysv/linux/mips/mips64/n64/libc.abilist   |  10 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist    |   8 +
>  .../unix/sysv/linux/nios2/libpthread.abilist  |   3 -
>  .../linux/powerpc/powerpc32/fpu/libc.abilist  |  10 +
>  .../powerpc/powerpc32/libpthread.abilist      |   6 +-
>  .../powerpc/powerpc32/nofpu/libc.abilist      |  10 +
>  .../linux/powerpc/powerpc64/be/libc.abilist   |  10 +
>  .../powerpc/powerpc64/be/libpthread.abilist   |   5 -
>  .../linux/powerpc/powerpc64/le/libc.abilist   |   8 +
>  .../powerpc/powerpc64/le/libpthread.abilist   |   3 -
>  sysdeps/unix/sysv/linux/pthread_getaffinity.c |  58 -----
>  sysdeps/unix/sysv/linux/pthread_getname.c     |  69 ------
>  sysdeps/unix/sysv/linux/pthread_setaffinity.c |  53 -----
>  sysdeps/unix/sysv/linux/pthread_setname.c     |  63 ------
>  .../unix/sysv/linux/riscv/rv64/libc.abilist   |   8 +
>  .../sysv/linux/riscv/rv64/libpthread.abilist  |   3 -
>  .../unix/sysv/linux/s390/s390-32/libc.abilist |  10 +
>  .../linux/s390/s390-32/libpthread.abilist     |   6 +-
>  .../unix/sysv/linux/s390/s390-64/libc.abilist |  10 +
>  .../linux/s390/s390-64/libpthread.abilist     |   6 +-
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  10 +
>  .../unix/sysv/linux/sh/be/libpthread.abilist  |   6 +-
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  10 +
>  .../unix/sysv/linux/sh/le/libpthread.abilist  |   6 +-
>  .../sysv/linux/sparc/sparc32/libc.abilist     |  10 +
>  .../linux/sparc/sparc32/libpthread.abilist    |   6 +-
>  .../sysv/linux/sparc/sparc64/libc.abilist     |  10 +
>  .../linux/sparc/sparc64/libpthread.abilist    |   6 +-
>  sysdeps/unix/sysv/linux/timer_routines.c      |  19 +-
>  .../unix/sysv/linux/x86_64/64/libc.abilist    |  10 +
>  .../sysv/linux/x86_64/64/libpthread.abilist   |   5 -
>  .../unix/sysv/linux/x86_64/x32/libc.abilist   |   8 +
>  .../sysv/linux/x86_64/x32/libpthread.abilist  |   3 -
>  101 files changed, 1289 insertions(+), 551 deletions(-)
>  create mode 100644 nptl/pthread_attr_copy.c
>  create mode 100644 nptl/pthread_attr_extension.c
>  create mode 100644 nptl/pthread_attr_getsigmask.c
>  create mode 100644 nptl/pthread_attr_setsigmask.c
>  create mode 100644 nptl/pthread_attr_setsigmask_internal.c
>  create mode 100644 nptl/tst-pthread-attr-sigmask.c
>  create mode 100644 nptl/tst-pthread-defaultattr-free.c
>  rename {sysdeps/unix/sysv/linux => nptl}/tst-setgetname.c (100%)
>  rename {sysdeps/unix/sysv/linux => nptl}/tst-thread-affinity-pthread.c (100%)
>  rename {sysdeps/unix/sysv/linux => nptl}/tst-thread-affinity-pthread2.c (100%)
>  rename {sysdeps/unix/sysv/linux => nptl}/tst-thread-affinity-sched.c (100%)
>  delete mode 100644 sysdeps/unix/sysv/linux/pthread_getaffinity.c
>  delete mode 100644 sysdeps/unix/sysv/linux/pthread_getname.c
>  delete mode 100644 sysdeps/unix/sysv/linux/pthread_setaffinity.c
>  delete mode 100644 sysdeps/unix/sysv/linux/pthread_setname.c
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 01/19] manual: Add missing section and node for clockid_t wait functions
  2020-05-19 10:44 ` [PATCH 01/19] manual: Add missing section and node for clockid_t wait functions Florian Weimer via Libc-alpha
@ 2020-05-20 13:12   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 42+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2020-05-20 13:12 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha

On 5/19/20 6:44 AM, Florian Weimer via Libc-alpha wrote:
> Without this, these functions appear under the node Default Thread
> Attributes, which is confusing.
> 
> Eventually, the documentation should be merged with the (yet to be
> documented) standardized functions.

OK for master.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  manual/threads.texi | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/manual/threads.texi b/manual/threads.texi
> index 0858ef8f92..a425635179 100644
> --- a/manual/threads.texi
> +++ b/manual/threads.texi
> @@ -625,6 +625,8 @@ the standard.
>  @menu
>  * Default Thread Attributes::             Setting default attributes for
>  					  threads in a process.
> +* Waiting with Explicit Clocks::          Functions for waiting with an
> +                                          explicit clock specification.
>  @end menu
>  
>  @node Default Thread Attributes
> @@ -669,6 +671,12 @@ The system does not have sufficient memory.
>  @end table
>  @end deftypefun
>  
> +@node Waiting with Explicit Clocks
> +@subsubsection Functions for Waiting According to a Specific Clock
> +
> +@Theglibc{} provides several waiting functions that expect an explicit
> +@code{clockid_t} argument.
> +
>  @comment semaphore.h
>  @comment POSIX-proposed
>  @deftypefun int sem_clockwait (sem_t *@var{sem}, clockid_t @var{clockid},
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 02/19] nptl: Replace some stubs with the Linux implementation
  2020-05-19 10:44 ` [PATCH 02/19] nptl: Replace some stubs with the Linux implementation Florian Weimer via Libc-alpha
@ 2020-05-20 13:27   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 42+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2020-05-20 13:27 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha

On 5/19/20 6:44 AM, Florian Weimer via Libc-alpha wrote:
> The stubs for pthread_getaffinity_np, pthread_getname_np,
> pthread_setaffinity_np, pthread_setname_np are replaced, and corresponding
> tests are moved.
> 
> After the removal of the NaCl port, nptl is Linux-specific, and the stubs
> are no longer needed.  This effectively reverts commit
> c76d1ff5149bd03210f2bb8cd64446c51618d016 ("NPTL: Add stubs for Linux-only
> extension functions.").

Reviewed with `git difftool -t meld -d HEAD~18..HEAD~17` and the move looks good.

OK for master.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>


> ---
>  nptl/Makefile                                 |  9 ++-
>  nptl/pthread_getaffinity.c                    | 42 ++++++++---
>  nptl/pthread_getname.c                        | 49 +++++++++++--
>  nptl/pthread_setaffinity.c                    | 37 +++++++---
>  nptl/pthread_setname.c                        | 43 ++++++++++--
>  .../unix/sysv/linux => nptl}/tst-setgetname.c |  0
>  .../tst-thread-affinity-pthread.c             |  0
>  .../tst-thread-affinity-pthread2.c            |  0
>  .../tst-thread-affinity-sched.c               |  0
>  sysdeps/unix/sysv/linux/Makefile              |  5 +-
>  sysdeps/unix/sysv/linux/pthread_getaffinity.c | 58 ----------------
>  sysdeps/unix/sysv/linux/pthread_getname.c     | 69 -------------------
>  sysdeps/unix/sysv/linux/pthread_setaffinity.c | 53 --------------
>  sysdeps/unix/sysv/linux/pthread_setname.c     | 63 -----------------
>  14 files changed, 151 insertions(+), 277 deletions(-)
>  rename {sysdeps/unix/sysv/linux => nptl}/tst-setgetname.c (100%)
>  rename {sysdeps/unix/sysv/linux => nptl}/tst-thread-affinity-pthread.c (100%)
>  rename {sysdeps/unix/sysv/linux => nptl}/tst-thread-affinity-pthread2.c (100%)
>  rename {sysdeps/unix/sysv/linux => nptl}/tst-thread-affinity-sched.c (100%)
>  delete mode 100644 sysdeps/unix/sysv/linux/pthread_getaffinity.c
>  delete mode 100644 sysdeps/unix/sysv/linux/pthread_getname.c
>  delete mode 100644 sysdeps/unix/sysv/linux/pthread_setaffinity.c
>  delete mode 100644 sysdeps/unix/sysv/linux/pthread_setname.c
> 
> diff --git a/nptl/Makefile b/nptl/Makefile
> index ef9a6eb561..5fc45b224b 100644
> --- a/nptl/Makefile
> +++ b/nptl/Makefile
> @@ -321,14 +321,19 @@ tests = tst-attr2 tst-attr3 tst-default-attr \
>  	tst-thread-exit-clobber tst-minstack-cancel tst-minstack-exit \
>  	tst-minstack-throw \
>  	tst-rwlock-pwn \
> -	tst-unwind-thread
> +	tst-unwind-thread \
> +	tst-thread-affinity-pthread \
> +	tst-thread-affinity-pthread2 \
> +	tst-thread-affinity-sched \
> +
>  
>  tests-container =  tst-pthread-getattr
>  
>  tests-internal := tst-robustpi8 tst-rwlock19 tst-rwlock20 \
>  		  tst-sem11 tst-sem12 tst-sem13 \
>  		  tst-barrier5 tst-signal7 tst-mutex8 tst-mutex8-static \
> -		  tst-mutexpi8 tst-mutexpi8-static tst-cancel25
> +		  tst-mutexpi8 tst-mutexpi8-static tst-cancel25 \
> +		  tst-setgetname \
>  
>  xtests = tst-setuid1 tst-setuid1-static tst-setuid2 \
>  	tst-mutexpp1 tst-mutexpp6 tst-mutexpp10
> diff --git a/nptl/pthread_getaffinity.c b/nptl/pthread_getaffinity.c
> index 2ba05b5b92..cf6ecfe01f 100644
> --- a/nptl/pthread_getaffinity.c
> +++ b/nptl/pthread_getaffinity.c
> @@ -1,6 +1,6 @@
> -/* Get the processor affinity of a thread.  Stub version.
> -   Copyright (C) 2014-2020 Free Software Foundation, Inc.
> +/* Copyright (C) 2003-2020 Free Software Foundation, Inc.
>     This file is part of the GNU C Library.
> +   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
>  
>     The GNU C Library is free software; you can redistribute it and/or
>     modify it under the terms of the GNU Lesser General Public
> @@ -16,17 +16,43 @@
>     License along with the GNU C Library; if not, see
>     <https://www.gnu.org/licenses/>.  */
>  
> +#include <errno.h>
> +#include <limits.h>
>  #include <pthreadP.h>
> +#include <string.h>
> +#include <sysdep.h>
> +#include <sys/param.h>
> +#include <sys/types.h>
> +#include <shlib-compat.h>
> +
>  
>  int
> -__pthread_getaffinity_np (pthread_t th, size_t cpusetsize, cpu_set_t *cpuset)
> +__pthread_getaffinity_new (pthread_t th, size_t cpusetsize, cpu_set_t *cpuset)
>  {
>    const struct pthread *pd = (const struct pthread *) th;
>  
> -  if (INVALID_TD_P (pd))
> -    return ESRCH;
> +  int res = INTERNAL_SYSCALL_CALL (sched_getaffinity, pd->tid,
> +				   MIN (INT_MAX, cpusetsize), cpuset);
> +  if (INTERNAL_SYSCALL_ERROR_P (res))
> +    return INTERNAL_SYSCALL_ERRNO (res);
> +
> +  /* Clean the rest of the memory the kernel didn't do.  */
> +  memset ((char *) cpuset + res, '\0', cpusetsize - res);
> +
> +  return 0;
> +}
> +strong_alias (__pthread_getaffinity_new, __pthread_getaffinity_np)
> +versioned_symbol (libpthread, __pthread_getaffinity_new,
> +		  pthread_getaffinity_np, GLIBC_2_3_4);
>  
> -  return ENOSYS;
> +
> +#if SHLIB_COMPAT (libpthread, 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);
>  }
> -weak_alias (__pthread_getaffinity_np, pthread_getaffinity_np)
> -stub_warning (pthread_getaffinity_np)
> +compat_symbol (libpthread, __pthread_getaffinity_old, pthread_getaffinity_np,
> +	       GLIBC_2_3_3);
> +#endif
> diff --git a/nptl/pthread_getname.c b/nptl/pthread_getname.c
> index b771f2ef76..c78cccffd4 100644
> --- a/nptl/pthread_getname.c
> +++ b/nptl/pthread_getname.c
> @@ -1,5 +1,5 @@
> -/* pthread_getname_np -- Get thread name.  Stub version.
> -   Copyright (C) 2014-2020 Free Software Foundation, Inc.
> +/* pthread_getname_np -- Get  thread name.  Linux version
> +   Copyright (C) 2010-2020 Free Software Foundation, Inc.
>     This file is part of the GNU C Library.
>  
>     The GNU C Library is free software; you can redistribute it and/or
> @@ -17,16 +17,53 @@
>     not, see <https://www.gnu.org/licenses/>.  */
>  
>  #include <errno.h>
> +#include <fcntl.h>
>  #include <pthreadP.h>
> +#include <stdio.h>
> +#include <string.h>
> +#include <unistd.h>
> +#include <sys/prctl.h>
> +
> +#include <not-cancel.h>
> +
>  
>  int
>  pthread_getname_np (pthread_t th, char *buf, size_t len)
>  {
>    const struct pthread *pd = (const struct pthread *) th;
>  
> -  if (INVALID_TD_P (pd))
> -    return ESRCH;
> +  /* Unfortunately the kernel headers do not export the TASK_COMM_LEN
> +     macro.  So we have to define it here.  */
> +#define TASK_COMM_LEN 16
> +  if (len < TASK_COMM_LEN)
> +    return ERANGE;
> +
> +  if (pd == THREAD_SELF)
> +    return prctl (PR_GET_NAME, buf) ? errno : 0;
> +
> +#define FMT "/proc/self/task/%u/comm"
> +  char fname[sizeof (FMT) + 8];
> +  sprintf (fname, FMT, (unsigned int) pd->tid);
> +
> +  int fd = __open64_nocancel (fname, O_RDONLY);
> +  if (fd == -1)
> +    return errno;
> +
> +  int res = 0;
> +  ssize_t n = TEMP_FAILURE_RETRY (__read_nocancel (fd, buf, len));
> +  if (n < 0)
> +    res = errno;
> +  else
> +    {
> +      if (buf[n - 1] == '\n')
> +	buf[n - 1] = '\0';
> +      else if (n == len)
> +	res = ERANGE;
> +      else
> +	buf[n] = '\0';
> +    }
> +
> +  __close_nocancel_nostatus (fd);
>  
> -  return ENOSYS;
> +  return res;
>  }
> -stub_warning (pthread_getname_np)
> diff --git a/nptl/pthread_setaffinity.c b/nptl/pthread_setaffinity.c
> index 29bbfb4fb2..b0bd90c324 100644
> --- a/nptl/pthread_setaffinity.c
> +++ b/nptl/pthread_setaffinity.c
> @@ -1,6 +1,6 @@
> -/* Set the processor affinity of a thread.  Stub version.
> -   Copyright (C) 2014-2020 Free Software Foundation, Inc.
> +/* Copyright (C) 2003-2020 Free Software Foundation, Inc.
>     This file is part of the GNU C Library.
> +   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
>  
>     The GNU C Library is free software; you can redistribute it and/or
>     modify it under the terms of the GNU Lesser General Public
> @@ -16,17 +16,38 @@
>     License along with the GNU C Library; if not, see
>     <https://www.gnu.org/licenses/>.  */
>  
> +#include <errno.h>
>  #include <pthreadP.h>
> +#include <sysdep.h>
> +#include <sys/types.h>
> +#include <shlib-compat.h>
> +
>  
>  int
> -pthread_setaffinity_np (pthread_t th,
> -                        size_t cpusetsize, const cpu_set_t *cpuset)
> +__pthread_setaffinity_new (pthread_t th, size_t cpusetsize,
> +			   const cpu_set_t *cpuset)
>  {
>    const struct pthread *pd = (const struct pthread *) th;
> +  int res;
> +
> +  res = INTERNAL_SYSCALL_CALL (sched_setaffinity, pd->tid, cpusetsize,
> +			       cpuset);
> +
> +  return (INTERNAL_SYSCALL_ERROR_P (res)
> +	  ? INTERNAL_SYSCALL_ERRNO (res)
> +	  : 0);
> +}
> +versioned_symbol (libpthread, __pthread_setaffinity_new,
> +		  pthread_setaffinity_np, GLIBC_2_3_4);
>  
> -  if (INVALID_TD_P (pd))
> -    return ESRCH;
>  
> -  return ENOSYS;
> +#if SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_3_4)
> +int
> +__pthread_setaffinity_old (pthread_t th, cpu_set_t *cpuset)
> +{
> +  /* The old interface by default assumed a 1024 processor bitmap.  */
> +  return __pthread_setaffinity_new (th, 128, cpuset);
>  }
> -stub_warning (pthread_setaffinity_np)
> +compat_symbol (libpthread, __pthread_setaffinity_old, pthread_setaffinity_np,
> +	       GLIBC_2_3_3);
> +#endif
> diff --git a/nptl/pthread_setname.c b/nptl/pthread_setname.c
> index adfb3e828f..29df46b77c 100644
> --- a/nptl/pthread_setname.c
> +++ b/nptl/pthread_setname.c
> @@ -1,5 +1,5 @@
> -/* pthread_setname_np -- Set thread name.  Stub version.
> -   Copyright (C) 2014-2020 Free Software Foundation, Inc.
> +/* pthread_setname_np -- Set  thread name.  Linux version
> +   Copyright (C) 2010-2020 Free Software Foundation, Inc.
>     This file is part of the GNU C Library.
>  
>     The GNU C Library is free software; you can redistribute it and/or
> @@ -17,16 +17,47 @@
>     not, see <https://www.gnu.org/licenses/>.  */
>  
>  #include <errno.h>
> +#include <fcntl.h>
>  #include <pthreadP.h>
> +#include <stdio.h>
> +#include <string.h>
> +#include <unistd.h>
> +#include <sys/prctl.h>
> +
> +#include <not-cancel.h>
> +
>  
>  int
>  pthread_setname_np (pthread_t th, const char *name)
>  {
>    const struct pthread *pd = (const struct pthread *) th;
>  
> -  if (INVALID_TD_P (pd))
> -    return ESRCH;
> +  /* Unfortunately the kernel headers do not export the TASK_COMM_LEN
> +     macro.  So we have to define it here.  */
> +#define TASK_COMM_LEN 16
> +  size_t name_len = strlen (name);
> +  if (name_len >= TASK_COMM_LEN)
> +    return ERANGE;
> +
> +  if (pd == THREAD_SELF)
> +    return prctl (PR_SET_NAME, name) ? errno : 0;
> +
> +#define FMT "/proc/self/task/%u/comm"
> +  char fname[sizeof (FMT) + 8];
> +  sprintf (fname, FMT, (unsigned int) pd->tid);
> +
> +  int fd = __open64_nocancel (fname, O_RDWR);
> +  if (fd == -1)
> +    return errno;
> +
> +  int res = 0;
> +  ssize_t n = TEMP_FAILURE_RETRY (__write_nocancel (fd, name, name_len));
> +  if (n < 0)
> +    res = errno;
> +  else if (n != name_len)
> +    res = EIO;
> +
> +  __close_nocancel_nostatus (fd);
>  
> -  return ENOSYS;
> +  return res;
>  }
> -stub_warning (pthread_setname_np)
> diff --git a/sysdeps/unix/sysv/linux/tst-setgetname.c b/nptl/tst-setgetname.c
> similarity index 100%
> rename from sysdeps/unix/sysv/linux/tst-setgetname.c
> rename to nptl/tst-setgetname.c
> diff --git a/sysdeps/unix/sysv/linux/tst-thread-affinity-pthread.c b/nptl/tst-thread-affinity-pthread.c
> similarity index 100%
> rename from sysdeps/unix/sysv/linux/tst-thread-affinity-pthread.c
> rename to nptl/tst-thread-affinity-pthread.c
> diff --git a/sysdeps/unix/sysv/linux/tst-thread-affinity-pthread2.c b/nptl/tst-thread-affinity-pthread2.c
> similarity index 100%
> rename from sysdeps/unix/sysv/linux/tst-thread-affinity-pthread2.c
> rename to nptl/tst-thread-affinity-pthread2.c
> diff --git a/sysdeps/unix/sysv/linux/tst-thread-affinity-sched.c b/nptl/tst-thread-affinity-sched.c
> similarity index 100%
> rename from sysdeps/unix/sysv/linux/tst-thread-affinity-sched.c
> rename to nptl/tst-thread-affinity-sched.c
> diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
> index 0326f92c40..0060435a92 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -299,8 +299,5 @@ CFLAGS-gai.c += -DNEED_NETLINK
>  endif
>  
>  ifeq ($(subdir),nptl)
> -tests += tst-align-clone tst-getpid1 \
> -	tst-thread-affinity-pthread tst-thread-affinity-pthread2 \
> -	tst-thread-affinity-sched
> -tests-internal += tst-setgetname
> +tests += tst-align-clone tst-getpid1
>  endif
> diff --git a/sysdeps/unix/sysv/linux/pthread_getaffinity.c b/sysdeps/unix/sysv/linux/pthread_getaffinity.c
> deleted file mode 100644
> index cf6ecfe01f..0000000000
> --- a/sysdeps/unix/sysv/linux/pthread_getaffinity.c
> +++ /dev/null
> @@ -1,58 +0,0 @@
> -/* Copyright (C) 2003-2020 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public
> -   License as published by the Free Software Foundation; either
> -   version 2.1 of the License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; if not, see
> -   <https://www.gnu.org/licenses/>.  */
> -
> -#include <errno.h>
> -#include <limits.h>
> -#include <pthreadP.h>
> -#include <string.h>
> -#include <sysdep.h>
> -#include <sys/param.h>
> -#include <sys/types.h>
> -#include <shlib-compat.h>
> -
> -
> -int
> -__pthread_getaffinity_new (pthread_t th, size_t cpusetsize, cpu_set_t *cpuset)
> -{
> -  const struct pthread *pd = (const struct pthread *) th;
> -
> -  int res = INTERNAL_SYSCALL_CALL (sched_getaffinity, pd->tid,
> -				   MIN (INT_MAX, cpusetsize), cpuset);
> -  if (INTERNAL_SYSCALL_ERROR_P (res))
> -    return INTERNAL_SYSCALL_ERRNO (res);
> -
> -  /* Clean the rest of the memory the kernel didn't do.  */
> -  memset ((char *) cpuset + res, '\0', cpusetsize - res);
> -
> -  return 0;
> -}
> -strong_alias (__pthread_getaffinity_new, __pthread_getaffinity_np)
> -versioned_symbol (libpthread, __pthread_getaffinity_new,
> -		  pthread_getaffinity_np, GLIBC_2_3_4);
> -
> -
> -#if SHLIB_COMPAT (libpthread, 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);
> -}
> -compat_symbol (libpthread, __pthread_getaffinity_old, pthread_getaffinity_np,
> -	       GLIBC_2_3_3);
> -#endif
> diff --git a/sysdeps/unix/sysv/linux/pthread_getname.c b/sysdeps/unix/sysv/linux/pthread_getname.c
> deleted file mode 100644
> index c78cccffd4..0000000000
> --- a/sysdeps/unix/sysv/linux/pthread_getname.c
> +++ /dev/null
> @@ -1,69 +0,0 @@
> -/* pthread_getname_np -- Get  thread name.  Linux version
> -   Copyright (C) 2010-2020 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public License as
> -   published by the Free Software Foundation; either version 2.1 of the
> -   License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; see the file COPYING.LIB.  If
> -   not, see <https://www.gnu.org/licenses/>.  */
> -
> -#include <errno.h>
> -#include <fcntl.h>
> -#include <pthreadP.h>
> -#include <stdio.h>
> -#include <string.h>
> -#include <unistd.h>
> -#include <sys/prctl.h>
> -
> -#include <not-cancel.h>
> -
> -
> -int
> -pthread_getname_np (pthread_t th, char *buf, size_t len)
> -{
> -  const struct pthread *pd = (const struct pthread *) th;
> -
> -  /* Unfortunately the kernel headers do not export the TASK_COMM_LEN
> -     macro.  So we have to define it here.  */
> -#define TASK_COMM_LEN 16
> -  if (len < TASK_COMM_LEN)
> -    return ERANGE;
> -
> -  if (pd == THREAD_SELF)
> -    return prctl (PR_GET_NAME, buf) ? errno : 0;
> -
> -#define FMT "/proc/self/task/%u/comm"
> -  char fname[sizeof (FMT) + 8];
> -  sprintf (fname, FMT, (unsigned int) pd->tid);
> -
> -  int fd = __open64_nocancel (fname, O_RDONLY);
> -  if (fd == -1)
> -    return errno;
> -
> -  int res = 0;
> -  ssize_t n = TEMP_FAILURE_RETRY (__read_nocancel (fd, buf, len));
> -  if (n < 0)
> -    res = errno;
> -  else
> -    {
> -      if (buf[n - 1] == '\n')
> -	buf[n - 1] = '\0';
> -      else if (n == len)
> -	res = ERANGE;
> -      else
> -	buf[n] = '\0';
> -    }
> -
> -  __close_nocancel_nostatus (fd);
> -
> -  return res;
> -}
> diff --git a/sysdeps/unix/sysv/linux/pthread_setaffinity.c b/sysdeps/unix/sysv/linux/pthread_setaffinity.c
> deleted file mode 100644
> index b0bd90c324..0000000000
> --- a/sysdeps/unix/sysv/linux/pthread_setaffinity.c
> +++ /dev/null
> @@ -1,53 +0,0 @@
> -/* Copyright (C) 2003-2020 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public
> -   License as published by the Free Software Foundation; either
> -   version 2.1 of the License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; if not, see
> -   <https://www.gnu.org/licenses/>.  */
> -
> -#include <errno.h>
> -#include <pthreadP.h>
> -#include <sysdep.h>
> -#include <sys/types.h>
> -#include <shlib-compat.h>
> -
> -
> -int
> -__pthread_setaffinity_new (pthread_t th, size_t cpusetsize,
> -			   const cpu_set_t *cpuset)
> -{
> -  const struct pthread *pd = (const struct pthread *) th;
> -  int res;
> -
> -  res = INTERNAL_SYSCALL_CALL (sched_setaffinity, pd->tid, cpusetsize,
> -			       cpuset);
> -
> -  return (INTERNAL_SYSCALL_ERROR_P (res)
> -	  ? INTERNAL_SYSCALL_ERRNO (res)
> -	  : 0);
> -}
> -versioned_symbol (libpthread, __pthread_setaffinity_new,
> -		  pthread_setaffinity_np, GLIBC_2_3_4);
> -
> -
> -#if SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_3_4)
> -int
> -__pthread_setaffinity_old (pthread_t th, cpu_set_t *cpuset)
> -{
> -  /* The old interface by default assumed a 1024 processor bitmap.  */
> -  return __pthread_setaffinity_new (th, 128, cpuset);
> -}
> -compat_symbol (libpthread, __pthread_setaffinity_old, pthread_setaffinity_np,
> -	       GLIBC_2_3_3);
> -#endif
> diff --git a/sysdeps/unix/sysv/linux/pthread_setname.c b/sysdeps/unix/sysv/linux/pthread_setname.c
> deleted file mode 100644
> index 29df46b77c..0000000000
> --- a/sysdeps/unix/sysv/linux/pthread_setname.c
> +++ /dev/null
> @@ -1,63 +0,0 @@
> -/* pthread_setname_np -- Set  thread name.  Linux version
> -   Copyright (C) 2010-2020 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public License as
> -   published by the Free Software Foundation; either version 2.1 of the
> -   License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; see the file COPYING.LIB.  If
> -   not, see <https://www.gnu.org/licenses/>.  */
> -
> -#include <errno.h>
> -#include <fcntl.h>
> -#include <pthreadP.h>
> -#include <stdio.h>
> -#include <string.h>
> -#include <unistd.h>
> -#include <sys/prctl.h>
> -
> -#include <not-cancel.h>
> -
> -
> -int
> -pthread_setname_np (pthread_t th, const char *name)
> -{
> -  const struct pthread *pd = (const struct pthread *) th;
> -
> -  /* Unfortunately the kernel headers do not export the TASK_COMM_LEN
> -     macro.  So we have to define it here.  */
> -#define TASK_COMM_LEN 16
> -  size_t name_len = strlen (name);
> -  if (name_len >= TASK_COMM_LEN)
> -    return ERANGE;
> -
> -  if (pd == THREAD_SELF)
> -    return prctl (PR_SET_NAME, name) ? errno : 0;
> -
> -#define FMT "/proc/self/task/%u/comm"
> -  char fname[sizeof (FMT) + 8];
> -  sprintf (fname, FMT, (unsigned int) pd->tid);
> -
> -  int fd = __open64_nocancel (fname, O_RDWR);
> -  if (fd == -1)
> -    return errno;
> -
> -  int res = 0;
> -  ssize_t n = TEMP_FAILURE_RETRY (__write_nocancel (fd, name, name_len));
> -  if (n < 0)
> -    res = errno;
> -  else if (n != name_len)
> -    res = EIO;
> -
> -  __close_nocancel_nostatus (fd);
> -
> -  return res;
> -}
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 03/19] nptl: Move pthread_attr_setaffinity_np into libc
  2020-05-19 10:44 ` [PATCH 03/19] nptl: Move pthread_attr_setaffinity_np into libc Florian Weimer via Libc-alpha
@ 2020-05-20 13:31   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 42+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2020-05-20 13:31 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha

On 5/19/20 6:44 AM, Florian Weimer via Libc-alpha wrote:
> 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.

Reviewed at the high-level with meld.

I picked several ablist files to review and found that the two old
symbol versions were moved from libpthread.abilist to libc.abilist
and the new GLIBC_2.32 symbol was added as expected.

Likewise the pthread_attr_setaffinity.c code includes the new compat
wrapper for GLIBC_2.32.

At this point the conversion is fairly well understood and it makes
sense to me to keep moving parts of libpthread into libc for the
eventual removal of libpthread.

OK for master.

Tested clean on x86_64 and i686.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> 
> 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
> ---
>  nptl/Makefile                                 |  3 ++-
>  nptl/Versions                                 | 12 ++++++++--
>  nptl/pthreadP.h                               |  2 ++
>  nptl/pthread_attr_setaffinity.c               | 22 +++++++++++++------
>  sysdeps/unix/sysv/linux/aarch64/libc.abilist  |  2 ++
>  .../sysv/linux/aarch64/libpthread.abilist     |  1 -
>  sysdeps/unix/sysv/linux/alpha/libc.abilist    |  3 +++
>  .../unix/sysv/linux/alpha/libpthread.abilist  |  2 --
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  2 ++
>  .../unix/sysv/linux/arm/be/libpthread.abilist |  1 -
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  2 ++
>  .../unix/sysv/linux/arm/le/libpthread.abilist |  1 -
>  sysdeps/unix/sysv/linux/csky/libc.abilist     |  2 ++
>  .../unix/sysv/linux/csky/libpthread.abilist   |  1 -
>  sysdeps/unix/sysv/linux/hppa/libc.abilist     |  3 +++
>  .../unix/sysv/linux/hppa/libpthread.abilist   |  2 --
>  sysdeps/unix/sysv/linux/i386/libc.abilist     |  3 +++
>  .../unix/sysv/linux/i386/libpthread.abilist   |  2 --
>  sysdeps/unix/sysv/linux/ia64/libc.abilist     |  3 +++
>  .../unix/sysv/linux/ia64/libpthread.abilist   |  2 --
>  .../sysv/linux/m68k/coldfire/libc.abilist     |  2 ++
>  .../linux/m68k/coldfire/libpthread.abilist    |  1 -
>  .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  3 +++
>  .../sysv/linux/m68k/m680x0/libpthread.abilist |  2 --
>  .../sysv/linux/microblaze/be/libc.abilist     |  2 ++
>  .../linux/microblaze/be/libpthread.abilist    |  1 -
>  .../sysv/linux/microblaze/le/libc.abilist     |  2 ++
>  .../linux/microblaze/le/libpthread.abilist    |  1 -
>  .../sysv/linux/mips/mips32/fpu/libc.abilist   |  3 +++
>  .../sysv/linux/mips/mips32/libpthread.abilist |  2 --
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist |  3 +++
>  .../sysv/linux/mips/mips64/libpthread.abilist |  2 --
>  .../sysv/linux/mips/mips64/n32/libc.abilist   |  3 +++
>  .../sysv/linux/mips/mips64/n64/libc.abilist   |  3 +++
>  sysdeps/unix/sysv/linux/nios2/libc.abilist    |  2 ++
>  .../unix/sysv/linux/nios2/libpthread.abilist  |  1 -
>  .../linux/powerpc/powerpc32/fpu/libc.abilist  |  3 +++
>  .../powerpc/powerpc32/libpthread.abilist      |  2 --
>  .../powerpc/powerpc32/nofpu/libc.abilist      |  3 +++
>  .../linux/powerpc/powerpc64/be/libc.abilist   |  3 +++
>  .../powerpc/powerpc64/be/libpthread.abilist   |  2 --
>  .../linux/powerpc/powerpc64/le/libc.abilist   |  2 ++
>  .../powerpc/powerpc64/le/libpthread.abilist   |  1 -
>  .../unix/sysv/linux/riscv/rv64/libc.abilist   |  2 ++
>  .../sysv/linux/riscv/rv64/libpthread.abilist  |  1 -
>  .../unix/sysv/linux/s390/s390-32/libc.abilist |  3 +++
>  .../linux/s390/s390-32/libpthread.abilist     |  2 --
>  .../unix/sysv/linux/s390/s390-64/libc.abilist |  3 +++
>  .../linux/s390/s390-64/libpthread.abilist     |  2 --
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  3 +++
>  .../unix/sysv/linux/sh/be/libpthread.abilist  |  2 --
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  3 +++
>  .../unix/sysv/linux/sh/le/libpthread.abilist  |  2 --
>  .../sysv/linux/sparc/sparc32/libc.abilist     |  3 +++
>  .../linux/sparc/sparc32/libpthread.abilist    |  2 --
>  .../sysv/linux/sparc/sparc64/libc.abilist     |  3 +++
>  .../linux/sparc/sparc64/libpthread.abilist    |  2 --
>  .../unix/sysv/linux/x86_64/64/libc.abilist    |  3 +++
>  .../sysv/linux/x86_64/64/libpthread.abilist   |  2 --
>  .../unix/sysv/linux/x86_64/x32/libc.abilist   |  2 ++
>  .../sysv/linux/x86_64/x32/libpthread.abilist  |  1 -
>  61 files changed, 108 insertions(+), 53 deletions(-)
> 
> diff --git a/nptl/Makefile b/nptl/Makefile
> index 5fc45b224b..76f7d60584 100644
> --- a/nptl/Makefile
> +++ b/nptl/Makefile
> @@ -46,6 +46,7 @@ routines = \
>    pthread_attr_getschedpolicy \
>    pthread_attr_getscope \
>    pthread_attr_init \
> +  pthread_attr_setaffinity \

OK.

>    pthread_attr_setdetachstate \
>    pthread_attr_setinheritsched \
>    pthread_attr_setschedparam \
> @@ -149,7 +150,7 @@ libpthread-routines = nptl-init nptlfreeres vars events version pt-interp \
>  		      herrno res pt-allocrtsig \
>  		      pthread_kill_other_threads \
>  		      pthread_getaffinity pthread_setaffinity \
> -		      pthread_attr_getaffinity pthread_attr_setaffinity \
> +		      pthread_attr_getaffinity \

OK.

>  		      pthread_mutexattr_getrobust pthread_mutexattr_setrobust \
>  		      pthread_mutex_consistent \
>  		      cleanup_routine unwind-forcedunwind \
> diff --git a/nptl/Versions b/nptl/Versions
> index f7140277f5..a799e63606 100644
> --- a/nptl/Versions
> +++ b/nptl/Versions
> @@ -29,11 +29,18 @@ libc {
>      pthread_cond_wait; pthread_cond_signal;
>      pthread_cond_broadcast; pthread_cond_timedwait;
>    }
> +  GLIBC_2.3.3 {
> +    pthread_attr_setaffinity_np;
> +  }
> +  GLIBC_2.3.4 {
> +    pthread_attr_setaffinity_np;
> +  }

OK. Add to libc.

>    # C11 thread symbols.
>    GLIBC_2.28 {
>      thrd_current; thrd_equal; thrd_sleep; thrd_yield;
>    }
>    GLIBC_2.32 {
> +    pthread_attr_setaffinity_np;

OK. New symbol.

>      pthread_sigmask;
>    }
>    GLIBC_PRIVATE {
> @@ -45,6 +52,7 @@ libc {
>      __libc_allocate_rtsig_private;
>      # Used by the C11 threads implementation.
>      __pthread_cond_destroy; __pthread_cond_init;
> +    __pthread_attr_setaffinity_np;
>    }
>  }
>  
> @@ -219,13 +227,13 @@ libpthread {
>  
>      # affinity interfaces without size parameter
>      pthread_getaffinity_np; pthread_setaffinity_np;
> -    pthread_attr_getaffinity_np; pthread_attr_setaffinity_np;
> +    pthread_attr_getaffinity_np;

OK.

>    }
>  
>    GLIBC_2.3.4 {
>      # New affinity interfaces.
>      pthread_getaffinity_np; pthread_setaffinity_np;
> -    pthread_attr_getaffinity_np; pthread_attr_setaffinity_np;
> +    pthread_attr_getaffinity_np;

OK.

>  
>      pthread_setschedprio;
>    }
> diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
> index c4e72f57a9..42730a46df 100644
> --- a/nptl/pthreadP.h
> +++ b/nptl/pthreadP.h
> @@ -433,6 +433,8 @@ extern int __pthread_attr_getstack (const pthread_attr_t *__restrict __attr,
>  				    size_t *__restrict __stacksize);
>  extern int __pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
>  				    size_t __stacksize);
> +int __pthread_attr_setaffinity_np (pthread_attr_t *, size_t, const cpu_set_t *);
> +libc_hidden_proto (__pthread_attr_setaffinity_np)
>  extern int __pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
>  				  const pthread_rwlockattr_t *__restrict
>  				  __attr);
> diff --git a/nptl/pthread_attr_setaffinity.c b/nptl/pthread_attr_setaffinity.c
> index cbdee85343..a42ffd92f4 100644
> --- a/nptl/pthread_attr_setaffinity.c
> +++ b/nptl/pthread_attr_setaffinity.c
> @@ -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)

OK.

>  {
>    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);

OK.

>  
>  
> -#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);

OK.

>  #endif
> diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> index 41bb214bb9..2bfad21106 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> @@ -1423,6 +1423,7 @@ GLIBC_2.17 pthread_attr_getschedparam F
>  GLIBC_2.17 pthread_attr_getschedpolicy F
>  GLIBC_2.17 pthread_attr_getscope F
>  GLIBC_2.17 pthread_attr_init F
> +GLIBC_2.17 pthread_attr_setaffinity_np F
>  GLIBC_2.17 pthread_attr_setdetachstate F
>  GLIBC_2.17 pthread_attr_setinheritsched F
>  GLIBC_2.17 pthread_attr_setschedparam F
> @@ -2146,4 +2147,5 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
> index 48b368acb1..2c6f328caa 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
> @@ -72,7 +72,6 @@ GLIBC_2.17 pthread_attr_getguardsize F
>  GLIBC_2.17 pthread_attr_getstack F
>  GLIBC_2.17 pthread_attr_getstackaddr F
>  GLIBC_2.17 pthread_attr_getstacksize F
> -GLIBC_2.17 pthread_attr_setaffinity_np F
>  GLIBC_2.17 pthread_attr_setguardsize F
>  GLIBC_2.17 pthread_attr_setstack F
>  GLIBC_2.17 pthread_attr_setstackaddr F
> diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> index 6430af207f..c0fc196987 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> @@ -2157,6 +2157,7 @@ GLIBC_2.3.3 inet6_option_next F
>  GLIBC_2.3.3 inet6_option_space F
>  GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
> +GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2203,6 +2204,7 @@ GLIBC_2.3.4 __vsprintf_chk F
>  GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
> +GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2226,6 +2228,7 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
> diff --git a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
> index cfffc5f529..2fb0e17408 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
> @@ -211,7 +211,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
>  GLIBC_2.3.3 __pthread_unregister_cancel_restore F
>  GLIBC_2.3.3 __pthread_unwind_next F
>  GLIBC_2.3.3 pthread_attr_getaffinity_np F
> -GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 pthread_attr_setstack F
>  GLIBC_2.3.3 pthread_attr_setstacksize F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
> @@ -222,7 +221,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index f4ea1756d5..b5bc69177a 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -133,6 +133,7 @@ GLIBC_2.30 twalk_r F
>  GLIBC_2.31 msgctl F
>  GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> @@ -1494,6 +1495,7 @@ GLIBC_2.4 pthread_attr_getschedparam F
>  GLIBC_2.4 pthread_attr_getschedpolicy F
>  GLIBC_2.4 pthread_attr_getscope F
>  GLIBC_2.4 pthread_attr_init F
> +GLIBC_2.4 pthread_attr_setaffinity_np F
>  GLIBC_2.4 pthread_attr_setdetachstate F
>  GLIBC_2.4 pthread_attr_setinheritsched F
>  GLIBC_2.4 pthread_attr_setschedparam F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
> index 050e799de8..352b22562e 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
> @@ -107,7 +107,6 @@ GLIBC_2.4 pthread_attr_getguardsize F
>  GLIBC_2.4 pthread_attr_getstack F
>  GLIBC_2.4 pthread_attr_getstackaddr F
>  GLIBC_2.4 pthread_attr_getstacksize F
> -GLIBC_2.4 pthread_attr_setaffinity_np F
>  GLIBC_2.4 pthread_attr_setguardsize F
>  GLIBC_2.4 pthread_attr_setstack F
>  GLIBC_2.4 pthread_attr_setstackaddr F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index f1456b26b2..ff6040f2d7 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -130,6 +130,7 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> @@ -1491,6 +1492,7 @@ GLIBC_2.4 pthread_attr_getschedparam F
>  GLIBC_2.4 pthread_attr_getschedpolicy F
>  GLIBC_2.4 pthread_attr_getscope F
>  GLIBC_2.4 pthread_attr_init F
> +GLIBC_2.4 pthread_attr_setaffinity_np F
>  GLIBC_2.4 pthread_attr_setdetachstate F
>  GLIBC_2.4 pthread_attr_setinheritsched F
>  GLIBC_2.4 pthread_attr_setschedparam F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
> index 050e799de8..352b22562e 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
> @@ -107,7 +107,6 @@ GLIBC_2.4 pthread_attr_getguardsize F
>  GLIBC_2.4 pthread_attr_getstack F
>  GLIBC_2.4 pthread_attr_getstackaddr F
>  GLIBC_2.4 pthread_attr_getstacksize F
> -GLIBC_2.4 pthread_attr_setaffinity_np F
>  GLIBC_2.4 pthread_attr_setguardsize F
>  GLIBC_2.4 pthread_attr_setstack F
>  GLIBC_2.4 pthread_attr_setstackaddr F
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index c54aed2f8e..ff47305e4a 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -1411,6 +1411,7 @@ GLIBC_2.29 pthread_attr_getschedparam F
>  GLIBC_2.29 pthread_attr_getschedpolicy F
>  GLIBC_2.29 pthread_attr_getscope F
>  GLIBC_2.29 pthread_attr_init F
> +GLIBC_2.29 pthread_attr_setaffinity_np F
>  GLIBC_2.29 pthread_attr_setdetachstate F
>  GLIBC_2.29 pthread_attr_setinheritsched F
>  GLIBC_2.29 pthread_attr_setschedparam F
> @@ -2090,4 +2091,5 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/csky/libpthread.abilist b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
> index 977905a839..8f8b4f8751 100644
> --- a/sysdeps/unix/sysv/linux/csky/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
> @@ -80,7 +80,6 @@ GLIBC_2.29 pthread_attr_getguardsize F
>  GLIBC_2.29 pthread_attr_getstack F
>  GLIBC_2.29 pthread_attr_getstackaddr F
>  GLIBC_2.29 pthread_attr_getstacksize F
> -GLIBC_2.29 pthread_attr_setaffinity_np F
>  GLIBC_2.29 pthread_attr_setguardsize F
>  GLIBC_2.29 pthread_attr_setstack F
>  GLIBC_2.29 pthread_attr_setstackaddr F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index 87373f755b..1724e42d34 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -2008,6 +2008,7 @@ GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
> +GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2036,6 +2037,7 @@ GLIBC_2.3.4 __vsprintf_chk F
>  GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
> +GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2047,6 +2049,7 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
> index 558d3f0dfd..4f2ed9e841 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
> @@ -203,7 +203,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
>  GLIBC_2.3.3 __pthread_unregister_cancel_restore F
>  GLIBC_2.3.3 __pthread_unwind_next F
>  GLIBC_2.3.3 pthread_attr_getaffinity_np F
> -GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> @@ -212,7 +211,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index 1bd2e02f79..aa8df3297a 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -2173,6 +2173,7 @@ GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
> +GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2201,6 +2202,7 @@ GLIBC_2.3.4 __vsprintf_chk F
>  GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
> +GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2213,6 +2215,7 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
> index f13fdce3a8..9de9705e66 100644
> --- a/sysdeps/unix/sysv/linux/i386/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
> @@ -211,7 +211,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
>  GLIBC_2.3.3 __pthread_unregister_cancel_restore F
>  GLIBC_2.3.3 __pthread_unwind_next F
>  GLIBC_2.3.3 pthread_attr_getaffinity_np F
> -GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> @@ -220,7 +219,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
> diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> index 07e51d46bf..2effe01e12 100644
> --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> @@ -2038,6 +2038,7 @@ GLIBC_2.3.3 inet6_option_next F
>  GLIBC_2.3.3 inet6_option_space F
>  GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
> +GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2068,6 +2069,7 @@ GLIBC_2.3.4 __vsprintf_chk F
>  GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
> +GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2079,6 +2081,7 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
> index 0c96fc3ccb..d0b122e280 100644
> --- a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
> @@ -203,7 +203,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
>  GLIBC_2.3.3 __pthread_unregister_cancel_restore F
>  GLIBC_2.3.3 __pthread_unwind_next F
>  GLIBC_2.3.3 pthread_attr_getaffinity_np F
> -GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 pthread_attr_setstack F
>  GLIBC_2.3.3 pthread_attr_setstacksize F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
> @@ -214,7 +213,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index 42ea4c24bf..285f56948f 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -134,6 +134,7 @@ GLIBC_2.30 twalk_r F
>  GLIBC_2.31 msgctl F
>  GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
> @@ -1474,6 +1475,7 @@ GLIBC_2.4 pthread_attr_getschedparam F
>  GLIBC_2.4 pthread_attr_getschedpolicy F
>  GLIBC_2.4 pthread_attr_getscope F
>  GLIBC_2.4 pthread_attr_init F
> +GLIBC_2.4 pthread_attr_setaffinity_np F
>  GLIBC_2.4 pthread_attr_setdetachstate F
>  GLIBC_2.4 pthread_attr_setinheritsched F
>  GLIBC_2.4 pthread_attr_setschedparam F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
> index 050e799de8..352b22562e 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
> @@ -107,7 +107,6 @@ GLIBC_2.4 pthread_attr_getguardsize F
>  GLIBC_2.4 pthread_attr_getstack F
>  GLIBC_2.4 pthread_attr_getstackaddr F
>  GLIBC_2.4 pthread_attr_getstacksize F
> -GLIBC_2.4 pthread_attr_setaffinity_np F
>  GLIBC_2.4 pthread_attr_setguardsize F
>  GLIBC_2.4 pthread_attr_setstack F
>  GLIBC_2.4 pthread_attr_setstackaddr F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index e9358fb092..fb0b5690bf 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -2117,6 +2117,7 @@ GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
> +GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2145,6 +2146,7 @@ GLIBC_2.3.4 __vsprintf_chk F
>  GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
> +GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2159,6 +2161,7 @@ GLIBC_2.30 twalk_r F
>  GLIBC_2.31 msgctl F
>  GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
> index f13fdce3a8..9de9705e66 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
> @@ -211,7 +211,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
>  GLIBC_2.3.3 __pthread_unregister_cancel_restore F
>  GLIBC_2.3.3 __pthread_unwind_next F
>  GLIBC_2.3.3 pthread_attr_getaffinity_np F
> -GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> @@ -220,7 +219,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index 2cefe739c0..db490575b5 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -1426,6 +1426,7 @@ GLIBC_2.18 pthread_attr_getschedparam F
>  GLIBC_2.18 pthread_attr_getschedpolicy F
>  GLIBC_2.18 pthread_attr_getscope F
>  GLIBC_2.18 pthread_attr_init F
> +GLIBC_2.18 pthread_attr_setaffinity_np F
>  GLIBC_2.18 pthread_attr_setdetachstate F
>  GLIBC_2.18 pthread_attr_setinheritsched F
>  GLIBC_2.18 pthread_attr_setschedparam F
> @@ -2141,4 +2142,5 @@ GLIBC_2.30 twalk_r F
>  GLIBC_2.31 msgctl F
>  GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
> index 87bd3ad30e..2e90b256b4 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
> @@ -72,7 +72,6 @@ GLIBC_2.18 pthread_attr_getguardsize F
>  GLIBC_2.18 pthread_attr_getstack F
>  GLIBC_2.18 pthread_attr_getstackaddr F
>  GLIBC_2.18 pthread_attr_getstacksize F
> -GLIBC_2.18 pthread_attr_setaffinity_np F
>  GLIBC_2.18 pthread_attr_setguardsize F
>  GLIBC_2.18 pthread_attr_setstack F
>  GLIBC_2.18 pthread_attr_setstackaddr F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index 3474ef1490..9d6ea2fd12 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -1426,6 +1426,7 @@ GLIBC_2.18 pthread_attr_getschedparam F
>  GLIBC_2.18 pthread_attr_getschedpolicy F
>  GLIBC_2.18 pthread_attr_getscope F
>  GLIBC_2.18 pthread_attr_init F
> +GLIBC_2.18 pthread_attr_setaffinity_np F
>  GLIBC_2.18 pthread_attr_setdetachstate F
>  GLIBC_2.18 pthread_attr_setinheritsched F
>  GLIBC_2.18 pthread_attr_setschedparam F
> @@ -2138,4 +2139,5 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
> index 87bd3ad30e..2e90b256b4 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
> @@ -72,7 +72,6 @@ GLIBC_2.18 pthread_attr_getguardsize F
>  GLIBC_2.18 pthread_attr_getstack F
>  GLIBC_2.18 pthread_attr_getstackaddr F
>  GLIBC_2.18 pthread_attr_getstacksize F
> -GLIBC_2.18 pthread_attr_setaffinity_np F
>  GLIBC_2.18 pthread_attr_setguardsize F
>  GLIBC_2.18 pthread_attr_setstack F
>  GLIBC_2.18 pthread_attr_setstackaddr F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index a6f99a7369..800f6bbc74 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -2091,6 +2091,7 @@ GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
> +GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2119,6 +2120,7 @@ GLIBC_2.3.4 __vsprintf_chk F
>  GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
> +GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2130,6 +2132,7 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
> index 474ed999b3..98c3ff9e0e 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
> @@ -210,7 +210,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
>  GLIBC_2.3.3 __pthread_unregister_cancel_restore F
>  GLIBC_2.3.3 __pthread_unwind_next F
>  GLIBC_2.3.3 pthread_attr_getaffinity_np F
> -GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 pthread_attr_setstack F
>  GLIBC_2.3.3 pthread_attr_setstacksize F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
> @@ -221,7 +220,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index 48222af11c..f5dbb73f60 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -2089,6 +2089,7 @@ GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
> +GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2117,6 +2118,7 @@ GLIBC_2.3.4 __vsprintf_chk F
>  GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
> +GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2128,6 +2130,7 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
> index 474ed999b3..98c3ff9e0e 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
> @@ -210,7 +210,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
>  GLIBC_2.3.3 __pthread_unregister_cancel_restore F
>  GLIBC_2.3.3 __pthread_unwind_next F
>  GLIBC_2.3.3 pthread_attr_getaffinity_np F
> -GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 pthread_attr_setstack F
>  GLIBC_2.3.3 pthread_attr_setstacksize F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
> @@ -221,7 +220,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index 99965cfb0f..2929249c59 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -2097,6 +2097,7 @@ GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
> +GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2125,6 +2126,7 @@ GLIBC_2.3.4 __vsprintf_chk F
>  GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
> +GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2136,6 +2138,7 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> index 2c8bafc669..aec8de9427 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> @@ -2089,6 +2089,7 @@ GLIBC_2.3.3 inet6_option_space F
>  GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
> +GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2119,6 +2120,7 @@ GLIBC_2.3.4 __vsprintf_chk F
>  GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
> +GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2130,6 +2132,7 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> index 52cf72052c..9aeb1aaf33 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> @@ -1468,6 +1468,7 @@ GLIBC_2.21 pthread_attr_getschedparam F
>  GLIBC_2.21 pthread_attr_getschedpolicy F
>  GLIBC_2.21 pthread_attr_getscope F
>  GLIBC_2.21 pthread_attr_init F
> +GLIBC_2.21 pthread_attr_setaffinity_np F
>  GLIBC_2.21 pthread_attr_setdetachstate F
>  GLIBC_2.21 pthread_attr_setinheritsched F
>  GLIBC_2.21 pthread_attr_setschedparam F
> @@ -2179,4 +2180,5 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
> index fb9c4a178a..8e3f650c0c 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
> @@ -72,7 +72,6 @@ GLIBC_2.21 pthread_attr_getguardsize F
>  GLIBC_2.21 pthread_attr_getstack F
>  GLIBC_2.21 pthread_attr_getstackaddr F
>  GLIBC_2.21 pthread_attr_getstacksize F
> -GLIBC_2.21 pthread_attr_setaffinity_np F
>  GLIBC_2.21 pthread_attr_setguardsize F
>  GLIBC_2.21 pthread_attr_setstack F
>  GLIBC_2.21 pthread_attr_setstackaddr F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index 2ca5bbccf3..c6ad37e5d2 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -2123,6 +2123,7 @@ GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
> +GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2159,6 +2160,7 @@ GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
>  GLIBC_2.3.4 longjmp F
>  GLIBC_2.3.4 makecontext F
> +GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2186,6 +2188,7 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
> index 65a9ef573e..359e47b705 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
> @@ -211,7 +211,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
>  GLIBC_2.3.3 __pthread_unregister_cancel_restore F
>  GLIBC_2.3.3 __pthread_unwind_next F
>  GLIBC_2.3.3 pthread_attr_getaffinity_np F
> -GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> @@ -221,7 +220,6 @@ GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 longjmp F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> index e6c4d002d5..e92f31f072 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> @@ -2156,6 +2156,7 @@ GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
> +GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2192,6 +2193,7 @@ GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
>  GLIBC_2.3.4 longjmp F
>  GLIBC_2.3.4 makecontext F
> +GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2219,6 +2221,7 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> index 82d77b7e48..537fcbe0cb 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> @@ -1987,6 +1987,7 @@ GLIBC_2.3.3 inet6_option_next F
>  GLIBC_2.3.3 inet6_option_space F
>  GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
> +GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2022,6 +2023,7 @@ GLIBC_2.3.4 getcontext F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
>  GLIBC_2.3.4 longjmp F
> +GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2049,6 +2051,7 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
> index fe5bf9fd47..b58778fcf7 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
> @@ -201,7 +201,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
>  GLIBC_2.3.3 __pthread_unregister_cancel_restore F
>  GLIBC_2.3.3 __pthread_unwind_next F
>  GLIBC_2.3.3 pthread_attr_getaffinity_np F
> -GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> @@ -211,7 +210,6 @@ GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 longjmp F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> index 0c2513a4b3..e2874d4294 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> @@ -1512,6 +1512,7 @@ GLIBC_2.17 pthread_attr_getschedparam F
>  GLIBC_2.17 pthread_attr_getschedpolicy F
>  GLIBC_2.17 pthread_attr_getscope F
>  GLIBC_2.17 pthread_attr_init F
> +GLIBC_2.17 pthread_attr_setaffinity_np F
>  GLIBC_2.17 pthread_attr_setdetachstate F
>  GLIBC_2.17 pthread_attr_setinheritsched F
>  GLIBC_2.17 pthread_attr_setschedparam F
> @@ -2341,4 +2342,5 @@ GLIBC_2.32 __wcstoieee128_l F
>  GLIBC_2.32 __wprintf_chkieee128 F
>  GLIBC_2.32 __wprintfieee128 F
>  GLIBC_2.32 __wscanfieee128 F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
> index 48b368acb1..2c6f328caa 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
> @@ -72,7 +72,6 @@ GLIBC_2.17 pthread_attr_getguardsize F
>  GLIBC_2.17 pthread_attr_getstack F
>  GLIBC_2.17 pthread_attr_getstackaddr F
>  GLIBC_2.17 pthread_attr_getstacksize F
> -GLIBC_2.17 pthread_attr_setaffinity_np F
>  GLIBC_2.17 pthread_attr_setguardsize F
>  GLIBC_2.17 pthread_attr_setstack F
>  GLIBC_2.17 pthread_attr_setstackaddr F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> index 234d34929a..f3a4babc77 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> @@ -1414,6 +1414,7 @@ GLIBC_2.27 pthread_attr_getschedparam F
>  GLIBC_2.27 pthread_attr_getschedpolicy F
>  GLIBC_2.27 pthread_attr_getscope F
>  GLIBC_2.27 pthread_attr_init F
> +GLIBC_2.27 pthread_attr_setaffinity_np F
>  GLIBC_2.27 pthread_attr_setdetachstate F
>  GLIBC_2.27 pthread_attr_setinheritsched F
>  GLIBC_2.27 pthread_attr_setschedparam F
> @@ -2108,4 +2109,5 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
> index 44e3719991..3f276531fb 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
> @@ -69,7 +69,6 @@ GLIBC_2.27 pthread_attr_getguardsize F
>  GLIBC_2.27 pthread_attr_getstack F
>  GLIBC_2.27 pthread_attr_getstackaddr F
>  GLIBC_2.27 pthread_attr_getstacksize F
> -GLIBC_2.27 pthread_attr_setaffinity_np F
>  GLIBC_2.27 pthread_attr_setguardsize F
>  GLIBC_2.27 pthread_attr_setstack F
>  GLIBC_2.27 pthread_attr_setstackaddr F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index 1f06cce028..5ed93d018d 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -2130,6 +2130,7 @@ GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
> +GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2158,6 +2159,7 @@ GLIBC_2.3.4 __vsprintf_chk F
>  GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
> +GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2184,6 +2186,7 @@ GLIBC_2.30 twalk_r F
>  GLIBC_2.31 msgctl F
>  GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
> index 0b2913ba2b..b7f8abece5 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
> @@ -213,7 +213,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
>  GLIBC_2.3.3 __pthread_unregister_cancel_restore F
>  GLIBC_2.3.3 __pthread_unwind_next F
>  GLIBC_2.3.3 pthread_attr_getaffinity_np F
> -GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> @@ -222,7 +221,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> index 26c2ce32e5..66ab0f48cb 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> @@ -2032,6 +2032,7 @@ GLIBC_2.3.3 inet6_option_next F
>  GLIBC_2.3.3 inet6_option_space F
>  GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
> +GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2062,6 +2063,7 @@ GLIBC_2.3.4 __vsprintf_chk F
>  GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
> +GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2085,6 +2087,7 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
> index 8c71cdc48d..0799bb2bf4 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
> @@ -205,7 +205,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
>  GLIBC_2.3.3 __pthread_unregister_cancel_restore F
>  GLIBC_2.3.3 __pthread_unwind_next F
>  GLIBC_2.3.3 pthread_attr_getaffinity_np F
> -GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> @@ -214,7 +213,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index 7ad2e920c3..8a676b0833 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -2012,6 +2012,7 @@ GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
> +GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2040,6 +2041,7 @@ GLIBC_2.3.4 __vsprintf_chk F
>  GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
> +GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2054,6 +2056,7 @@ GLIBC_2.30 twalk_r F
>  GLIBC_2.31 msgctl F
>  GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
> index 558d3f0dfd..4f2ed9e841 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
> @@ -203,7 +203,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
>  GLIBC_2.3.3 __pthread_unregister_cancel_restore F
>  GLIBC_2.3.3 __pthread_unwind_next F
>  GLIBC_2.3.3 pthread_attr_getaffinity_np F
> -GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> @@ -212,7 +211,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index d2611bf0a5..e6f7e1b02d 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -2012,6 +2012,7 @@ GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
> +GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2040,6 +2041,7 @@ GLIBC_2.3.4 __vsprintf_chk F
>  GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
> +GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2051,6 +2053,7 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
> index 558d3f0dfd..4f2ed9e841 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
> @@ -203,7 +203,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
>  GLIBC_2.3.3 __pthread_unregister_cancel_restore F
>  GLIBC_2.3.3 __pthread_unwind_next F
>  GLIBC_2.3.3 pthread_attr_getaffinity_np F
> -GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> @@ -212,7 +211,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index 18a528f0e9..e1ae0f6618 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -2124,6 +2124,7 @@ GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
> +GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2152,6 +2153,7 @@ GLIBC_2.3.4 __vsprintf_chk F
>  GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
> +GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2175,6 +2177,7 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
> index cfffc5f529..2fb0e17408 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
> @@ -211,7 +211,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
>  GLIBC_2.3.3 __pthread_unregister_cancel_restore F
>  GLIBC_2.3.3 __pthread_unwind_next F
>  GLIBC_2.3.3 pthread_attr_getaffinity_np F
> -GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 pthread_attr_setstack F
>  GLIBC_2.3.3 pthread_attr_setstacksize F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
> @@ -222,7 +221,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> index a1d48b0f3c..67a35b3812 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> @@ -2061,6 +2061,7 @@ GLIBC_2.3.3 inet6_option_next F
>  GLIBC_2.3.3 inet6_option_space F
>  GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
> +GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2091,6 +2092,7 @@ GLIBC_2.3.4 __vsprintf_chk F
>  GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
> +GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2102,6 +2104,7 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
> index 0c96fc3ccb..d0b122e280 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
> @@ -203,7 +203,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
>  GLIBC_2.3.3 __pthread_unregister_cancel_restore F
>  GLIBC_2.3.3 __pthread_unwind_next F
>  GLIBC_2.3.3 pthread_attr_getaffinity_np F
> -GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 pthread_attr_setstack F
>  GLIBC_2.3.3 pthread_attr_setstacksize F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
> @@ -214,7 +213,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> index 6418ace78a..c48d097b7f 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> @@ -2019,6 +2019,7 @@ GLIBC_2.3.3 inet6_option_next F
>  GLIBC_2.3.3 inet6_option_space F
>  GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
> +GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2049,6 +2050,7 @@ GLIBC_2.3.4 __vsprintf_chk F
>  GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
> +GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2060,6 +2062,7 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
> index 2888c3150b..b08f2413b1 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
> @@ -203,7 +203,6 @@ GLIBC_2.3.3 __pthread_unregister_cancel F
>  GLIBC_2.3.3 __pthread_unregister_cancel_restore F
>  GLIBC_2.3.3 __pthread_unwind_next F
>  GLIBC_2.3.3 pthread_attr_getaffinity_np F
> -GLIBC_2.3.3 pthread_attr_setaffinity_np F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> @@ -212,7 +211,6 @@ GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_attr_setaffinity_np F
>  GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> index edb9f2f004..83618e9254 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> @@ -1431,6 +1431,7 @@ GLIBC_2.16 pthread_attr_getschedparam F
>  GLIBC_2.16 pthread_attr_getschedpolicy F
>  GLIBC_2.16 pthread_attr_getscope F
>  GLIBC_2.16 pthread_attr_init F
> +GLIBC_2.16 pthread_attr_setaffinity_np F
>  GLIBC_2.16 pthread_attr_setdetachstate F
>  GLIBC_2.16 pthread_attr_setinheritsched F
>  GLIBC_2.16 pthread_attr_setschedparam F
> @@ -2159,4 +2160,5 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
> index 5ac72e4515..58e5c764dd 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
> @@ -72,7 +72,6 @@ GLIBC_2.16 pthread_attr_getguardsize F
>  GLIBC_2.16 pthread_attr_getstack F
>  GLIBC_2.16 pthread_attr_getstackaddr F
>  GLIBC_2.16 pthread_attr_getstacksize F
> -GLIBC_2.16 pthread_attr_setaffinity_np F
>  GLIBC_2.16 pthread_attr_setguardsize F
>  GLIBC_2.16 pthread_attr_setstack F
>  GLIBC_2.16 pthread_attr_setstackaddr F
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 04/19] nptl: Move pthread_getaffinity_np into libc
  2020-05-19 10:44 ` [PATCH 04/19] nptl: Move pthread_getaffinity_np " Florian Weimer via Libc-alpha
@ 2020-05-20 13:52   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 42+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2020-05-20 13:52 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha

On 5/19/20 6:44 AM, Florian Weimer via Libc-alpha wrote:
> This is part of the libpthread removal project:
> 
>     <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>
> 
> The abilist updates were performed by:
> 
> git ls-files 'sysdeps/unix/sysv/linux/**/libc.abilist' \
>   | while read x ; do
>     echo "GLIBC_2.32 pthread_getaffinity_np F" >> $x
> done
> python3 scripts/move-symbol-to-libc.py pthread_getaffinity_np

This moves pthread_getaffinity_np, and the move looks good to me.

OK for master.

Tested clean on x86_64 and i686.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  nptl/Makefile                                 |  3 ++-
>  nptl/Versions                                 |  5 ++++-
>  nptl/pthreadP.h                               |  1 +
>  nptl/pthread_getaffinity.c                    | 21 ++++++++++++-------
>  sysdeps/unix/sysv/linux/aarch64/libc.abilist  |  2 ++
>  .../sysv/linux/aarch64/libpthread.abilist     |  1 -
>  sysdeps/unix/sysv/linux/alpha/libc.abilist    |  3 +++
>  .../unix/sysv/linux/alpha/libpthread.abilist  |  2 --
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  2 ++
>  .../unix/sysv/linux/arm/be/libpthread.abilist |  1 -
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  2 ++
>  .../unix/sysv/linux/arm/le/libpthread.abilist |  1 -
>  sysdeps/unix/sysv/linux/csky/libc.abilist     |  2 ++
>  .../unix/sysv/linux/csky/libpthread.abilist   |  1 -
>  sysdeps/unix/sysv/linux/hppa/libc.abilist     |  3 +++
>  .../unix/sysv/linux/hppa/libpthread.abilist   |  2 --
>  sysdeps/unix/sysv/linux/i386/libc.abilist     |  3 +++
>  .../unix/sysv/linux/i386/libpthread.abilist   |  2 --
>  sysdeps/unix/sysv/linux/ia64/libc.abilist     |  3 +++
>  .../unix/sysv/linux/ia64/libpthread.abilist   |  2 --
>  .../sysv/linux/m68k/coldfire/libc.abilist     |  2 ++
>  .../linux/m68k/coldfire/libpthread.abilist    |  1 -
>  .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  3 +++
>  .../sysv/linux/m68k/m680x0/libpthread.abilist |  2 --
>  .../sysv/linux/microblaze/be/libc.abilist     |  2 ++
>  .../linux/microblaze/be/libpthread.abilist    |  1 -
>  .../sysv/linux/microblaze/le/libc.abilist     |  2 ++
>  .../linux/microblaze/le/libpthread.abilist    |  1 -
>  .../sysv/linux/mips/mips32/fpu/libc.abilist   |  3 +++
>  .../sysv/linux/mips/mips32/libpthread.abilist |  2 --
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist |  3 +++
>  .../sysv/linux/mips/mips64/libpthread.abilist |  2 --
>  .../sysv/linux/mips/mips64/n32/libc.abilist   |  3 +++
>  .../sysv/linux/mips/mips64/n64/libc.abilist   |  3 +++
>  sysdeps/unix/sysv/linux/nios2/libc.abilist    |  2 ++
>  .../unix/sysv/linux/nios2/libpthread.abilist  |  1 -
>  .../linux/powerpc/powerpc32/fpu/libc.abilist  |  3 +++
>  .../powerpc/powerpc32/libpthread.abilist      |  2 --
>  .../powerpc/powerpc32/nofpu/libc.abilist      |  3 +++
>  .../linux/powerpc/powerpc64/be/libc.abilist   |  3 +++
>  .../powerpc/powerpc64/be/libpthread.abilist   |  2 --
>  .../linux/powerpc/powerpc64/le/libc.abilist   |  2 ++
>  .../powerpc/powerpc64/le/libpthread.abilist   |  1 -
>  .../unix/sysv/linux/riscv/rv64/libc.abilist   |  2 ++
>  .../sysv/linux/riscv/rv64/libpthread.abilist  |  1 -
>  .../unix/sysv/linux/s390/s390-32/libc.abilist |  3 +++
>  .../linux/s390/s390-32/libpthread.abilist     |  2 --
>  .../unix/sysv/linux/s390/s390-64/libc.abilist |  3 +++
>  .../linux/s390/s390-64/libpthread.abilist     |  2 --
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  3 +++
>  .../unix/sysv/linux/sh/be/libpthread.abilist  |  2 --
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  3 +++
>  .../unix/sysv/linux/sh/le/libpthread.abilist  |  2 --
>  .../sysv/linux/sparc/sparc32/libc.abilist     |  3 +++
>  .../linux/sparc/sparc32/libpthread.abilist    |  2 --
>  .../sysv/linux/sparc/sparc64/libc.abilist     |  3 +++
>  .../linux/sparc/sparc64/libpthread.abilist    |  2 --
>  .../unix/sysv/linux/x86_64/64/libc.abilist    |  3 +++
>  .../sysv/linux/x86_64/64/libpthread.abilist   |  2 --
>  .../unix/sysv/linux/x86_64/x32/libc.abilist   |  2 ++
>  .../sysv/linux/x86_64/x32/libpthread.abilist  |  1 -
>  61 files changed, 99 insertions(+), 53 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 \

OK.

>    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 \

OK.

>  		      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;

OK. Moved from libpthread.

>    }
>    GLIBC_2.3.4 {
>      pthread_attr_setaffinity_np;
> @@ -41,6 +42,7 @@ libc {
>    }
>    GLIBC_2.32 {
>      pthread_attr_setaffinity_np;
> +    pthread_getaffinity_np;

OK. New.

>      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.

OK.

>    }
>  }
>  
> @@ -226,7 +229,7 @@ libpthread {
>      __pthread_cleanup_routine;
>  
>      # affinity interfaces without size parameter
> -    pthread_getaffinity_np; pthread_setaffinity_np;
> +    pthread_setaffinity_np;

OK. Removed.

>      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)

OK.

>  
>  #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)

OK.

>  {
>    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);

OK. New.

> +
> +#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

OK. Existing.

>  
> -#if SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_3_4)
> +#if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_3_4)

OK. Moved.

>  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);

OK.

>  }
> -compat_symbol (libpthread, __pthread_getaffinity_old, pthread_getaffinity_np,
> +compat_symbol (libc, __pthread_getaffinity_old, pthread_getaffinity_np,
>  	       GLIBC_2_3_3);

OK.

>  #endif
> diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> index 2bfad21106..55499b8d3c 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> @@ -1439,6 +1439,7 @@ GLIBC_2.17 pthread_condattr_destroy F
>  GLIBC_2.17 pthread_condattr_init F
>  GLIBC_2.17 pthread_equal F
>  GLIBC_2.17 pthread_exit F
> +GLIBC_2.17 pthread_getaffinity_np F
>  GLIBC_2.17 pthread_getschedparam F
>  GLIBC_2.17 pthread_mutex_destroy F
>  GLIBC_2.17 pthread_mutex_init F
> @@ -2148,4 +2149,5 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
> index 2c6f328caa..77cf95c491 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
> @@ -95,7 +95,6 @@ GLIBC_2.17 pthread_condattr_setpshared F
>  GLIBC_2.17 pthread_create F
>  GLIBC_2.17 pthread_detach F
>  GLIBC_2.17 pthread_exit F
> -GLIBC_2.17 pthread_getaffinity_np F
>  GLIBC_2.17 pthread_getattr_np F
>  GLIBC_2.17 pthread_getconcurrency F
>  GLIBC_2.17 pthread_getcpuclockid F
> diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> index c0fc196987..387b0badaa 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> @@ -2158,6 +2158,7 @@ GLIBC_2.3.3 inet6_option_space F
>  GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 pthread_attr_setaffinity_np F
> +GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2205,6 +2206,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
>  GLIBC_2.3.4 pthread_attr_setaffinity_np F
> +GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2229,6 +2231,7 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
> diff --git a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
> index 2fb0e17408..8d504c3cdb 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
> @@ -216,12 +216,10 @@ GLIBC_2.3.3 pthread_attr_setstacksize F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> -GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
>  GLIBC_2.30 pthread_cond_clockwait F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index b5bc69177a..2775ee0963 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -134,6 +134,7 @@ GLIBC_2.31 msgctl F
>  GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> @@ -1511,6 +1512,7 @@ GLIBC_2.4 pthread_condattr_destroy F
>  GLIBC_2.4 pthread_condattr_init F
>  GLIBC_2.4 pthread_equal F
>  GLIBC_2.4 pthread_exit F
> +GLIBC_2.4 pthread_getaffinity_np F
>  GLIBC_2.4 pthread_getschedparam F
>  GLIBC_2.4 pthread_mutex_destroy F
>  GLIBC_2.4 pthread_mutex_init F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
> index 352b22562e..c1313fb4bf 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
> @@ -130,7 +130,6 @@ GLIBC_2.4 pthread_condattr_setpshared F
>  GLIBC_2.4 pthread_create F
>  GLIBC_2.4 pthread_detach F
>  GLIBC_2.4 pthread_exit F
> -GLIBC_2.4 pthread_getaffinity_np F
>  GLIBC_2.4 pthread_getattr_np F
>  GLIBC_2.4 pthread_getconcurrency F
>  GLIBC_2.4 pthread_getcpuclockid F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index ff6040f2d7..0e233ff542 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -131,6 +131,7 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> @@ -1508,6 +1509,7 @@ GLIBC_2.4 pthread_condattr_destroy F
>  GLIBC_2.4 pthread_condattr_init F
>  GLIBC_2.4 pthread_equal F
>  GLIBC_2.4 pthread_exit F
> +GLIBC_2.4 pthread_getaffinity_np F
>  GLIBC_2.4 pthread_getschedparam F
>  GLIBC_2.4 pthread_mutex_destroy F
>  GLIBC_2.4 pthread_mutex_init F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
> index 352b22562e..c1313fb4bf 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
> @@ -130,7 +130,6 @@ GLIBC_2.4 pthread_condattr_setpshared F
>  GLIBC_2.4 pthread_create F
>  GLIBC_2.4 pthread_detach F
>  GLIBC_2.4 pthread_exit F
> -GLIBC_2.4 pthread_getaffinity_np F
>  GLIBC_2.4 pthread_getattr_np F
>  GLIBC_2.4 pthread_getconcurrency F
>  GLIBC_2.4 pthread_getcpuclockid F
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index ff47305e4a..dbef2ad653 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -1427,6 +1427,7 @@ GLIBC_2.29 pthread_condattr_destroy F
>  GLIBC_2.29 pthread_condattr_init F
>  GLIBC_2.29 pthread_equal F
>  GLIBC_2.29 pthread_exit F
> +GLIBC_2.29 pthread_getaffinity_np F
>  GLIBC_2.29 pthread_getschedparam F
>  GLIBC_2.29 pthread_mutex_destroy F
>  GLIBC_2.29 pthread_mutex_init F
> @@ -2092,4 +2093,5 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/csky/libpthread.abilist b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
> index 8f8b4f8751..bcdea792ec 100644
> --- a/sysdeps/unix/sysv/linux/csky/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
> @@ -103,7 +103,6 @@ GLIBC_2.29 pthread_condattr_setpshared F
>  GLIBC_2.29 pthread_create F
>  GLIBC_2.29 pthread_detach F
>  GLIBC_2.29 pthread_exit F
> -GLIBC_2.29 pthread_getaffinity_np F
>  GLIBC_2.29 pthread_getattr_default_np F
>  GLIBC_2.29 pthread_getattr_np F
>  GLIBC_2.29 pthread_getconcurrency F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index 1724e42d34..4405dbfe63 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -2009,6 +2009,7 @@ GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
>  GLIBC_2.3.3 pthread_attr_setaffinity_np F
> +GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2038,6 +2039,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
>  GLIBC_2.3.4 pthread_attr_setaffinity_np F
> +GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2050,6 +2052,7 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
> index 4f2ed9e841..a12e0308b0 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
> @@ -206,12 +206,10 @@ GLIBC_2.3.3 pthread_attr_getaffinity_np F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> -GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
>  GLIBC_2.30 pthread_cond_clockwait F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index aa8df3297a..de447796e7 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -2174,6 +2174,7 @@ GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
>  GLIBC_2.3.3 pthread_attr_setaffinity_np F
> +GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2203,6 +2204,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
>  GLIBC_2.3.4 pthread_attr_setaffinity_np F
> +GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2216,6 +2218,7 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
> index 9de9705e66..f84feaca66 100644
> --- a/sysdeps/unix/sysv/linux/i386/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
> @@ -214,12 +214,10 @@ GLIBC_2.3.3 pthread_attr_getaffinity_np F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> -GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
>  GLIBC_2.30 pthread_cond_clockwait F
> diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> index 2effe01e12..df3da1bea3 100644
> --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> @@ -2039,6 +2039,7 @@ GLIBC_2.3.3 inet6_option_space F
>  GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 pthread_attr_setaffinity_np F
> +GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2070,6 +2071,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
>  GLIBC_2.3.4 pthread_attr_setaffinity_np F
> +GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2082,6 +2084,7 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
> index d0b122e280..927afe3bd5 100644
> --- a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
> @@ -208,12 +208,10 @@ GLIBC_2.3.3 pthread_attr_setstacksize F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> -GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
>  GLIBC_2.30 pthread_cond_clockwait F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index 285f56948f..deb56b3dfc 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -135,6 +135,7 @@ GLIBC_2.31 msgctl F
>  GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
> @@ -1491,6 +1492,7 @@ GLIBC_2.4 pthread_condattr_destroy F
>  GLIBC_2.4 pthread_condattr_init F
>  GLIBC_2.4 pthread_equal F
>  GLIBC_2.4 pthread_exit F
> +GLIBC_2.4 pthread_getaffinity_np F
>  GLIBC_2.4 pthread_getschedparam F
>  GLIBC_2.4 pthread_mutex_destroy F
>  GLIBC_2.4 pthread_mutex_init F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
> index 352b22562e..c1313fb4bf 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
> @@ -130,7 +130,6 @@ GLIBC_2.4 pthread_condattr_setpshared F
>  GLIBC_2.4 pthread_create F
>  GLIBC_2.4 pthread_detach F
>  GLIBC_2.4 pthread_exit F
> -GLIBC_2.4 pthread_getaffinity_np F
>  GLIBC_2.4 pthread_getattr_np F
>  GLIBC_2.4 pthread_getconcurrency F
>  GLIBC_2.4 pthread_getcpuclockid F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index fb0b5690bf..96d8a1a101 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -2118,6 +2118,7 @@ GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
>  GLIBC_2.3.3 pthread_attr_setaffinity_np F
> +GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2147,6 +2148,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
>  GLIBC_2.3.4 pthread_attr_setaffinity_np F
> +GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2162,6 +2164,7 @@ GLIBC_2.31 msgctl F
>  GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
> index 9de9705e66..f84feaca66 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
> @@ -214,12 +214,10 @@ GLIBC_2.3.3 pthread_attr_getaffinity_np F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> -GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
>  GLIBC_2.30 pthread_cond_clockwait F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index db490575b5..134db9a3f8 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -1442,6 +1442,7 @@ GLIBC_2.18 pthread_condattr_destroy F
>  GLIBC_2.18 pthread_condattr_init F
>  GLIBC_2.18 pthread_equal F
>  GLIBC_2.18 pthread_exit F
> +GLIBC_2.18 pthread_getaffinity_np F
>  GLIBC_2.18 pthread_getschedparam F
>  GLIBC_2.18 pthread_mutex_destroy F
>  GLIBC_2.18 pthread_mutex_init F
> @@ -2143,4 +2144,5 @@ GLIBC_2.31 msgctl F
>  GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
> index 2e90b256b4..1af46cb44e 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
> @@ -95,7 +95,6 @@ GLIBC_2.18 pthread_condattr_setpshared F
>  GLIBC_2.18 pthread_create F
>  GLIBC_2.18 pthread_detach F
>  GLIBC_2.18 pthread_exit F
> -GLIBC_2.18 pthread_getaffinity_np F
>  GLIBC_2.18 pthread_getattr_default_np F
>  GLIBC_2.18 pthread_getattr_np F
>  GLIBC_2.18 pthread_getconcurrency F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index 9d6ea2fd12..aa5be2136d 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -1442,6 +1442,7 @@ GLIBC_2.18 pthread_condattr_destroy F
>  GLIBC_2.18 pthread_condattr_init F
>  GLIBC_2.18 pthread_equal F
>  GLIBC_2.18 pthread_exit F
> +GLIBC_2.18 pthread_getaffinity_np F
>  GLIBC_2.18 pthread_getschedparam F
>  GLIBC_2.18 pthread_mutex_destroy F
>  GLIBC_2.18 pthread_mutex_init F
> @@ -2140,4 +2141,5 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
> index 2e90b256b4..1af46cb44e 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
> @@ -95,7 +95,6 @@ GLIBC_2.18 pthread_condattr_setpshared F
>  GLIBC_2.18 pthread_create F
>  GLIBC_2.18 pthread_detach F
>  GLIBC_2.18 pthread_exit F
> -GLIBC_2.18 pthread_getaffinity_np F
>  GLIBC_2.18 pthread_getattr_default_np F
>  GLIBC_2.18 pthread_getattr_np F
>  GLIBC_2.18 pthread_getconcurrency F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index 800f6bbc74..8f76103289 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -2092,6 +2092,7 @@ GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
>  GLIBC_2.3.3 pthread_attr_setaffinity_np F
> +GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2121,6 +2122,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
>  GLIBC_2.3.4 pthread_attr_setaffinity_np F
> +GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2133,6 +2135,7 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
> index 98c3ff9e0e..14009d87e9 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
> @@ -215,12 +215,10 @@ GLIBC_2.3.3 pthread_attr_setstacksize F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> -GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
>  GLIBC_2.30 pthread_cond_clockwait F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index f5dbb73f60..ec6d5478e2 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -2090,6 +2090,7 @@ GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
>  GLIBC_2.3.3 pthread_attr_setaffinity_np F
> +GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2119,6 +2120,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
>  GLIBC_2.3.4 pthread_attr_setaffinity_np F
> +GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2131,6 +2133,7 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
> index 98c3ff9e0e..14009d87e9 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
> @@ -215,12 +215,10 @@ GLIBC_2.3.3 pthread_attr_setstacksize F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> -GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
>  GLIBC_2.30 pthread_cond_clockwait F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index 2929249c59..4f473ef639 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -2098,6 +2098,7 @@ GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
>  GLIBC_2.3.3 pthread_attr_setaffinity_np F
> +GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2127,6 +2128,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
>  GLIBC_2.3.4 pthread_attr_setaffinity_np F
> +GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2139,6 +2141,7 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> index aec8de9427..81a7044545 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> @@ -2090,6 +2090,7 @@ GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 pthread_attr_setaffinity_np F
> +GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2121,6 +2122,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
>  GLIBC_2.3.4 pthread_attr_setaffinity_np F
> +GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2133,6 +2135,7 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> index 9aeb1aaf33..7ba8a9a002 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> @@ -1484,6 +1484,7 @@ GLIBC_2.21 pthread_condattr_destroy F
>  GLIBC_2.21 pthread_condattr_init F
>  GLIBC_2.21 pthread_equal F
>  GLIBC_2.21 pthread_exit F
> +GLIBC_2.21 pthread_getaffinity_np F
>  GLIBC_2.21 pthread_getschedparam F
>  GLIBC_2.21 pthread_mutex_destroy F
>  GLIBC_2.21 pthread_mutex_init F
> @@ -2181,4 +2182,5 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
> index 8e3f650c0c..0c1fa0baca 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
> @@ -95,7 +95,6 @@ GLIBC_2.21 pthread_condattr_setpshared F
>  GLIBC_2.21 pthread_create F
>  GLIBC_2.21 pthread_detach F
>  GLIBC_2.21 pthread_exit F
> -GLIBC_2.21 pthread_getaffinity_np F
>  GLIBC_2.21 pthread_getattr_default_np F
>  GLIBC_2.21 pthread_getattr_np F
>  GLIBC_2.21 pthread_getconcurrency F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index c6ad37e5d2..6483f68273 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -2124,6 +2124,7 @@ GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
>  GLIBC_2.3.3 pthread_attr_setaffinity_np F
> +GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2161,6 +2162,7 @@ GLIBC_2.3.4 getsourcefilter F
>  GLIBC_2.3.4 longjmp F
>  GLIBC_2.3.4 makecontext F
>  GLIBC_2.3.4 pthread_attr_setaffinity_np F
> +GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2189,6 +2191,7 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
> index 359e47b705..4307193cb2 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
> @@ -214,13 +214,11 @@ GLIBC_2.3.3 pthread_attr_getaffinity_np F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> -GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 longjmp F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
>  GLIBC_2.3.4 siglongjmp F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> index e92f31f072..405a39cbd0 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> @@ -2157,6 +2157,7 @@ GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
>  GLIBC_2.3.3 pthread_attr_setaffinity_np F
> +GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2194,6 +2195,7 @@ GLIBC_2.3.4 getsourcefilter F
>  GLIBC_2.3.4 longjmp F
>  GLIBC_2.3.4 makecontext F
>  GLIBC_2.3.4 pthread_attr_setaffinity_np F
> +GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2222,6 +2224,7 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> index 537fcbe0cb..b1286be61e 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> @@ -1988,6 +1988,7 @@ GLIBC_2.3.3 inet6_option_space F
>  GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 pthread_attr_setaffinity_np F
> +GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2024,6 +2025,7 @@ GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
>  GLIBC_2.3.4 longjmp F
>  GLIBC_2.3.4 pthread_attr_setaffinity_np F
> +GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2052,6 +2054,7 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
> index b58778fcf7..41a9f178a2 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
> @@ -204,13 +204,11 @@ GLIBC_2.3.3 pthread_attr_getaffinity_np F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> -GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 longjmp F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
>  GLIBC_2.3.4 siglongjmp F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> index e2874d4294..c9016bfc8a 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> @@ -1528,6 +1528,7 @@ GLIBC_2.17 pthread_condattr_destroy F
>  GLIBC_2.17 pthread_condattr_init F
>  GLIBC_2.17 pthread_equal F
>  GLIBC_2.17 pthread_exit F
> +GLIBC_2.17 pthread_getaffinity_np F
>  GLIBC_2.17 pthread_getschedparam F
>  GLIBC_2.17 pthread_mutex_destroy F
>  GLIBC_2.17 pthread_mutex_init F
> @@ -2343,4 +2344,5 @@ GLIBC_2.32 __wprintf_chkieee128 F
>  GLIBC_2.32 __wprintfieee128 F
>  GLIBC_2.32 __wscanfieee128 F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
> index 2c6f328caa..77cf95c491 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
> @@ -95,7 +95,6 @@ GLIBC_2.17 pthread_condattr_setpshared F
>  GLIBC_2.17 pthread_create F
>  GLIBC_2.17 pthread_detach F
>  GLIBC_2.17 pthread_exit F
> -GLIBC_2.17 pthread_getaffinity_np F
>  GLIBC_2.17 pthread_getattr_np F
>  GLIBC_2.17 pthread_getconcurrency F
>  GLIBC_2.17 pthread_getcpuclockid F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> index f3a4babc77..029c60d5d8 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> @@ -1430,6 +1430,7 @@ GLIBC_2.27 pthread_condattr_destroy F
>  GLIBC_2.27 pthread_condattr_init F
>  GLIBC_2.27 pthread_equal F
>  GLIBC_2.27 pthread_exit F
> +GLIBC_2.27 pthread_getaffinity_np F
>  GLIBC_2.27 pthread_getschedparam F
>  GLIBC_2.27 pthread_mutex_destroy F
>  GLIBC_2.27 pthread_mutex_init F
> @@ -2110,4 +2111,5 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
> index 3f276531fb..41a796e225 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
> @@ -92,7 +92,6 @@ GLIBC_2.27 pthread_condattr_setpshared F
>  GLIBC_2.27 pthread_create F
>  GLIBC_2.27 pthread_detach F
>  GLIBC_2.27 pthread_exit F
> -GLIBC_2.27 pthread_getaffinity_np F
>  GLIBC_2.27 pthread_getattr_default_np F
>  GLIBC_2.27 pthread_getattr_np F
>  GLIBC_2.27 pthread_getconcurrency F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index 5ed93d018d..b75ce88958 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -2131,6 +2131,7 @@ GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
>  GLIBC_2.3.3 pthread_attr_setaffinity_np F
> +GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2160,6 +2161,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
>  GLIBC_2.3.4 pthread_attr_setaffinity_np F
> +GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2187,6 +2189,7 @@ GLIBC_2.31 msgctl F
>  GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
> index b7f8abece5..1471cf4d13 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
> @@ -216,12 +216,10 @@ GLIBC_2.3.3 pthread_attr_getaffinity_np F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> -GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
>  GLIBC_2.30 pthread_cond_clockwait F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> index 66ab0f48cb..70571678c6 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> @@ -2033,6 +2033,7 @@ GLIBC_2.3.3 inet6_option_space F
>  GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 pthread_attr_setaffinity_np F
> +GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2064,6 +2065,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
>  GLIBC_2.3.4 pthread_attr_setaffinity_np F
> +GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2088,6 +2090,7 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
> index 0799bb2bf4..8d0b90477a 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
> @@ -208,12 +208,10 @@ GLIBC_2.3.3 pthread_attr_getaffinity_np F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> -GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
>  GLIBC_2.30 pthread_cond_clockwait F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index 8a676b0833..de14989270 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -2013,6 +2013,7 @@ GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
>  GLIBC_2.3.3 pthread_attr_setaffinity_np F
> +GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2042,6 +2043,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
>  GLIBC_2.3.4 pthread_attr_setaffinity_np F
> +GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2057,6 +2059,7 @@ GLIBC_2.31 msgctl F
>  GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
> index 4f2ed9e841..a12e0308b0 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
> @@ -206,12 +206,10 @@ GLIBC_2.3.3 pthread_attr_getaffinity_np F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> -GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
>  GLIBC_2.30 pthread_cond_clockwait F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index e6f7e1b02d..e181c5c936 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -2013,6 +2013,7 @@ GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
>  GLIBC_2.3.3 pthread_attr_setaffinity_np F
> +GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2042,6 +2043,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
>  GLIBC_2.3.4 pthread_attr_setaffinity_np F
> +GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2054,6 +2056,7 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
> index 4f2ed9e841..a12e0308b0 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
> @@ -206,12 +206,10 @@ GLIBC_2.3.3 pthread_attr_getaffinity_np F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> -GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
>  GLIBC_2.30 pthread_cond_clockwait F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index e1ae0f6618..670ed9b896 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -2125,6 +2125,7 @@ GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 posix_fadvise64 F
>  GLIBC_2.3.3 posix_fallocate64 F
>  GLIBC_2.3.3 pthread_attr_setaffinity_np F
> +GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2154,6 +2155,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
>  GLIBC_2.3.4 pthread_attr_setaffinity_np F
> +GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2178,6 +2180,7 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
> index 2fb0e17408..8d504c3cdb 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
> @@ -216,12 +216,10 @@ GLIBC_2.3.3 pthread_attr_setstacksize F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> -GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
>  GLIBC_2.30 pthread_cond_clockwait F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> index 67a35b3812..a7980633b3 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> @@ -2062,6 +2062,7 @@ GLIBC_2.3.3 inet6_option_space F
>  GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 pthread_attr_setaffinity_np F
> +GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2093,6 +2094,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
>  GLIBC_2.3.4 pthread_attr_setaffinity_np F
> +GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2105,6 +2107,7 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
> index d0b122e280..927afe3bd5 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
> @@ -208,12 +208,10 @@ GLIBC_2.3.3 pthread_attr_setstacksize F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> -GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
>  GLIBC_2.30 pthread_cond_clockwait F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> index c48d097b7f..766bfb7be3 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> @@ -2020,6 +2020,7 @@ GLIBC_2.3.3 inet6_option_space F
>  GLIBC_2.3.3 nftw F
>  GLIBC_2.3.3 nftw64 F
>  GLIBC_2.3.3 pthread_attr_setaffinity_np F
> +GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 remap_file_pages F
>  GLIBC_2.3.3 sched_getaffinity F
>  GLIBC_2.3.3 sched_setaffinity F
> @@ -2051,6 +2052,7 @@ GLIBC_2.3.4 __xpg_strerror_r F
>  GLIBC_2.3.4 getipv4sourcefilter F
>  GLIBC_2.3.4 getsourcefilter F
>  GLIBC_2.3.4 pthread_attr_setaffinity_np F
> +GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 regexec F
>  GLIBC_2.3.4 sched_getaffinity F
>  GLIBC_2.3.4 sched_setaffinity F
> @@ -2063,6 +2065,7 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
> index b08f2413b1..1b07b47739 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
> @@ -206,12 +206,10 @@ GLIBC_2.3.3 pthread_attr_getaffinity_np F
>  GLIBC_2.3.3 pthread_barrierattr_getpshared F
>  GLIBC_2.3.3 pthread_condattr_getclock F
>  GLIBC_2.3.3 pthread_condattr_setclock F
> -GLIBC_2.3.3 pthread_getaffinity_np F
>  GLIBC_2.3.3 pthread_setaffinity_np F
>  GLIBC_2.3.3 pthread_timedjoin_np F
>  GLIBC_2.3.3 pthread_tryjoin_np F
>  GLIBC_2.3.4 pthread_attr_getaffinity_np F
> -GLIBC_2.3.4 pthread_getaffinity_np F
>  GLIBC_2.3.4 pthread_setaffinity_np F
>  GLIBC_2.3.4 pthread_setschedprio F
>  GLIBC_2.30 pthread_cond_clockwait F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> index 83618e9254..075f8870a1 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> @@ -1447,6 +1447,7 @@ GLIBC_2.16 pthread_condattr_destroy F
>  GLIBC_2.16 pthread_condattr_init F
>  GLIBC_2.16 pthread_equal F
>  GLIBC_2.16 pthread_exit F
> +GLIBC_2.16 pthread_getaffinity_np F
>  GLIBC_2.16 pthread_getschedparam F
>  GLIBC_2.16 pthread_mutex_destroy F
>  GLIBC_2.16 pthread_mutex_init F
> @@ -2161,4 +2162,5 @@ GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
> index 58e5c764dd..6ff1703de1 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
> @@ -95,7 +95,6 @@ GLIBC_2.16 pthread_condattr_setpshared F
>  GLIBC_2.16 pthread_create F
>  GLIBC_2.16 pthread_detach F
>  GLIBC_2.16 pthread_exit F
> -GLIBC_2.16 pthread_getaffinity_np F
>  GLIBC_2.16 pthread_getattr_np F
>  GLIBC_2.16 pthread_getconcurrency F
>  GLIBC_2.16 pthread_getcpuclockid F
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 05/19] nptl: Move pthread_gettattr_np into libc
  2020-05-19 10:44 ` [PATCH 05/19] nptl: Move pthread_gettattr_np " Florian Weimer via Libc-alpha
@ 2020-05-20 13:57   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 42+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2020-05-20 13:57 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha

On 5/19/20 6:44 AM, Florian Weimer via Libc-alpha wrote:
> This is part of the libpthread removal project:
> 
>     <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>
> 
> Use __getline instead of __getdelim to avoid a localplt failure.
> Likewise for __getrlimit/getrlimit.
> 
> The abilist updates were performed by:
> 
> git ls-files 'sysdeps/unix/sysv/linux/**/libc.abilist' \
>   | while read x ; do
>     echo "GLIBC_2.32 pthread_getattr_np F" >> $x
> done
> python3 scripts/move-symbol-to-libc.py --only-linux pthread_getattr_np
> 
> The private export of __pthread_getaffinity_np is no longer needed, but
> the hidden alias still necessary so that the symbol can be exported with
> versioned_symbol.

This moves pthread_getattr_np and it looks good to me.

OK for master.

Tests are clean on x86_64 and i686.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  nptl/Makefile                                       |  2 +-
>  nptl/Versions                                       |  8 +++++---
>  nptl/libpthread-compat.c                            |  5 +++++
>  nptl/pthread_getattr_np.c                           | 13 ++++++++++---
>  sysdeps/unix/sysv/linux/aarch64/libc.abilist        |  2 ++
>  sysdeps/unix/sysv/linux/aarch64/libpthread.abilist  |  1 -
>  sysdeps/unix/sysv/linux/alpha/libc.abilist          |  2 ++
>  sysdeps/unix/sysv/linux/alpha/libpthread.abilist    |  2 +-
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist         |  2 ++
>  sysdeps/unix/sysv/linux/arm/be/libpthread.abilist   |  1 -
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist         |  2 ++
>  sysdeps/unix/sysv/linux/arm/le/libpthread.abilist   |  1 -
>  sysdeps/unix/sysv/linux/csky/libc.abilist           |  2 ++
>  sysdeps/unix/sysv/linux/csky/libpthread.abilist     |  1 -
>  sysdeps/unix/sysv/linux/hppa/libc.abilist           |  2 ++
>  sysdeps/unix/sysv/linux/hppa/libpthread.abilist     |  2 +-
>  sysdeps/unix/sysv/linux/i386/libc.abilist           |  2 ++
>  sysdeps/unix/sysv/linux/i386/libpthread.abilist     |  2 +-
>  sysdeps/unix/sysv/linux/ia64/libc.abilist           |  2 ++
>  sysdeps/unix/sysv/linux/ia64/libpthread.abilist     |  2 +-
>  sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist  |  2 ++
>  .../sysv/linux/m68k/coldfire/libpthread.abilist     |  1 -
>  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist    |  2 ++
>  .../unix/sysv/linux/m68k/m680x0/libpthread.abilist  |  2 +-
>  sysdeps/unix/sysv/linux/microblaze/be/libc.abilist  |  2 ++
>  .../sysv/linux/microblaze/be/libpthread.abilist     |  1 -
>  sysdeps/unix/sysv/linux/microblaze/le/libc.abilist  |  2 ++
>  .../sysv/linux/microblaze/le/libpthread.abilist     |  1 -
>  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist    |  2 ++
>  .../unix/sysv/linux/mips/mips32/libpthread.abilist  |  2 +-
>  .../unix/sysv/linux/mips/mips32/nofpu/libc.abilist  |  2 ++
>  .../unix/sysv/linux/mips/mips64/libpthread.abilist  |  2 +-
>  .../unix/sysv/linux/mips/mips64/n32/libc.abilist    |  2 ++
>  .../unix/sysv/linux/mips/mips64/n64/libc.abilist    |  2 ++
>  sysdeps/unix/sysv/linux/nios2/libc.abilist          |  2 ++
>  sysdeps/unix/sysv/linux/nios2/libpthread.abilist    |  1 -
>  .../sysv/linux/powerpc/powerpc32/fpu/libc.abilist   |  2 ++
>  .../sysv/linux/powerpc/powerpc32/libpthread.abilist |  2 +-
>  .../sysv/linux/powerpc/powerpc32/nofpu/libc.abilist |  2 ++
>  .../sysv/linux/powerpc/powerpc64/be/libc.abilist    |  2 ++
>  .../linux/powerpc/powerpc64/be/libpthread.abilist   |  1 -
>  .../sysv/linux/powerpc/powerpc64/le/libc.abilist    |  2 ++
>  .../linux/powerpc/powerpc64/le/libpthread.abilist   |  1 -
>  sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist     |  2 ++
>  .../unix/sysv/linux/riscv/rv64/libpthread.abilist   |  1 -
>  sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist   |  2 ++
>  .../unix/sysv/linux/s390/s390-32/libpthread.abilist |  2 +-
>  sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist   |  2 ++
>  .../unix/sysv/linux/s390/s390-64/libpthread.abilist |  2 +-
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist          |  2 ++
>  sysdeps/unix/sysv/linux/sh/be/libpthread.abilist    |  2 +-
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist          |  2 ++
>  sysdeps/unix/sysv/linux/sh/le/libpthread.abilist    |  2 +-
>  sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist  |  2 ++
>  .../sysv/linux/sparc/sparc32/libpthread.abilist     |  2 +-
>  sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist  |  2 ++
>  .../sysv/linux/sparc/sparc64/libpthread.abilist     |  2 +-
>  sysdeps/unix/sysv/linux/x86_64/64/libc.abilist      |  2 ++
>  .../unix/sysv/linux/x86_64/64/libpthread.abilist    |  1 -
>  sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist     |  2 ++
>  .../unix/sysv/linux/x86_64/x32/libpthread.abilist   |  1 -
>  61 files changed, 95 insertions(+), 34 deletions(-)
> 
> diff --git a/nptl/Makefile b/nptl/Makefile
> index 7edad1c0c9..0dd8800f19 100644
> --- a/nptl/Makefile
> +++ b/nptl/Makefile
> @@ -58,6 +58,7 @@ routines = \
>    pthread_condattr_init \
>    pthread_equal \
>    pthread_getaffinity \
> +  pthread_getattr_np \
>    pthread_getschedparam \
>    pthread_self \
>    pthread_setschedparam \
> @@ -89,7 +90,6 @@ libpthread-routines = nptl-init nptlfreeres vars events version pt-interp \
>  		      pthread_attr_getstackaddr pthread_attr_setstackaddr \
>  		      pthread_attr_getstacksize pthread_attr_setstacksize \
>  		      pthread_attr_getstack pthread_attr_setstack \
> -		      pthread_getattr_np \
>  		      pthread_mutex_init pthread_mutex_destroy \
>  		      pthread_mutex_lock pthread_mutex_trylock \
>  		      pthread_mutex_timedlock pthread_mutex_unlock \
> diff --git a/nptl/Versions b/nptl/Versions
> index 637d100a9e..ce08076611 100644
> --- a/nptl/Versions
> +++ b/nptl/Versions
> @@ -21,6 +21,9 @@ libc {
>    GLIBC_2.1 {
>      pthread_attr_init;
>    }
> +  GLIBC_2.2.3 {
> +    pthread_getattr_np;
> +  }

OK.

>    GLIBC_2.3.2 {
>      __register_atfork;
>  
> @@ -43,6 +46,7 @@ libc {
>    GLIBC_2.32 {
>      pthread_attr_setaffinity_np;
>      pthread_getaffinity_np;
> +    pthread_getattr_np;
>      pthread_sigmask;
>    }
>    GLIBC_PRIVATE {
> @@ -55,7 +59,6 @@ libc {
>      # Used by the C11 threads implementation.
>      __pthread_cond_destroy; __pthread_cond_init;
>      __pthread_attr_setaffinity_np;
> -    __pthread_getaffinity_np; # For pthread_getattr_np.
>    }
>  }
>  
> @@ -197,8 +200,7 @@ libpthread {
>    }
>  
>    GLIBC_2.2.3 {
> -    # Extensions.
> -    pthread_getattr_np;
> +    __libpthread_version_placeholder;

OK. Needed for version node.

>    }
>  
>    GLIBC_2.2.6 {
> diff --git a/nptl/libpthread-compat.c b/nptl/libpthread-compat.c
> index 512b4c77c8..ec02b5dccf 100644
> --- a/nptl/libpthread-compat.c
> +++ b/nptl/libpthread-compat.c
> @@ -41,6 +41,11 @@ compat_symbol_unique (libpthread,
>  		      __libpthread_version_placeholder, GLIBC_2_1_2);
>  #endif
>  
> +#if (SHLIB_COMPAT (libpthread, GLIBC_2_2_3, GLIBC_2_2_4))
> +compat_symbol_unique (libpthread,
> +		      __libpthread_version_placeholder, GLIBC_2_2_3);
> +#endif
> +
>  #if (SHLIB_COMPAT (libpthread, GLIBC_2_2_6, GLIBC_2_3))
>  compat_symbol_unique (libpthread,
>  		      __libpthread_version_placeholder, GLIBC_2_2_6);
> diff --git a/nptl/pthread_getattr_np.c b/nptl/pthread_getattr_np.c
> index 644548d862..0e8911346d 100644
> --- a/nptl/pthread_getattr_np.c
> +++ b/nptl/pthread_getattr_np.c
> @@ -30,7 +30,7 @@
>  
>  
>  int
> -pthread_getattr_np (pthread_t thread_id, pthread_attr_t *attr)
> +__pthread_getattr_np (pthread_t thread_id, pthread_attr_t *attr)
>  {
>    struct pthread *thread = (struct pthread *) thread_id;
>    struct pthread_attr *iattr = (struct pthread_attr *) attr;
> @@ -84,7 +84,7 @@ pthread_getattr_np (pthread_t thread_id, pthread_attr_t *attr)
>        /* We need the limit of the stack in any case.  */
>        else
>  	{
> -	  if (getrlimit (RLIMIT_STACK, &rl) != 0)
> +	  if (__getrlimit (RLIMIT_STACK, &rl) != 0)
>  	    ret = errno;
>  	  else
>  	    {
> @@ -115,7 +115,7 @@ pthread_getattr_np (pthread_t thread_id, pthread_attr_t *attr)
>  
>  	      while (! feof_unlocked (fp))
>  		{
> -		  if (__getdelim (&line, &linelen, '\n', fp) <= 0)
> +		  if (__getline (&line, &linelen, fp) <= 0)
>  		    break;
>  
>  		  uintptr_t from;
> @@ -208,3 +208,10 @@ pthread_getattr_np (pthread_t thread_id, pthread_attr_t *attr)
>  
>    return ret;
>  }
> +versioned_symbol (libc, __pthread_getattr_np, pthread_getattr_np, GLIBC_2_32);
> +
> +#if SHLIB_COMPAT (libc, GLIBC_2_2_3, GLIBC_2_32)
> +strong_alias (__pthread_getattr_np, __pthread_getattr_np_alias)
> +compat_symbol (libc, __pthread_getattr_np_alias,
> +	       pthread_getattr_np, GLIBC_2_2_3);
> +#endif
> diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> index 55499b8d3c..6dc59b38b0 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> @@ -1440,6 +1440,7 @@ GLIBC_2.17 pthread_condattr_init F
>  GLIBC_2.17 pthread_equal F
>  GLIBC_2.17 pthread_exit F
>  GLIBC_2.17 pthread_getaffinity_np F
> +GLIBC_2.17 pthread_getattr_np F
>  GLIBC_2.17 pthread_getschedparam F
>  GLIBC_2.17 pthread_mutex_destroy F
>  GLIBC_2.17 pthread_mutex_init F
> @@ -2150,4 +2151,5 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
> index 77cf95c491..c6b4ea2dc1 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libpthread.abilist
> @@ -95,7 +95,6 @@ GLIBC_2.17 pthread_condattr_setpshared F
>  GLIBC_2.17 pthread_create F
>  GLIBC_2.17 pthread_detach F
>  GLIBC_2.17 pthread_exit F
> -GLIBC_2.17 pthread_getattr_np F
>  GLIBC_2.17 pthread_getconcurrency F
>  GLIBC_2.17 pthread_getcpuclockid F
>  GLIBC_2.17 pthread_getname_np F
> diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> index 387b0badaa..fd628bcd28 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> @@ -1969,6 +1969,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
>  GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
>  GLIBC_2.2.3 __rpc_thread_svc_pollfd F
>  GLIBC_2.2.3 fnmatch F
> +GLIBC_2.2.3 pthread_getattr_np F
>  GLIBC_2.2.3 sprofil F
>  GLIBC_2.2.4 dl_iterate_phdr F
>  GLIBC_2.2.4 getgrouplist F
> @@ -2232,6 +2233,7 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
> diff --git a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
> index 8d504c3cdb..390b6384d0 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libpthread.abilist
> @@ -177,7 +177,7 @@ GLIBC_2.2 pthread_yield F
>  GLIBC_2.2 pwrite F
>  GLIBC_2.2 pwrite64 F
>  GLIBC_2.2 sem_timedwait F
> -GLIBC_2.2.3 pthread_getattr_np F
> +GLIBC_2.2.3 __libpthread_version_placeholder F
>  GLIBC_2.2.6 __libpthread_version_placeholder F
>  GLIBC_2.28 call_once F
>  GLIBC_2.28 cnd_broadcast F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index 2775ee0963..d0b1cd24c9 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -135,6 +135,7 @@ GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> @@ -1513,6 +1514,7 @@ GLIBC_2.4 pthread_condattr_init F
>  GLIBC_2.4 pthread_equal F
>  GLIBC_2.4 pthread_exit F
>  GLIBC_2.4 pthread_getaffinity_np F
> +GLIBC_2.4 pthread_getattr_np F
>  GLIBC_2.4 pthread_getschedparam F
>  GLIBC_2.4 pthread_mutex_destroy F
>  GLIBC_2.4 pthread_mutex_init F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
> index c1313fb4bf..b6c26c7a50 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist
> @@ -130,7 +130,6 @@ GLIBC_2.4 pthread_condattr_setpshared F
>  GLIBC_2.4 pthread_create F
>  GLIBC_2.4 pthread_detach F
>  GLIBC_2.4 pthread_exit F
> -GLIBC_2.4 pthread_getattr_np F
>  GLIBC_2.4 pthread_getconcurrency F
>  GLIBC_2.4 pthread_getcpuclockid F
>  GLIBC_2.4 pthread_getspecific F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index 0e233ff542..3dde0ef8bd 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -132,6 +132,7 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
> @@ -1510,6 +1511,7 @@ GLIBC_2.4 pthread_condattr_init F
>  GLIBC_2.4 pthread_equal F
>  GLIBC_2.4 pthread_exit F
>  GLIBC_2.4 pthread_getaffinity_np F
> +GLIBC_2.4 pthread_getattr_np F
>  GLIBC_2.4 pthread_getschedparam F
>  GLIBC_2.4 pthread_mutex_destroy F
>  GLIBC_2.4 pthread_mutex_init F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
> index c1313fb4bf..b6c26c7a50 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist
> @@ -130,7 +130,6 @@ GLIBC_2.4 pthread_condattr_setpshared F
>  GLIBC_2.4 pthread_create F
>  GLIBC_2.4 pthread_detach F
>  GLIBC_2.4 pthread_exit F
> -GLIBC_2.4 pthread_getattr_np F
>  GLIBC_2.4 pthread_getconcurrency F
>  GLIBC_2.4 pthread_getcpuclockid F
>  GLIBC_2.4 pthread_getspecific F
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index dbef2ad653..4db9bbd971 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -1428,6 +1428,7 @@ GLIBC_2.29 pthread_condattr_init F
>  GLIBC_2.29 pthread_equal F
>  GLIBC_2.29 pthread_exit F
>  GLIBC_2.29 pthread_getaffinity_np F
> +GLIBC_2.29 pthread_getattr_np F
>  GLIBC_2.29 pthread_getschedparam F
>  GLIBC_2.29 pthread_mutex_destroy F
>  GLIBC_2.29 pthread_mutex_init F
> @@ -2094,4 +2095,5 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/csky/libpthread.abilist b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
> index bcdea792ec..6ce59276a7 100644
> --- a/sysdeps/unix/sysv/linux/csky/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libpthread.abilist
> @@ -104,7 +104,6 @@ GLIBC_2.29 pthread_create F
>  GLIBC_2.29 pthread_detach F
>  GLIBC_2.29 pthread_exit F
>  GLIBC_2.29 pthread_getattr_default_np F
> -GLIBC_2.29 pthread_getattr_np F
>  GLIBC_2.29 pthread_getconcurrency F
>  GLIBC_2.29 pthread_getcpuclockid F
>  GLIBC_2.29 pthread_getname_np F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index 4405dbfe63..52aa86b191 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -1829,6 +1829,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
>  GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
>  GLIBC_2.2.3 __rpc_thread_svc_pollfd F
>  GLIBC_2.2.3 fnmatch F
> +GLIBC_2.2.3 pthread_getattr_np F
>  GLIBC_2.2.3 sprofil F
>  GLIBC_2.2.4 dl_iterate_phdr F
>  GLIBC_2.2.4 getgrouplist F
> @@ -2053,6 +2054,7 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
> index a12e0308b0..cabc5af858 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist
> @@ -169,7 +169,7 @@ GLIBC_2.2 sigwait F
>  GLIBC_2.2 system F
>  GLIBC_2.2 tcdrain F
>  GLIBC_2.2 write F
> -GLIBC_2.2.3 pthread_getattr_np F
> +GLIBC_2.2.3 __libpthread_version_placeholder F
>  GLIBC_2.2.6 __libpthread_version_placeholder F
>  GLIBC_2.28 call_once F
>  GLIBC_2.28 cnd_broadcast F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index de447796e7..48ee395a64 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -1982,6 +1982,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
>  GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
>  GLIBC_2.2.3 __rpc_thread_svc_pollfd F
>  GLIBC_2.2.3 fnmatch F
> +GLIBC_2.2.3 pthread_getattr_np F
>  GLIBC_2.2.3 sprofil F
>  GLIBC_2.2.4 dl_iterate_phdr F
>  GLIBC_2.2.4 getgrouplist F
> @@ -2219,6 +2220,7 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
> index f84feaca66..18177307c8 100644
> --- a/sysdeps/unix/sysv/linux/i386/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libpthread.abilist
> @@ -177,7 +177,7 @@ GLIBC_2.2 pthread_yield F
>  GLIBC_2.2 pwrite F
>  GLIBC_2.2 pwrite64 F
>  GLIBC_2.2 sem_timedwait F
> -GLIBC_2.2.3 pthread_getattr_np F
> +GLIBC_2.2.3 __libpthread_version_placeholder F
>  GLIBC_2.2.6 __libpthread_version_placeholder F
>  GLIBC_2.28 call_once F
>  GLIBC_2.28 cnd_broadcast F
> diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> index df3da1bea3..34458f348f 100644
> --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> @@ -1851,6 +1851,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
>  GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
>  GLIBC_2.2.3 __rpc_thread_svc_pollfd F
>  GLIBC_2.2.3 fnmatch F
> +GLIBC_2.2.3 pthread_getattr_np F
>  GLIBC_2.2.3 sprofil F
>  GLIBC_2.2.4 dl_iterate_phdr F
>  GLIBC_2.2.4 getgrouplist F
> @@ -2085,6 +2086,7 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
> index 927afe3bd5..335f486cb5 100644
> --- a/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/libpthread.abilist
> @@ -169,7 +169,7 @@ GLIBC_2.2 sigwait F
>  GLIBC_2.2 system F
>  GLIBC_2.2 tcdrain F
>  GLIBC_2.2 write F
> -GLIBC_2.2.3 pthread_getattr_np F
> +GLIBC_2.2.3 __libpthread_version_placeholder F
>  GLIBC_2.2.6 __libpthread_version_placeholder F
>  GLIBC_2.28 call_once F
>  GLIBC_2.28 cnd_broadcast F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index deb56b3dfc..377326b12c 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -136,6 +136,7 @@ GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _Exit F
>  GLIBC_2.4 _IO_2_1_stderr_ D 0x98
> @@ -1493,6 +1494,7 @@ GLIBC_2.4 pthread_condattr_init F
>  GLIBC_2.4 pthread_equal F
>  GLIBC_2.4 pthread_exit F
>  GLIBC_2.4 pthread_getaffinity_np F
> +GLIBC_2.4 pthread_getattr_np F
>  GLIBC_2.4 pthread_getschedparam F
>  GLIBC_2.4 pthread_mutex_destroy F
>  GLIBC_2.4 pthread_mutex_init F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
> index c1313fb4bf..b6c26c7a50 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist
> @@ -130,7 +130,6 @@ GLIBC_2.4 pthread_condattr_setpshared F
>  GLIBC_2.4 pthread_create F
>  GLIBC_2.4 pthread_detach F
>  GLIBC_2.4 pthread_exit F
> -GLIBC_2.4 pthread_getattr_np F
>  GLIBC_2.4 pthread_getconcurrency F
>  GLIBC_2.4 pthread_getcpuclockid F
>  GLIBC_2.4 pthread_getspecific F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index 96d8a1a101..81eea10680 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -1938,6 +1938,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
>  GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
>  GLIBC_2.2.3 __rpc_thread_svc_pollfd F
>  GLIBC_2.2.3 fnmatch F
> +GLIBC_2.2.3 pthread_getattr_np F
>  GLIBC_2.2.3 sprofil F
>  GLIBC_2.2.4 dl_iterate_phdr F
>  GLIBC_2.2.4 getgrouplist F
> @@ -2165,6 +2166,7 @@ GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
> index f84feaca66..18177307c8 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist
> @@ -177,7 +177,7 @@ GLIBC_2.2 pthread_yield F
>  GLIBC_2.2 pwrite F
>  GLIBC_2.2 pwrite64 F
>  GLIBC_2.2 sem_timedwait F
> -GLIBC_2.2.3 pthread_getattr_np F
> +GLIBC_2.2.3 __libpthread_version_placeholder F
>  GLIBC_2.2.6 __libpthread_version_placeholder F
>  GLIBC_2.28 call_once F
>  GLIBC_2.28 cnd_broadcast F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index 134db9a3f8..ff75663747 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -1443,6 +1443,7 @@ GLIBC_2.18 pthread_condattr_init F
>  GLIBC_2.18 pthread_equal F
>  GLIBC_2.18 pthread_exit F
>  GLIBC_2.18 pthread_getaffinity_np F
> +GLIBC_2.18 pthread_getattr_np F
>  GLIBC_2.18 pthread_getschedparam F
>  GLIBC_2.18 pthread_mutex_destroy F
>  GLIBC_2.18 pthread_mutex_init F
> @@ -2145,4 +2146,5 @@ GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
> index 1af46cb44e..60397187b6 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist
> @@ -96,7 +96,6 @@ GLIBC_2.18 pthread_create F
>  GLIBC_2.18 pthread_detach F
>  GLIBC_2.18 pthread_exit F
>  GLIBC_2.18 pthread_getattr_default_np F
> -GLIBC_2.18 pthread_getattr_np F
>  GLIBC_2.18 pthread_getconcurrency F
>  GLIBC_2.18 pthread_getcpuclockid F
>  GLIBC_2.18 pthread_getname_np F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index aa5be2136d..e9a6375dfc 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -1443,6 +1443,7 @@ GLIBC_2.18 pthread_condattr_init F
>  GLIBC_2.18 pthread_equal F
>  GLIBC_2.18 pthread_exit F
>  GLIBC_2.18 pthread_getaffinity_np F
> +GLIBC_2.18 pthread_getattr_np F
>  GLIBC_2.18 pthread_getschedparam F
>  GLIBC_2.18 pthread_mutex_destroy F
>  GLIBC_2.18 pthread_mutex_init F
> @@ -2142,4 +2143,5 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
> index 1af46cb44e..60397187b6 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist
> @@ -96,7 +96,6 @@ GLIBC_2.18 pthread_create F
>  GLIBC_2.18 pthread_detach F
>  GLIBC_2.18 pthread_exit F
>  GLIBC_2.18 pthread_getattr_default_np F
> -GLIBC_2.18 pthread_getattr_np F
>  GLIBC_2.18 pthread_getconcurrency F
>  GLIBC_2.18 pthread_getcpuclockid F
>  GLIBC_2.18 pthread_getname_np F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index 8f76103289..598fc488c7 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -1916,6 +1916,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
>  GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
>  GLIBC_2.2.3 __rpc_thread_svc_pollfd F
>  GLIBC_2.2.3 fnmatch F
> +GLIBC_2.2.3 pthread_getattr_np F
>  GLIBC_2.2.3 sprofil F
>  GLIBC_2.2.4 dl_iterate_phdr F
>  GLIBC_2.2.4 getgrouplist F
> @@ -2136,6 +2137,7 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
> index 14009d87e9..b35d7f19ca 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist
> @@ -176,7 +176,7 @@ GLIBC_2.2 sem_timedwait F
>  GLIBC_2.2 sem_trywait F
>  GLIBC_2.2 sem_unlink F
>  GLIBC_2.2 sem_wait F
> -GLIBC_2.2.3 pthread_getattr_np F
> +GLIBC_2.2.3 __libpthread_version_placeholder F
>  GLIBC_2.2.6 __libpthread_version_placeholder F
>  GLIBC_2.28 call_once F
>  GLIBC_2.28 cnd_broadcast F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index ec6d5478e2..77e8d6b155 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -1914,6 +1914,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
>  GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
>  GLIBC_2.2.3 __rpc_thread_svc_pollfd F
>  GLIBC_2.2.3 fnmatch F
> +GLIBC_2.2.3 pthread_getattr_np F
>  GLIBC_2.2.3 sprofil F
>  GLIBC_2.2.4 dl_iterate_phdr F
>  GLIBC_2.2.4 getgrouplist F
> @@ -2134,6 +2135,7 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
> index 14009d87e9..b35d7f19ca 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist
> @@ -176,7 +176,7 @@ GLIBC_2.2 sem_timedwait F
>  GLIBC_2.2 sem_trywait F
>  GLIBC_2.2 sem_unlink F
>  GLIBC_2.2 sem_wait F
> -GLIBC_2.2.3 pthread_getattr_np F
> +GLIBC_2.2.3 __libpthread_version_placeholder F
>  GLIBC_2.2.6 __libpthread_version_placeholder F
>  GLIBC_2.28 call_once F
>  GLIBC_2.28 cnd_broadcast F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index 4f473ef639..a3aad2487f 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -1912,6 +1912,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
>  GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
>  GLIBC_2.2.3 __rpc_thread_svc_pollfd F
>  GLIBC_2.2.3 fnmatch F
> +GLIBC_2.2.3 pthread_getattr_np F
>  GLIBC_2.2.3 sprofil F
>  GLIBC_2.2.4 dl_iterate_phdr F
>  GLIBC_2.2.4 getgrouplist F
> @@ -2142,6 +2143,7 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> index 81a7044545..c074f612f5 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> @@ -1908,6 +1908,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
>  GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
>  GLIBC_2.2.3 __rpc_thread_svc_pollfd F
>  GLIBC_2.2.3 fnmatch F
> +GLIBC_2.2.3 pthread_getattr_np F
>  GLIBC_2.2.3 sprofil F
>  GLIBC_2.2.4 dl_iterate_phdr F
>  GLIBC_2.2.4 getgrouplist F
> @@ -2136,6 +2137,7 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> index 7ba8a9a002..d1c638acb9 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> @@ -1485,6 +1485,7 @@ GLIBC_2.21 pthread_condattr_init F
>  GLIBC_2.21 pthread_equal F
>  GLIBC_2.21 pthread_exit F
>  GLIBC_2.21 pthread_getaffinity_np F
> +GLIBC_2.21 pthread_getattr_np F
>  GLIBC_2.21 pthread_getschedparam F
>  GLIBC_2.21 pthread_mutex_destroy F
>  GLIBC_2.21 pthread_mutex_init F
> @@ -2183,4 +2184,5 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
> index 0c1fa0baca..924ad6e451 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist
> @@ -96,7 +96,6 @@ GLIBC_2.21 pthread_create F
>  GLIBC_2.21 pthread_detach F
>  GLIBC_2.21 pthread_exit F
>  GLIBC_2.21 pthread_getattr_default_np F
> -GLIBC_2.21 pthread_getattr_np F
>  GLIBC_2.21 pthread_getconcurrency F
>  GLIBC_2.21 pthread_getcpuclockid F
>  GLIBC_2.21 pthread_getname_np F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index 6483f68273..bfc8185b0e 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -1942,6 +1942,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
>  GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
>  GLIBC_2.2.3 __rpc_thread_svc_pollfd F
>  GLIBC_2.2.3 fnmatch F
> +GLIBC_2.2.3 pthread_getattr_np F
>  GLIBC_2.2.3 sprofil F
>  GLIBC_2.2.4 dl_iterate_phdr F
>  GLIBC_2.2.4 getgrouplist F
> @@ -2192,6 +2193,7 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
> index 4307193cb2..13b41dafb6 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist
> @@ -177,7 +177,7 @@ GLIBC_2.2 pthread_yield F
>  GLIBC_2.2 pwrite F
>  GLIBC_2.2 pwrite64 F
>  GLIBC_2.2 sem_timedwait F
> -GLIBC_2.2.3 pthread_getattr_np F
> +GLIBC_2.2.3 __libpthread_version_placeholder F
>  GLIBC_2.2.6 __libpthread_version_placeholder F
>  GLIBC_2.28 call_once F
>  GLIBC_2.28 cnd_broadcast F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> index 405a39cbd0..9a889f1bc6 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> @@ -1946,6 +1946,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
>  GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
>  GLIBC_2.2.3 __rpc_thread_svc_pollfd F
>  GLIBC_2.2.3 fnmatch F
> +GLIBC_2.2.3 pthread_getattr_np F
>  GLIBC_2.2.3 sprofil F
>  GLIBC_2.2.4 dl_iterate_phdr F
>  GLIBC_2.2.4 getgrouplist F
> @@ -2225,6 +2226,7 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> index b1286be61e..b69f4b126f 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> @@ -1371,6 +1371,7 @@ GLIBC_2.3 pthread_condattr_destroy F
>  GLIBC_2.3 pthread_condattr_init F
>  GLIBC_2.3 pthread_equal F
>  GLIBC_2.3 pthread_exit F
> +GLIBC_2.3 pthread_getattr_np F
>  GLIBC_2.3 pthread_getschedparam F
>  GLIBC_2.3 pthread_mutex_destroy F
>  GLIBC_2.3 pthread_mutex_init F
> @@ -2055,6 +2056,7 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
> index 41a9f178a2..e9477a3584 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist
> @@ -114,7 +114,6 @@ GLIBC_2.3 pthread_condattr_setpshared F
>  GLIBC_2.3 pthread_create F
>  GLIBC_2.3 pthread_detach F
>  GLIBC_2.3 pthread_exit F
> -GLIBC_2.3 pthread_getattr_np F
>  GLIBC_2.3 pthread_getconcurrency F
>  GLIBC_2.3 pthread_getcpuclockid F
>  GLIBC_2.3 pthread_getspecific F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> index c9016bfc8a..a07753847d 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> @@ -1529,6 +1529,7 @@ GLIBC_2.17 pthread_condattr_init F
>  GLIBC_2.17 pthread_equal F
>  GLIBC_2.17 pthread_exit F
>  GLIBC_2.17 pthread_getaffinity_np F
> +GLIBC_2.17 pthread_getattr_np F
>  GLIBC_2.17 pthread_getschedparam F
>  GLIBC_2.17 pthread_mutex_destroy F
>  GLIBC_2.17 pthread_mutex_init F
> @@ -2345,4 +2346,5 @@ GLIBC_2.32 __wprintfieee128 F
>  GLIBC_2.32 __wscanfieee128 F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
> index 77cf95c491..c6b4ea2dc1 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist
> @@ -95,7 +95,6 @@ GLIBC_2.17 pthread_condattr_setpshared F
>  GLIBC_2.17 pthread_create F
>  GLIBC_2.17 pthread_detach F
>  GLIBC_2.17 pthread_exit F
> -GLIBC_2.17 pthread_getattr_np F
>  GLIBC_2.17 pthread_getconcurrency F
>  GLIBC_2.17 pthread_getcpuclockid F
>  GLIBC_2.17 pthread_getname_np F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> index 029c60d5d8..6d5a52dc1a 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> @@ -1431,6 +1431,7 @@ GLIBC_2.27 pthread_condattr_init F
>  GLIBC_2.27 pthread_equal F
>  GLIBC_2.27 pthread_exit F
>  GLIBC_2.27 pthread_getaffinity_np F
> +GLIBC_2.27 pthread_getattr_np F
>  GLIBC_2.27 pthread_getschedparam F
>  GLIBC_2.27 pthread_mutex_destroy F
>  GLIBC_2.27 pthread_mutex_init F
> @@ -2112,4 +2113,5 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
> index 41a796e225..894c474fcb 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist
> @@ -93,7 +93,6 @@ GLIBC_2.27 pthread_create F
>  GLIBC_2.27 pthread_detach F
>  GLIBC_2.27 pthread_exit F
>  GLIBC_2.27 pthread_getattr_default_np F
> -GLIBC_2.27 pthread_getattr_np F
>  GLIBC_2.27 pthread_getconcurrency F
>  GLIBC_2.27 pthread_getcpuclockid F
>  GLIBC_2.27 pthread_getname_np F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index b75ce88958..ae3849d3f6 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -1941,6 +1941,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
>  GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
>  GLIBC_2.2.3 __rpc_thread_svc_pollfd F
>  GLIBC_2.2.3 fnmatch F
> +GLIBC_2.2.3 pthread_getattr_np F
>  GLIBC_2.2.3 sprofil F
>  GLIBC_2.2.4 dl_iterate_phdr F
>  GLIBC_2.2.4 getgrouplist F
> @@ -2190,6 +2191,7 @@ GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
> index 1471cf4d13..0a60f1cca2 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist
> @@ -179,7 +179,7 @@ GLIBC_2.2 pthread_yield F
>  GLIBC_2.2 pwrite F
>  GLIBC_2.2 pwrite64 F
>  GLIBC_2.2 sem_timedwait F
> -GLIBC_2.2.3 pthread_getattr_np F
> +GLIBC_2.2.3 __libpthread_version_placeholder F
>  GLIBC_2.2.6 __libpthread_version_placeholder F
>  GLIBC_2.28 call_once F
>  GLIBC_2.28 cnd_broadcast F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> index 70571678c6..2eb931c02c 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> @@ -1847,6 +1847,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
>  GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
>  GLIBC_2.2.3 __rpc_thread_svc_pollfd F
>  GLIBC_2.2.3 fnmatch F
> +GLIBC_2.2.3 pthread_getattr_np F
>  GLIBC_2.2.3 sprofil F
>  GLIBC_2.2.4 dl_iterate_phdr F
>  GLIBC_2.2.4 getgrouplist F
> @@ -2091,6 +2092,7 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
> index 8d0b90477a..0e99688824 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist
> @@ -171,7 +171,7 @@ GLIBC_2.2 sigwait F
>  GLIBC_2.2 system F
>  GLIBC_2.2 tcdrain F
>  GLIBC_2.2 write F
> -GLIBC_2.2.3 pthread_getattr_np F
> +GLIBC_2.2.3 __libpthread_version_placeholder F
>  GLIBC_2.2.6 __libpthread_version_placeholder F
>  GLIBC_2.28 call_once F
>  GLIBC_2.28 cnd_broadcast F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index de14989270..ce4f366fbb 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -1833,6 +1833,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
>  GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
>  GLIBC_2.2.3 __rpc_thread_svc_pollfd F
>  GLIBC_2.2.3 fnmatch F
> +GLIBC_2.2.3 pthread_getattr_np F
>  GLIBC_2.2.3 sprofil F
>  GLIBC_2.2.4 dl_iterate_phdr F
>  GLIBC_2.2.4 getgrouplist F
> @@ -2060,6 +2061,7 @@ GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
> index a12e0308b0..cabc5af858 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist
> @@ -169,7 +169,7 @@ GLIBC_2.2 sigwait F
>  GLIBC_2.2 system F
>  GLIBC_2.2 tcdrain F
>  GLIBC_2.2 write F
> -GLIBC_2.2.3 pthread_getattr_np F
> +GLIBC_2.2.3 __libpthread_version_placeholder F
>  GLIBC_2.2.6 __libpthread_version_placeholder F
>  GLIBC_2.28 call_once F
>  GLIBC_2.28 cnd_broadcast F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index e181c5c936..f37a08ab09 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -1833,6 +1833,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
>  GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
>  GLIBC_2.2.3 __rpc_thread_svc_pollfd F
>  GLIBC_2.2.3 fnmatch F
> +GLIBC_2.2.3 pthread_getattr_np F
>  GLIBC_2.2.3 sprofil F
>  GLIBC_2.2.4 dl_iterate_phdr F
>  GLIBC_2.2.4 getgrouplist F
> @@ -2057,6 +2058,7 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
> index a12e0308b0..cabc5af858 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist
> @@ -169,7 +169,7 @@ GLIBC_2.2 sigwait F
>  GLIBC_2.2 system F
>  GLIBC_2.2 tcdrain F
>  GLIBC_2.2 write F
> -GLIBC_2.2.3 pthread_getattr_np F
> +GLIBC_2.2.3 __libpthread_version_placeholder F
>  GLIBC_2.2.6 __libpthread_version_placeholder F
>  GLIBC_2.28 call_once F
>  GLIBC_2.28 cnd_broadcast F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index 670ed9b896..af3a5e2618 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -1935,6 +1935,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
>  GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
>  GLIBC_2.2.3 __rpc_thread_svc_pollfd F
>  GLIBC_2.2.3 fnmatch F
> +GLIBC_2.2.3 pthread_getattr_np F
>  GLIBC_2.2.3 sprofil F
>  GLIBC_2.2.4 dl_iterate_phdr F
>  GLIBC_2.2.4 getgrouplist F
> @@ -2181,6 +2182,7 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 _IO_fprintf F
>  GLIBC_2.4 _IO_printf F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
> index 8d504c3cdb..390b6384d0 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist
> @@ -177,7 +177,7 @@ GLIBC_2.2 pthread_yield F
>  GLIBC_2.2 pwrite F
>  GLIBC_2.2 pwrite64 F
>  GLIBC_2.2 sem_timedwait F
> -GLIBC_2.2.3 pthread_getattr_np F
> +GLIBC_2.2.3 __libpthread_version_placeholder F
>  GLIBC_2.2.6 __libpthread_version_placeholder F
>  GLIBC_2.28 call_once F
>  GLIBC_2.28 cnd_broadcast F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> index a7980633b3..1fccc06f21 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> @@ -1877,6 +1877,7 @@ GLIBC_2.2.3 __rpc_thread_svc_fdset F
>  GLIBC_2.2.3 __rpc_thread_svc_max_pollfd F
>  GLIBC_2.2.3 __rpc_thread_svc_pollfd F
>  GLIBC_2.2.3 fnmatch F
> +GLIBC_2.2.3 pthread_getattr_np F
>  GLIBC_2.2.3 sprofil F
>  GLIBC_2.2.4 dl_iterate_phdr F
>  GLIBC_2.2.4 getgrouplist F
> @@ -2108,6 +2109,7 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
> index 927afe3bd5..335f486cb5 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist
> @@ -169,7 +169,7 @@ GLIBC_2.2 sigwait F
>  GLIBC_2.2 system F
>  GLIBC_2.2 tcdrain F
>  GLIBC_2.2 write F
> -GLIBC_2.2.3 pthread_getattr_np F
> +GLIBC_2.2.3 __libpthread_version_placeholder F
>  GLIBC_2.2.6 __libpthread_version_placeholder F
>  GLIBC_2.28 call_once F
>  GLIBC_2.28 cnd_broadcast F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> index 766bfb7be3..03af18babb 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> @@ -1279,6 +1279,7 @@ GLIBC_2.2.5 pthread_condattr_destroy F
>  GLIBC_2.2.5 pthread_condattr_init F
>  GLIBC_2.2.5 pthread_equal F
>  GLIBC_2.2.5 pthread_exit F
> +GLIBC_2.2.5 pthread_getattr_np F
>  GLIBC_2.2.5 pthread_getschedparam F
>  GLIBC_2.2.5 pthread_mutex_destroy F
>  GLIBC_2.2.5 pthread_mutex_init F
> @@ -2066,6 +2067,7 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
>  GLIBC_2.4 __confstr_chk F
>  GLIBC_2.4 __fgets_chk F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
> index 1b07b47739..971269d2ef 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist
> @@ -94,7 +94,6 @@ GLIBC_2.2.5 pthread_condattr_setpshared F
>  GLIBC_2.2.5 pthread_create F
>  GLIBC_2.2.5 pthread_detach F
>  GLIBC_2.2.5 pthread_exit F
> -GLIBC_2.2.5 pthread_getattr_np F
>  GLIBC_2.2.5 pthread_getconcurrency F
>  GLIBC_2.2.5 pthread_getcpuclockid F
>  GLIBC_2.2.5 pthread_getspecific F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> index 075f8870a1..2da0af70d4 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> @@ -1448,6 +1448,7 @@ GLIBC_2.16 pthread_condattr_init F
>  GLIBC_2.16 pthread_equal F
>  GLIBC_2.16 pthread_exit F
>  GLIBC_2.16 pthread_getaffinity_np F
> +GLIBC_2.16 pthread_getattr_np F
>  GLIBC_2.16 pthread_getschedparam F
>  GLIBC_2.16 pthread_mutex_destroy F
>  GLIBC_2.16 pthread_mutex_init F
> @@ -2163,4 +2164,5 @@ GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
>  GLIBC_2.32 pthread_getaffinity_np F
> +GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
> index 6ff1703de1..b9bf4324a9 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist
> @@ -95,7 +95,6 @@ GLIBC_2.16 pthread_condattr_setpshared F
>  GLIBC_2.16 pthread_create F
>  GLIBC_2.16 pthread_detach F
>  GLIBC_2.16 pthread_exit F
> -GLIBC_2.16 pthread_getattr_np F
>  GLIBC_2.16 pthread_getconcurrency F
>  GLIBC_2.16 pthread_getcpuclockid F
>  GLIBC_2.16 pthread_getname_np F
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 06/19] nptl: Make __pthread_attr_init, __pthread_attr_destroy available internally
  2020-05-19 10:44 ` [PATCH 06/19] nptl: Make __pthread_attr_init, __pthread_attr_destroy available internally Florian Weimer via Libc-alpha
@ 2020-05-20 13:59   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 42+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2020-05-20 13:59 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha

On 5/19/20 6:44 AM, Florian Weimer via Libc-alpha wrote:
> pthread_attr_destroy needs to be a weak alias to avoid future
> linknamespace failures.

Agreed.

> ---
>  nptl/Versions               | 1 +
>  nptl/pthreadP.h             | 4 +++-
>  nptl/pthread_attr_destroy.c | 3 ++-
>  nptl/pthread_attr_init.c    | 5 +++--
>  4 files changed, 9 insertions(+), 4 deletions(-)
> 

OK for master.

Tested clean on x86_64 and i686.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> diff --git a/nptl/Versions b/nptl/Versions
> index ce08076611..65f0c077da 100644
> --- a/nptl/Versions
> +++ b/nptl/Versions
> @@ -59,6 +59,7 @@ libc {
>      # Used by the C11 threads implementation.
>      __pthread_cond_destroy; __pthread_cond_init;
>      __pthread_attr_setaffinity_np;
> +    __pthread_attr_init; __pthread_attr_destroy;

OK.

>    }
>  }
>  
> diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
> index ac0135422b..f218b01574 100644
> --- a/nptl/pthreadP.h
> +++ b/nptl/pthreadP.h
> @@ -347,7 +347,8 @@ extern int __pthread_create_2_1 (pthread_t *newthread,
>  extern int __pthread_create_2_0 (pthread_t *newthread,
>  				 const pthread_attr_t *attr,
>  				 void *(*start_routine) (void *), void *arg);
> -extern int __pthread_attr_init_2_1 (pthread_attr_t *attr);
> +extern int __pthread_attr_init (pthread_attr_t *attr);
> +libc_hidden_proto (__pthread_attr_init)
>  extern int __pthread_attr_init_2_0 (pthread_attr_t *attr);
>  
>  
> @@ -403,6 +404,7 @@ extern int __pthread_mutexattr_init (pthread_mutexattr_t *attr);
>  extern int __pthread_mutexattr_destroy (pthread_mutexattr_t *attr);
>  extern int __pthread_mutexattr_settype (pthread_mutexattr_t *attr, int kind);
>  extern int __pthread_attr_destroy (pthread_attr_t *attr);
> +libc_hidden_proto (__pthread_attr_destroy)
>  extern int __pthread_attr_getdetachstate (const pthread_attr_t *attr,
>  					  int *detachstate);
>  extern int __pthread_attr_setdetachstate (pthread_attr_t *attr,
> diff --git a/nptl/pthread_attr_destroy.c b/nptl/pthread_attr_destroy.c
> index d20f209377..21f8026a2c 100644
> --- a/nptl/pthread_attr_destroy.c
> +++ b/nptl/pthread_attr_destroy.c
> @@ -39,4 +39,5 @@ __pthread_attr_destroy (pthread_attr_t *attr)
>  
>    return 0;
>  }
> -strong_alias (__pthread_attr_destroy, pthread_attr_destroy)
> +libc_hidden_def (__pthread_attr_destroy)
> +weak_alias (__pthread_attr_destroy, pthread_attr_destroy)

OK.

> diff --git a/nptl/pthread_attr_init.c b/nptl/pthread_attr_init.c
> index f15cccab0a..acc22c64c4 100644
> --- a/nptl/pthread_attr_init.c
> +++ b/nptl/pthread_attr_init.c
> @@ -29,7 +29,7 @@ int __attr_list_lock = LLL_LOCK_INITIALIZER;
>  
>  
>  int
> -__pthread_attr_init_2_1 (pthread_attr_t *attr)
> +__pthread_attr_init (pthread_attr_t *attr)
>  {
>    struct pthread_attr *iattr;
>  
> @@ -48,7 +48,8 @@ __pthread_attr_init_2_1 (pthread_attr_t *attr)
>  
>    return 0;
>  }
> -versioned_symbol (libc, __pthread_attr_init_2_1, pthread_attr_init, GLIBC_2_1);
> +libc_hidden_def (__pthread_attr_init)
> +versioned_symbol (libc, __pthread_attr_init, pthread_attr_init, GLIBC_2_1);
>  
>  
>  #if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_1)
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 07/19] nptl: Add __pthread_attr_copy for copying pthread_attr_t objects
  2020-05-19 10:44 ` [PATCH 07/19] nptl: Add __pthread_attr_copy for copying pthread_attr_t objects Florian Weimer via Libc-alpha
@ 2020-05-20 14:10   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 42+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2020-05-20 14:10 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha

On 5/19/20 6:44 AM, Florian Weimer via Libc-alpha wrote:
> Also add the private type union pthread_attr_transparent, to reduce
> the amount of casting that is required.

OK for master.

Tested clean on x86_64 and i686.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  nptl/Makefile                |  1 +
>  nptl/Versions                |  1 +
>  nptl/pthreadP.h              |  6 ++++
>  nptl/pthread_attr_copy.c     | 57 ++++++++++++++++++++++++++++++++++++
>  sysdeps/nptl/internaltypes.h |  7 +++++
>  5 files changed, 72 insertions(+)
>  create mode 100644 nptl/pthread_attr_copy.c
> 
> diff --git a/nptl/Makefile b/nptl/Makefile
> index 0dd8800f19..b4aaad0f20 100644
> --- a/nptl/Makefile
> +++ b/nptl/Makefile
> @@ -39,6 +39,7 @@ routines = \
>    old_pthread_cond_destroy \
>    old_pthread_cond_init \
>    pthread_atfork \
> +  pthread_attr_copy \

OK

>    pthread_attr_destroy \
>    pthread_attr_getdetachstate \
>    pthread_attr_getinheritsched \
> diff --git a/nptl/Versions b/nptl/Versions
> index 65f0c077da..4c7b43354d 100644
> --- a/nptl/Versions
> +++ b/nptl/Versions
> @@ -60,6 +60,7 @@ libc {
>      __pthread_cond_destroy; __pthread_cond_init;
>      __pthread_attr_setaffinity_np;
>      __pthread_attr_init; __pthread_attr_destroy;
> +    __pthread_attr_copy;

OK.

>    }
>  }
>  
> diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
> index f218b01574..41b693d034 100644
> --- a/nptl/pthreadP.h
> +++ b/nptl/pthreadP.h
> @@ -580,6 +580,12 @@ extern void __wait_lookup_done (void) attribute_hidden;
>  # define PTHREAD_STATIC_FN_REQUIRE(name) __asm (".globl " #name);
>  #endif
>  
> +/* Make a deep copy of the attribute *SOURCE in *TARGET.  *TARGET is
> +   not assumed to have been initialized.  Returns 0 on success, or a
> +   positive error code otherwise.  */
> +int __pthread_attr_copy (pthread_attr_t *target, const pthread_attr_t *source);
> +libc_hidden_proto (__pthread_attr_copy)

OK.

> +
>  /* Returns 0 if POL is a valid scheduling policy.  */
>  static inline int
>  check_sched_policy_attr (int pol)
> diff --git a/nptl/pthread_attr_copy.c b/nptl/pthread_attr_copy.c
> new file mode 100644
> index 0000000000..77a1a43eeb
> --- /dev/null
> +++ b/nptl/pthread_attr_copy.c
> @@ -0,0 +1,57 @@
> +/* Deep copy of a pthread_attr_t object.
> +   Copyright (C) 2020 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <errno.h>
> +#include <pthreadP.h>
> +#include <stdlib.h>
> +
> +int
> +__pthread_attr_copy (pthread_attr_t *target, const pthread_attr_t *source)
> +{
> +  /* Avoid overwriting *TARGET until all allocations have
> +     succeeded.  */
> +  union pthread_attr_transparent temp;
> +  temp.external = *source;
> +
> +  /* Force new allocation.  This function has full ownership of temp.  */
> +  temp.internal.cpuset = NULL;
> +  temp.internal.cpusetsize = 0;
> +
> +  int ret = 0;
> +
> +  struct pthread_attr *isource = (struct pthread_attr *) source;
> +
> +  /* Propagate affinity mask information.  */
> +  if (isource->cpusetsize > 0)
> +    ret = __pthread_attr_setaffinity_np (&temp.external,
> +                                         isource->cpusetsize,
> +                                         isource->cpuset);
> +
> +  if (ret != 0)
> +    {
> +      /* Deallocate because we have ownership.  */
> +      __pthread_attr_destroy (&temp.external);
> +      return ret;
> +    }
> +
> +  /* Transfer ownership.  *target is not assumed to have been
> +     initialized.  */

OK. At this point we copy pointers and we no longer own the memory
that was allocated at the extension pointer.

> +  *target = temp.external;
> +  return 0;
> +}
> +libc_hidden_def (__pthread_attr_copy)
> diff --git a/sysdeps/nptl/internaltypes.h b/sysdeps/nptl/internaltypes.h
> index 71f09b4624..6d06a76baf 100644
> --- a/sysdeps/nptl/internaltypes.h
> +++ b/sysdeps/nptl/internaltypes.h
> @@ -49,6 +49,13 @@ struct pthread_attr
>  #define ATTR_FLAG_SCHED_SET		0x0020
>  #define ATTR_FLAG_POLICY_SET		0x0040
>  
> +/* Used to allocate a pthread_attr_t object which is also accessed
> +   internally.  */
> +union pthread_attr_transparent
> +{
> +  pthread_attr_t external;
> +  struct pthread_attr internal;
> +};

OK.

>  
>  /* Mutex attribute data structure.  */
>  struct pthread_mutexattr
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 08/19] nptl: Use __pthread_attr_copy in pthread_getattr_default_np (bug 25999)
  2020-05-19 10:44 ` [PATCH 08/19] nptl: Use __pthread_attr_copy in pthread_getattr_default_np (bug 25999) Florian Weimer via Libc-alpha
@ 2020-05-20 14:42   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 42+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2020-05-20 14:42 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha

On 5/19/20 6:44 AM, Florian Weimer via Libc-alpha wrote:
> pthread_getattr_default_np needs to make a deep copy.

Agreed, this seems like an oversight regarding the affinity.
I expect not enough programs ever use the kind of setup you run in
the test, but it's still wrong, we should be doing a deep copy.

Tested clean on x86_64 and i686.

OK for master.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  nptl/Makefile                       |  1 +
>  nptl/pthread_getattr_default_np.c   | 12 ++---
>  nptl/tst-pthread-defaultattr-free.c | 78 +++++++++++++++++++++++++++++
>  3 files changed, 82 insertions(+), 9 deletions(-)
>  create mode 100644 nptl/tst-pthread-defaultattr-free.c
> 
> diff --git a/nptl/Makefile b/nptl/Makefile
> index b4aaad0f20..e5686b20ac 100644
> --- a/nptl/Makefile
> +++ b/nptl/Makefile
> @@ -328,6 +328,7 @@ tests = tst-attr2 tst-attr3 tst-default-attr \
>  	tst-thread-affinity-pthread \
>  	tst-thread-affinity-pthread2 \
>  	tst-thread-affinity-sched \
> +	tst-pthread-defaultattr-free \

OK.

>  
>  
>  tests-container =  tst-pthread-getattr
> diff --git a/nptl/pthread_getattr_default_np.c b/nptl/pthread_getattr_default_np.c
> index cce20cbe94..a9665c5df7 100644
> --- a/nptl/pthread_getattr_default_np.c
> +++ b/nptl/pthread_getattr_default_np.c
> @@ -16,20 +16,14 @@
>     License along with the GNU C Library; if not, see
>     <https://www.gnu.org/licenses/>.  */
>  
> -#include <errno.h>
> -#include <stdlib.h>
>  #include <pthreadP.h>
>  
>  int
>  pthread_getattr_default_np (pthread_attr_t *out)
>  {
> -  struct pthread_attr *real_out;
> -
> -  real_out = (struct pthread_attr *) out;
> -
>    lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
> -  *real_out = __default_pthread_attr;
> +  int ret = __pthread_attr_copy (out,
> +                                 (pthread_attr_t *) &__default_pthread_attr);

OK. Locks kept in place, and call to __pthread_attr_copy owns the struct.

>    lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
> -
> -  return 0;
> +  return ret;
>  }
> diff --git a/nptl/tst-pthread-defaultattr-free.c b/nptl/tst-pthread-defaultattr-free.c
> new file mode 100644
> index 0000000000..5a84302380
> --- /dev/null
> +++ b/nptl/tst-pthread-defaultattr-free.c
> @@ -0,0 +1,78 @@
> +/* Test for user-after-free bug in pthread_getattr_default_np (bug 25999).

OK.

> +   Copyright (C) 2020 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <pthread.h>
> +#include <sched.h>
> +#include <support/check.h>
> +#include <support/xthread.h>
> +
> +static int
> +do_test (void)
> +{
> +  /* This is a typical affinity size.  */
> +  enum { cpu_count = 128 };
> +  cpu_set_t *set = CPU_ALLOC (cpu_count);
> +  size_t set_size = CPU_ALLOC_SIZE (cpu_count);
> +  CPU_ZERO_S (set_size, set);
> +  CPU_SET (1, set);
> +  CPU_SET (3, set);

OK.

> +
> +  /* Apply the affinity mask to the default attribute.  */
> +  pthread_attr_t attr;
> +  xpthread_attr_init (&attr);
> +  TEST_COMPARE (pthread_attr_setaffinity_np (&attr, set_size, set), 0);
> +  TEST_COMPARE (pthread_setattr_default_np (&attr), 0);

OK. Set the default.

> +  xpthread_attr_destroy (&attr);

OK.

> +
> +  /* Read back the default attribute and check affinity mask.  */
> +  pthread_getattr_default_np (&attr);
> +  CPU_ZERO_S (set_size, set);
> +  TEST_COMPARE (pthread_attr_getaffinity_np (&attr, set_size, set), 0);
> +  for (int i = 0; i < cpu_count; ++i)
> +    TEST_COMPARE (!!CPU_ISSET (i, set), i == 1 || i == 3);

OK.

> +
> +
> +  /* Apply a larger CPU affinity mask to the default attribute, to
> +     trigger reallocation.  */
> +  {
> +    cpu_set_t *large_set = CPU_ALLOC (4 * cpu_count);
> +    size_t large_set_size = CPU_ALLOC_SIZE (4 * cpu_count);
> +    CPU_ZERO_S (large_set_size, large_set);
> +    pthread_attr_t large_attr;
> +    xpthread_attr_init (&large_attr);
> +    TEST_COMPARE (pthread_attr_setaffinity_np (&large_attr,
> +                                               large_set_size, large_set), 0);
> +    TEST_COMPARE (pthread_setattr_default_np (&large_attr), 0);

OK.

> +    xpthread_attr_destroy (&large_attr);
> +    CPU_FREE (large_set);
> +  }
> +
> +  /* Read back the default attribute and check affinity mask.  */
> +  CPU_ZERO_S (set_size, set);
> +  TEST_COMPARE (pthread_attr_getaffinity_np (&attr, set_size, set), 0);
> +  for (int i = 0; i < cpu_count; ++i)
> +    TEST_COMPARE (!!CPU_ISSET (i, set), i == 1 || i == 3);
> +  /* Due to bug 25999, the following caused a double-free abort.  */
> +  xpthread_attr_destroy (&attr);

OK.

> +
> +  CPU_FREE (set);
> +
> +  return 0;
> +}
> +
> +#include <support/test-driver.c>
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 09/19] nptl: Use __pthread_attr_copy in pthread_setattr_default_np
  2020-05-19 10:44 ` [PATCH 09/19] nptl: Use __pthread_attr_copy in pthread_setattr_default_np Florian Weimer via Libc-alpha
@ 2020-05-20 14:48   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 42+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2020-05-20 14:48 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha

On 5/19/20 6:44 AM, Florian Weimer via Libc-alpha wrote:
> ---
>  nptl/pthread_setattr_default_np.c | 53 +++++++++----------------------
>  1 file changed, 15 insertions(+), 38 deletions(-)
> 

OK for master.

Tested clean on x86_64 and i686.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> diff --git a/nptl/pthread_setattr_default_np.c b/nptl/pthread_setattr_default_np.c
> index d6a46624b5..eb5d24d3bd 100644
> --- a/nptl/pthread_setattr_default_np.c
> +++ b/nptl/pthread_setattr_default_np.c
> @@ -26,7 +26,6 @@ int
>  pthread_setattr_default_np (const pthread_attr_t *in)
>  {
>    const struct pthread_attr *real_in;
> -  struct pthread_attr attrs;

OK.

>    int ret;
>  
>    real_in = (struct pthread_attr *) in;
> @@ -58,49 +57,27 @@ pthread_setattr_default_np (const pthread_attr_t *in)
>    if (real_in->flags & ATTR_FLAG_STACKADDR)
>      return EINVAL;
>  
> -  attrs = *real_in;
> +  union pthread_attr_transparent temp;
> +  ret = __pthread_attr_copy (&temp.external, in);
> +  if (ret != 0)
> +    return ret;

OK. Make a deep copy and allocate as required. May fail with ENOMEM.

>  
> -  /* Now take the lock because we start writing into
> +  /* Now take the lock because we start accessing
>       __default_pthread_attr.  */
>    lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);

OK.

>  
> -  /* Free the cpuset if the input is 0.  Otherwise copy in the cpuset
> -     contents.  */
> -  size_t cpusetsize = attrs.cpusetsize;
> -  if (cpusetsize == 0)
> -    {
> -      free (__default_pthread_attr.cpuset);
> -      __default_pthread_attr.cpuset = NULL;
> -    }
> -  else if (cpusetsize == __default_pthread_attr.cpusetsize)
> -    {
> -      attrs.cpuset = __default_pthread_attr.cpuset;
> -      memcpy (attrs.cpuset, real_in->cpuset, cpusetsize);
> -    }
> -  else
> -    {
> -      /* This may look wrong at first sight, but it isn't.  We're freeing
> -	 __default_pthread_attr.cpuset and allocating to attrs.cpuset because
> -	 we'll copy over all of attr to __default_pthread_attr later.  */
> -      cpu_set_t *newp = realloc (__default_pthread_attr.cpuset,
> -				 cpusetsize);
> -
> -      if (newp == NULL)
> -	{
> -	  ret = ENOMEM;
> -	  goto out;
> -	}
> -
> -      attrs.cpuset = newp;
> -      memcpy (attrs.cpuset, real_in->cpuset, cpusetsize);
> -    }

OK. We don't need any of this code because we did a deep copy and will
subsequently destroy the attribute. I like the cleanup.

> +  /* Preserve the previous stack size (see above).  */
> +  if (temp.internal.stacksize == 0)
> +    temp.internal.stacksize = __default_pthread_attr.stacksize;

OK.

> +
> +  /* Destroy the old attribute structure because it will be
> +     overwritten.  */
> +  __pthread_attr_destroy ((pthread_attr_t *) &__default_pthread_attr);

OK.

>  
> -  /* We don't want to accidentally set the default stacksize to zero.  */
> -  if (attrs.stacksize == 0)
> -    attrs.stacksize = __default_pthread_attr.stacksize;
> -  __default_pthread_attr = attrs;
> +  /* __default_pthread_attr takes ownership, so do not free
> +     attrs.internal after this point.  */
> +  __default_pthread_attr = temp.internal;

OK.

>  
> - out:
>    lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
>    return ret;
>  }
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 10/19] <libc-symbols.h>: Add libpthread hidden alias support
  2020-05-19 10:44 ` [PATCH 10/19] <libc-symbols.h>: Add libpthread hidden alias support Florian Weimer via Libc-alpha
@ 2020-05-20 14:51   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 42+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2020-05-20 14:51 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha

On 5/19/20 6:44 AM, Florian Weimer via Libc-alpha wrote:
> ---
>  include/libc-symbols.h | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 

Defines look good and you'll use them in the next set of patches
to allow libpthread code to call these functions from libc until
the conversion is fully complete (at which point we could clean
it all up).

OK for master.

Tested clean on x86_64 and i686.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> diff --git a/include/libc-symbols.h b/include/libc-symbols.h
> index 3555cb6f3d..b2f36bc44b 100644
> --- a/include/libc-symbols.h
> +++ b/include/libc-symbols.h
> @@ -737,6 +737,29 @@ for linking")
>  # define libresolv_hidden_data_ver(local, name)
>  #endif
>  
> +#if IS_IN (libpthread)
> +# define libpthread_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
> +# define libpthread_hidden_tls_proto(name, attrs...) \
> +  hidden_tls_proto (name, ##attrs)
> +# define libpthread_hidden_def(name) hidden_def (name)
> +# define libpthread_hidden_weak(name) hidden_weak (name)
> +# define libpthread_hidden_ver(local, name) hidden_ver (local, name)
> +# define libpthread_hidden_data_def(name) hidden_data_def (name)
> +# define libpthread_hidden_tls_def(name) hidden_tls_def (name)
> +# define libpthread_hidden_data_weak(name) hidden_data_weak (name)
> +# define libpthread_hidden_data_ver(local, name) hidden_data_ver (local, name)
> +#else
> +# define libpthread_hidden_proto(name, attrs...)
> +# define libpthread_hidden_tls_proto(name, attrs...)
> +# define libpthread_hidden_def(name)
> +# define libpthread_hidden_weak(name)
> +# define libpthread_hidden_ver(local, name)
> +# define libpthread_hidden_data_def(name)
> +# define libpthread_hidden_tls_def(name)
> +# define libpthread_hidden_data_weak(name)
> +# define libpthread_hidden_data_ver(local, name)
> +#endif

OK.

> +
>  #if IS_IN (librt)
>  # define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
>  # define librt_hidden_tls_proto(name, attrs...) \
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 11/19] nptl: Add internal alias __pthread_getattr_default_np
  2020-05-19 10:44 ` [PATCH 11/19] nptl: Add internal alias __pthread_getattr_default_np Florian Weimer via Libc-alpha
@ 2020-06-02  3:28   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 42+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2020-06-02  3:28 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha

On 5/19/20 6:44 AM, Florian Weimer via Libc-alpha wrote:

OK for master.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  nptl/Versions                     | 1 +
>  nptl/pthreadP.h                   | 2 ++
>  nptl/pthread_getattr_default_np.c | 4 +++-
>  3 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/nptl/Versions b/nptl/Versions
> index 4c7b43354d..e4696c128f 100644
> --- a/nptl/Versions
> +++ b/nptl/Versions
> @@ -61,6 +61,7 @@ libc {
>      __pthread_attr_setaffinity_np;
>      __pthread_attr_init; __pthread_attr_destroy;
>      __pthread_attr_copy;
> +    __pthread_getattr_default_np;

OK.

>    }
>  }
>  
> diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
> index 41b693d034..9c6dd41b7c 100644
> --- a/nptl/pthreadP.h
> +++ b/nptl/pthreadP.h
> @@ -437,6 +437,8 @@ extern int __pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
>  				    size_t __stacksize);
>  int __pthread_attr_setaffinity_np (pthread_attr_t *, size_t, const cpu_set_t *);
>  libc_hidden_proto (__pthread_attr_setaffinity_np)
> +extern __typeof (pthread_getattr_default_np) __pthread_getattr_default_np;
> +libpthread_hidden_proto (__pthread_getattr_default_np)

OK.

>  extern int __pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
>  				  const pthread_rwlockattr_t *__restrict
>  				  __attr);
> diff --git a/nptl/pthread_getattr_default_np.c b/nptl/pthread_getattr_default_np.c
> index a9665c5df7..5c99f980e2 100644
> --- a/nptl/pthread_getattr_default_np.c
> +++ b/nptl/pthread_getattr_default_np.c
> @@ -19,7 +19,7 @@
>  #include <pthreadP.h>
>  
>  int
> -pthread_getattr_default_np (pthread_attr_t *out)
> +__pthread_getattr_default_np (pthread_attr_t *out)
>  {
>    lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
>    int ret = __pthread_attr_copy (out,
> @@ -27,3 +27,5 @@ pthread_getattr_default_np (pthread_attr_t *out)
>    lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
>    return ret;
>  }
> +libpthread_hidden_def (__pthread_getattr_default_np)
> +weak_alias (__pthread_getattr_default_np, pthread_getattr_default_np)

OK.

> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 12/19] nptl: Use __pthread_getattr_default_np in pthread_create
  2020-05-19 10:44 ` [PATCH 12/19] nptl: Use __pthread_getattr_default_np in pthread_create Florian Weimer via Libc-alpha
@ 2020-06-02  3:34   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 42+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2020-06-02  3:34 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha

On 5/19/20 6:44 AM, Florian Weimer via Libc-alpha wrote:
> This removes another instance of custom attribute copying code.

OK for master.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  nptl/pthread_create.c | 32 +++++++-------------------------
>  1 file changed, 7 insertions(+), 25 deletions(-)
> 
> diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
> index a43089065c..347d510707 100644
> --- a/nptl/pthread_create.c
> +++ b/nptl/pthread_create.c
> @@ -613,32 +613,14 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr,
>  
>    const struct pthread_attr *iattr = (struct pthread_attr *) attr;
>    struct pthread_attr default_attr;
> -  bool free_cpuset = false;
> +  bool destroy_default_attr = false;

OK.

>    bool c11 = (attr == ATTR_C11_THREAD);
>    if (iattr == NULL || c11)
>      {
> -      lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
> -      default_attr = __default_pthread_attr;
> -      size_t cpusetsize = default_attr.cpusetsize;
> -      if (cpusetsize > 0)
> -	{
> -	  cpu_set_t *cpuset;
> -	  if (__glibc_likely (__libc_use_alloca (cpusetsize)))
> -	    cpuset = __alloca (cpusetsize);
> -	  else
> -	    {
> -	      cpuset = malloc (cpusetsize);
> -	      if (cpuset == NULL)
> -		{
> -		  lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
> -		  return ENOMEM;
> -		}
> -	      free_cpuset = true;
> -	    }
> -	  memcpy (cpuset, default_attr.cpuset, cpusetsize);
> -	  default_attr.cpuset = cpuset;
> -	}
> -      lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
> +      int ret = __pthread_getattr_default_np ((pthread_attr_t *) &default_attr);

OK. Call internally to get the default attributes.

> +      if (ret != 0)
> +	return ret;
> +      destroy_default_attr = true;
>        iattr = &default_attr;
>      }
>  
> @@ -869,8 +851,8 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr,
>      }
>  
>   out:
> -  if (__glibc_unlikely (free_cpuset))
> -    free (default_attr.cpuset);
> +  if (destroy_default_attr)
> +    __pthread_attr_destroy ((pthread_attr_t *) &default_attr);

OK.

>  
>    return retval;
>  }
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 13/19] nptl: Use __pthread_attr_setaffinity_np in pthread_getattr_np
  2020-05-19 10:44 ` [PATCH 13/19] nptl: Use __pthread_attr_setaffinity_np in pthread_getattr_np Florian Weimer via Libc-alpha
@ 2020-06-02  3:36   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 42+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2020-06-02  3:36 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha

On 5/19/20 6:44 AM, Florian Weimer via Libc-alpha wrote:
> This avoids duplicating the code for the affinity mask allocation
> handling.

OK for master.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  nptl/pthread_getattr_np.c | 30 ++++++++++++++----------------
>  1 file changed, 14 insertions(+), 16 deletions(-)
> 
> diff --git a/nptl/pthread_getattr_np.c b/nptl/pthread_getattr_np.c
> index 0e8911346d..ce437205e4 100644
> --- a/nptl/pthread_getattr_np.c
> +++ b/nptl/pthread_getattr_np.c
> @@ -33,8 +33,13 @@ int
>  __pthread_getattr_np (pthread_t thread_id, pthread_attr_t *attr)
>  {
>    struct pthread *thread = (struct pthread *) thread_id;
> +
> +  /* Prepare the new thread attribute.  */
> +  int ret = __pthread_attr_init (attr);
> +  if (ret != 0)
> +    return ret;
> +

OK.

>    struct pthread_attr *iattr = (struct pthread_attr *) attr;
> -  int ret = 0;
>  
>    lll_lock (thread->lock, LLL_PRIVATE);
>  
> @@ -187,25 +192,18 @@ __pthread_getattr_np (pthread_t thread_id, pthread_attr_t *attr)
>        while (ret == EINVAL && size < 1024 * 1024);
>  
>        if (ret == 0)
> -	{
> -	  iattr->cpuset = cpuset;
> -	  iattr->cpusetsize = size;
> -	}
> -      else
> -	{
> -	  free (cpuset);
> -	  if (ret == ENOSYS)
> -	    {
> -	      /* There is no such functionality.  */
> -	      ret = 0;
> -	      iattr->cpuset = NULL;
> -	      iattr->cpusetsize = 0;
> -	    }
> -	}
> +	ret = __pthread_attr_setaffinity_np (attr, size, cpuset);

OK. Handled all in pthread_attr_setaffinity_np.

> +      else if (ret == ENOSYS)
> +	/* There is no such functionality.  */
> +	ret = 0;
> +      free (cpuset);

OK.

>      }
>  
>    lll_unlock (thread->lock, LLL_PRIVATE);
>  
> +  if (ret != 0)
> +    __pthread_attr_destroy (attr);

OK. Destory the attribute if things failed.

> +
>    return ret;
>  }
>  versioned_symbol (libc, __pthread_getattr_np, pthread_getattr_np, GLIBC_2_32);
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 14/19] nptl: Change type of __default_pthread_attr
  2020-05-19 10:44 ` [PATCH 14/19] nptl: Change type of __default_pthread_attr Florian Weimer via Libc-alpha
@ 2020-06-02  3:39   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 42+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2020-06-02  3:39 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha

On 5/19/20 6:44 AM, Florian Weimer via Libc-alpha wrote:
> union pthread_attr_transparent has always the correct size, even if
> pthread_attr_t has padding that is not present in struct pthread_attr.
> 
> This should not result in an observable behavioral change.  The
> existing code appears to have been correct, but it was brittle because
> it was not clear which functions were allowed to write to an entire
> pthread_attr_t argument (e.g., by copying it).

OK for master.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  nptl/allocatestack.c              | 2 +-
>  nptl/nptl-init.c                  | 4 ++--
>  nptl/pthreadP.h                   | 2 +-
>  nptl/pthread_attr_getstacksize.c  | 2 +-
>  nptl/pthread_create.c             | 8 ++++----
>  nptl/pthread_getattr_default_np.c | 3 +--
>  nptl/pthread_setattr_default_np.c | 6 +++---
>  nptl/vars.c                       | 2 +-
>  8 files changed, 14 insertions(+), 15 deletions(-)
> 
> diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
> index c94980c21c..d16f3d71f8 100644
> --- a/nptl/allocatestack.c
> +++ b/nptl/allocatestack.c
> @@ -425,7 +425,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
>    else
>      {
>        lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
> -      size = __default_pthread_attr.stacksize;
> +      size = __default_pthread_attr.internal.stacksize;

OK.

>        lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
>      }
>  
> diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c
> index 96b1444a01..d4cf20e3d1 100644
> --- a/nptl/nptl-init.c
> +++ b/nptl/nptl-init.c
> @@ -318,8 +318,8 @@ __pthread_initialize_minimal_internal (void)
>    /* Round the resource limit up to page size.  */
>    limit.rlim_cur = ALIGN_UP (limit.rlim_cur, pagesz);
>    lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
> -  __default_pthread_attr.stacksize = limit.rlim_cur;
> -  __default_pthread_attr.guardsize = GLRO (dl_pagesize);
> +  __default_pthread_attr.internal.stacksize = limit.rlim_cur;
> +  __default_pthread_attr.internal.guardsize = GLRO (dl_pagesize);

OK.

>    lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
>  
>  #ifdef SHARED
> diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
> index 9c6dd41b7c..acc8e88e4a 100644
> --- a/nptl/pthreadP.h
> +++ b/nptl/pthreadP.h
> @@ -199,7 +199,7 @@ enum
>  
>  
>  /* Default pthread attributes.  */
> -extern struct pthread_attr __default_pthread_attr attribute_hidden;
> +extern union pthread_attr_transparent __default_pthread_attr attribute_hidden;

OK.

>  extern int __default_pthread_attr_lock attribute_hidden;
>  
>  /* Size and alignment of static TLS block.  */
> diff --git a/nptl/pthread_attr_getstacksize.c b/nptl/pthread_attr_getstacksize.c
> index 346b375690..9830a635a6 100644
> --- a/nptl/pthread_attr_getstacksize.c
> +++ b/nptl/pthread_attr_getstacksize.c
> @@ -33,7 +33,7 @@ __pthread_attr_getstacksize (const pthread_attr_t *attr, size_t *stacksize)
>    if (size == 0)
>      {
>        lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
> -      size = __default_pthread_attr.stacksize;
> +      size = __default_pthread_attr.internal.stacksize;

OK.

>        lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
>      }
>    *stacksize = size;
> diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
> index 347d510707..86fbeb5218 100644
> --- a/nptl/pthread_create.c
> +++ b/nptl/pthread_create.c
> @@ -612,16 +612,16 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr,
>    STACK_VARIABLES;
>  
>    const struct pthread_attr *iattr = (struct pthread_attr *) attr;
> -  struct pthread_attr default_attr;
> +  union pthread_attr_transparent default_attr;

OK.

>    bool destroy_default_attr = false;
>    bool c11 = (attr == ATTR_C11_THREAD);
>    if (iattr == NULL || c11)
>      {
> -      int ret = __pthread_getattr_default_np ((pthread_attr_t *) &default_attr);
> +      int ret = __pthread_getattr_default_np (&default_attr.external);

OK. Uses external type for public API.

>        if (ret != 0)
>  	return ret;
>        destroy_default_attr = true;
> -      iattr = &default_attr;
> +      iattr = &default_attr.internal;

OK.

>      }
>  
>    struct pthread *pd = NULL;
> @@ -852,7 +852,7 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr,
>  
>   out:
>    if (destroy_default_attr)
> -    __pthread_attr_destroy ((pthread_attr_t *) &default_attr);
> +    __pthread_attr_destroy (&default_attr.external);

OK.

>  
>    return retval;
>  }
> diff --git a/nptl/pthread_getattr_default_np.c b/nptl/pthread_getattr_default_np.c
> index 5c99f980e2..f3ce1c2885 100644
> --- a/nptl/pthread_getattr_default_np.c
> +++ b/nptl/pthread_getattr_default_np.c
> @@ -22,8 +22,7 @@ int
>  __pthread_getattr_default_np (pthread_attr_t *out)
>  {
>    lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
> -  int ret = __pthread_attr_copy (out,
> -                                 (pthread_attr_t *) &__default_pthread_attr);
> +  int ret = __pthread_attr_copy (out, &__default_pthread_attr.external);

OK.

>    lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
>    return ret;
>  }
> diff --git a/nptl/pthread_setattr_default_np.c b/nptl/pthread_setattr_default_np.c
> index eb5d24d3bd..c4cfb4e8ef 100644
> --- a/nptl/pthread_setattr_default_np.c
> +++ b/nptl/pthread_setattr_default_np.c
> @@ -68,15 +68,15 @@ pthread_setattr_default_np (const pthread_attr_t *in)
>  
>    /* Preserve the previous stack size (see above).  */
>    if (temp.internal.stacksize == 0)
> -    temp.internal.stacksize = __default_pthread_attr.stacksize;
> +    temp.internal.stacksize = __default_pthread_attr.internal.stacksize;
>  
>    /* Destroy the old attribute structure because it will be
>       overwritten.  */
> -  __pthread_attr_destroy ((pthread_attr_t *) &__default_pthread_attr);
> +  __pthread_attr_destroy (&__default_pthread_attr.external);
>  
>    /* __default_pthread_attr takes ownership, so do not free
>       attrs.internal after this point.  */
> -  __default_pthread_attr = temp.internal;
> +  __default_pthread_attr = temp;

OK.

>  
>    lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
>    return ret;
> diff --git a/nptl/vars.c b/nptl/vars.c
> index b88300d9b4..3696020145 100644
> --- a/nptl/vars.c
> +++ b/nptl/vars.c
> @@ -22,7 +22,7 @@
>  
>  /* Default thread attributes for the case when the user does not
>     provide any.  */
> -struct pthread_attr __default_pthread_attr attribute_hidden;
> +union pthread_attr_transparent __default_pthread_attr attribute_hidden;

OK.

>  
>  /* Mutex protecting __default_pthread_attr.  */
>  int __default_pthread_attr_lock = LLL_LOCK_INITIALIZER;
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 15/19] nptl: Destroy the default thread attribute as part of freeres
  2020-05-19 10:44 ` [PATCH 15/19] nptl: Destroy the default thread attribute as part of freeres Florian Weimer via Libc-alpha
@ 2020-06-02  3:41   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 42+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2020-06-02  3:41 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha

On 5/19/20 6:44 AM, Florian Weimer via Libc-alpha wrote:
> This avoids a spurious memory leak report by valgrind.

OK for master.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  nptl/nptlfreeres.c                |  1 +
>  nptl/pthreadP.h                   |  2 ++
>  nptl/pthread_setattr_default_np.c | 10 ++++++++++
>  3 files changed, 13 insertions(+)
> 
> diff --git a/nptl/nptlfreeres.c b/nptl/nptlfreeres.c
> index dda11e5922..07aa34adfa 100644
> --- a/nptl/nptlfreeres.c
> +++ b/nptl/nptlfreeres.c
> @@ -25,6 +25,7 @@
>  void
>  __libpthread_freeres (void)
>  {
> +  call_function_static_weak (__default_pthread_attr_freeres);

OK.

>    call_function_static_weak (__nptl_stacks_freeres);
>    call_function_static_weak (__shm_directory_freeres);
>    call_function_static_weak (__nptl_unwind_freeres);
> diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
> index acc8e88e4a..ed30b72923 100644
> --- a/nptl/pthreadP.h
> +++ b/nptl/pthreadP.h
> @@ -201,6 +201,8 @@ enum
>  /* Default pthread attributes.  */
>  extern union pthread_attr_transparent __default_pthread_attr attribute_hidden;
>  extern int __default_pthread_attr_lock attribute_hidden;
> +/* Called from __libpthread_freeres to deallocate the default attribute.  */
> +extern void __default_pthread_attr_freeres (void) attribute_hidden;

OK.

>  
>  /* Size and alignment of static TLS block.  */
>  extern size_t __static_tls_size attribute_hidden;
> diff --git a/nptl/pthread_setattr_default_np.c b/nptl/pthread_setattr_default_np.c
> index c4cfb4e8ef..7a1c644334 100644
> --- a/nptl/pthread_setattr_default_np.c
> +++ b/nptl/pthread_setattr_default_np.c
> @@ -81,3 +81,13 @@ pthread_setattr_default_np (const pthread_attr_t *in)
>    lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
>    return ret;
>  }
> +
> +/* This is placed in the same file as pthread_setattr_default_np
> +   because only this function can trigger allocation of attribute
> +   data.  This way, the function is automatically defined for all the
> +   cases when it is needed in static builds.  */
> +void
> +__default_pthread_attr_freeres (void)
> +{
> +  __pthread_attr_destroy (&__default_pthread_attr.external);

OK. Delete any internally allocated memory.

> +}
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 16/19] nptl: Make pthread_attr_t dynamically extensible
  2020-05-19 10:44 ` [PATCH 16/19] nptl: Make pthread_attr_t dynamically extensible Florian Weimer via Libc-alpha
@ 2020-06-02  3:47   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 42+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2020-06-02  3:47 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha

On 5/19/20 6:44 AM, Florian Weimer via Libc-alpha wrote:
> This introduces the function __pthread_attr_extension to allocate the
> extension space, which is freed by pthread_attr_destroy.

OK for master with one typo fixed.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  nptl/Makefile                          |  1 +
>  nptl/pthreadP.h                        |  6 +++++
>  nptl/pthread_attr_copy.c               | 16 +++++++------
>  nptl/pthread_attr_destroy.c            | 12 ++++++----
>  nptl/pthread_attr_extension.c          | 32 ++++++++++++++++++++++++++
>  nptl/pthread_attr_getaffinity.c        | 14 +++++------
>  nptl/pthread_attr_setaffinity.c        | 23 +++++++++++-------
>  nptl/pthread_create.c                  |  2 +-
>  sysdeps/nptl/internaltypes.h           | 16 ++++++++++---
>  sysdeps/unix/sysv/linux/createthread.c |  9 +++++---
>  10 files changed, 98 insertions(+), 33 deletions(-)
>  create mode 100644 nptl/pthread_attr_extension.c
> 
> diff --git a/nptl/Makefile b/nptl/Makefile
> index e5686b20ac..d6f12d0371 100644
> --- a/nptl/Makefile
> +++ b/nptl/Makefile
> @@ -41,6 +41,7 @@ routines = \
>    pthread_atfork \
>    pthread_attr_copy \
>    pthread_attr_destroy \
> +  pthread_attr_extension \

OK.

>    pthread_attr_getdetachstate \
>    pthread_attr_getinheritsched \
>    pthread_attr_getschedparam \
> diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
> index ed30b72923..7b3153594e 100644
> --- a/nptl/pthreadP.h
> +++ b/nptl/pthreadP.h
> @@ -578,6 +578,12 @@ extern void __shm_directory_freeres (void) attribute_hidden;
>  
>  extern void __wait_lookup_done (void) attribute_hidden;
>  
> +/* Allocates the extension space for ATTR.  Returns an error code on
> +   memory allocation failure, zero on success.  If ATTR already has an
> +   extension space, this function does nothing.  */
> +int __pthread_attr_extension (struct pthread_attr *attr) attribute_hidden
> +  __attribute_warn_unused_result__;

OK. Good comment.

> +
>  #ifdef SHARED
>  # define PTHREAD_STATIC_FN_REQUIRE(name)
>  #else
> diff --git a/nptl/pthread_attr_copy.c b/nptl/pthread_attr_copy.c
> index 77a1a43eeb..eb29557505 100644
> --- a/nptl/pthread_attr_copy.c
> +++ b/nptl/pthread_attr_copy.c
> @@ -29,18 +29,20 @@ __pthread_attr_copy (pthread_attr_t *target, const pthread_attr_t *source)
>    temp.external = *source;
>  
>    /* Force new allocation.  This function has full ownership of temp.  */
> -  temp.internal.cpuset = NULL;
> -  temp.internal.cpusetsize = 0;
> +  temp.internal.extension = NULL;

OK. Init.

>  
>    int ret = 0;
>  
>    struct pthread_attr *isource = (struct pthread_attr *) source;
>  
> -  /* Propagate affinity mask information.  */
> -  if (isource->cpusetsize > 0)
> -    ret = __pthread_attr_setaffinity_np (&temp.external,
> -                                         isource->cpusetsize,
> -                                         isource->cpuset);
> +  if (isource->extension != NULL)
> +    {
> +      /* Propagate affinity mask information.  */
> +      if (isource->extension->cpusetsize > 0)
> +        ret = __pthread_attr_setaffinity_np (&temp.external,
> +                                             isource->extension->cpusetsize,
> +                                             isource->extension->cpuset);
> +    }

OK. Use extension space.

>  
>    if (ret != 0)
>      {
> diff --git a/nptl/pthread_attr_destroy.c b/nptl/pthread_attr_destroy.c
> index 21f8026a2c..b6a3cca657 100644
> --- a/nptl/pthread_attr_destroy.c
> +++ b/nptl/pthread_attr_destroy.c
> @@ -30,12 +30,16 @@ __pthread_attr_destroy (pthread_attr_t *attr)
>    iattr = (struct pthread_attr *) attr;
>  
>  #if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_1)
> -  /* In old struct pthread_attr, neither next nor cpuset are
> -     present.  */
> +  /* In old struct pthread_attr, the extension member is missing.  */
>    if (__builtin_expect ((iattr->flags & ATTR_FLAG_OLDATTR), 0) == 0)
>  #endif
> -    /* The affinity CPU set might be allocated dynamically.  */
> -    free (iattr->cpuset);
> +    {
> +      if (iattr->extension != NULL)
> +        {
> +          free (iattr->extension->cpuset);
> +          free (iattr->extension);

OK.

> +        }
> +    }
>  
>    return 0;
>  }
> diff --git a/nptl/pthread_attr_extension.c b/nptl/pthread_attr_extension.c
> new file mode 100644
> index 0000000000..e8521b1556
> --- /dev/null
> +++ b/nptl/pthread_attr_extension.c
> @@ -0,0 +1,32 @@
> +/* Allocate the extension space for strucht pthread_attr.

Typo: s/strucht/struct/g

> +   Copyright (C) 2020 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <errno.h>
> +#include <pthreadP.h>
> +#include <stdlib.h>
> +
> +int
> + __pthread_attr_extension (struct pthread_attr *attr)
> +{
> +  if (attr->extension != NULL)
> +    return 0;
> +  attr->extension = calloc (sizeof (*attr->extension), 1);
> +  if (attr->extension == NULL)
> +    return errno;
> +  return 0;
> +}

OK. Dynamically allocate space for the extension via calloc.

> diff --git a/nptl/pthread_attr_getaffinity.c b/nptl/pthread_attr_getaffinity.c
> index 212c1f7c0a..9483f69ddc 100644
> --- a/nptl/pthread_attr_getaffinity.c
> +++ b/nptl/pthread_attr_getaffinity.c
> @@ -33,22 +33,22 @@ __pthread_attr_getaffinity_new (const pthread_attr_t *attr, size_t cpusetsize,
>  
>    iattr = (const struct pthread_attr *) attr;
>  
> -  if (iattr->cpuset != NULL)
> +  if (iattr->extension != NULL && iattr->extension->cpuset != NULL)

OK.

>      {
>        /* Check whether there are any bits set beyond the limits
>  	 the user requested.  */
> -      for (size_t cnt = cpusetsize; cnt < iattr->cpusetsize; ++cnt)
> -	if (((char *) iattr->cpuset)[cnt] != 0)
> +      for (size_t cnt = cpusetsize; cnt < iattr->extension->cpusetsize; ++cnt)
> +	if (((char *) iattr->extension->cpuset)[cnt] != 0)

OK.

>  	  return EINVAL;
>  
>        /* Copy over the cpuset from the thread attribute object.  Limit the copy
>  	 to the minimum of the source and destination sizes to prevent a buffer
>  	 overrun.  If the destination is larger, fill the remaining space with
>  	 zeroes.  */
> -      void *p = mempcpy (cpuset, iattr->cpuset,
> -			 MIN (iattr->cpusetsize, cpusetsize));
> -      if (cpusetsize > iattr->cpusetsize)
> -	memset (p, '\0', cpusetsize - iattr->cpusetsize);
> +      void *p = mempcpy (cpuset, iattr->extension->cpuset,
> +			 MIN (iattr->extension->cpusetsize, cpusetsize));
> +      if (cpusetsize > iattr->extension->cpusetsize)
> +	memset (p, '\0', cpusetsize - iattr->extension->cpusetsize);

OK.

>      }
>    else
>      /* We have no information.  */
> diff --git a/nptl/pthread_attr_setaffinity.c b/nptl/pthread_attr_setaffinity.c
> index a42ffd92f4..9f9a70dee0 100644
> --- a/nptl/pthread_attr_setaffinity.c
> +++ b/nptl/pthread_attr_setaffinity.c
> @@ -34,23 +34,30 @@ __pthread_attr_setaffinity_np (pthread_attr_t *attr, size_t cpusetsize,
>  
>    if (cpuset == NULL || cpusetsize == 0)
>      {
> -      free (iattr->cpuset);
> -      iattr->cpuset = NULL;
> -      iattr->cpusetsize = 0;
> +      if (iattr->extension != NULL)
> +	{
> +	  free (iattr->extension->cpuset);
> +	  iattr->extension->cpuset = NULL;
> +	  iattr->extension->cpusetsize = 0;

OK.

> +	}
>      }
>    else
>      {
> -      if (iattr->cpusetsize != cpusetsize)
> +      int ret = __pthread_attr_extension (iattr);
> +      if (ret != 0)
> +	return ret;
> +
> +      if (iattr->extension->cpusetsize != cpusetsize)
>  	{
> -	  void *newp = (cpu_set_t *) realloc (iattr->cpuset, cpusetsize);
> +	  void *newp = realloc (iattr->extension->cpuset, cpusetsize);
>  	  if (newp == NULL)
>  	    return ENOMEM;
>  
> -	  iattr->cpuset = newp;
> -	  iattr->cpusetsize = cpusetsize;
> +	  iattr->extension->cpuset = newp;
> +	  iattr->extension->cpusetsize = cpusetsize;
>  	}
>  
> -      memcpy (iattr->cpuset, cpuset, cpusetsize);
> +      memcpy (iattr->extension->cpuset, cpuset, cpusetsize);

OK.

>      }
>  
>    return 0;
> diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
> index 86fbeb5218..f6418eb5ed 100644
> --- a/nptl/pthread_create.c
> +++ b/nptl/pthread_create.c
> @@ -884,7 +884,7 @@ __pthread_create_2_0 (pthread_t *newthread, const pthread_attr_t *attr,
>        new_attr.guardsize = ps;
>        new_attr.stackaddr = NULL;
>        new_attr.stacksize = 0;
> -      new_attr.cpuset = NULL;
> +      new_attr.extension = NULL;

OK.

>  
>        /* We will pass this value on to the real implementation.  */
>        attr = (pthread_attr_t *) &new_attr;
> diff --git a/sysdeps/nptl/internaltypes.h b/sysdeps/nptl/internaltypes.h
> index 6d06a76baf..ca57c315d4 100644
> --- a/sysdeps/nptl/internaltypes.h
> +++ b/sysdeps/nptl/internaltypes.h
> @@ -36,9 +36,10 @@ struct pthread_attr
>    /* Stack handling.  */
>    void *stackaddr;
>    size_t stacksize;
> -  /* Affinity map.  */
> -  cpu_set_t *cpuset;
> -  size_t cpusetsize;
> +
> +  /* Allocated via a call to __pthread_attr_extension once needed.  */
> +  struct pthread_attr_extension *extension;
> +  void *unused;

OK. Keep the same size, but shuffle the usage around to get an extension
pointer and an unused pointer.

>  };
>  
>  #define ATTR_FLAG_DETACHSTATE		0x0001
> @@ -57,6 +58,15 @@ union pthread_attr_transparent
>    struct pthread_attr internal;
>  };
>  
> +/* Extension space for pthread attributes.  Referenced by the
> +   extension member of struct pthread_attr.  */
> +struct pthread_attr_extension
> +{
> +  /* Affinity map.  */
> +  cpu_set_t *cpuset;
> +  size_t cpusetsize;

OK. At worst an applicaiton that is copying the attribute around
is going to just get a copied pointer to the same affinity map.
Such an application was not correct anyway.

> +};
> +
>  /* Mutex attribute data structure.  */
>  struct pthread_mutexattr
>  {
> diff --git a/sysdeps/unix/sysv/linux/createthread.c b/sysdeps/unix/sysv/linux/createthread.c
> index 21f9d24f2d..6588893ba5 100644
> --- a/sysdeps/unix/sysv/linux/createthread.c
> +++ b/sysdeps/unix/sysv/linux/createthread.c
> @@ -52,8 +52,10 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr,
>    /* Determine whether the newly created threads has to be started
>       stopped since we have to set the scheduling parameters or set the
>       affinity.  */
> +  bool need_setaffinity = (attr != NULL && attr->extension != NULL
> +			   && attr->extension->cpuset != 0);

OK.

>    if (attr != NULL
> -      && (__glibc_unlikely (attr->cpuset != NULL)
> +      && (__glibc_unlikely (need_setaffinity)
>  	  || __glibc_unlikely ((attr->flags & ATTR_FLAG_NOTINHERITSCHED) != 0)))
>      *stopped_start = true;
>  
> @@ -113,12 +115,13 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr,
>        int res;
>  
>        /* Set the affinity mask if necessary.  */
> -      if (attr->cpuset != NULL)
> +      if (need_setaffinity)
>  	{
>  	  assert (*stopped_start);
>  
>  	  res = INTERNAL_SYSCALL_CALL (sched_setaffinity, pd->tid,
> -				       attr->cpusetsize, attr->cpuset);
> +				       attr->extension->cpusetsize,
> +				       attr->extension->cpuset);

OK.

>  
>  	  if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (res)))
>  	  err_out:
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 17/19] nptl: Add pthread_attr_setsigmask_np, pthread_attr_getsigmask_np
  2020-05-19 10:44 ` [PATCH 17/19] nptl: Add pthread_attr_setsigmask_np, pthread_attr_getsigmask_np Florian Weimer via Libc-alpha
@ 2020-06-02  4:01   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 42+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2020-06-02  4:01 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha

On 5/19/20 6:44 AM, Florian Weimer via Libc-alpha wrote:

OK for master with NEWS entry sentence fix (missing word),
and typo fixed.

The new interface looks good to me and is generally useful
for starting a thread with the given signal mask and avoiding
the usual coordination between caller and thread (which can
be very useful).

No regressions on x86_64 and i686, and the tst-timer-sigmask
failure is gone.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  NEWS                                          |   4 +
>  nptl/Makefile                                 |   4 +
>  nptl/Versions                                 |   3 +
>  nptl/pthreadP.h                               |  10 +
>  nptl/pthread_attr_copy.c                      |   5 +
>  nptl/pthread_attr_getsigmask.c                |  38 ++++
>  nptl/pthread_attr_setsigmask.c                |  34 +++
>  nptl/pthread_attr_setsigmask_internal.c       |  45 ++++
>  nptl/pthread_create.c                         |  25 ++-
>  nptl/tst-pthread-attr-sigmask.c               | 204 ++++++++++++++++++
>  sysdeps/nptl/internaltypes.h                  |   3 +
>  sysdeps/nptl/pthread.h                        |  15 ++
>  sysdeps/unix/sysv/linux/aarch64/libc.abilist  |   2 +
>  sysdeps/unix/sysv/linux/alpha/libc.abilist    |   2 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist   |   2 +
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist   |   2 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist     |   2 +
>  sysdeps/unix/sysv/linux/hppa/libc.abilist     |   2 +
>  sysdeps/unix/sysv/linux/i386/libc.abilist     |   2 +
>  sysdeps/unix/sysv/linux/ia64/libc.abilist     |   2 +
>  .../sysv/linux/m68k/coldfire/libc.abilist     |   2 +
>  .../unix/sysv/linux/m68k/m680x0/libc.abilist  |   2 +
>  .../sysv/linux/microblaze/be/libc.abilist     |   2 +
>  .../sysv/linux/microblaze/le/libc.abilist     |   2 +
>  .../sysv/linux/mips/mips32/fpu/libc.abilist   |   2 +
>  .../sysv/linux/mips/mips32/nofpu/libc.abilist |   2 +
>  .../sysv/linux/mips/mips64/n32/libc.abilist   |   2 +
>  .../sysv/linux/mips/mips64/n64/libc.abilist   |   2 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist    |   2 +
>  .../linux/powerpc/powerpc32/fpu/libc.abilist  |   2 +
>  .../powerpc/powerpc32/nofpu/libc.abilist      |   2 +
>  .../linux/powerpc/powerpc64/be/libc.abilist   |   2 +
>  .../linux/powerpc/powerpc64/le/libc.abilist   |   2 +
>  .../unix/sysv/linux/riscv/rv64/libc.abilist   |   2 +
>  .../unix/sysv/linux/s390/s390-32/libc.abilist |   2 +
>  .../unix/sysv/linux/s390/s390-64/libc.abilist |   2 +
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist    |   2 +
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist    |   2 +
>  .../sysv/linux/sparc/sparc32/libc.abilist     |   2 +
>  .../sysv/linux/sparc/sparc64/libc.abilist     |   2 +
>  .../unix/sysv/linux/x86_64/64/libc.abilist    |   2 +
>  .../unix/sysv/linux/x86_64/x32/libc.abilist   |   2 +
>  42 files changed, 442 insertions(+), 8 deletions(-)
>  create mode 100644 nptl/pthread_attr_getsigmask.c
>  create mode 100644 nptl/pthread_attr_setsigmask.c
>  create mode 100644 nptl/pthread_attr_setsigmask_internal.c
>  create mode 100644 nptl/tst-pthread-attr-sigmask.c
> 
> diff --git a/NEWS b/NEWS
> index 141078c319..2508feb249 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -23,6 +23,10 @@ Major new features:
>    toolchains.  It is recommended to use GCC 8 or newer when testing
>    this option.
>  
> +* On Linux, the pthread_attr_setsigmask_np and
> +  pthread_attr_getsigmask_np functions have been added.  They allow to
> +  specify the signal mask of a thread created with pthread_create.

Missing "applications" or "developers", either is fine.

e.g. s/They allow to/They allow applications to/g.

> +
>  Deprecated and removed features, and other changes affecting compatibility:
>  
>  * The deprecated <sys/sysctl.h> header and the sysctl function have been
> diff --git a/nptl/Makefile b/nptl/Makefile
> index d6f12d0371..cd0ed97181 100644
> --- a/nptl/Makefile
> +++ b/nptl/Makefile
> @@ -47,6 +47,7 @@ routines = \
>    pthread_attr_getschedparam \
>    pthread_attr_getschedpolicy \
>    pthread_attr_getscope \
> +  pthread_attr_getsigmask \
>    pthread_attr_init \
>    pthread_attr_setaffinity \
>    pthread_attr_setdetachstate \
> @@ -54,6 +55,8 @@ routines = \
>    pthread_attr_setschedparam \
>    pthread_attr_setschedpolicy \
>    pthread_attr_setscope \
> +  pthread_attr_setsigmask \
> +  pthread_attr_setsigmask_internal \
>    pthread_cond_destroy \
>    pthread_cond_init \
>    pthread_condattr_destroy \
> @@ -330,6 +333,7 @@ tests = tst-attr2 tst-attr3 tst-default-attr \
>  	tst-thread-affinity-pthread2 \
>  	tst-thread-affinity-sched \
>  	tst-pthread-defaultattr-free \
> +	tst-pthread-attr-sigmask \

OK.

>  
>  
>  tests-container =  tst-pthread-getattr
> diff --git a/nptl/Versions b/nptl/Versions
> index e4696c128f..aed118e717 100644
> --- a/nptl/Versions
> +++ b/nptl/Versions
> @@ -44,7 +44,9 @@ libc {
>      thrd_current; thrd_equal; thrd_sleep; thrd_yield;
>    }
>    GLIBC_2.32 {
> +    pthread_attr_getsigmask_np;
>      pthread_attr_setaffinity_np;
> +    pthread_attr_setsigmask_np;
>      pthread_getaffinity_np;
>      pthread_getattr_np;
>      pthread_sigmask;
> @@ -62,6 +64,7 @@ libc {
>      __pthread_attr_init; __pthread_attr_destroy;
>      __pthread_attr_copy;
>      __pthread_getattr_default_np;
> +    __pthread_attr_setsigmask_internal;

OK.

>    }
>  }
>  
> diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
> index 7b3153594e..b48ce1f050 100644
> --- a/nptl/pthreadP.h
> +++ b/nptl/pthreadP.h
> @@ -528,6 +528,16 @@ extern int __pthread_getaffinity_np (pthread_t th, size_t cpusetsize,
>  				     cpu_set_t *cpuset);
>  libc_hidden_proto (__pthread_getaffinity_np)
>  
> +/* Special internal version of pthread_attr_setsigmask_np which does
> +   not filter out internal signals from *SIGMASK.  This can be used to
> +   launch threads with internal symbols blocked.  */

Typo: s/symbols/signals/g

> +  extern int __pthread_attr_setsigmask_internal (pthread_attr_t *attr,
> +						 const sigset_t *sigmask);
> +libc_hidden_proto (__pthread_attr_setsigmask_internal)
> +
> +extern __typeof (pthread_attr_getsigmask_np) __pthread_attr_getsigmask_np;
> +libc_hidden_proto (__pthread_attr_getsigmask_np)

OK.

> +
>  #if IS_IN (libpthread)
>  /* Special versions which use non-exported functions.  */
>  extern void __pthread_cleanup_push (struct _pthread_cleanup_buffer *buffer,
> diff --git a/nptl/pthread_attr_copy.c b/nptl/pthread_attr_copy.c
> index eb29557505..5d0c62f65c 100644
> --- a/nptl/pthread_attr_copy.c
> +++ b/nptl/pthread_attr_copy.c
> @@ -42,6 +42,11 @@ __pthread_attr_copy (pthread_attr_t *target, const pthread_attr_t *source)
>          ret = __pthread_attr_setaffinity_np (&temp.external,
>                                               isource->extension->cpusetsize,
>                                               isource->extension->cpuset);
> +
> +      /* Propagate the signal mask information.  */
> +      if (ret == 0 && isource->extension->sigmask_set)
> +        ret = __pthread_attr_setsigmask_internal ((pthread_attr_t *) &temp,
> +                                                  &isource->extension->sigmask);

OK.

>      }
>  
>    if (ret != 0)
> diff --git a/nptl/pthread_attr_getsigmask.c b/nptl/pthread_attr_getsigmask.c
> new file mode 100644
> index 0000000000..99b9812ef8
> --- /dev/null
> +++ b/nptl/pthread_attr_getsigmask.c
> @@ -0,0 +1,38 @@
> +/* Obtain the configured signal mask from a POSIX thread attribute.
> +   Copyright (C) 2020 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <pthreadP.h>
> +
> +int
> +__pthread_attr_getsigmask_np (const pthread_attr_t *attr, sigset_t *sigmask)
> +{
> +  struct pthread_attr *iattr = (struct pthread_attr *) attr;
> +
> +  if (iattr->extension == NULL || !iattr->extension->sigmask_set)
> +    {
> +      __sigemptyset (sigmask);
> +      return PTHREAD_ATTR_NO_SIGMASK_NP;
> +    }
> +  else
> +    {
> +      *sigmask = iattr->extension->sigmask;
> +      return 0;
> +    }
> +}
> +libc_hidden_def (__pthread_attr_getsigmask_np)
> +weak_alias (__pthread_attr_getsigmask_np, pthread_attr_getsigmask_np)

OK.

> diff --git a/nptl/pthread_attr_setsigmask.c b/nptl/pthread_attr_setsigmask.c
> new file mode 100644
> index 0000000000..4574f51056
> --- /dev/null
> +++ b/nptl/pthread_attr_setsigmask.c
> @@ -0,0 +1,34 @@
> +/* Set the signal mask in a POSIX thread attribute.  Public variant.
> +   Copyright (C) 2020 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <pthreadP.h>
> +#include <internal-signals.h>
> +
> +int
> +pthread_attr_setsigmask_np (pthread_attr_t *attr, const sigset_t *sigmask)
> +{
> +  int ret = __pthread_attr_setsigmask_internal (attr, sigmask);
> +  if (ret != 0)
> +    return ret;
> +
> +  /* Filter out internal signals.  */
> +  struct pthread_attr *iattr = (struct pthread_attr *) attr;
> +  __clear_internal_signals (&iattr->extension->sigmask);

OK.

> +
> +  return 0;
> +}
> diff --git a/nptl/pthread_attr_setsigmask_internal.c b/nptl/pthread_attr_setsigmask_internal.c
> new file mode 100644
> index 0000000000..a2941b4ee9
> --- /dev/null
> +++ b/nptl/pthread_attr_setsigmask_internal.c
> @@ -0,0 +1,45 @@
> +/* Set the signal mask in a POSIX thread attribute.  Internal variant.
> +   Copyright (C) 2020 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <pthreadP.h>
> +#include <internal-signals.h>
> +
> +int
> +__pthread_attr_setsigmask_internal (pthread_attr_t *attr,
> +                                    const sigset_t *sigmask)
> +{
> +  struct pthread_attr *iattr = (struct pthread_attr *) attr;
> +
> +  if (sigmask == NULL)
> +    {
> +      /* Mark the signal mask as unset if it is present.  */
> +      if (iattr->extension != NULL)
> +        iattr->extension->sigmask_set = false;
> +      return 0;

OK.

> +    }
> +
> +  int ret = __pthread_attr_extension (iattr);
> +  if (ret != 0)
> +    return ret;
> +
> +  iattr->extension->sigmask = *sigmask;
> +  iattr->extension->sigmask_set = true;
> +
> +  return 0;

OK.

> +}
> +libc_hidden_def (__pthread_attr_setsigmask_internal)
> diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
> index f6418eb5ed..35a9927cf2 100644
> --- a/nptl/pthread_create.c
> +++ b/nptl/pthread_create.c
> @@ -745,14 +745,23 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr,
>    sigset_t original_sigmask;
>    __libc_signal_block_all (&original_sigmask);
>  
> -  /* Conceptually, the new thread needs to inherit the signal mask of
> -     this thread.  Therefore, it needs to restore the saved signal
> -     mask of this thread, so save it in the startup information.  */
> -  pd->sigmask = original_sigmask;
> -
> -  /* Reset the cancellation signal mask in case this thread is running
> -     cancellation.  */
> -  __sigdelset (&pd->sigmask, SIGCANCEL);
> +  if (iattr->extension != NULL && iattr->extension->sigmask_set)
> +    /* Use the signal mask in the attribute.  The internal signals
> +       have already been filtered by the public
> +       pthread_attr_setsigmask_np interface.  */
> +    pd->sigmask = iattr->extension->sigmask;

OK. Very clean.

> +  else
> +    {
> +      /* Conceptually, the new thread needs to inherit the signal mask
> +	 of this thread.  Therefore, it needs to restore the saved
> +	 signal mask of this thread, so save it in the startup
> +	 information.  */
> +      pd->sigmask = original_sigmask;
> +
> +      /* Reset the cancellation signal mask in case this thread is
> +	 running cancellation.  */
> +      __sigdelset (&pd->sigmask, SIGCANCEL);

OK.

> +    }
>  
>    /* Start the thread.  */
>    if (__glibc_unlikely (report_thread_creation (pd)))
> diff --git a/nptl/tst-pthread-attr-sigmask.c b/nptl/tst-pthread-attr-sigmask.c
> new file mode 100644
> index 0000000000..8f854d8d11
> --- /dev/null
> +++ b/nptl/tst-pthread-attr-sigmask.c
> @@ -0,0 +1,204 @@
> +/* Tests for pthread_attr_setsigmask_np, pthread_attr_getsigmask_np.
> +   Copyright (C) 2020 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +/* This thread uses different masked status for SIGUSR1, SIGUSR2,
> +   SIGHUP to determine if signal masks are applied to new threads as
> +   expected.  */
> +
> +#include <signal.h>
> +#include <stdbool.h>
> +#include <stddef.h>
> +#include <stdio.h>
> +#include <support/check.h>
> +#include <support/xsignal.h>
> +#include <support/xthread.h>
> +#include <threads.h>
> +
> +typedef bool signals[_NSIG];
> +
> +static const char *
> +masked_or_unmasked (bool masked)
> +{
> +  if (masked)
> +    return "masked";
> +  else
> +    return "unmasked";
> +}
> +
> +/* Report an error if ACTUAL_MASK does not match EXPECTED_MASK.
> +   CONTEXT is used in error messages.  */
> +static void
> +check_sigmask (const char *context, signals expected_mask,
> +               const sigset_t *actual_mask)
> +{
> +  for (int sig = 1; sig < _NSIG; ++sig)
> +    if (sigismember (actual_mask, sig) != expected_mask[sig])
> +      {
> +        support_record_failure ();
> +        printf ("error: %s: signal %d should be %s, but is %s\n",
> +                context, sig,
> +                masked_or_unmasked (sigismember (actual_mask, sig)),
> +                masked_or_unmasked (expected_mask[sig]));
> +      }
> +}
> +
> +/* Report an error if the current thread signal mask does not match
> +   EXPECTED_MASK.  CONTEXT is used in error messages.  */
> +static void
> +check_current_sigmask (const char *context, signals expected_mask)
> +{
> +  sigset_t actual_mask;
> +  xpthread_sigmask (SIG_SETMASK, NULL, &actual_mask);
> +  check_sigmask (context, expected_mask, &actual_mask);
> +}
> +
> +/* Thread start routine which checks the current thread signal mask
> +   against CLOSURE.  */
> +static void *
> +check_sigmask_thread_function (void *closure)
> +{
> +  check_current_sigmask ("on thread", closure);
> +  return NULL;
> +}
> +
> +/* Same for C11 threads.  */
> +static int
> +check_sigmask_thread_function_c11 (void *closure)
> +{
> +  check_current_sigmask ("on C11 thread", closure);
> +  return 0;
> +}
> +
> +/* Launch a POSIX thread with ATTR (which can be NULL) and check that
> +   it has the expected signal mask.  */
> +static void
> +check_posix_thread (pthread_attr_t *attr, signals expected_mask)
> +{
> +  xpthread_join (xpthread_create (attr, check_sigmask_thread_function,
> +                                  expected_mask));
> +}
> +
> +/* Launch a C11 thread and check that it has the expected signal
> +   mask.  */
> +static void
> +check_c11_thread (signals expected_mask)
> +{
> +  thrd_t thr;
> +  TEST_VERIFY_EXIT (thrd_create (&thr, check_sigmask_thread_function_c11,
> +                                 expected_mask) == thrd_success);
> +  TEST_VERIFY_EXIT (thrd_join (thr, NULL) == thrd_success);
> +}
> +
> +static int
> +do_test (void)
> +{
> +  check_current_sigmask ("initial mask", (signals) { false, });
> +  check_posix_thread (NULL, (signals) { false, });
> +  check_c11_thread ((signals) { false, });

OK. Defaults.

> +
> +  sigset_t set;
> +  sigemptyset (&set);
> +  sigaddset (&set, SIGUSR1);
> +  xpthread_sigmask (SIG_SETMASK, &set, NULL);
> +  check_current_sigmask ("SIGUSR1 masked", (signals) { [SIGUSR1] = true, });
> +  /* The signal mask is inherited by the new thread.  */
> +  check_posix_thread (NULL, (signals) { [SIGUSR1] = true, });
> +  check_c11_thread ((signals) { [SIGUSR1] = true, });

OK. Inherited.

> +
> +  pthread_attr_t attr;
> +  xpthread_attr_init (&attr);
> +  TEST_COMPARE (pthread_attr_getsigmask_np (&attr, &set),
> +                PTHREAD_ATTR_NO_SIGMASK_NP);
> +  /* By default, the signal mask is inherited (even with an explicit
> +     thread attribute).  */
> +  check_posix_thread (&attr, (signals) { [SIGUSR1] = true, });
> +
> +  /* Check that pthread_attr_getsigmask_np can obtain the signal
> +     mask.  */
> +  sigemptyset (&set);
> +  sigaddset (&set, SIGUSR2);
> +  TEST_COMPARE (pthread_attr_setsigmask_np (&attr, &set), 0);
> +  sigemptyset (&set);
> +  TEST_COMPARE (pthread_attr_getsigmask_np (&attr, &set), 0);
> +  check_sigmask ("pthread_attr_getsigmask_np", (signals) { [SIGUSR2] = true, },
> +                 &set);

OK. Inherited with an explicit thread attribute.

> +
> +  /* Check that a thread is launched with the configured signal
> +     mask.  */
> +  check_current_sigmask ("SIGUSR1 masked", (signals) { [SIGUSR1] = true, });
> +  check_posix_thread (&attr, (signals) { [SIGUSR2] = true, });
> +  check_current_sigmask ("SIGUSR1 masked", (signals) { [SIGUSR1] = true, });
> +
> +  /* But C11 threads remain at inheritance.  */
> +  check_c11_thread ((signals) { [SIGUSR1] = true, });
> +
> +  /* Check that filling the original signal set does not affect thread
> +     creation.  */
> +  sigfillset (&set);
> +  check_posix_thread (&attr, (signals) { [SIGUSR2] = true, });
> +
> +  /* Check that clearing the signal in the attribute restores
> +     inheritance.  */
> +  TEST_COMPARE (pthread_attr_setsigmask_np (&attr, NULL), 0);
> +  TEST_COMPARE (pthread_attr_getsigmask_np (&attr, &set),
> +                PTHREAD_ATTR_NO_SIGMASK_NP);
> +  check_posix_thread (&attr, (signals) { [SIGUSR1] = true, });
> +
> +  /* Mask SIGHUP via the default thread attribute.  */
> +  sigemptyset (&set);
> +  sigaddset (&set, SIGHUP);
> +  TEST_COMPARE (pthread_attr_setsigmask_np (&attr, &set), 0);
> +  TEST_COMPARE (pthread_setattr_default_np (&attr), 0);
> +
> +  /* Check that the mask was applied to the default attribute.  */
> +  xpthread_attr_destroy (&attr);
> +  TEST_COMPARE (pthread_getattr_default_np (&attr), 0);
> +  sigaddset (&set, SIGHUP);
> +  TEST_COMPARE (pthread_attr_getsigmask_np (&attr, &set), 0);
> +  check_sigmask ("default attribute", (signals) { [SIGHUP] = true, }, &set);
> +  xpthread_attr_destroy (&attr);
> +
> +  /* Check that the default attribute is applied.  */
> +  check_posix_thread (NULL, (signals) { [SIGHUP] = true, });
> +  check_c11_thread ((signals) { [SIGHUP] = true, });
> +
> +  /* An explicit attribute with no signal mask triggers inheritance
> +     even if the default has been changed.  */
> +  xpthread_attr_init (&attr);
> +  check_posix_thread (&attr, (signals) { [SIGUSR1] = true, });
> +
> +  /* Explicitly setting the signal mask affects the new thread even
> +     with a default attribute.  */
> +  sigemptyset (&set);
> +  sigaddset (&set, SIGUSR2);
> +  TEST_COMPARE (pthread_attr_setsigmask_np (&attr, &set), 0);
> +  check_posix_thread (&attr, (signals) { [SIGUSR2] = true, });
> +
> +  /* Resetting the default attribute brings back the old inheritance
> +     behavior.  */
> +  xpthread_attr_destroy (&attr);
> +  xpthread_attr_init (&attr);
> +  TEST_COMPARE (pthread_setattr_default_np (&attr), 0);
> +  xpthread_attr_destroy (&attr);
> +  check_posix_thread (NULL, (signals) { [SIGUSR1] = true, });
> +  check_c11_thread ((signals) { [SIGUSR1] = true, });

OK.

> +
> +  return 0;
> +}
> +
> +#include <support/test-driver.c>
> diff --git a/sysdeps/nptl/internaltypes.h b/sysdeps/nptl/internaltypes.h
> index ca57c315d4..65584cbb7e 100644
> --- a/sysdeps/nptl/internaltypes.h
> +++ b/sysdeps/nptl/internaltypes.h
> @@ -65,6 +65,9 @@ struct pthread_attr_extension
>    /* Affinity map.  */
>    cpu_set_t *cpuset;
>    size_t cpusetsize;
> +
> +  sigset_t sigmask;
> +  bool sigmask_set;

OK. Add to extension.

>  };
>  
>  /* Mutex attribute data structure.  */
> diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h
> index 44dd707896..8a403cbf36 100644
> --- a/sysdeps/nptl/pthread.h
> +++ b/sysdeps/nptl/pthread.h
> @@ -27,6 +27,7 @@
>  #include <bits/setjmp.h>
>  #include <bits/wordsize.h>
>  #include <bits/types/struct_timespec.h>
> +#include <bits/types/__sigset_t.h>
>  
>  
>  /* Detach state.  */
> @@ -385,6 +386,20 @@ extern int pthread_attr_getaffinity_np (const pthread_attr_t *__attr,
>  extern int pthread_getattr_default_np (pthread_attr_t *__attr)
>       __THROW __nonnull ((1));
>  
> +/* Store *SIGMASK as the signal mask for the new thread in *ATTR.  */
> +extern int pthread_attr_setsigmask_np (pthread_attr_t *__attr,
> +				       const __sigset_t *sigmask);
> +
> +/* Store the signal mask of *ATTR in *SIGMASK.  If there is no signal
> +   mask stored, return PTHREAD_ATTR_NOSIGMASK_NP.  Return zero on
> +   success.  */
> +extern int pthread_attr_getsigmask_np (const pthread_attr_t *__attr,
> +				       __sigset_t *sigmask);
> +
> +/* Special return value from pthread_attr_getsigmask_np if the signal
> +   mask has not been set.  */
> +#define PTHREAD_ATTR_NO_SIGMASK_NP (-1)

OK.

> +
>  /* Set the default attributes to be used by pthread_create in this
>     process.  */
>  extern int pthread_setattr_default_np (const pthread_attr_t *__attr)
> diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> index 6dc59b38b0..48c790b15d 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
> @@ -2149,7 +2149,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> index fd628bcd28..cb70cb974f 100644
> --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
> @@ -2231,7 +2231,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index d0b1cd24c9..573eca117e 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -133,7 +133,9 @@ GLIBC_2.30 twalk_r F
>  GLIBC_2.31 msgctl F
>  GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index 3dde0ef8bd..8a8633f0a4 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -130,7 +130,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index 4db9bbd971..3042a93084 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -2093,7 +2093,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index 52aa86b191..a02a576321 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -2052,7 +2052,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index 48ee395a64..f0b9c9e070 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -2218,7 +2218,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> index 34458f348f..1534fd7a24 100644
> --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist
> @@ -2084,7 +2084,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index 377326b12c..9a0ada4b52 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -134,7 +134,9 @@ GLIBC_2.30 twalk_r F
>  GLIBC_2.31 msgctl F
>  GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index 81eea10680..333c35bf16 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -2164,7 +2164,9 @@ GLIBC_2.30 twalk_r F
>  GLIBC_2.31 msgctl F
>  GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index ff75663747..824eceec11 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -2144,7 +2144,9 @@ GLIBC_2.30 twalk_r F
>  GLIBC_2.31 msgctl F
>  GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index e9a6375dfc..5a6dcdd21b 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -2141,7 +2141,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index 598fc488c7..6e5dbb28f1 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -2135,7 +2135,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index 77e8d6b155..3ee64614b2 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -2133,7 +2133,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index a3aad2487f..dc62615524 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -2141,7 +2141,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> index c074f612f5..8cf78bcf51 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
> @@ -2135,7 +2135,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> index d1c638acb9..7817aeb0e2 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> @@ -2182,7 +2182,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index bfc8185b0e..ca04e8f2d3 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -2191,7 +2191,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> index 9a889f1bc6..10cb895639 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> @@ -2224,7 +2224,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> index b69f4b126f..96ddc448d7 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
> @@ -2054,7 +2054,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> index a07753847d..deddb53d83 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
> @@ -2344,7 +2344,9 @@ GLIBC_2.32 __wcstoieee128_l F
>  GLIBC_2.32 __wprintf_chkieee128 F
>  GLIBC_2.32 __wprintfieee128 F
>  GLIBC_2.32 __wscanfieee128 F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> index 6d5a52dc1a..58217dcb13 100644
> --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
> @@ -2111,7 +2111,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index ae3849d3f6..c22c29b35a 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -2189,7 +2189,9 @@ GLIBC_2.30 twalk_r F
>  GLIBC_2.31 msgctl F
>  GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> index 2eb931c02c..568f1727c4 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
> @@ -2090,7 +2090,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index ce4f366fbb..d9988dae90 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -2059,7 +2059,9 @@ GLIBC_2.30 twalk_r F
>  GLIBC_2.31 msgctl F
>  GLIBC_2.31 semctl F
>  GLIBC_2.31 shmctl F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index f37a08ab09..39edeffe82 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -2056,7 +2056,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index af3a5e2618..8668e15e8c 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -2180,7 +2180,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> index 1fccc06f21..eb884afa3e 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
> @@ -2107,7 +2107,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> index 03af18babb..a208fb3556 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
> @@ -2065,7 +2065,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> index 2da0af70d4..3eca3493e2 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
> @@ -2162,7 +2162,9 @@ GLIBC_2.30 getdents64 F
>  GLIBC_2.30 gettid F
>  GLIBC_2.30 tgkill F
>  GLIBC_2.30 twalk_r F
> +GLIBC_2.32 pthread_attr_getsigmask_np F
>  GLIBC_2.32 pthread_attr_setaffinity_np F
> +GLIBC_2.32 pthread_attr_setsigmask_np F
>  GLIBC_2.32 pthread_getaffinity_np F
>  GLIBC_2.32 pthread_getattr_np F
>  GLIBC_2.32 pthread_sigmask F
> 

OK. Update ABI.

-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 18/19] manual: Add pthread_attr_setsigmask_np, pthread_attr_getsigmask_np
  2020-05-19 10:45 ` [PATCH 18/19] manual: " Florian Weimer via Libc-alpha
  2020-05-20  7:39   ` Michael Kerrisk via Libc-alpha
@ 2020-06-02  4:05   ` Carlos O'Donell via Libc-alpha
  1 sibling, 0 replies; 42+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2020-06-02  4:05 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha; +Cc: Michael Kerrisk (man-pages)

On 5/19/20 6:45 AM, Florian Weimer via Libc-alpha wrote:
> And the PTHREAD_ATTR_NO_SIGMASK_NP constant.
> ---
>  manual/threads.texi | 47 +++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 47 insertions(+)
> 

OK for master. Straight forward extension of the existing API and makes
it easier to set the signal mask for the created thread in the attribute.
The extension mechanism implemented for this should allow more flexible
changes in the future.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> diff --git a/manual/threads.texi b/manual/threads.texi
> index a425635179..28d7cf2abd 100644
> --- a/manual/threads.texi
> +++ b/manual/threads.texi
> @@ -625,6 +625,7 @@ the standard.
>  @menu
>  * Default Thread Attributes::             Setting default attributes for
>  					  threads in a process.
> +* Initial Thread Signal Mask::            Setting the initial mask of threads.
>  * Waiting with Explicit Clocks::          Functions for waiting with an
>                                            explicit clock specification.
>  @end menu
> @@ -671,6 +672,52 @@ The system does not have sufficient memory.
>  @end table
>  @end deftypefun
>  
> +@node Initial Thread Signal Mask
> +@subsubsection Controlling the Initial Signal Mask of a New Thread
> +
> +@Theglibc{} provides a way to specify the initial signal mask of a
> +thread created using @code{pthread_create}, passing a thread attribute
> +object configured for this purpose.
> +
> +These functions achieve the same effect as blocking all signals using
> +@code{pthread_sigmask} before creating the thread, and setting the
> +desired signal mask from the new thread, but in a more explicit
> +fashion.
> +
> +@deftypefun int pthread_attr_setsigmask_np (pthread_attr_t *@var{attr}, const sigset_t *@var{sigmask})
> +@standards{GNU, pthread.h}
> +@safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{}}@acunsafe{@acsmem{}}}
> +Change the initial signal mask specified by @var{attr}.  If
> +@var{sigmask} is not @code{NULL}, the initial signal mask for new
> +threads created with @var{attr} is set to @code{*@var{sigmask}}.  If
> +@var{sigmask} is @code{NULL}, @var{attr} will no longer specify an
> +explicit signal mask, so that the initial signal mask of the new
> +thread is inherited from the parent thread creating the new thread.

OK.

> +
> +This function returns zero on success, and @code{ENOMEM} on memory
> +allocation failure.

OK.

> +@end deftypefun
> +
> +@deftypefun int pthread_attr_getsigmask_np (const pthread_attr_t *@var{attr}, sigset_t *@var{sigmask})
> +@standards{GNU, pthread.h}
> +@safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{}}@acunsafe{@acsmem{}}}
> +Retrieve the initial signal mask stored in @var{attr} and write it ot
> +@code{*@var{sigmask}}.  If the signal mask has not been set, return
> +the special constant @code{PTHREAD_ATTR_NO_SIGMASK_NP}, otherwise
> +return zero.

OK.

> +
> +Obtaining the signal mask only works if it has been previously stored
> +by @code{pthread_attr_setsigmask_np}.  For example, the
> +@code{pthread_getattr_np} function does not obtain the current signal
> +mask of the specified thread, and @code{pthread_attr_setsigmask_np}
> +will subsequently report the signal mask as unset.
> +@end deftypefun
> +
> +@deftypevr Macro int PTHREAD_ATTR_NO_SIGMASK_NP
> +The special value returned by @code{pthread_attr_setsigmask_np} to
> +indicate that no signal mask has been set for the attribute.

OK.

> +@end deftypevr
> +
>  @node Waiting with Explicit Clocks
>  @subsubsection Functions for Waiting According to a Specific Clock
>  
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 19/19] Linux: Use __pthread_attr_setsigmask_internal for timer helper thread
  2020-05-19 10:45 ` [PATCH 19/19] Linux: Use __pthread_attr_setsigmask_internal for timer helper thread Florian Weimer via Libc-alpha
@ 2020-06-02  4:07   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 42+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2020-06-02  4:07 UTC (permalink / raw)
  To: Florian Weimer, libc-alpha

On 5/19/20 6:45 AM, Florian Weimer via Libc-alpha wrote:
> timer_create needs to create threads with all signals blocked,
> including SIGTIMER (which happens to equal SIGCANCEL).  Add a new
> internal interface which provides an explicit way to achieve that.

OK with commit message fixed (last sentence removed).

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> 
> Fixes commit b3cae39dcbfa2432b3f3aa28854d8ac57f0de1b8 ("nptl: Start
> new threads with all signals blocked [BZ #25098]").
> ---
>  sysdeps/unix/sysv/linux/timer_routines.c | 19 ++++++++++---------
>  1 file changed, 10 insertions(+), 9 deletions(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/timer_routines.c b/sysdeps/unix/sysv/linux/timer_routines.c
> index 63083f6f91..86fad2a2c0 100644
> --- a/sysdeps/unix/sysv/linux/timer_routines.c
> +++ b/sysdeps/unix/sysv/linux/timer_routines.c
> @@ -136,23 +136,24 @@ __start_helper_thread (void)
>    (void) pthread_attr_init (&attr);
>    (void) pthread_attr_setstacksize (&attr, __pthread_get_minstack (&attr));
>  
> -  /* Block all signals in the helper thread but SIGSETXID.  To do this
> -     thoroughly we temporarily have to block all signals here.  The
> -     helper can lose wakeups if SIGTIMER is not blocked throughout.  */
> +  /* Block all signals in the helper thread but SIGSETXID.  */
>    sigset_t ss;
> -  __libc_signal_block_app (&ss);
> -  __libc_signal_block_sigtimer (NULL);
> +  __sigfillset (&ss);
> +  __sigdelset (&ss, SIGSETXID);
> +  int res = __pthread_attr_setsigmask_internal (&attr, &ss);

OK. Yay, use the interface :-)

> +  if (res != 0)
> +    {
> +      pthread_attr_destroy (&attr);
> +      return;
> +    }
>  
>    /* Create the helper thread for this timer.  */
>    pthread_t th;
> -  int res = pthread_create (&th, &attr, timer_helper_thread, NULL);
> +  res = pthread_create (&th, &attr, timer_helper_thread, NULL);

OK.

>    if (res == 0)
>      /* We managed to start the helper thread.  */
>      __helper_tid = ((struct pthread *) th)->tid;
>  
> -  /* Restore the signal mask.  */
> -  __libc_signal_restore_set (&ss);

OK.

> -
>    /* No need for the attribute anymore.  */
>    (void) pthread_attr_destroy (&attr);
>  
> 


-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 18/19] manual: Add pthread_attr_setsigmask_np, pthread_attr_getsigmask_np
  2020-05-20  7:39   ` Michael Kerrisk via Libc-alpha
@ 2020-06-03  9:26     ` Florian Weimer via Libc-alpha
  0 siblings, 0 replies; 42+ messages in thread
From: Florian Weimer via Libc-alpha @ 2020-06-03  9:26 UTC (permalink / raw)
  To: Michael Kerrisk; +Cc: libc-alpha

* Michael Kerrisk:

> Hi Florian,
>
> On Tue, May 19, 2020 at 2:04 PM Florian Weimer via Libc-alpha
> <libc-alpha@sourceware.org> wrote:
>>
>> And the PTHREAD_ATTR_NO_SIGMASK_NP constant.
>> ---
>>  manual/threads.texi | 47 +++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 47 insertions(+)
>>
>> diff --git a/manual/threads.texi b/manual/threads.texi
>> index a425635179..28d7cf2abd 100644
>> --- a/manual/threads.texi
>> +++ b/manual/threads.texi
>> @@ -625,6 +625,7 @@ the standard.
>>  @menu
>>  * Default Thread Attributes::             Setting default attributes for
>>                                           threads in a process.
>> +* Initial Thread Signal Mask::            Setting the initial mask of threads.
>>  * Waiting with Explicit Clocks::          Functions for waiting with an
>>                                            explicit clock specification.
>>  @end menu
>> @@ -671,6 +672,52 @@ The system does not have sufficient memory.
>>  @end table
>>  @end deftypefun
>>
>> +@node Initial Thread Signal Mask
>> +@subsubsection Controlling the Initial Signal Mask of a New Thread
>> +
>> +@Theglibc{} provides a way to specify the initial signal mask of a
>> +thread created using @code{pthread_create}, passing a thread attribute
>> +object configured for this purpose.
>> +
>> +These functions achieve the same effect as blocking all signals using
>> +@code{pthread_sigmask} before creating the thread, and setting the
>> +desired signal mask from the new thread, but in a more explicit
>> +fashion.
>
> So, I'm not quite clear what's going on here. Is it like this:
>
> First thread
>
> Block all signals
>     |
>     V
> Create new thread --->NEW THREAD ---> Set mask to attr value
>     |
>     V
> Restore signal mask to original value.
>
> If so, maybe that could be explained a bit more explicitly?

I added this as a longer explanation to the end of the section and
dropped the second paragraph quoted above.

>> +@deftypefun int pthread_attr_setsigmask_np (pthread_attr_t *@var{attr}, const sigset_t *@var{sigmask})
>> +@standards{GNU, pthread.h}
>> +@safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{}}@acunsafe{@acsmem{}}}
>> +Change the initial signal mask specified by @var{attr}.  If
>> +@var{sigmask} is not @code{NULL}, the initial signal mask for new
>> +threads created with @var{attr} is set to @code{*@var{sigmask}}.  If
>> +@var{sigmask} is @code{NULL}, @var{attr} will no longer specify an
>> +explicit signal mask, so that the initial signal mask of the new
>> +thread is inherited from the parent thread creating the new thread.
>
> I don't like "parent" here. Threads are peers.
>
> s/parent thread creating the new thread/creating thread/

This is what I have now:

+@var{sigmask} is @code{NULL}, @var{attr} will no longer specify an
+explicit signal mask, so that the initial signal mask of the new
+thread is inherited from the thread that calls @code{pthread_create}.

>> +
>> +This function returns zero on success, and @code{ENOMEM} on memory
>> +allocation failure.
>> +@end deftypefun
>> +
>> +@deftypefun int pthread_attr_getsigmask_np (const pthread_attr_t *@var{attr}, sigset_t *@var{sigmask})
>> +@standards{GNU, pthread.h}
>> +@safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{}}@acunsafe{@acsmem{}}}
>> +Retrieve the initial signal mask stored in @var{attr} and write it ot
>
> s/initial// ?
> s/write/save/ ?
> s/ot/to/

Fixed:

+Retrieve the signal mask stored in @var{attr} and copy it to
+@code{*@var{sigmask}}.  If the signal mask has not been set, return

>> +@code{*@var{sigmask}}.  If the signal mask has not been set, return
>> +the special constant @code{PTHREAD_ATTR_NO_SIGMASK_NP}, otherwise
>> +return zero.
>> +
>> +Obtaining the signal mask only works if it has been previously stored
>> +by @code{pthread_attr_setsigmask_np}.  For example, the
>> +@code{pthread_getattr_np} function does not obtain the current signal
>> +mask of the specified thread, and @code{pthread_attr_setsigmask_np}
>> +will subsequently report the signal mask as unset.
>> +@end deftypefun
>
> I see what you're trying to say above, but maybe it would be clearer
> to say something like: all that these APIs are doing is manipulating
> an attribute setting in an object that is used to create new threads
> and pthread_attr_getsigmask_np simply retrieves that attribute setting
> (and never the calling thread's signal mask).

The problem is that this should be really in the documentation of
pthread_getattr_np, which is currently undocumented. 8-(

I'm going to add a comment in front of the paragraph:

+@c Move this to the documentation of pthread_getattr_np once it exists.

I also fixed the second reference to pthread_attr_setsigmask_np (should
have been pthread_attr_getsigmask_np).

We could parse /proc/TID/status in pthread_getattr_np, to obtain the
signal mask of a foreign thread, but that seems over the top to me.

I'm going to post a new patch shortly.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2020-06-03  9:26 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19 10:43 [PATCH 00/19] Signal mask for timer helper thread Florian Weimer via Libc-alpha
2020-05-19 10:44 ` [PATCH 01/19] manual: Add missing section and node for clockid_t wait functions Florian Weimer via Libc-alpha
2020-05-20 13:12   ` Carlos O'Donell via Libc-alpha
2020-05-19 10:44 ` [PATCH 02/19] nptl: Replace some stubs with the Linux implementation Florian Weimer via Libc-alpha
2020-05-20 13:27   ` Carlos O'Donell via Libc-alpha
2020-05-19 10:44 ` [PATCH 03/19] nptl: Move pthread_attr_setaffinity_np into libc Florian Weimer via Libc-alpha
2020-05-20 13:31   ` Carlos O'Donell via Libc-alpha
2020-05-19 10:44 ` [PATCH 04/19] nptl: Move pthread_getaffinity_np " Florian Weimer via Libc-alpha
2020-05-20 13:52   ` Carlos O'Donell via Libc-alpha
2020-05-19 10:44 ` [PATCH 05/19] nptl: Move pthread_gettattr_np " Florian Weimer via Libc-alpha
2020-05-20 13:57   ` Carlos O'Donell via Libc-alpha
2020-05-19 10:44 ` [PATCH 06/19] nptl: Make __pthread_attr_init, __pthread_attr_destroy available internally Florian Weimer via Libc-alpha
2020-05-20 13:59   ` Carlos O'Donell via Libc-alpha
2020-05-19 10:44 ` [PATCH 07/19] nptl: Add __pthread_attr_copy for copying pthread_attr_t objects Florian Weimer via Libc-alpha
2020-05-20 14:10   ` Carlos O'Donell via Libc-alpha
2020-05-19 10:44 ` [PATCH 08/19] nptl: Use __pthread_attr_copy in pthread_getattr_default_np (bug 25999) Florian Weimer via Libc-alpha
2020-05-20 14:42   ` Carlos O'Donell via Libc-alpha
2020-05-19 10:44 ` [PATCH 09/19] nptl: Use __pthread_attr_copy in pthread_setattr_default_np Florian Weimer via Libc-alpha
2020-05-20 14:48   ` Carlos O'Donell via Libc-alpha
2020-05-19 10:44 ` [PATCH 10/19] <libc-symbols.h>: Add libpthread hidden alias support Florian Weimer via Libc-alpha
2020-05-20 14:51   ` Carlos O'Donell via Libc-alpha
2020-05-19 10:44 ` [PATCH 11/19] nptl: Add internal alias __pthread_getattr_default_np Florian Weimer via Libc-alpha
2020-06-02  3:28   ` Carlos O'Donell via Libc-alpha
2020-05-19 10:44 ` [PATCH 12/19] nptl: Use __pthread_getattr_default_np in pthread_create Florian Weimer via Libc-alpha
2020-06-02  3:34   ` Carlos O'Donell via Libc-alpha
2020-05-19 10:44 ` [PATCH 13/19] nptl: Use __pthread_attr_setaffinity_np in pthread_getattr_np Florian Weimer via Libc-alpha
2020-06-02  3:36   ` Carlos O'Donell via Libc-alpha
2020-05-19 10:44 ` [PATCH 14/19] nptl: Change type of __default_pthread_attr Florian Weimer via Libc-alpha
2020-06-02  3:39   ` Carlos O'Donell via Libc-alpha
2020-05-19 10:44 ` [PATCH 15/19] nptl: Destroy the default thread attribute as part of freeres Florian Weimer via Libc-alpha
2020-06-02  3:41   ` Carlos O'Donell via Libc-alpha
2020-05-19 10:44 ` [PATCH 16/19] nptl: Make pthread_attr_t dynamically extensible Florian Weimer via Libc-alpha
2020-06-02  3:47   ` Carlos O'Donell via Libc-alpha
2020-05-19 10:44 ` [PATCH 17/19] nptl: Add pthread_attr_setsigmask_np, pthread_attr_getsigmask_np Florian Weimer via Libc-alpha
2020-06-02  4:01   ` Carlos O'Donell via Libc-alpha
2020-05-19 10:45 ` [PATCH 18/19] manual: " Florian Weimer via Libc-alpha
2020-05-20  7:39   ` Michael Kerrisk via Libc-alpha
2020-06-03  9:26     ` Florian Weimer via Libc-alpha
2020-06-02  4:05   ` Carlos O'Donell via Libc-alpha
2020-05-19 10:45 ` [PATCH 19/19] Linux: Use __pthread_attr_setsigmask_internal for timer helper thread Florian Weimer via Libc-alpha
2020-06-02  4:07   ` Carlos O'Donell via Libc-alpha
2020-05-20 13:11 ` [PATCH 00/19] Signal mask " Carlos O'Donell via Libc-alpha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).