  @c pthread_atfork
  @c pthread_attr_destroy
 diff --git a/nptl/Makefile b/nptl/Makefile
-index fa925819ca..ef85c23f21 100644
+index 0d8aadebed..85f83b1aa5 100644
 --- a/nptl/Makefile
 +++ b/nptl/Makefile
 @@ -78,6 +78,7 @@ libpthread-routines = nptl-init vars events version pt-interp \

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
<Ported to glibc 2.23 by Ioan-Adrian Ratiu>
Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
---
 manual/threads.texi                                | 40 ++++++++++++++
 nptl/Makefile                                      |  2 +
 nptl/Versions                                      |  5 ++
 nptl/pthread_cond_broadcast.c                      |  7 +--
 nptl/pthread_cond_destroy.c                        |  9 ++--
 nptl/pthread_cond_init.c                           | 22 +++++++-
 nptl/pthread_cond_signal.c                         |  7 +--
 nptl/pthread_cond_timedwait.c                      | 15 +++---
 nptl/pthread_cond_wait.c                           | 16 +++---
 nptl/pthread_condattr_getclock.c                   |  5 +-
 nptl/pthread_condattr_getprotocol_np.c             | 28 ++++++++++
 nptl/pthread_condattr_getpshared.c                 |  3 +-
 nptl/pthread_condattr_setclock.c                   |  6 +--
 nptl/pthread_condattr_setprotocol_np.c             | 36 +++++++++++++
 nptl/pthread_condattr_setpshared.c                 |  3 +-
 nptl/sysdeps/pthread/cond-lock.h                   | 58 ++++++++++++++++++++
 nptl/sysdeps/unix/sysv/linux/lowlevelpilock.c      | 61 ++++++++++++++++++++++
 sysdeps/nptl/internaltypes.h                       | 30 ++++++++---
 sysdeps/nptl/pthread.h                             | 14 +++++
 sysdeps/unix/sysv/linux/aarch64/libpthread.abilist |  3 ++
 sysdeps/unix/sysv/linux/alpha/libpthread.abilist   |  3 ++
 sysdeps/unix/sysv/linux/arm/libpthread.abilist     |  3 ++
 sysdeps/unix/sysv/linux/i386/libpthread.abilist    |  3 ++
 sysdeps/unix/sysv/linux/ia64/libpthread.abilist    |  3 ++
 .../sysv/linux/m68k/coldfire/libpthread.abilist    |  3 ++
 .../unix/sysv/linux/m68k/m680x0/libpthread.abilist |  3 ++
 .../unix/sysv/linux/microblaze/libpthread.abilist  |  3 ++
 .../unix/sysv/linux/mips/mips32/libpthread.abilist |  3 ++
 .../unix/sysv/linux/mips/mips64/libpthread.abilist |  3 ++
 .../linux/powerpc/powerpc32/libpthread.abilist     |  3 ++
 .../linux/powerpc/powerpc64/libpthread.abilist     |  3 ++
 .../sysv/linux/s390/s390-32/libpthread.abilist     |  3 ++
 .../sysv/linux/s390/s390-64/libpthread.abilist     |  3 ++
 sysdeps/unix/sysv/linux/sh/libpthread.abilist      |  3 ++
 .../sysv/linux/sparc/sparc32/libpthread.abilist    |  3 ++
 .../sysv/linux/sparc/sparc64/libpthread.abilist    |  3 ++
 .../linux/tile/tilegx/tilegx32/libpthread.abilist  |  3 ++
 .../linux/tile/tilegx/tilegx64/libpthread.abilist  |  3 ++
 .../sysv/linux/tile/tilepro/libpthread.abilist     |  3 ++
 .../unix/sysv/linux/x86_64/64/libpthread.abilist   |  3 ++
 .../unix/sysv/linux/x86_64/x32/libpthread.abilist  |  3 ++
 41 files changed, 394 insertions(+), 39 deletions(-)
 create mode 100644 nptl/pthread_condattr_getprotocol_np.c
 create mode 100644 nptl/pthread_condattr_setprotocol_np.c
 create mode 100644 nptl/sysdeps/pthread/cond-lock.h

   GLIBC_PRIVATE {
     __pthread_initialize_minimal;
     __pthread_clock_gettime; __pthread_clock_settime;
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index 4edc74b1ef..4cf5e50524 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -19,6 +19,7 @@
 #ifndef _PTHREADP_H
 #define _PTHREADP_H	1
 
+#include <assert.h>
 #include <pthread.h>
 #include <setjmp.h>
 #include <stdbool.h>
@@ -599,6 +600,24 @@ extern void __wait_lookup_done (void) attribute_hidden;
 # define USE_REQUEUE_PI(mut) 0
 #endif
 
+static bool
+prio_inherit_missing (void)
+{
+#ifdef __NR_futex
+  static int tpi_supported;
+  if (__glibc_unlikely (tpi_supported == 0))
+    {
+      int lock = 0;
+      INTERNAL_SYSCALL_DECL (err);
+      int ret = INTERNAL_SYSCALL (futex, err, 4, &lock, FUTEX_UNLOCK_PI, 0, 0);
+      assert (INTERNAL_SYSCALL_ERROR_P (ret, err));
+      tpi_supported = INTERNAL_SYSCALL_ERRNO (ret, err) == ENOSYS ? -1 : 1;
+    }
+  return __glibc_unlikely (tpi_supported < 0);
+#endif
+  return true;
+}
+
 /* Returns 0 if POL is a valid scheduling policy.  */
 static inline int
 check_sched_policy_attr (int pol)
diff --git a/nptl/pthread_cond_broadcast.c b/nptl/pthread_cond_broadcast.c
index 552fd42f60..0bf22fc205 100644
--- a/nptl/pthread_cond_broadcast.c
