[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[glibc] 01/02: Use a git command to build cvs-libpthread.diff



This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch sid
in repository glibc.

commit ae0904ae89501020ce3da791463cd71f7cbb1082
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Sun Oct 9 14:12:50 2016 +0200

    Use a git command to build cvs-libpthread.diff
---
 debian/patches/hurd-i386/cvs-libpthread.diff | 5973 ++++++++++++++------------
 1 file changed, 3215 insertions(+), 2758 deletions(-)

diff --git a/debian/patches/hurd-i386/cvs-libpthread.diff b/debian/patches/hurd-i386/cvs-libpthread.diff
index 34e624e..7ff62ef 100644
--- a/debian/patches/hurd-i386/cvs-libpthread.diff
+++ b/debian/patches/hurd-i386/cvs-libpthread.diff
@@ -1,240 +1,243 @@
-git snapshot 1f32bdc2e2f54cf4279b720909ff9c2d64a1c406
+git diff empty --patch-with-stat --src-prefix=glibc/libpthread/ --dst-prefix=glibc/libpthread/ 1f32bdc2e2f54cf4279b720909ff9c2d64a1c406
 from git.savannah.gnu.org:/srv/git/hurd/libpthread.git/
 thus by construction only libpthread/ files, thus hurd-only
 Date:   Wed Sep 21 00:05:53 2016 +0200
 
- ChangeLog                                     |    6 
- Makeconfig                                    |   12 
- Makefile                                      |  335 ++++++++++
- TODO                                          |  131 ++++
- Versions                                      |  146 ++++
- configure                                     |    2 
- configure.in                                  |    4 
- forward.c                                     |  249 +++++++
- include/pthread.h                             |    7 
- include/pthread/pthread.h                     |  835 ++++++++++++++++++++++++++
- include/pthread/pthreadtypes.h                |  125 +++
- libc_pthread_init.c                           |   35 +
- libpthread.a                                  |   22 
- libpthread_pic.a                              |   22 
- lockfile.c                                    |   65 ++
- not-in-libc.h                                 |   12 
- pthread/Versions                              |   15 
- pthread/alloca_cutoff.c                       |   27 
- pthread/cthreads-compat.c                     |  101 +++
- pthread/pt-alloc.c                            |  219 ++++++
- pthread/pt-cancel.c                           |   63 +
- pthread/pt-cleanup.c                          |   28 
- pthread/pt-create.c                           |  254 +++++++
- pthread/pt-dealloc.c                          |   69 ++
- pthread/pt-detach.c                           |   80 ++
- pthread/pt-exit.c                             |  112 +++
- pthread/pt-getattr.c                          |   51 +
- pthread/pt-initialize.c                       |   88 ++
- pthread/pt-internal.h                         |  330 ++++++++++
- pthread/pt-join.c                             |   76 ++
- pthread/pt-self.c                             |   34 +
- pthread/pt-setcancelstate.c                   |   47 +
- pthread/pt-setcanceltype.c                    |   47 +
- pthread/pt-sigmask.c                          |   33 +
- pthread/pt-spin-inlines.c                     |   34 +
- pthread/pt-testcancel.c                       |   36 +
- pthread/pt-yield.c                            |   26 
- pthreadP.h                                    |   26 
- shlib-versions                                |    1 
- sysdeps/generic/pt-atfork.c                   |   33 +
- sysdeps/generic/pt-attr-destroy.c             |   28 
- sysdeps/generic/pt-attr-getdetachstate.c      |   31 
- sysdeps/generic/pt-attr-getguardsize.c        |   29 
- sysdeps/generic/pt-attr-getinheritsched.c     |   31 
- sysdeps/generic/pt-attr-getschedparam.c       |   34 +
- sysdeps/generic/pt-attr-getschedpolicy.c      |   31 
- sysdeps/generic/pt-attr-getscope.c            |   31 
- sysdeps/generic/pt-attr-getstack.c            |   31 
- sysdeps/generic/pt-attr-getstackaddr.c        |   29 
- sysdeps/generic/pt-attr-getstacksize.c        |   29 
- sysdeps/generic/pt-attr-init.c                |   29 
- sysdeps/generic/pt-attr-setdetachstate.c      |   40 +
- sysdeps/generic/pt-attr-setguardsize.c        |   29 
- sysdeps/generic/pt-attr-setinheritsched.c     |   40 +
- sysdeps/generic/pt-attr-setschedparam.c       |   40 +
- sysdeps/generic/pt-attr-setschedpolicy.c      |   44 +
- sysdeps/generic/pt-attr-setscope.c            |   43 +
- sysdeps/generic/pt-attr-setstack.c            |   51 +
- sysdeps/generic/pt-attr-setstackaddr.c        |   29 
- sysdeps/generic/pt-attr-setstacksize.c        |   30 
- sysdeps/generic/pt-attr.c                     |   41 +
- sysdeps/generic/pt-barrier-destroy.c          |   27 
- sysdeps/generic/pt-barrier-init.c             |   53 +
- sysdeps/generic/pt-barrier-wait.c             |   69 ++
- sysdeps/generic/pt-barrier.c                  |   26 
- sysdeps/generic/pt-barrierattr-destroy.c      |   27 
- sysdeps/generic/pt-barrierattr-getpshared.c   |   29 
- sysdeps/generic/pt-barrierattr-init.c         |   28 
- sysdeps/generic/pt-barrierattr-setpshared.c   |   39 +
- sysdeps/generic/pt-cond-brdcast.c             |   45 +
- sysdeps/generic/pt-cond-destroy.c             |   29 
- sysdeps/generic/pt-cond-init.c                |   47 +
- sysdeps/generic/pt-cond-signal.c              |   43 +
- sysdeps/generic/pt-cond-timedwait.c           |  178 +++++
- sysdeps/generic/pt-cond-wait.c                |   39 +
- sysdeps/generic/pt-cond.c                     |   29 
- sysdeps/generic/pt-condattr-destroy.c         |   29 
- sysdeps/generic/pt-condattr-getclock.c        |   31 
- sysdeps/generic/pt-condattr-getpshared.c      |   29 
- sysdeps/generic/pt-condattr-init.c            |   30 
- sysdeps/generic/pt-condattr-setclock.c        |   52 +
- sysdeps/generic/pt-condattr-setpshared.c      |   39 +
- sysdeps/generic/pt-destroy-specific.c         |   28 
- sysdeps/generic/pt-equal.c                    |   31 
- sysdeps/generic/pt-getconcurrency.c           |   27 
- sysdeps/generic/pt-getcpuclockid.c            |   35 +
- sysdeps/generic/pt-getschedparam.c            |   31 
- sysdeps/generic/pt-getspecific.c              |   27 
- sysdeps/generic/pt-init-specific.c            |   27 
- sysdeps/generic/pt-key-create.c               |   30 
- sysdeps/generic/pt-key-delete.c               |   29 
- sysdeps/generic/pt-key.h                      |   22 
- sysdeps/generic/pt-kill.c                     |   33 +
- sysdeps/generic/pt-mutex-destroy.c            |   39 +
- sysdeps/generic/pt-mutex-getprioceiling.c     |   30 
- sysdeps/generic/pt-mutex-init.c               |   50 +
- sysdeps/generic/pt-mutex-lock.c               |   37 +
- sysdeps/generic/pt-mutex-setprioceiling.c     |   30 
- sysdeps/generic/pt-mutex-timedlock.c          |  196 ++++++
- sysdeps/generic/pt-mutex-transfer-np.c        |   66 ++
- sysdeps/generic/pt-mutex-trylock.c            |  112 +++
- sysdeps/generic/pt-mutex-unlock.c             |  108 +++
- sysdeps/generic/pt-mutexattr-destroy.c        |   27 
- sysdeps/generic/pt-mutexattr-getprioceiling.c |   30 
- sysdeps/generic/pt-mutexattr-getprotocol.c    |   29 
- sysdeps/generic/pt-mutexattr-getpshared.c     |   29 
- sysdeps/generic/pt-mutexattr-gettype.c        |   28 
- sysdeps/generic/pt-mutexattr-init.c           |   28 
- sysdeps/generic/pt-mutexattr-setprioceiling.c |   30 
- sysdeps/generic/pt-mutexattr-setprotocol.c    |   42 +
- sysdeps/generic/pt-mutexattr-setpshared.c     |   39 +
- sysdeps/generic/pt-mutexattr-settype.c        |   37 +
- sysdeps/generic/pt-mutexattr.c                |   45 +
- sysdeps/generic/pt-once.c                     |   45 +
- sysdeps/generic/pt-rwlock-attr.c              |   26 
- sysdeps/generic/pt-rwlock-destroy.c           |   29 
- sysdeps/generic/pt-rwlock-init.c              |   45 +
- sysdeps/generic/pt-rwlock-rdlock.c            |   33 +
- sysdeps/generic/pt-rwlock-timedrdlock.c       |  120 +++
- sysdeps/generic/pt-rwlock-timedwrlock.c       |  103 +++
- sysdeps/generic/pt-rwlock-tryrdlock.c         |   56 +
- sysdeps/generic/pt-rwlock-trywrlock.c         |   46 +
- sysdeps/generic/pt-rwlock-unlock.c            |   99 +++
- sysdeps/generic/pt-rwlock-wrlock.c            |   35 +
- sysdeps/generic/pt-rwlockattr-destroy.c       |   27 
- sysdeps/generic/pt-rwlockattr-getpshared.c    |   29 
- sysdeps/generic/pt-rwlockattr-init.c          |   28 
- sysdeps/generic/pt-rwlockattr-setpshared.c    |   39 +
- sysdeps/generic/pt-setconcurrency.c           |   34 +
- sysdeps/generic/pt-setschedparam.c            |   31 
- sysdeps/generic/pt-setschedprio.c             |   29 
- sysdeps/generic/pt-setspecific.c              |   27 
- sysdeps/generic/pt-startup.c                  |   25 
- sysdeps/generic/raise.c                       |   50 +
- sysdeps/generic/sem-close.c                   |   32 
- sysdeps/generic/sem-destroy.c                 |   38 +
- sysdeps/generic/sem-getvalue.c                |   33 +
- sysdeps/generic/sem-init.c                    |   46 +
- sysdeps/generic/sem-open.c                    |   32 
- sysdeps/generic/sem-post.c                    |   62 +
- sysdeps/generic/sem-timedwait.c               |  100 +++
- sysdeps/generic/sem-trywait.c                 |   42 +
- sysdeps/generic/sem-unlink.c                  |   32 
- sysdeps/generic/sem-wait.c                    |   32 
- sysdeps/generic/shm-directory.h               |   31 
- sysdeps/hurd/pt-destroy-specific.c            |   79 ++
- sysdeps/hurd/pt-getspecific.c                 |   40 +
- sysdeps/hurd/pt-init-specific.c               |   30 
- sysdeps/hurd/pt-key-create.c                  |  110 +++
- sysdeps/hurd/pt-key-delete.c                  |   64 +
- sysdeps/hurd/pt-key.h                         |   76 ++
- sysdeps/hurd/pt-kill.c                        |   52 +
- sysdeps/hurd/pt-setspecific.c                 |   48 +
- sysdeps/i386/bits/memory.h                    |   40 +
- sysdeps/i386/bits/pt-atomic.h                 |   66 ++
- sysdeps/i386/machine-sp.h                     |   30 
- sysdeps/i386/pt-machdep.h                     |   29 
- sysdeps/mach/bits/spin-lock-inline.h          |   90 ++
- sysdeps/mach/bits/spin-lock.h                 |   38 +
- sysdeps/mach/hurd/Implies                     |    2 
- sysdeps/mach/hurd/bits/pthread-np.h           |   38 +
- sysdeps/mach/hurd/i386/pt-machdep.c           |   83 ++
- sysdeps/mach/hurd/i386/pt-setup.c             |  110 +++
- sysdeps/mach/hurd/pt-attr-setstackaddr.c      |   29 
- sysdeps/mach/hurd/pt-attr-setstacksize.c      |   29 
- sysdeps/mach/hurd/pt-docancel.c               |   66 ++
- sysdeps/mach/hurd/pt-hurd-cond-timedwait.c    |  169 +++++
- sysdeps/mach/hurd/pt-hurd-cond-wait.c         |   41 +
- sysdeps/mach/hurd/pt-sigstate-destroy.c       |   28 
- sysdeps/mach/hurd/pt-sigstate-init.c          |   44 +
- sysdeps/mach/hurd/pt-sigstate.c               |   80 ++
- sysdeps/mach/hurd/pt-sysdep.c                 |   98 +++
- sysdeps/mach/hurd/pt-sysdep.h                 |   67 ++
- sysdeps/mach/i386/bits/spin-lock-inline.h     |   98 +++
- sysdeps/mach/i386/bits/spin-lock.h            |   39 +
- sysdeps/mach/pt-block.c                       |   39 +
- sysdeps/mach/pt-spin.c                        |   36 +
- sysdeps/mach/pt-stack-alloc.c                 |   69 ++
- sysdeps/mach/pt-thread-alloc.c                |   95 ++
- sysdeps/mach/pt-thread-start.c                |   51 +
- sysdeps/mach/pt-thread-terminate.c            |   85 ++
- sysdeps/mach/pt-timedblock.c                  |   68 ++
- sysdeps/mach/pt-wakeup.c                      |   38 +
- sysdeps/posix/pt-spin.c                       |   54 +
- sysdeps/pthread/Makefile                      |    4 
- sysdeps/pthread/bits/barrier-attr.h           |   32 
- sysdeps/pthread/bits/barrier.h                |   39 +
- sysdeps/pthread/bits/cancelation.h            |   51 +
- sysdeps/pthread/bits/condition-attr.h         |   34 +
- sysdeps/pthread/bits/condition.h              |   39 +
- sysdeps/pthread/bits/mutex-attr.h             |   41 +
- sysdeps/pthread/bits/mutex.h                  |   75 ++
- sysdeps/pthread/bits/once.h                   |   34 +
- sysdeps/pthread/bits/pthread-np.h             |   27 
- sysdeps/pthread/bits/pthread.h                |   38 +
- sysdeps/pthread/bits/pthreadtypes.h           |   29 
- sysdeps/pthread/bits/rwlock-attr.h            |   32 
- sysdeps/pthread/bits/rwlock.h                 |   46 +
- sysdeps/pthread/bits/semaphore.h              |   44 +
- sysdeps/pthread/bits/thread-attr.h            |   47 +
- sysdeps/pthread/bits/thread-specific.h        |   25 
- sysdeps/pthread/flockfile.c                   |   32 
- sysdeps/pthread/ftrylockfile.c                |   35 +
- sysdeps/pthread/funlockfile.c                 |   33 +
- sysdeps/pthread/libc-lockP.h                  |  158 ++++
- sysdeps/pthread/pthread-functions.h           |  141 ++++
- sysdeps/pthread/semaphore.h                   |   81 ++
- tests/.cvsignore                              |    1 
- tests/Makefile                                |   40 +
- tests/README                                  |    6 
- tests/test-1.c                                |   50 +
- tests/test-10.c                               |   46 +
- tests/test-11.c                               |  143 ++++
- tests/test-12.c                               |   29 
- tests/test-13.c                               |   66 ++
- tests/test-14.c                               |   44 +
- tests/test-15.c                               |   87 ++
- tests/test-16.c                               |   71 ++
- tests/test-17.c                               |   57 +
- tests/test-2.c                                |   39 +
- tests/test-3.c                                |   55 +
- tests/test-4.c                                |   86 ++
- tests/test-5.c                                |   75 ++
- tests/test-6.c                                |   96 ++
- tests/test-7.c                                |   70 ++
- tests/test-8.c                                |   60 +
- tests/test-9.c                                |   88 ++
- tests/test-__pthread_destroy_specific-skip.c  |   83 ++
+ ChangeLog                                     |   6 +
+ Makeconfig                                    |  12 +
+ Makefile                                      | 335 +++++++++++
+ TODO                                          | 131 ++++
+ Versions                                      | 146 +++++
+ configure                                     |   2 +
+ configure.in                                  |   4 +
+ forward.c                                     | 249 ++++++++
+ include/pthread.h                             |   7 +
+ include/pthread/pthread.h                     | 835 ++++++++++++++++++++++++++
+ include/pthread/pthreadtypes.h                | 125 ++++
+ libc_pthread_init.c                           |  35 ++
+ libpthread.a                                  |  22 +
+ libpthread_pic.a                              |  22 +
+ lockfile.c                                    |  65 ++
+ not-in-libc.h                                 |  12 +
+ pthread/Versions                              |  15 +
+ pthread/alloca_cutoff.c                       |  27 +
+ pthread/cthreads-compat.c                     | 101 ++++
+ pthread/pt-alloc.c                            | 219 +++++++
+ pthread/pt-cancel.c                           |  63 ++
+ pthread/pt-cleanup.c                          |  28 +
+ pthread/pt-create.c                           | 254 ++++++++
+ pthread/pt-dealloc.c                          |  69 +++
+ pthread/pt-detach.c                           |  80 +++
+ pthread/pt-exit.c                             | 112 ++++
+ pthread/pt-getattr.c                          |  51 ++
+ pthread/pt-initialize.c                       |  88 +++
+ pthread/pt-internal.h                         | 330 ++++++++++
+ pthread/pt-join.c                             |  76 +++
+ pthread/pt-self.c                             |  34 ++
+ pthread/pt-setcancelstate.c                   |  47 ++
+ pthread/pt-setcanceltype.c                    |  47 ++
+ pthread/pt-sigmask.c                          |  33 +
+ pthread/pt-spin-inlines.c                     |  34 ++
+ pthread/pt-testcancel.c                       |  36 ++
+ pthread/pt-yield.c                            |  26 +
+ pthreadP.h                                    |  26 +
+ shlib-versions                                |   1 +
+ sysdeps/generic/pt-atfork.c                   |  33 +
+ sysdeps/generic/pt-attr-destroy.c             |  28 +
+ sysdeps/generic/pt-attr-getdetachstate.c      |  31 +
+ sysdeps/generic/pt-attr-getguardsize.c        |  29 +
+ sysdeps/generic/pt-attr-getinheritsched.c     |  31 +
+ sysdeps/generic/pt-attr-getschedparam.c       |  34 ++
+ sysdeps/generic/pt-attr-getschedpolicy.c      |  31 +
+ sysdeps/generic/pt-attr-getscope.c            |  31 +
+ sysdeps/generic/pt-attr-getstack.c            |  31 +
+ sysdeps/generic/pt-attr-getstackaddr.c        |  29 +
+ sysdeps/generic/pt-attr-getstacksize.c        |  29 +
+ sysdeps/generic/pt-attr-init.c                |  29 +
+ sysdeps/generic/pt-attr-setdetachstate.c      |  40 ++
+ sysdeps/generic/pt-attr-setguardsize.c        |  29 +
+ sysdeps/generic/pt-attr-setinheritsched.c     |  40 ++
+ sysdeps/generic/pt-attr-setschedparam.c       |  40 ++
+ sysdeps/generic/pt-attr-setschedpolicy.c      |  44 ++
+ sysdeps/generic/pt-attr-setscope.c            |  43 ++
+ sysdeps/generic/pt-attr-setstack.c            |  51 ++
+ sysdeps/generic/pt-attr-setstackaddr.c        |  29 +
+ sysdeps/generic/pt-attr-setstacksize.c        |  30 +
+ sysdeps/generic/pt-attr.c                     |  41 ++
+ sysdeps/generic/pt-barrier-destroy.c          |  27 +
+ sysdeps/generic/pt-barrier-init.c             |  53 ++
+ sysdeps/generic/pt-barrier-wait.c             |  69 +++
+ sysdeps/generic/pt-barrier.c                  |  26 +
+ sysdeps/generic/pt-barrierattr-destroy.c      |  27 +
+ sysdeps/generic/pt-barrierattr-getpshared.c   |  29 +
+ sysdeps/generic/pt-barrierattr-init.c         |  28 +
+ sysdeps/generic/pt-barrierattr-setpshared.c   |  39 ++
+ sysdeps/generic/pt-cond-brdcast.c             |  45 ++
+ sysdeps/generic/pt-cond-destroy.c             |  29 +
+ sysdeps/generic/pt-cond-init.c                |  47 ++
+ sysdeps/generic/pt-cond-signal.c              |  43 ++
+ sysdeps/generic/pt-cond-timedwait.c           | 178 ++++++
+ sysdeps/generic/pt-cond-wait.c                |  39 ++
+ sysdeps/generic/pt-cond.c                     |  29 +
+ sysdeps/generic/pt-condattr-destroy.c         |  29 +
+ sysdeps/generic/pt-condattr-getclock.c        |  31 +
+ sysdeps/generic/pt-condattr-getpshared.c      |  29 +
+ sysdeps/generic/pt-condattr-init.c            |  30 +
+ sysdeps/generic/pt-condattr-setclock.c        |  52 ++
+ sysdeps/generic/pt-condattr-setpshared.c      |  39 ++
+ sysdeps/generic/pt-destroy-specific.c         |  28 +
+ sysdeps/generic/pt-equal.c                    |  31 +
+ sysdeps/generic/pt-getconcurrency.c           |  27 +
+ sysdeps/generic/pt-getcpuclockid.c            |  35 ++
+ sysdeps/generic/pt-getschedparam.c            |  31 +
+ sysdeps/generic/pt-getspecific.c              |  27 +
+ sysdeps/generic/pt-init-specific.c            |  27 +
+ sysdeps/generic/pt-key-create.c               |  30 +
+ sysdeps/generic/pt-key-delete.c               |  29 +
+ sysdeps/generic/pt-key.h                      |  22 +
+ sysdeps/generic/pt-kill.c                     |  33 +
+ sysdeps/generic/pt-mutex-destroy.c            |  39 ++
+ sysdeps/generic/pt-mutex-getprioceiling.c     |  30 +
+ sysdeps/generic/pt-mutex-init.c               |  50 ++
+ sysdeps/generic/pt-mutex-lock.c               |  37 ++
+ sysdeps/generic/pt-mutex-setprioceiling.c     |  30 +
+ sysdeps/generic/pt-mutex-timedlock.c          | 196 ++++++
+ sysdeps/generic/pt-mutex-transfer-np.c        |  66 ++
+ sysdeps/generic/pt-mutex-trylock.c            | 112 ++++
+ sysdeps/generic/pt-mutex-unlock.c             | 108 ++++
+ sysdeps/generic/pt-mutexattr-destroy.c        |  27 +
+ sysdeps/generic/pt-mutexattr-getprioceiling.c |  30 +
+ sysdeps/generic/pt-mutexattr-getprotocol.c    |  29 +
+ sysdeps/generic/pt-mutexattr-getpshared.c     |  29 +
+ sysdeps/generic/pt-mutexattr-gettype.c        |  28 +
+ sysdeps/generic/pt-mutexattr-init.c           |  28 +
+ sysdeps/generic/pt-mutexattr-setprioceiling.c |  30 +
+ sysdeps/generic/pt-mutexattr-setprotocol.c    |  42 ++
+ sysdeps/generic/pt-mutexattr-setpshared.c     |  39 ++
+ sysdeps/generic/pt-mutexattr-settype.c        |  37 ++
+ sysdeps/generic/pt-mutexattr.c                |  45 ++
+ sysdeps/generic/pt-once.c                     |  45 ++
+ sysdeps/generic/pt-rwlock-attr.c              |  26 +
+ sysdeps/generic/pt-rwlock-destroy.c           |  29 +
+ sysdeps/generic/pt-rwlock-init.c              |  45 ++
+ sysdeps/generic/pt-rwlock-rdlock.c            |  33 +
+ sysdeps/generic/pt-rwlock-timedrdlock.c       | 120 ++++
+ sysdeps/generic/pt-rwlock-timedwrlock.c       | 103 ++++
+ sysdeps/generic/pt-rwlock-tryrdlock.c         |  56 ++
+ sysdeps/generic/pt-rwlock-trywrlock.c         |  46 ++
+ sysdeps/generic/pt-rwlock-unlock.c            |  99 +++
+ sysdeps/generic/pt-rwlock-wrlock.c            |  35 ++
+ sysdeps/generic/pt-rwlockattr-destroy.c       |  27 +
+ sysdeps/generic/pt-rwlockattr-getpshared.c    |  29 +
+ sysdeps/generic/pt-rwlockattr-init.c          |  28 +
+ sysdeps/generic/pt-rwlockattr-setpshared.c    |  39 ++
+ sysdeps/generic/pt-setconcurrency.c           |  34 ++
+ sysdeps/generic/pt-setschedparam.c            |  31 +
+ sysdeps/generic/pt-setschedprio.c             |  29 +
+ sysdeps/generic/pt-setspecific.c              |  27 +
+ sysdeps/generic/pt-startup.c                  |  25 +
+ sysdeps/generic/raise.c                       |  50 ++
+ sysdeps/generic/sem-close.c                   |  32 +
+ sysdeps/generic/sem-destroy.c                 |  38 ++
+ sysdeps/generic/sem-getvalue.c                |  33 +
+ sysdeps/generic/sem-init.c                    |  46 ++
+ sysdeps/generic/sem-open.c                    |  32 +
+ sysdeps/generic/sem-post.c                    |  62 ++
+ sysdeps/generic/sem-timedwait.c               | 100 +++
+ sysdeps/generic/sem-trywait.c                 |  42 ++
+ sysdeps/generic/sem-unlink.c                  |  32 +
+ sysdeps/generic/sem-wait.c                    |  32 +
+ sysdeps/generic/shm-directory.h               |  31 +
+ sysdeps/hurd/pt-destroy-specific.c            |  79 +++
+ sysdeps/hurd/pt-getspecific.c                 |  40 ++
+ sysdeps/hurd/pt-init-specific.c               |  30 +
+ sysdeps/hurd/pt-key-create.c                  | 110 ++++
+ sysdeps/hurd/pt-key-delete.c                  |  64 ++
+ sysdeps/hurd/pt-key.h                         |  76 +++
+ sysdeps/hurd/pt-kill.c                        |  52 ++
+ sysdeps/hurd/pt-setspecific.c                 |  48 ++
+ sysdeps/i386/bits/memory.h                    |  40 ++
+ sysdeps/i386/bits/pt-atomic.h                 |  66 ++
+ sysdeps/i386/machine-sp.h                     |  30 +
+ sysdeps/i386/pt-machdep.h                     |  29 +
+ sysdeps/mach/bits/spin-lock-inline.h          |  90 +++
+ sysdeps/mach/bits/spin-lock.h                 |  38 ++
+ sysdeps/mach/hurd/Implies                     |   2 +
+ sysdeps/mach/hurd/bits/pthread-np.h           |  38 ++
+ sysdeps/mach/hurd/i386/pt-machdep.c           |  83 +++
+ sysdeps/mach/hurd/i386/pt-setup.c             | 110 ++++
+ sysdeps/mach/hurd/pt-attr-setstackaddr.c      |  29 +
+ sysdeps/mach/hurd/pt-attr-setstacksize.c      |  29 +
+ sysdeps/mach/hurd/pt-docancel.c               |  66 ++
+ sysdeps/mach/hurd/pt-hurd-cond-timedwait.c    | 169 ++++++
+ sysdeps/mach/hurd/pt-hurd-cond-wait.c         |  41 ++
+ sysdeps/mach/hurd/pt-sigstate-destroy.c       |  28 +
+ sysdeps/mach/hurd/pt-sigstate-init.c          |  44 ++
+ sysdeps/mach/hurd/pt-sigstate.c               |  80 +++
+ sysdeps/mach/hurd/pt-sysdep.c                 |  98 +++
+ sysdeps/mach/hurd/pt-sysdep.h                 |  67 +++
+ sysdeps/mach/i386/bits/spin-lock-inline.h     |  98 +++
+ sysdeps/mach/i386/bits/spin-lock.h            |  39 ++
+ sysdeps/mach/pt-block.c                       |  39 ++
+ sysdeps/mach/pt-spin.c                        |  36 ++
+ sysdeps/mach/pt-stack-alloc.c                 |  69 +++
+ sysdeps/mach/pt-thread-alloc.c                |  95 +++
+ sysdeps/mach/pt-thread-start.c                |  51 ++
+ sysdeps/mach/pt-thread-terminate.c            |  85 +++
+ sysdeps/mach/pt-timedblock.c                  |  68 +++
+ sysdeps/mach/pt-wakeup.c                      |  38 ++
+ sysdeps/posix/pt-spin.c                       |  54 ++
+ sysdeps/pthread/Makefile                      |   4 +
+ sysdeps/pthread/bits/barrier-attr.h           |  32 +
+ sysdeps/pthread/bits/barrier.h                |  39 ++
+ sysdeps/pthread/bits/cancelation.h            |  51 ++
+ sysdeps/pthread/bits/condition-attr.h         |  34 ++
+ sysdeps/pthread/bits/condition.h              |  39 ++
+ sysdeps/pthread/bits/mutex-attr.h             |  41 ++
+ sysdeps/pthread/bits/mutex.h                  |  75 +++
+ sysdeps/pthread/bits/once.h                   |  34 ++
+ sysdeps/pthread/bits/pthread-np.h             |  27 +
+ sysdeps/pthread/bits/pthread.h                |  38 ++
+ sysdeps/pthread/bits/pthreadtypes.h           |  29 +
+ sysdeps/pthread/bits/rwlock-attr.h            |  32 +
+ sysdeps/pthread/bits/rwlock.h                 |  46 ++
+ sysdeps/pthread/bits/semaphore.h              |  44 ++
+ sysdeps/pthread/bits/thread-attr.h            |  47 ++
+ sysdeps/pthread/bits/thread-specific.h        |  25 +
+ sysdeps/pthread/flockfile.c                   |  32 +
+ sysdeps/pthread/ftrylockfile.c                |  35 ++
+ sysdeps/pthread/funlockfile.c                 |  33 +
+ sysdeps/pthread/libc-lockP.h                  | 158 +++++
+ sysdeps/pthread/pthread-functions.h           | 141 +++++
+ sysdeps/pthread/semaphore.h                   |  81 +++
+ tests/.cvsignore                              |   1 +
+ tests/Makefile                                |  40 ++
+ tests/README                                  |   6 +
+ tests/test-1.c                                |  50 ++
+ tests/test-10.c                               |  46 ++
+ tests/test-11.c                               | 143 +++++
+ tests/test-12.c                               |  29 +
+ tests/test-13.c                               |  66 ++
+ tests/test-14.c                               |  44 ++
+ tests/test-15.c                               |  87 +++
+ tests/test-16.c                               |  71 +++
+ tests/test-17.c                               |  57 ++
+ tests/test-2.c                                |  39 ++
+ tests/test-3.c                                |  55 ++
+ tests/test-4.c                                |  86 +++
+ tests/test-5.c                                |  75 +++
+ tests/test-6.c                                |  96 +++
+ tests/test-7.c                                |  70 +++
+ tests/test-8.c                                |  60 ++
+ tests/test-9.c                                |  88 +++
+ tests/test-__pthread_destroy_specific-skip.c  |  83 +++
  228 files changed, 13021 insertions(+)
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/ChangeLog glibc-2.24/libpthread/ChangeLog
---- glibc/libpthread/ChangeLog	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/ChangeLog	2009-10-14 03:39:13.000000000 +0200
+
+diff --git glibc/libpthread/ChangeLog glibc/libpthread/ChangeLog
+new file mode 100644
+index 0000000..e991eac
+--- /dev/null
++++ glibc/libpthread/ChangeLog
 @@ -0,0 +1,6 @@
 +51839d398b0f9885a17ab5c0768b8dec4dd9eb79 is the last commit imported from CVS.
 +All commits after that one have valid author and committer information.
@@ -242,23 +245,677 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +Use this to examine the change log for earlier changes:
 +
 +    $ git show 51839d398b0f9885a17ab5c0768b8dec4dd9eb79:ChangeLog
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/configure glibc-2.24/libpthread/configure
---- glibc/libpthread/configure	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/configure	2015-11-01 11:58:39.571925608 +0100
+diff --git glibc/libpthread/Makeconfig glibc/libpthread/Makeconfig
+new file mode 100644
+index 0000000..9ce18d3
+--- /dev/null
++++ glibc/libpthread/Makeconfig
+@@ -0,0 +1,12 @@
++# Makeconfig fragment for Hurd libpthread add-on.
++# This gets included at the end of the main glibc Makeconfig.
++
++have-thread-library = yes
++
++shared-thread-library = $(common-objpfx)libpthread/libpthread.so
++static-thread-library = $(common-objpfx)libpthread/libpthread.a
++bounded-thread-library = $(static-thread-library)
++
++rpath-dirs += libpthread
++
+++includes += -I$(..)libpthread/include
+diff --git glibc/libpthread/Makefile glibc/libpthread/Makefile
+new file mode 100644
+index 0000000..21c9b94
+--- /dev/null
++++ glibc/libpthread/Makefile
+@@ -0,0 +1,335 @@
++#
++#   Copyright (C) 1994, 1995, 1996, 1997, 2000, 2002, 2004, 2005, 2006, 2007,
++#     2008, 2011 Free Software Foundation, Inc.
++#
++#   This program is free software; you can redistribute it and/or
++#   modify it under the terms of the GNU General Public License as
++#   published by the Free Software Foundation; either version 2, or (at
++#   your option) any later version.
++#
++#   This program 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
++#   General Public License for more details.
++#
++#   You should have received a copy of the GNU General Public License
++#   along with this program; if not, write to the Free Software
++#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++
++ifeq ($(..),)
++# non-glibc build
++IN_GLIBC = no
++else
++# glibc build
++IN_GLIBC = yes
++# set elf=yes, to retain compatibility with glibc < 2.16
++ifeq ($(elf),)
++elf = yes
++endif
++endif
++
++ifeq ($(IN_GLIBC),no)
++dir := libpthread
++makemode := library
++else
++subdir := libpthread
++
++pthread-version := 0.3
++
++srcdir = .
++endif
++
++MICROKERNEL := mach
++SYSDEPS := lockfile
++
++LCLHDRS :=
++
++libpthread-routines := pt-attr pt-attr-destroy pt-attr-getdetachstate	    \
++	pt-attr-getguardsize pt-attr-getinheritsched			    \
++	pt-attr-getschedparam pt-attr-getschedpolicy pt-attr-getscope	    \
++	pt-attr-getstack pt-attr-getstackaddr pt-attr-getstacksize	    \
++	pt-attr-init pt-attr-setdetachstate pt-attr-setguardsize	    \
++	pt-attr-setinheritsched pt-attr-setschedparam			    \
++	pt-attr-setschedpolicy pt-attr-setscope pt-attr-setstack	    \
++	pt-attr-setstackaddr pt-attr-setstacksize			    \
++									    \
++	pt-barrier-destroy pt-barrier-init pt-barrier-wait		    \
++	pt-barrier pt-barrierattr-destroy pt-barrierattr-init		    \
++	pt-barrierattr-getpshared pt-barrierattr-setpshared		    \
++									    \
++	pt-destroy-specific pt-init-specific				    \
++	pt-key-create pt-key-delete					    \
++	pt-getspecific pt-setspecific					    \
++									    \
++	pt-once								    \
++									    \
++	pt-alloc							    \
++	pt-create							    \
++	pt-getattr							    \
++	pt-equal							    \
++	pt-dealloc							    \
++	pt-detach							    \
++	pt-exit								    \
++	pt-initialize							    \
++	pt-join								    \
++	pt-self								    \
++	pt-sigmask							    \
++	pt-spin-inlines							    \
++	pt-cleanup							    \
++	pt-setcancelstate						    \
++	pt-setcanceltype						    \
++	pt-testcancel							    \
++	pt-cancel							    \
++									    \
++	pt-mutexattr							    \
++	pt-mutexattr-destroy pt-mutexattr-init				    \
++	pt-mutexattr-getprioceiling pt-mutexattr-getprotocol		    \
++	pt-mutexattr-getpshared pt-mutexattr-gettype			    \
++	pt-mutexattr-setprioceiling pt-mutexattr-setprotocol		    \
++	pt-mutexattr-setpshared pt-mutexattr-settype			    \
++									    \
++	pt-mutex-init pt-mutex-destroy					    \
++	pt-mutex-lock pt-mutex-trylock pt-mutex-timedlock		    \
++	pt-mutex-unlock							    \
++	pt-mutex-transfer-np						    \
++	pt-mutex-getprioceiling pt-mutex-setprioceiling			    \
++									    \
++	pt-rwlock-attr							    \
++	pt-rwlockattr-init pt-rwlockattr-destroy			    \
++	pt-rwlockattr-getpshared pt-rwlockattr-setpshared		    \
++									    \
++	pt-rwlock-init pt-rwlock-destroy				    \
++	pt-rwlock-rdlock pt-rwlock-tryrdlock				    \
++	pt-rwlock-trywrlock pt-rwlock-wrlock				    \
++	pt-rwlock-timedrdlock pt-rwlock-timedwrlock			    \
++	pt-rwlock-unlock						    \
++									    \
++	pt-cond								    \
++	pt-condattr-init pt-condattr-destroy				    \
++	pt-condattr-getclock pt-condattr-getpshared			    \
++	pt-condattr-setclock pt-condattr-setpshared			    \
++									    \
++	pt-cond-destroy pt-cond-init					    \
++	pt-cond-brdcast							    \
++	pt-cond-signal							    \
++	pt-cond-wait							    \
++	pt-cond-timedwait						    \
++	pt-hurd-cond-wait						    \
++	pt-hurd-cond-timedwait						    \
++									    \
++	pt-stack-alloc							    \
++	pt-thread-alloc							    \
++	pt-thread-start							    \
++	pt-thread-terminate						    \
++	pt-startup							    \
++									    \
++	pt-getconcurrency pt-setconcurrency				    \
++									    \
++	pt-block							    \
++	pt-timedblock							    \
++	pt-wakeup							    \
++	pt-docancel							    \
++	pt-sysdep							    \
++	pt-setup							    \
++	pt-machdep							    \
++	pt-spin								    \
++									    \
++	pt-sigstate-init						    \
++	pt-sigstate-destroy						    \
++	pt-sigstate							    \
++									    \
++	pt-atfork							    \
++	pt-kill								    \
++	pt-getcpuclockid						    \
++									    \
++	pt-getschedparam pt-setschedparam pt-setschedprio		    \
++	pt-yield							    \
++									    \
++	sem-close sem-destroy sem-getvalue sem-init sem-open		    \
++	sem-post sem-timedwait sem-trywait sem-unlink			    \
++	sem-wait							    \
++									    \
++	shm-directory							    \
++									    \
++	cthreads-compat							    \
++	$(SYSDEPS)
++
++ifeq ($(IN_GLIBC),no)
++SRCS := $(addsuffix .c,$(libpthread-routines))
++OBJS = $(addsuffix .o,$(basename $(notdir $(SRCS))))
++
++OTHERTAGS = 
++
++libname = libpthread
++endif
++
++headers :=				\
++              pthread.h				\
++              pthread/pthread.h			\
++              pthread/pthreadtypes.h		\
++	      semaphore.h			\
++						\
++              bits/pthread.h			\
++              bits/pthread-np.h			\
++              bits/pthreadtypes.h		\
++              bits/mutex.h			\
++              bits/condition.h			\
++              bits/condition-attr.h		\
++              bits/spin-lock.h			\
++              bits/spin-lock-inline.h		\
++              bits/cancelation.h		\
++              bits/thread-attr.h		\
++              bits/barrier-attr.h		\
++              bits/barrier.h			\
++              bits/thread-specific.h		\
++              bits/once.h			\
++              bits/mutex-attr.h			\
++              bits/rwlock.h			\
++              bits/rwlock-attr.h		\
++	      bits/semaphore.h
++
++ifeq ($(IN_GLIBC),yes)
++distribute :=
++
++routines := forward libc_pthread_init alloca_cutoff
++shared-only-routines = forward
++
++vpath %.c
++
++extra-libs := libpthread
++extra-libs-others := $(extra-libs)
++install-lib := libpthread.so
++
++include ../Makeconfig
++endif
++
++SYSDEP_PATH = $(srcdir)/sysdeps/$(MICROKERNEL)/hurd/i386	\
++	 $(srcdir)/sysdeps/$(MICROKERNEL)/i386			\
++	 $(srcdir)/sysdeps/i386					\
++	 $(srcdir)/sysdeps/$(MICROKERNEL)/hurd			\
++	 $(srcdir)/sysdeps/$(MICROKERNEL)			\
++	 $(srcdir)/sysdeps/hurd					\
++	 $(srcdir)/sysdeps/generic				\
++	 $(srcdir)/sysdeps/posix				\
++	 $(srcdir)/pthread					\
++	 $(srcdir)/include
++
++VPATH += $(SYSDEP_PATH)
++
++ifeq ($(IN_GLIBC),no)
++HURDLIBS = ihash
++else
++LDLIBS-pthread.so = -lihash
++endif
++
++ifeq ($(IN_GLIBC),no)
++installhdrs :=
++installhdrsubdir := .
++
++include ../Makeconf
++endif
++
++CPPFLAGS += \
++	  -DENABLE_TLS					\
++	  $(addprefix -I, $(SYSDEP_PATH))
++
++ifeq ($(IN_GLIBC),no)
++CPPFLAGS += \
++	  -imacros $(srcdir)/include/libc-symbols.h	\
++	  -imacros $(srcdir)/not-in-libc.h
++endif
++
++ifeq ($(IN_GLIBC),yes)
++CFLAGS-lockfile.c = -D_IO_MTSAFE_IO
++
++all: # Make this the default target; it will be defined in Rules.
++endif
++
++ifeq ($(IN_GLIBC),no)
++inst_libdir = $(libdir)
++endif
++
++ifeq ($(IN_GLIBC),no)
++install: install-headers
++install-headers: $(addprefix $(includedir)/, $(headers))
++
++install: $(inst_libdir)/libpthread2.a $(inst_libdir)/libpthread2_pic.a
++else
++subdir_install: $(inst_libdir)/libpthread2.a
++endif
++
++# XXX: If $(inst_libdir)/libpthread2.a is installed and
++# $(inst_libdir)/libpthread is not, we can have some issues.
++.PHONY: $(inst_libdir)/libpthread.a $(inst_libdir)/libpthread_pic.a
++
++# XXX: These rules are a hack.  But it is better than messing with
++# ../Makeconf at the moment.  Note that the linker scripts
++# $(srcdir)/libpthread.a and $(srcdir)/libpthread_pic.a get overwritten
++# when building in $(srcdir) and not a seperate build directory.
++$(inst_libdir)/libpthread2.a: $(inst_libdir)/libpthread.a
++	mv $< $@
++	$(INSTALL_DATA) $(srcdir)/libpthread.a $<
++
++$(inst_libdir)/libpthread2_pic.a: $(inst_libdir)/libpthread_pic.a
++	mv $< $@
++	$(INSTALL_DATA) $(srcdir)/libpthread_pic.a $<
++
++ifeq ($(IN_GLIBC),yes)
++libc-link.so = $(common-objpfx)libc.so
++
++extra-B-pthread.so = -B$(common-objpfx)libpthread/
++
++include ../Rules
++
++# Depend on libc.so so a DT_NEEDED is generated in the shared objects.
++# This ensures they will load libc.so for needed symbols if loaded by
++# a statically-linked program that hasn't already loaded it.
++# Depend on ld.so too to get proper versions of ld.so symbols.
++$(objpfx)libpthread.so: $(libc-link.so) $(common-objpfx)libc_nonshared.a \
++			$(if $(filter yes,$(elf)), $(elf-objpfx)/ld.so) \
++			$(common-objpfx)/mach/libmachuser.so \
++			$(common-objpfx)/hurd/libhurduser.so
++endif
++
++ifeq ($(IN_GLIBC),no)
++.PHONY: $(addprefix $(includedir)/, $(headers))
++
++$(addprefix $(includedir)/, $(headers)):
++	@set -e;							\
++	t="$@";								\
++	t=$${t#$(includedir)/};						\
++	header_ok=0;							\
++	for dir in $(SYSDEP_PATH);					\
++	do								\
++	  if test -e "$$dir/$$t";					\
++	  then								\
++	    tdir=`dirname "$@"`;					\
++	    if test ! -e $$tdir;					\
++	    then							\
++	      mkdir $$tdir;						\
++	    fi;								\
++	    echo $(INSTALL_DATA) "$$dir/$$t" "$@";			\
++	    $(INSTALL_DATA) "$$dir/$$t" "$@";				\
++	    header_ok=1;						\
++	    break;							\
++	  fi;								\
++	done;								\
++	if test "$${header_ok}" -ne 1;					\
++	then								\
++	  echo;								\
++	  echo '*** 'The header file \`$@\' is required, but not	\
++provided, by;								\
++	  echo '*** 'this configuration.  Please report this to the	\
++maintainer.;								\
++	  echo;								\
++	  false;							\
++	fi
++
++#  ifeq ($(VERSIONING),yes)
++#  
++#  # Adding this dependency gets it included in the command line,
++#  # where ld will read it as a linker script.
++#  $(libname).so.$(hurd-version): $(srcdir)/$(libname).map
++#  
++#  endif
++endif
+diff --git glibc/libpthread/TODO glibc/libpthread/TODO
+new file mode 100644
+index 0000000..979c38c
+--- /dev/null
++++ glibc/libpthread/TODO
+@@ -0,0 +1,131 @@
++-*- Mode: outline -*-
++
++* Interfaces
++** All interfaces specified by IEEE Std 1003.1-2001 are present, however,
++   pthread_kill and pthread_sigmask are defined in <pthread.h> and not
++   <signal.h> as they should be.  Once we are compiled with glibc,
++   this should be eaiser.
++
++* Test cases.  Can never have enough.
++
++* Ports
++  Port to other kernels (e.g. Linux and FreeBSD) and test on other
++  platforms.
++
++* Implementation details
++** pthread_atfork
++   This cannot be implemented without either changing glibc to export
++   some hooks (c.f. libc/sysdeps/mach/hurd/fork.c) or by providing a
++   custom fork implementation that wraps the origial using dlopen et
++   al.
++
++** Scheduling and priorities
++
++   We do not support scheduling right now in any way what so ever.
++
++   This affects:
++     pthread_attr_getinheritsched
++     pthread_attr_setinheritsched
++     pthread_attr_getschedparam
++     pthread_attr_setschedparam
++     pthread_attr_getschedpolicy
++     pthread_attr_setschedpolicy
++     pthread_attr_getscope
++     pthread_attr_setscope
++
++     pthread_mutexattr_getprioceiling
++     pthread_mutexattr_setprioceiling
++     pthread_mutexattr_getprotocol
++     pthread_mutexattr_setprotocol
++     pthread_mutex_getprioceiling
++     pthread_mutex_setprioceiling
++
++     pthread_setschedprio
++     pthread_getschedparam
++     pthread_setschedparam
++
++** Cancelation
++*** Cancelation points
++    The only cancelation points are pthread_join, pthread_cond_wait,
++    pthead_cond_timedwait and pthread_testcancel.  Need to explore if
++    the hurd_sigstate->cancel_hook (c.f. <hurd/signal.h>) provides the
++    desired semantics.  If not, must either wrap the some functions
++    using dlsym or wait until integration with glibc.
++*** Async cancelation
++    We inject a new IP into the cancelled (running) thread and then
++    run the cancelation handlers
++    (c.f. sysdeps/mach/hurd/pt-docancel.c).  The handlers need to have
++    access to the stack as they may use local variables.  I think that
++    this method may leave the frame pointer in a corrupted state if
++    the thread was in, for instance, the middle of a function call.
++    The robustness needs to be confirmed.
++
++** Process Shared Attribute
++
++   Currently, there is no real support for the process shared
++   attribute.  spinlocks work because we just use a test and set loop,
++   however, barriers, conditions mutexes and rwlocks, however, signal
++   wakeups via ports of which the names are process local.
++
++   We could have some process local data that is hashed to via the
++   address of the data structure.  Then the first thread that blocks
++   per process would spin on the shared memory area and all others
++   would then block as normal.  When the resource became available,
++   the first thread would signal the other local threads as necessary.
++   Alternatively, there could be some server, however, this opens a
++   new question: what can we use as an authentication agent.
++
++** Locking algorithm
++
++   When a thread blocks, it puts itself on a queue and then waits for
++   a message on a thread local port.  The thread which eventually does
++   the wakeup sends a message to the waiter thereby waking it up.  If
++   the wakeup is a broadcast wakeup (e.g. pthread_cond_broadcast,
++   pthread_barrier_wait and pthread_rdlock_unlock), the thread must
++   send O(N) messages where N is the number of waiting threads.  If
++   all the threads instead received on a lock local (rather than
++   thread local) port then the thread which eventually does the wake
++   need just do one operation, mach_port_destroy and all of the
++   waiting threads would wakeup and get MACH_RCV_PORT_DIED back from
++   mach_msg.  Note that the trade off is that the port must be
++   recreated.  This needs to be benchmarked.
++
++   A possible problem with this is scheduling priorities.  There may
++   be a preference for certain threads to wakeup before others
++   (especially if we are not doing a broadcast, for instance,
++   pthread_mutex_unlock and pthread_cond_signal).  If we take this
++   approach, the kernel chooses which threads are awakened.  If we
++   find that the kernel makes the wrong choices, we can still overcome
++   this by merging the two algorithms: have a list of ports sorted in
++   priority order and the waker does a mach_port_destroy on each as
++   appropriate.
++
++** Barriers
++
++   Barriers can be very slow and the contention can be very high.  The
++   above algorithm is very appealing, however, this may be augmented
++   with an initial number of spins and yields.  It is expected that
++   all of the threads reach the barrier within close succession, thus
++   queuing a message may be more expensive.  This needs to be
++   benchmarked.
++
++** Clocks
++*** pthread_condattr_setclock allows a process to specify a clock for
++    use with pthread_cond_timedwaits.  What is the correct default for
++    this, right now, we use CLOCK_REALTIME, however, we are really
++    using the system clock which, if I understand correctly, is
++    completely different.
++*** Could we even use other clocks? mach_msg uses a relative time against
++    the system clock.
++*** pthread_getcpuclockid just returns CLOCK_THREAD_CPUTIME_ID if defined.
++    Is this the correct behavior?
++
++** Timed Blocking
++*** pthread_cond_timedwait, pthead_mutex_timedlock, pthread_rwlock_timedrdlock
++    and pthread_rwlock_timedwrlock all take absolute times.  We need
++    to convert them to relative times for mach_msg.  Is there a way
++    around this?  How will clock skew affect us?
++
++** weak aliases
++   Use them consistently and correctly and start by reading
++   http://sources.redhat.com/ml/libc-alpha/2002-08/msg00278.html.
+diff --git glibc/libpthread/Versions glibc/libpthread/Versions
+new file mode 100644
+index 0000000..089c6b5
+--- /dev/null
++++ glibc/libpthread/Versions
+@@ -0,0 +1,146 @@
++libc {
++  GLIBC_2.13 {
++    pthread_attr_destroy; pthread_attr_getdetachstate;
++    pthread_attr_getinheritsched; pthread_attr_getschedparam;
++    pthread_attr_getschedpolicy; pthread_attr_getscope; pthread_attr_init;
++    pthread_attr_setdetachstate; pthread_attr_setinheritsched;
++    pthread_attr_setschedparam; pthread_attr_setschedpolicy;
++    pthread_attr_setscope;
++    pthread_condattr_destroy; pthread_condattr_init;
++    pthread_cond_broadcast; pthread_cond_destroy;
++    pthread_cond_init; pthread_cond_signal; pthread_cond_wait;
++    pthread_cond_timedwait;
++    pthread_equal;
++    pthread_exit; pthread_getschedparam; pthread_setschedparam;
++    pthread_mutex_destroy; pthread_mutex_init;
++    pthread_mutex_lock; pthread_mutex_trylock; pthread_mutex_unlock;
++    pthread_self; pthread_setcancelstate; pthread_setcanceltype;
++    __pthread_get_cleanup_stack;
++  }
++  GLIBC_2.22 {
++    __register_atfork;
++  }
++  GLIBC_PRIVATE {
++    __libc_alloca_cutoff;
++    __libc_pthread_init;
++  }
++}
++
++libpthread {
++  GLIBC_2.2.6 {
++    _IO_flockfile; _IO_ftrylockfile; _IO_funlockfile;
++  }
++  GLIBC_2.12 {
++    __pthread_errorcheck_mutexattr; __pthread_recursive_mutexattr;
++
++    __pthread_get_cleanup_stack;
++
++    __pthread_mutex_transfer_np;
++
++    _pthread_mutex_destroy; _pthread_mutex_init;
++    _pthread_mutex_lock; _pthread_mutex_trylock; _pthread_mutex_unlock;
++    _pthread_rwlock_destroy; _pthread_rwlock_init;
++
++    _cthread_init_routine;
++
++    cthread_detach;
++    cthread_fork;
++    cthread_keycreate;
++    cthread_getspecific;
++    cthread_setspecific;
++    __mutex_lock_solid;
++    __mutex_unlock_solid;
++    _cthreads_flockfile;
++    _cthreads_ftrylockfile;
++    _cthreads_funlockfile;
++
++    flockfile; ftrylockfile; funlockfile;
++
++    pthread_atfork;
++
++    pthread_attr_destroy; pthread_attr_getdetachstate;
++    pthread_attr_getguardsize; pthread_attr_getinheritsched;
++    pthread_attr_getschedparam; pthread_attr_getschedpolicy;
++    pthread_attr_getscope; pthread_attr_getstack; pthread_attr_getstackaddr;
++    pthread_attr_getstacksize; pthread_attr_init; pthread_attr_setdetachstate;
++    pthread_attr_setguardsize; pthread_attr_setinheritsched;
++    pthread_attr_setschedparam; pthread_attr_setschedpolicy;
++    pthread_attr_setscope; pthread_attr_setstack; pthread_attr_setstackaddr;
++    pthread_attr_setstacksize;
++
++    pthread_barrier_destroy; pthread_barrier_init; pthread_barrier_wait;
++    pthread_barrierattr_destroy; pthread_barrierattr_getpshared;
++    pthread_barrierattr_init; pthread_barrierattr_setpshared;
++
++    pthread_cancel;
++
++    pthread_cond_broadcast; pthread_cond_destroy; pthread_cond_init;
++    pthread_cond_signal; pthread_cond_timedwait; pthread_cond_wait;
++
++    pthread_condattr_destroy; pthread_condattr_getclock;
++    pthread_condattr_getpshared; pthread_condattr_init;
++    pthread_condattr_setclock; pthread_condattr_setpshared;
++
++    pthread_create; pthread_detach; pthread_equal; pthread_exit;
++
++    pthread_getattr_np;
++
++    pthread_getconcurrency; pthread_getcpuclockid;
++    pthread_getschedparam; pthread_getspecific;
++
++    pthread_join;
++
++    pthread_key_create; pthread_key_delete;
++    __pthread_key_create;
++
++    pthread_kill;
++    __pthread_kill;
++
++    pthread_mutex_destroy; pthread_mutex_getprioceiling;
++    pthread_mutex_init; pthread_mutex_lock; pthread_mutex_setprioceiling;
++    pthread_mutex_timedlock; pthread_mutex_transfer_np;
++    pthread_mutex_trylock; pthread_mutex_unlock;
++
++    pthread_mutexattr_destroy; pthread_mutexattr_getprioceiling;
++    pthread_mutexattr_getprotocol; pthread_mutexattr_getpshared;
++    pthread_mutexattr_gettype; pthread_mutexattr_init;
++    pthread_mutexattr_setprioceiling; pthread_mutexattr_setprotocol;
++    pthread_mutexattr_setpshared; pthread_mutexattr_settype;
++
++    pthread_once;
++
++    pthread_rwlock_destroy; pthread_rwlock_init; pthread_rwlock_rdlock;
++    pthread_rwlock_timedrdlock; pthread_rwlock_timedwrlock;
++    pthread_rwlock_tryrdlock; pthread_rwlock_trywrlock;
++    pthread_rwlock_unlock; pthread_rwlock_wrlock;
++
++    pthread_rwlockattr_destroy; pthread_rwlockattr_getpshared;
++    pthread_rwlockattr_init; pthread_rwlockattr_setpshared;
++
++    pthread_self;
++
++    pthread_setcancelstate; pthread_setcanceltype;
++    pthread_setconcurrency; pthread_setschedparam;
++    pthread_setschedprio; pthread_setspecific;
++
++    pthread_sigmask;
++    pthread_testcancel;
++    pthread_yield;
++
++    sem_close; sem_destroy; sem_getvalue; sem_init; sem_open; sem_post;
++    sem_timedwait; sem_trywait; sem_unlink; sem_wait;
++
++    pthread_spin_destroy; pthread_spin_init; pthread_spin_lock;
++    pthread_spin_trylock; pthread_spin_unlock;
++    __pthread_spin_destroy; __pthread_spin_init;
++    __pthread_spin_lock; __pthread_spin_trylock; __pthread_spin_unlock;
++    _pthread_spin_lock;
++  }
++  GLIBC_2.17 {
++    pthread_hurd_cond_wait_np;
++    pthread_hurd_cond_timedwait_np;
++  }
++  GLIBC_PRIVATE {
++    __shm_directory;
++  }
++}
+diff --git glibc/libpthread/configure glibc/libpthread/configure
+new file mode 100644
+index 0000000..5983490
+--- /dev/null
++++ glibc/libpthread/configure
 @@ -0,0 +1,2 @@
 +libc_add_on_canonical=libpthread
 +libc_add_on_subdirs=.
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/configure.in glibc-2.24/libpthread/configure.in
---- glibc/libpthread/configure.in	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/configure.in	2012-04-22 01:03:32.972396697 +0200
+diff --git glibc/libpthread/configure.in glibc/libpthread/configure.in
+new file mode 100644
+index 0000000..4e140b1
+--- /dev/null
++++ glibc/libpthread/configure.in
 @@ -0,0 +1,4 @@
 +GLIBC_PROVIDES
 +
 +libc_add_on_canonical=libpthread
 +libc_add_on_subdirs=.
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/forward.c glibc-2.24/libpthread/forward.c
---- glibc/libpthread/forward.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/forward.c	2016-09-21 00:05:49.973857307 +0200
+diff --git glibc/libpthread/forward.c glibc/libpthread/forward.c
+new file mode 100644
+index 0000000..c3a1f32
+--- /dev/null
++++ glibc/libpthread/forward.c
 @@ -0,0 +1,249 @@
 +/* Copyright (C) 2002, 2003, 2012 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
@@ -509,9 +1166,24 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +/* TODO: unregister_atfork, and define UNREGISTER_ATFORK, for module unload support */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/include/pthread/pthread.h glibc-2.24/libpthread/include/pthread/pthread.h
---- glibc/libpthread/include/pthread/pthread.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/include/pthread/pthread.h	2016-09-19 00:48:37.344623158 +0200
+diff --git glibc/libpthread/include/pthread.h glibc/libpthread/include/pthread.h
+new file mode 100644
+index 0000000..1d4d3c7
+--- /dev/null
++++ glibc/libpthread/include/pthread.h
+@@ -0,0 +1,7 @@
++#ifndef _PTHREAD_H
++#include <pthread/pthread.h>
++
++extern int __pthread_mutex_lock (pthread_mutex_t *__mutex);
++extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex);
++
++#endif
+diff --git glibc/libpthread/include/pthread/pthread.h glibc/libpthread/include/pthread/pthread.h
+new file mode 100644
+index 0000000..3aa6a93
+--- /dev/null
++++ glibc/libpthread/include/pthread/pthread.h
 @@ -0,0 +1,835 @@
 +/* Copyright (C) 2000, 2002, 2005, 2006, 2007, 2008, 2009, 2010
 +     Free Software Foundation, Inc.
@@ -1348,9 +2020,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +__END_DECLS
 +
 +#endif /* pthread.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/include/pthread/pthreadtypes.h glibc-2.24/libpthread/include/pthread/pthreadtypes.h
---- glibc/libpthread/include/pthread/pthreadtypes.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/include/pthread/pthreadtypes.h	2011-08-23 19:03:43.769029050 +0200
+diff --git glibc/libpthread/include/pthread/pthreadtypes.h glibc/libpthread/include/pthread/pthreadtypes.h
+new file mode 100644
+index 0000000..33bd009
+--- /dev/null
++++ glibc/libpthread/include/pthread/pthreadtypes.h
 @@ -0,0 +1,125 @@
 +/* Copyright (C) 2000, 2002, 2005, 2008 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
@@ -1428,584 +2102,228 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  {
 +    __PTHREAD_MUTEX_TIMED,
 +    __PTHREAD_MUTEX_ERRORCHECK,
-+    __PTHREAD_MUTEX_RECURSIVE
-+  };
-+
-+#include <bits/mutex-attr.h>
-+typedef struct __pthread_mutexattr pthread_mutexattr_t;
-+
-+#include <bits/mutex.h>
-+typedef struct __pthread_mutex pthread_mutex_t;
-+
-+#include <bits/condition-attr.h>
-+typedef struct __pthread_condattr pthread_condattr_t;
-+
-+#include <bits/condition.h>
-+typedef struct __pthread_cond pthread_cond_t;
-+
-+#ifdef __USE_XOPEN2K
-+# include <bits/spin-lock.h>
-+typedef __pthread_spinlock_t pthread_spinlock_t;
-+#endif /* XPG6.  */
-+
-+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
-+
-+#include <bits/rwlock-attr.h>
-+typedef struct __pthread_rwlockattr pthread_rwlockattr_t;
-+
-+#include <bits/rwlock.h>
-+typedef struct __pthread_rwlock pthread_rwlock_t;
-+
-+#endif /* __USE_UNIX98 || __USE_XOPEN2K */
-+
-+#ifdef __USE_XOPEN2K
-+
-+#include <bits/barrier-attr.h>
-+typedef struct __pthread_barrierattr pthread_barrierattr_t;
-+
-+#include <bits/barrier.h>
-+typedef struct __pthread_barrier pthread_barrier_t;
-+
-+#endif /* __USE_XOPEN2K */
-+
-+#include <bits/thread-specific.h>
-+typedef __pthread_key pthread_key_t;
-+
-+#include <bits/once.h>
-+typedef struct __pthread_once pthread_once_t;
-+
-+__END_DECLS
-+
-+#endif /* pthreadtypes.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/include/pthread.h glibc-2.24/libpthread/include/pthread.h
---- glibc/libpthread/include/pthread.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/include/pthread.h	2009-07-11 11:29:35.000000000 +0200
-@@ -0,0 +1,7 @@
-+#ifndef _PTHREAD_H
-+#include <pthread/pthread.h>
-+
-+extern int __pthread_mutex_lock (pthread_mutex_t *__mutex);
-+extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex);
-+
-+#endif
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/libc_pthread_init.c glibc-2.24/libpthread/libc_pthread_init.c
---- glibc/libpthread/libc_pthread_init.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/libc_pthread_init.c	2016-09-21 00:05:53.993837636 +0200
-@@ -0,0 +1,35 @@
-+/* Copyright (C) 2002 Free Software Foundation, Inc.
-+   This file is part of the GNU C Library.
-+   Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
-+
-+   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, write to the Free
-+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+   02111-1307 USA.  */
-+
-+#include <string.h>
-+#include <pthread-functions.h>
-+
-+void
-+internal_function
-+__libc_pthread_init (const struct pthread_functions *functions)
-+{
-+#ifdef SHARED
-+  /* We copy the content of the variable pointed to by the FUNCTIONS
-+     parameter to one in libc.so since this means access to the array
-+     can be done with one memory access instead of two.  */
-+  memcpy (&__libc_pthread_functions, functions,
-+	  sizeof (__libc_pthread_functions));
-+  __libc_pthread_functions_init = 1;
-+#endif
-+}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/libpthread.a glibc-2.24/libpthread/libpthread.a
---- glibc/libpthread/libpthread.a	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/libpthread.a	2015-11-01 11:55:57.073044900 +0100
-@@ -0,0 +1,22 @@
-+/* pthread initializer is weak in glibc.  It must be included if glibc
-+   is to start threading. */
-+EXTERN(_cthread_init_routine)
-+
-+/* Weak references in glibc that must be filled if glibc is to be
-+   thread safe.  */
-+EXTERN(cthread_detach)
-+EXTERN(cthread_fork)
-+EXTERN(cthread_keycreate)
-+EXTERN(cthread_getspecific)
-+EXTERN(cthread_setspecific)
-+EXTERN(__mutex_lock_solid)
-+EXTERN(__mutex_unlock_solid)
-+/* For libio stream locking.  */
-+EXTERN(_cthreads_flockfile)
-+EXTERN(_cthreads_funlockfile)
-+EXTERN(_cthreads_ftrylockfile)
-+/* To get the sigthread stack layout on fork */
-+EXTERN(pthread_getattr_np)
-+EXTERN(pthread_attr_getstack)
-+
-+GROUP(-lpthread2 -lihash -lrt)
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/libpthread_pic.a glibc-2.24/libpthread/libpthread_pic.a
---- glibc/libpthread/libpthread_pic.a	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/libpthread_pic.a	2015-11-01 11:55:57.073044900 +0100
-@@ -0,0 +1,22 @@
-+/* pthread initializer is weak in glibc.  It must be included if glibc
-+   is to start threading. */
-+EXTERN(_cthread_init_routine)
-+
-+/* Weak references in glibc that must be filled if glibc is to be
-+   thread safe.  */
-+EXTERN(cthread_detach)
-+EXTERN(cthread_fork)
-+EXTERN(cthread_keycreate)
-+EXTERN(cthread_getspecific)
-+EXTERN(cthread_setspecific)
-+EXTERN(__mutex_lock_solid)
-+EXTERN(__mutex_unlock_solid)
-+/* For libio stream locking.  */
-+EXTERN(_cthreads_flockfile)
-+EXTERN(_cthreads_funlockfile)
-+EXTERN(_cthreads_ftrylockfile)
-+/* To get the sigthread stack layout on fork */
-+EXTERN(pthread_getattr_np)
-+EXTERN(pthread_attr_getstack)
-+
-+GROUP(-lpthread2_pic -lihash_pic)
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/lockfile.c glibc-2.24/libpthread/lockfile.c
---- glibc/libpthread/lockfile.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/lockfile.c	2009-07-11 11:29:35.000000000 +0200
-@@ -0,0 +1,65 @@
-+/* lockfile - Handle locking and unlocking of streams.  Hurd cthreads version.
-+   Copyright (C) 2000,01,02 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 Library General Public License as
-+   published by the Free Software Foundation; either version 2 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
-+   Library General Public License for more details.
-+
-+   You should have received a copy of the GNU Library General Public
-+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+   Boston, MA 02111-1307, USA.  */
-+
-+#include <cthreads.h>
-+#include <pthread.h>		/* Must come before <stdio.h>! */
-+#include <stdio.h>
-+
-+#ifdef _STDIO_USES_IOSTREAM
-+
-+void
-+_cthreads_flockfile (_IO_FILE *fp)
-+{
-+  _IO_lock_lock (*fp->_lock);
-+}
-+
-+void
-+_cthreads_funlockfile (_IO_FILE *fp)
-+{
-+  _IO_lock_unlock (*fp->_lock);
-+}
-+
-+int
-+_cthreads_ftrylockfile (_IO_FILE *fp)
-+{
-+  return __libc_lock_trylock_recursive (*fp->_lock);
-+}
-+
-+# undef 	_IO_flockfile
-+# undef 	_IO_funlockfile
-+# undef 	_IO_ftrylockfile
-+# undef		flockfile
-+# undef		funlockfile
-+# undef		ftrylockfile
-+
-+void _IO_flockfile (_IO_FILE *)
-+     __attribute__ ((alias ("_cthreads_flockfile")));
-+void _IO_funlockfile (_IO_FILE *)
-+     __attribute__ ((alias ("_cthreads_funlockfile")));
-+int _IO_ftrylockfile (_IO_FILE *)
-+     __attribute__ ((alias ("_cthreads_ftrylockfile")));
-+
-+void flockfile (_IO_FILE *)
-+     __attribute__ ((alias ("_cthreads_flockfile")));
-+void funlockfile (_IO_FILE *)
-+     __attribute__ ((alias ("_cthreads_funlockfile")));
-+int ftrylockfile (_IO_FILE *)
-+     __attribute__ ((alias ("_cthreads_ftrylockfile")));
-+
-+#endif /* _STDIO_USES_IOSTREAM */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/Makeconfig glibc-2.24/libpthread/Makeconfig
---- glibc/libpthread/Makeconfig	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/Makeconfig	2012-04-26 12:41:22.757280617 +0200
-@@ -0,0 +1,12 @@
-+# Makeconfig fragment for Hurd libpthread add-on.
-+# This gets included at the end of the main glibc Makeconfig.
-+
-+have-thread-library = yes
-+
-+shared-thread-library = $(common-objpfx)libpthread/libpthread.so
-+static-thread-library = $(common-objpfx)libpthread/libpthread.a
-+bounded-thread-library = $(static-thread-library)
-+
-+rpath-dirs += libpthread
-+
-++includes += -I$(..)libpthread/include
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/Makefile glibc-2.24/libpthread/Makefile
---- glibc/libpthread/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/Makefile	2016-09-21 00:05:53.993837636 +0200
-@@ -0,0 +1,335 @@
-+#
-+#   Copyright (C) 1994, 1995, 1996, 1997, 2000, 2002, 2004, 2005, 2006, 2007,
-+#     2008, 2011 Free Software Foundation, Inc.
-+#
-+#   This program is free software; you can redistribute it and/or
-+#   modify it under the terms of the GNU General Public License as
-+#   published by the Free Software Foundation; either version 2, or (at
-+#   your option) any later version.
-+#
-+#   This program 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
-+#   General Public License for more details.
-+#
-+#   You should have received a copy of the GNU General Public License
-+#   along with this program; if not, write to the Free Software
-+#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++    __PTHREAD_MUTEX_RECURSIVE
++  };
 +
-+ifeq ($(..),)
-+# non-glibc build
-+IN_GLIBC = no
-+else
-+# glibc build
-+IN_GLIBC = yes
-+# set elf=yes, to retain compatibility with glibc < 2.16
-+ifeq ($(elf),)
-+elf = yes
-+endif
-+endif
++#include <bits/mutex-attr.h>
++typedef struct __pthread_mutexattr pthread_mutexattr_t;
 +
-+ifeq ($(IN_GLIBC),no)
-+dir := libpthread
-+makemode := library
-+else
-+subdir := libpthread
++#include <bits/mutex.h>
++typedef struct __pthread_mutex pthread_mutex_t;
 +
-+pthread-version := 0.3
++#include <bits/condition-attr.h>
++typedef struct __pthread_condattr pthread_condattr_t;
 +
-+srcdir = .
-+endif
++#include <bits/condition.h>
++typedef struct __pthread_cond pthread_cond_t;
 +
-+MICROKERNEL := mach
-+SYSDEPS := lockfile
++#ifdef __USE_XOPEN2K
++# include <bits/spin-lock.h>
++typedef __pthread_spinlock_t pthread_spinlock_t;
++#endif /* XPG6.  */
 +
-+LCLHDRS :=
++#if defined __USE_UNIX98 || defined __USE_XOPEN2K
 +
-+libpthread-routines := pt-attr pt-attr-destroy pt-attr-getdetachstate	    \
-+	pt-attr-getguardsize pt-attr-getinheritsched			    \
-+	pt-attr-getschedparam pt-attr-getschedpolicy pt-attr-getscope	    \
-+	pt-attr-getstack pt-attr-getstackaddr pt-attr-getstacksize	    \
-+	pt-attr-init pt-attr-setdetachstate pt-attr-setguardsize	    \
-+	pt-attr-setinheritsched pt-attr-setschedparam			    \
-+	pt-attr-setschedpolicy pt-attr-setscope pt-attr-setstack	    \
-+	pt-attr-setstackaddr pt-attr-setstacksize			    \
-+									    \
-+	pt-barrier-destroy pt-barrier-init pt-barrier-wait		    \
-+	pt-barrier pt-barrierattr-destroy pt-barrierattr-init		    \
-+	pt-barrierattr-getpshared pt-barrierattr-setpshared		    \
-+									    \
-+	pt-destroy-specific pt-init-specific				    \
-+	pt-key-create pt-key-delete					    \
-+	pt-getspecific pt-setspecific					    \
-+									    \
-+	pt-once								    \
-+									    \
-+	pt-alloc							    \
-+	pt-create							    \
-+	pt-getattr							    \
-+	pt-equal							    \
-+	pt-dealloc							    \
-+	pt-detach							    \
-+	pt-exit								    \
-+	pt-initialize							    \
-+	pt-join								    \
-+	pt-self								    \
-+	pt-sigmask							    \
-+	pt-spin-inlines							    \
-+	pt-cleanup							    \
-+	pt-setcancelstate						    \
-+	pt-setcanceltype						    \
-+	pt-testcancel							    \
-+	pt-cancel							    \
-+									    \
-+	pt-mutexattr							    \
-+	pt-mutexattr-destroy pt-mutexattr-init				    \
-+	pt-mutexattr-getprioceiling pt-mutexattr-getprotocol		    \
-+	pt-mutexattr-getpshared pt-mutexattr-gettype			    \
-+	pt-mutexattr-setprioceiling pt-mutexattr-setprotocol		    \
-+	pt-mutexattr-setpshared pt-mutexattr-settype			    \
-+									    \
-+	pt-mutex-init pt-mutex-destroy					    \
-+	pt-mutex-lock pt-mutex-trylock pt-mutex-timedlock		    \
-+	pt-mutex-unlock							    \
-+	pt-mutex-transfer-np						    \
-+	pt-mutex-getprioceiling pt-mutex-setprioceiling			    \
-+									    \
-+	pt-rwlock-attr							    \
-+	pt-rwlockattr-init pt-rwlockattr-destroy			    \
-+	pt-rwlockattr-getpshared pt-rwlockattr-setpshared		    \
-+									    \
-+	pt-rwlock-init pt-rwlock-destroy				    \
-+	pt-rwlock-rdlock pt-rwlock-tryrdlock				    \
-+	pt-rwlock-trywrlock pt-rwlock-wrlock				    \
-+	pt-rwlock-timedrdlock pt-rwlock-timedwrlock			    \
-+	pt-rwlock-unlock						    \
-+									    \
-+	pt-cond								    \
-+	pt-condattr-init pt-condattr-destroy				    \
-+	pt-condattr-getclock pt-condattr-getpshared			    \
-+	pt-condattr-setclock pt-condattr-setpshared			    \
-+									    \
-+	pt-cond-destroy pt-cond-init					    \
-+	pt-cond-brdcast							    \
-+	pt-cond-signal							    \
-+	pt-cond-wait							    \
-+	pt-cond-timedwait						    \
-+	pt-hurd-cond-wait						    \
-+	pt-hurd-cond-timedwait						    \
-+									    \
-+	pt-stack-alloc							    \
-+	pt-thread-alloc							    \
-+	pt-thread-start							    \
-+	pt-thread-terminate						    \
-+	pt-startup							    \
-+									    \
-+	pt-getconcurrency pt-setconcurrency				    \
-+									    \
-+	pt-block							    \
-+	pt-timedblock							    \
-+	pt-wakeup							    \
-+	pt-docancel							    \
-+	pt-sysdep							    \
-+	pt-setup							    \
-+	pt-machdep							    \
-+	pt-spin								    \
-+									    \
-+	pt-sigstate-init						    \
-+	pt-sigstate-destroy						    \
-+	pt-sigstate							    \
-+									    \
-+	pt-atfork							    \
-+	pt-kill								    \
-+	pt-getcpuclockid						    \
-+									    \
-+	pt-getschedparam pt-setschedparam pt-setschedprio		    \
-+	pt-yield							    \
-+									    \
-+	sem-close sem-destroy sem-getvalue sem-init sem-open		    \
-+	sem-post sem-timedwait sem-trywait sem-unlink			    \
-+	sem-wait							    \
-+									    \
-+	shm-directory							    \
-+									    \
-+	cthreads-compat							    \
-+	$(SYSDEPS)
++#include <bits/rwlock-attr.h>
++typedef struct __pthread_rwlockattr pthread_rwlockattr_t;
 +
-+ifeq ($(IN_GLIBC),no)
-+SRCS := $(addsuffix .c,$(libpthread-routines))
-+OBJS = $(addsuffix .o,$(basename $(notdir $(SRCS))))
++#include <bits/rwlock.h>
++typedef struct __pthread_rwlock pthread_rwlock_t;
 +
-+OTHERTAGS = 
++#endif /* __USE_UNIX98 || __USE_XOPEN2K */
 +
-+libname = libpthread
-+endif
++#ifdef __USE_XOPEN2K
 +
-+headers :=				\
-+              pthread.h				\
-+              pthread/pthread.h			\
-+              pthread/pthreadtypes.h		\
-+	      semaphore.h			\
-+						\
-+              bits/pthread.h			\
-+              bits/pthread-np.h			\
-+              bits/pthreadtypes.h		\
-+              bits/mutex.h			\
-+              bits/condition.h			\
-+              bits/condition-attr.h		\
-+              bits/spin-lock.h			\
-+              bits/spin-lock-inline.h		\
-+              bits/cancelation.h		\
-+              bits/thread-attr.h		\
-+              bits/barrier-attr.h		\
-+              bits/barrier.h			\
-+              bits/thread-specific.h		\
-+              bits/once.h			\
-+              bits/mutex-attr.h			\
-+              bits/rwlock.h			\
-+              bits/rwlock-attr.h		\
-+	      bits/semaphore.h
++#include <bits/barrier-attr.h>
++typedef struct __pthread_barrierattr pthread_barrierattr_t;
 +
-+ifeq ($(IN_GLIBC),yes)
-+distribute :=
++#include <bits/barrier.h>
++typedef struct __pthread_barrier pthread_barrier_t;
 +
-+routines := forward libc_pthread_init alloca_cutoff
-+shared-only-routines = forward
++#endif /* __USE_XOPEN2K */
 +
-+vpath %.c
++#include <bits/thread-specific.h>
++typedef __pthread_key pthread_key_t;
 +
-+extra-libs := libpthread
-+extra-libs-others := $(extra-libs)
-+install-lib := libpthread.so
++#include <bits/once.h>
++typedef struct __pthread_once pthread_once_t;
 +
-+include ../Makeconfig
-+endif
++__END_DECLS
 +
-+SYSDEP_PATH = $(srcdir)/sysdeps/$(MICROKERNEL)/hurd/i386	\
-+	 $(srcdir)/sysdeps/$(MICROKERNEL)/i386			\
-+	 $(srcdir)/sysdeps/i386					\
-+	 $(srcdir)/sysdeps/$(MICROKERNEL)/hurd			\
-+	 $(srcdir)/sysdeps/$(MICROKERNEL)			\
-+	 $(srcdir)/sysdeps/hurd					\
-+	 $(srcdir)/sysdeps/generic				\
-+	 $(srcdir)/sysdeps/posix				\
-+	 $(srcdir)/pthread					\
-+	 $(srcdir)/include
++#endif /* pthreadtypes.h */
+diff --git glibc/libpthread/libc_pthread_init.c glibc/libpthread/libc_pthread_init.c
+new file mode 100644
+index 0000000..afce1f7
+--- /dev/null
++++ glibc/libpthread/libc_pthread_init.c
+@@ -0,0 +1,35 @@
++/* Copyright (C) 2002 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++   Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
 +
-+VPATH += $(SYSDEP_PATH)
++   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.
 +
-+ifeq ($(IN_GLIBC),no)
-+HURDLIBS = ihash
-+else
-+LDLIBS-pthread.so = -lihash
-+endif
++   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.
 +
-+ifeq ($(IN_GLIBC),no)
-+installhdrs :=
-+installhdrsubdir := .
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
 +
-+include ../Makeconf
-+endif
++#include <string.h>
++#include <pthread-functions.h>
 +
-+CPPFLAGS += \
-+	  -DENABLE_TLS					\
-+	  $(addprefix -I, $(SYSDEP_PATH))
++void
++internal_function
++__libc_pthread_init (const struct pthread_functions *functions)
++{
++#ifdef SHARED
++  /* We copy the content of the variable pointed to by the FUNCTIONS
++     parameter to one in libc.so since this means access to the array
++     can be done with one memory access instead of two.  */
++  memcpy (&__libc_pthread_functions, functions,
++	  sizeof (__libc_pthread_functions));
++  __libc_pthread_functions_init = 1;
++#endif
++}
+diff --git glibc/libpthread/libpthread.a glibc/libpthread/libpthread.a
+new file mode 100644
+index 0000000..7d3f8d3
+--- /dev/null
++++ glibc/libpthread/libpthread.a
+@@ -0,0 +1,22 @@
++/* pthread initializer is weak in glibc.  It must be included if glibc
++   is to start threading. */
++EXTERN(_cthread_init_routine)
 +
-+ifeq ($(IN_GLIBC),no)
-+CPPFLAGS += \
-+	  -imacros $(srcdir)/include/libc-symbols.h	\
-+	  -imacros $(srcdir)/not-in-libc.h
-+endif
++/* Weak references in glibc that must be filled if glibc is to be
++   thread safe.  */
++EXTERN(cthread_detach)
++EXTERN(cthread_fork)
++EXTERN(cthread_keycreate)
++EXTERN(cthread_getspecific)
++EXTERN(cthread_setspecific)
++EXTERN(__mutex_lock_solid)
++EXTERN(__mutex_unlock_solid)
++/* For libio stream locking.  */
++EXTERN(_cthreads_flockfile)
++EXTERN(_cthreads_funlockfile)
++EXTERN(_cthreads_ftrylockfile)
++/* To get the sigthread stack layout on fork */
++EXTERN(pthread_getattr_np)
++EXTERN(pthread_attr_getstack)
 +
-+ifeq ($(IN_GLIBC),yes)
-+CFLAGS-lockfile.c = -D_IO_MTSAFE_IO
++GROUP(-lpthread2 -lihash -lrt)
+diff --git glibc/libpthread/libpthread_pic.a glibc/libpthread/libpthread_pic.a
+new file mode 100644
+index 0000000..cf0bd90
+--- /dev/null
++++ glibc/libpthread/libpthread_pic.a
+@@ -0,0 +1,22 @@
++/* pthread initializer is weak in glibc.  It must be included if glibc
++   is to start threading. */
++EXTERN(_cthread_init_routine)
 +
-+all: # Make this the default target; it will be defined in Rules.
-+endif
++/* Weak references in glibc that must be filled if glibc is to be
++   thread safe.  */
++EXTERN(cthread_detach)
++EXTERN(cthread_fork)
++EXTERN(cthread_keycreate)
++EXTERN(cthread_getspecific)
++EXTERN(cthread_setspecific)
++EXTERN(__mutex_lock_solid)
++EXTERN(__mutex_unlock_solid)
++/* For libio stream locking.  */
++EXTERN(_cthreads_flockfile)
++EXTERN(_cthreads_funlockfile)
++EXTERN(_cthreads_ftrylockfile)
++/* To get the sigthread stack layout on fork */
++EXTERN(pthread_getattr_np)
++EXTERN(pthread_attr_getstack)
 +
-+ifeq ($(IN_GLIBC),no)
-+inst_libdir = $(libdir)
-+endif
++GROUP(-lpthread2_pic -lihash_pic)
+diff --git glibc/libpthread/lockfile.c glibc/libpthread/lockfile.c
+new file mode 100644
+index 0000000..040cbfb
+--- /dev/null
++++ glibc/libpthread/lockfile.c
+@@ -0,0 +1,65 @@
++/* lockfile - Handle locking and unlocking of streams.  Hurd cthreads version.
++   Copyright (C) 2000,01,02 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
 +
-+ifeq ($(IN_GLIBC),no)
-+install: install-headers
-+install-headers: $(addprefix $(includedir)/, $(headers))
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Library General Public License as
++   published by the Free Software Foundation; either version 2 of the
++   License, or (at your option) any later version.
 +
-+install: $(inst_libdir)/libpthread2.a $(inst_libdir)/libpthread2_pic.a
-+else
-+subdir_install: $(inst_libdir)/libpthread2.a
-+endif
++   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
++   Library General Public License for more details.
 +
-+# XXX: If $(inst_libdir)/libpthread2.a is installed and
-+# $(inst_libdir)/libpthread is not, we can have some issues.
-+.PHONY: $(inst_libdir)/libpthread.a $(inst_libdir)/libpthread_pic.a
++   You should have received a copy of the GNU Library General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If not,
++   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
 +
-+# XXX: These rules are a hack.  But it is better than messing with
-+# ../Makeconf at the moment.  Note that the linker scripts
-+# $(srcdir)/libpthread.a and $(srcdir)/libpthread_pic.a get overwritten
-+# when building in $(srcdir) and not a seperate build directory.
-+$(inst_libdir)/libpthread2.a: $(inst_libdir)/libpthread.a
-+	mv $< $@
-+	$(INSTALL_DATA) $(srcdir)/libpthread.a $<
++#include <cthreads.h>
++#include <pthread.h>		/* Must come before <stdio.h>! */
++#include <stdio.h>
 +
-+$(inst_libdir)/libpthread2_pic.a: $(inst_libdir)/libpthread_pic.a
-+	mv $< $@
-+	$(INSTALL_DATA) $(srcdir)/libpthread_pic.a $<
++#ifdef _STDIO_USES_IOSTREAM
 +
-+ifeq ($(IN_GLIBC),yes)
-+libc-link.so = $(common-objpfx)libc.so
++void
++_cthreads_flockfile (_IO_FILE *fp)
++{
++  _IO_lock_lock (*fp->_lock);
++}
 +
-+extra-B-pthread.so = -B$(common-objpfx)libpthread/
++void
++_cthreads_funlockfile (_IO_FILE *fp)
++{
++  _IO_lock_unlock (*fp->_lock);
++}
 +
-+include ../Rules
++int
++_cthreads_ftrylockfile (_IO_FILE *fp)
++{
++  return __libc_lock_trylock_recursive (*fp->_lock);
++}
 +
-+# Depend on libc.so so a DT_NEEDED is generated in the shared objects.
-+# This ensures they will load libc.so for needed symbols if loaded by
-+# a statically-linked program that hasn't already loaded it.
-+# Depend on ld.so too to get proper versions of ld.so symbols.
-+$(objpfx)libpthread.so: $(libc-link.so) $(common-objpfx)libc_nonshared.a \
-+			$(if $(filter yes,$(elf)), $(elf-objpfx)/ld.so) \
-+			$(common-objpfx)/mach/libmachuser.so \
-+			$(common-objpfx)/hurd/libhurduser.so
-+endif
++# undef 	_IO_flockfile
++# undef 	_IO_funlockfile
++# undef 	_IO_ftrylockfile
++# undef		flockfile
++# undef		funlockfile
++# undef		ftrylockfile
 +
-+ifeq ($(IN_GLIBC),no)
-+.PHONY: $(addprefix $(includedir)/, $(headers))
++void _IO_flockfile (_IO_FILE *)
++     __attribute__ ((alias ("_cthreads_flockfile")));
++void _IO_funlockfile (_IO_FILE *)
++     __attribute__ ((alias ("_cthreads_funlockfile")));
++int _IO_ftrylockfile (_IO_FILE *)
++     __attribute__ ((alias ("_cthreads_ftrylockfile")));
 +
-+$(addprefix $(includedir)/, $(headers)):
-+	@set -e;							\
-+	t="$@";								\
-+	t=$${t#$(includedir)/};						\
-+	header_ok=0;							\
-+	for dir in $(SYSDEP_PATH);					\
-+	do								\
-+	  if test -e "$$dir/$$t";					\
-+	  then								\
-+	    tdir=`dirname "$@"`;					\
-+	    if test ! -e $$tdir;					\
-+	    then							\
-+	      mkdir $$tdir;						\
-+	    fi;								\
-+	    echo $(INSTALL_DATA) "$$dir/$$t" "$@";			\
-+	    $(INSTALL_DATA) "$$dir/$$t" "$@";				\
-+	    header_ok=1;						\
-+	    break;							\
-+	  fi;								\
-+	done;								\
-+	if test "$${header_ok}" -ne 1;					\
-+	then								\
-+	  echo;								\
-+	  echo '*** 'The header file \`$@\' is required, but not	\
-+provided, by;								\
-+	  echo '*** 'this configuration.  Please report this to the	\
-+maintainer.;								\
-+	  echo;								\
-+	  false;							\
-+	fi
++void flockfile (_IO_FILE *)
++     __attribute__ ((alias ("_cthreads_flockfile")));
++void funlockfile (_IO_FILE *)
++     __attribute__ ((alias ("_cthreads_funlockfile")));
++int ftrylockfile (_IO_FILE *)
++     __attribute__ ((alias ("_cthreads_ftrylockfile")));
 +
-+#  ifeq ($(VERSIONING),yes)
-+#  
-+#  # Adding this dependency gets it included in the command line,
-+#  # where ld will read it as a linker script.
-+#  $(libname).so.$(hurd-version): $(srcdir)/$(libname).map
-+#  
-+#  endif
-+endif
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/not-in-libc.h glibc-2.24/libpthread/not-in-libc.h
---- glibc/libpthread/not-in-libc.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/not-in-libc.h	2015-02-12 23:26:10.982123125 +0100
++#endif /* _STDIO_USES_IOSTREAM */
+diff --git glibc/libpthread/not-in-libc.h glibc/libpthread/not-in-libc.h
+new file mode 100644
+index 0000000..7c5f0bc
+--- /dev/null
++++ glibc/libpthread/not-in-libc.h
 @@ -0,0 +1,12 @@
 +#define __mach_port_insert_right mach_port_insert_right
 +#define __mach_port_allocate	mach_port_allocate
@@ -2019,9 +2337,32 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#define __vm_allocate		vm_allocate
 +#define __vm_deallocate		vm_deallocate
 +#define __sched_yield           sched_yield
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/pthread/alloca_cutoff.c glibc-2.24/libpthread/pthread/alloca_cutoff.c
---- glibc/libpthread/pthread/alloca_cutoff.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/pthread/alloca_cutoff.c	2016-09-12 00:06:46.694990466 +0200
+diff --git glibc/libpthread/pthread/Versions glibc/libpthread/pthread/Versions
+new file mode 100644
+index 0000000..e4b4e8b
+--- /dev/null
++++ glibc/libpthread/pthread/Versions
+@@ -0,0 +1,15 @@
++libc {
++  GLIBC_2.2 {
++    # XXX
++    __vm_deallocate; __mach_port_insert_right; __mach_reply_port;
++    __mig_init; __vm_allocate;
++
++    # functions used in inline functions or macros
++    __pthread_spin_destroy; __pthread_spin_init; __pthread_spin_lock;
++    _pthread_spin_lock; __pthread_spin_trylock; __pthread_spin_unlock;
++
++    # p*
++    pthread_spin_destroy; pthread_spin_init; pthread_spin_lock;
++    pthread_spin_trylock; pthread_spin_unlock;
++  }
++}
+diff --git glibc/libpthread/pthread/alloca_cutoff.c glibc/libpthread/pthread/alloca_cutoff.c
+new file mode 100644
+index 0000000..ec54d8f
+--- /dev/null
++++ glibc/libpthread/pthread/alloca_cutoff.c
 @@ -0,0 +1,27 @@
 +/* Allocate a new thread structure.
 +   Copyright (C) 2015-2016 Free Software Foundation, Inc.
@@ -2050,9 +2391,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +	return size <= 65536;
 +}
 +libc_hidden_def (__libc_alloca_cutoff)
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/pthread/cthreads-compat.c glibc-2.24/libpthread/pthread/cthreads-compat.c
---- glibc/libpthread/pthread/cthreads-compat.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/pthread/cthreads-compat.c	2015-11-01 11:55:57.073044900 +0100
+diff --git glibc/libpthread/pthread/cthreads-compat.c glibc/libpthread/pthread/cthreads-compat.c
+new file mode 100644
+index 0000000..1a0971b
+--- /dev/null
++++ glibc/libpthread/pthread/cthreads-compat.c
 @@ -0,0 +1,101 @@
 +/* Compatibility routines for cthreads.
 +   Copyright (C) 2000, 2002, 2008 Free Software Foundation, Inc.
@@ -2155,9 +2498,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +    return;
 +  __pthread_mutex_unlock (lock);
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/pthread/pt-alloc.c glibc-2.24/libpthread/pthread/pt-alloc.c
---- glibc/libpthread/pthread/pt-alloc.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/pthread/pt-alloc.c	2016-09-21 00:05:53.993837636 +0200
+diff --git glibc/libpthread/pthread/pt-alloc.c glibc/libpthread/pthread/pt-alloc.c
+new file mode 100644
+index 0000000..21063d5
+--- /dev/null
++++ glibc/libpthread/pthread/pt-alloc.c
 @@ -0,0 +1,219 @@
 +/* Allocate a new thread structure.
 +   Copyright (C) 2000, 2002, 2005, 2007, 2008 Free Software Foundation, Inc.
@@ -2378,9 +2723,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  *pthread = new;
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/pthread/pt-cancel.c glibc-2.24/libpthread/pthread/pt-cancel.c
---- glibc/libpthread/pthread/pt-cancel.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/pthread/pt-cancel.c	2013-02-10 10:49:14.685444953 +0100
+diff --git glibc/libpthread/pthread/pt-cancel.c glibc/libpthread/pthread/pt-cancel.c
+new file mode 100644
+index 0000000..96c77f7
+--- /dev/null
++++ glibc/libpthread/pthread/pt-cancel.c
 @@ -0,0 +1,63 @@
 +/* Cancel a thread.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -2445,9 +2792,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return err;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/pthread/pt-cleanup.c glibc-2.24/libpthread/pthread/pt-cleanup.c
---- glibc/libpthread/pthread/pt-cleanup.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/pthread/pt-cleanup.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/pthread/pt-cleanup.c glibc/libpthread/pthread/pt-cleanup.c
+new file mode 100644
+index 0000000..58865aa
+--- /dev/null
++++ glibc/libpthread/pthread/pt-cleanup.c
 @@ -0,0 +1,28 @@
 +/* Add a cancelation handler to the stack.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -2477,9 +2826,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +{
 +  return &_pthread_self ()->cancelation_handlers;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/pthread/pt-create.c glibc-2.24/libpthread/pthread/pt-create.c
---- glibc/libpthread/pthread/pt-create.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/pthread/pt-create.c	2016-09-21 00:05:53.993837636 +0200
+diff --git glibc/libpthread/pthread/pt-create.c glibc/libpthread/pthread/pt-create.c
+new file mode 100644
+index 0000000..c9e0730
+--- /dev/null
++++ glibc/libpthread/pthread/pt-create.c
 @@ -0,0 +1,254 @@
 +/* Thread creation.
 +   Copyright (C) 2000, 2002, 2005, 2007 Free Software Foundation, Inc.
@@ -2735,9 +3086,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 + failed:
 +  return err;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/pthread/pt-dealloc.c glibc-2.24/libpthread/pthread/pt-dealloc.c
---- glibc/libpthread/pthread/pt-dealloc.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/pthread/pt-dealloc.c	2016-09-21 00:05:53.993837636 +0200
+diff --git glibc/libpthread/pthread/pt-dealloc.c glibc/libpthread/pthread/pt-dealloc.c
+new file mode 100644
+index 0000000..f44aefa
+--- /dev/null
++++ glibc/libpthread/pthread/pt-dealloc.c
 @@ -0,0 +1,69 @@
 +/* Deallocate a thread structure.
 +   Copyright (C) 2000, 2008 Free Software Foundation, Inc.
@@ -2808,9 +3161,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +     which reads this variable.  */
 +  pthread->state = PTHREAD_TERMINATED;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/pthread/pt-detach.c glibc-2.24/libpthread/pthread/pt-detach.c
---- glibc/libpthread/pthread/pt-detach.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/pthread/pt-detach.c	2016-09-19 00:35:55.101028213 +0200
+diff --git glibc/libpthread/pthread/pt-detach.c glibc/libpthread/pthread/pt-detach.c
+new file mode 100644
+index 0000000..3431f1b
+--- /dev/null
++++ glibc/libpthread/pthread/pt-detach.c
 @@ -0,0 +1,80 @@
 +/* Detach a thread.
 +   Copyright (C) 2000, 2005 Free Software Foundation, Inc.
@@ -2892,9 +3247,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return err;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/pthread/pt-exit.c glibc-2.24/libpthread/pthread/pt-exit.c
---- glibc/libpthread/pthread/pt-exit.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/pthread/pt-exit.c	2016-09-21 00:05:53.993837636 +0200
+diff --git glibc/libpthread/pthread/pt-exit.c glibc/libpthread/pthread/pt-exit.c
+new file mode 100644
+index 0000000..b078db2
+--- /dev/null
++++ glibc/libpthread/pthread/pt-exit.c
 @@ -0,0 +1,112 @@
 +/* Thread termination.
 +   Copyright (C) 2000, 2002, 2005, 2007, 2011 Free Software Foundation, Inc.
@@ -3008,9 +3365,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__pthread_exit, pthread_exit);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/pthread/pt-getattr.c glibc-2.24/libpthread/pthread/pt-getattr.c
---- glibc/libpthread/pthread/pt-getattr.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/pthread/pt-getattr.c	2015-03-22 23:10:39.716432033 +0100
+diff --git glibc/libpthread/pthread/pt-getattr.c glibc/libpthread/pthread/pt-getattr.c
+new file mode 100644
+index 0000000..574420a
+--- /dev/null
++++ glibc/libpthread/pthread/pt-getattr.c
 @@ -0,0 +1,51 @@
 +/* Thread attributes retrieval.
 +   Copyright (C) 2008 Free Software Foundation, Inc.
@@ -3063,9 +3422,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/pthread/pt-initialize.c glibc-2.24/libpthread/pthread/pt-initialize.c
---- glibc/libpthread/pthread/pt-initialize.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/pthread/pt-initialize.c	2016-09-21 00:05:49.973857307 +0200
+diff --git glibc/libpthread/pthread/pt-initialize.c glibc/libpthread/pthread/pt-initialize.c
+new file mode 100644
+index 0000000..4435a36
+--- /dev/null
++++ glibc/libpthread/pthread/pt-initialize.c
 @@ -0,0 +1,88 @@
 +/* Initialize pthreads library.
 +   Copyright (C) 2000,02 Free Software Foundation, Inc.
@@ -3155,9 +3516,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#endif
 +  RUN_HOOK (__pthread_init, ());
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/pthread/pt-internal.h glibc-2.24/libpthread/pthread/pt-internal.h
---- glibc/libpthread/pthread/pt-internal.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/pthread/pt-internal.h	2016-09-21 00:05:53.993837636 +0200
+diff --git glibc/libpthread/pthread/pt-internal.h glibc/libpthread/pthread/pt-internal.h
+new file mode 100644
+index 0000000..c1b6c59
+--- /dev/null
++++ glibc/libpthread/pthread/pt-internal.h
 @@ -0,0 +1,330 @@
 +/* Internal defenitions for pthreads library.
 +   Copyright (C) 2000, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
@@ -3489,9 +3852,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +const struct __pthread_condattr __pthread_default_condattr;
 +
 +#endif /* pt-internal.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/pthread/pt-join.c glibc-2.24/libpthread/pthread/pt-join.c
---- glibc/libpthread/pthread/pt-join.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/pthread/pt-join.c	2016-09-21 00:05:53.993837636 +0200
+diff --git glibc/libpthread/pthread/pt-join.c glibc/libpthread/pthread/pt-join.c
+new file mode 100644
+index 0000000..9730afc
+--- /dev/null
++++ glibc/libpthread/pthread/pt-join.c
 @@ -0,0 +1,76 @@
 +/* Wait for thread termination.
 +   Copyright (C) 2000 Free Software Foundation, Inc.
@@ -3569,9 +3934,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return err;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/pthread/pt-self.c glibc-2.24/libpthread/pthread/pt-self.c
---- glibc/libpthread/pthread/pt-self.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/pthread/pt-self.c	2012-04-22 01:03:32.972396697 +0200
+diff --git glibc/libpthread/pthread/pt-self.c glibc/libpthread/pthread/pt-self.c
+new file mode 100644
+index 0000000..deb57c0
+--- /dev/null
++++ glibc/libpthread/pthread/pt-self.c
 @@ -0,0 +1,34 @@
 +/* Get calling thread's ID.
 +   Copyright (C) 2000, 2008 Free Software Foundation, Inc.
@@ -3607,9 +3974,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__pthread_self, pthread_self);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/pthread/pt-setcancelstate.c glibc-2.24/libpthread/pthread/pt-setcancelstate.c
---- glibc/libpthread/pthread/pt-setcancelstate.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/pthread/pt-setcancelstate.c	2013-02-10 10:49:14.685444953 +0100
+diff --git glibc/libpthread/pthread/pt-setcancelstate.c glibc/libpthread/pthread/pt-setcancelstate.c
+new file mode 100644
+index 0000000..7b60015
+--- /dev/null
++++ glibc/libpthread/pthread/pt-setcancelstate.c
 @@ -0,0 +1,47 @@
 +/* Set the cancel state for the calling thread.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -3658,9 +4027,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__pthread_setcancelstate, pthread_setcancelstate);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/pthread/pt-setcanceltype.c glibc-2.24/libpthread/pthread/pt-setcanceltype.c
---- glibc/libpthread/pthread/pt-setcanceltype.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/pthread/pt-setcanceltype.c	2013-02-10 10:49:14.685444953 +0100
+diff --git glibc/libpthread/pthread/pt-setcanceltype.c glibc/libpthread/pthread/pt-setcanceltype.c
+new file mode 100644
+index 0000000..3cfbe9c
+--- /dev/null
++++ glibc/libpthread/pthread/pt-setcanceltype.c
 @@ -0,0 +1,47 @@
 +/* Set the cancel type for the calling thread.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -3709,9 +4080,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__pthread_setcanceltype, pthread_setcanceltype);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/pthread/pt-sigmask.c glibc-2.24/libpthread/pthread/pt-sigmask.c
---- glibc/libpthread/pthread/pt-sigmask.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/pthread/pt-sigmask.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/pthread/pt-sigmask.c glibc/libpthread/pthread/pt-sigmask.c
+new file mode 100644
+index 0000000..1b53873
+--- /dev/null
++++ glibc/libpthread/pthread/pt-sigmask.c
 @@ -0,0 +1,33 @@
 +/* Get or set a thread's signal mask.
 +   Copyright (C) 2000 Free Software Foundation, Inc.
@@ -3746,9 +4119,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  /* Do not clear SELF's pending signals.  */
 +  return __pthread_sigstate (self, how, set, oset, 0);
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/pthread/pt-spin-inlines.c glibc-2.24/libpthread/pthread/pt-spin-inlines.c
---- glibc/libpthread/pthread/pt-spin-inlines.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/pthread/pt-spin-inlines.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/pthread/pt-spin-inlines.c glibc/libpthread/pthread/pt-spin-inlines.c
+new file mode 100644
+index 0000000..cfb21dd
+--- /dev/null
++++ glibc/libpthread/pthread/pt-spin-inlines.c
 @@ -0,0 +1,34 @@
 +/* Copyright (C) 2000 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
@@ -3784,9 +4159,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +weak_alias (__pthread_spin_init, pthread_spin_init);
 +weak_alias (__pthread_spin_trylock, pthread_spin_trylock);
 +weak_alias (__pthread_spin_unlock, pthread_spin_unlock);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/pthread/pt-testcancel.c glibc-2.24/libpthread/pthread/pt-testcancel.c
---- glibc/libpthread/pthread/pt-testcancel.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/pthread/pt-testcancel.c	2013-02-10 10:49:14.685444953 +0100
+diff --git glibc/libpthread/pthread/pt-testcancel.c glibc/libpthread/pthread/pt-testcancel.c
+new file mode 100644
+index 0000000..3ba07b6
+--- /dev/null
++++ glibc/libpthread/pthread/pt-testcancel.c
 @@ -0,0 +1,36 @@
 +/* Add an explicit cancelation point.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -3824,9 +4201,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  if (cancelled)
 +    pthread_exit (PTHREAD_CANCELED);
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/pthread/pt-yield.c glibc-2.24/libpthread/pthread/pt-yield.c
---- glibc/libpthread/pthread/pt-yield.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/pthread/pt-yield.c	2010-05-21 18:15:23.000000000 +0200
+diff --git glibc/libpthread/pthread/pt-yield.c glibc/libpthread/pthread/pt-yield.c
+new file mode 100644
+index 0000000..27848bb
+--- /dev/null
++++ glibc/libpthread/pthread/pt-yield.c
 @@ -0,0 +1,26 @@
 +/* Yield the processor to another thread or process.
 +   Copyright (C) 2010 Free Software Foundation, Inc.
@@ -3854,28 +4233,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +{
 +  return sched_yield ();
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/pthread/Versions glibc-2.24/libpthread/pthread/Versions
---- glibc/libpthread/pthread/Versions	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/pthread/Versions	2009-07-11 11:29:35.000000000 +0200
-@@ -0,0 +1,15 @@
-+libc {
-+  GLIBC_2.2 {
-+    # XXX
-+    __vm_deallocate; __mach_port_insert_right; __mach_reply_port;
-+    __mig_init; __vm_allocate;
-+
-+    # functions used in inline functions or macros
-+    __pthread_spin_destroy; __pthread_spin_init; __pthread_spin_lock;
-+    _pthread_spin_lock; __pthread_spin_trylock; __pthread_spin_unlock;
-+
-+    # p*
-+    pthread_spin_destroy; pthread_spin_init; pthread_spin_lock;
-+    pthread_spin_trylock; pthread_spin_unlock;
-+  }
-+}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/pthreadP.h glibc-2.24/libpthread/pthreadP.h
---- glibc/libpthread/pthreadP.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/pthreadP.h	2016-09-21 00:05:53.993837636 +0200
+diff --git glibc/libpthread/pthreadP.h glibc/libpthread/pthreadP.h
+new file mode 100644
+index 0000000..f1fd625
+--- /dev/null
++++ glibc/libpthread/pthreadP.h
 @@ -0,0 +1,26 @@
 +/* Copyright (C) 2016 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
@@ -3903,14 +4265,18 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +extern int __pthread_kill (pthread_t threadid, int signo);
 +
 +#endif	/* pthreadP.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/shlib-versions glibc-2.24/libpthread/shlib-versions
---- glibc/libpthread/shlib-versions	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/shlib-versions	2016-09-12 00:06:46.694990466 +0200
+diff --git glibc/libpthread/shlib-versions glibc/libpthread/shlib-versions
+new file mode 100644
+index 0000000..98e07a6
+--- /dev/null
++++ glibc/libpthread/shlib-versions
 @@ -0,0 +1 @@
 +libpthread=0.3
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-atfork.c glibc-2.24/libpthread/sysdeps/generic/pt-atfork.c
---- glibc/libpthread/sysdeps/generic/pt-atfork.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-atfork.c	2016-09-12 00:06:38.695028466 +0200
+diff --git glibc/libpthread/sysdeps/generic/pt-atfork.c glibc/libpthread/sysdeps/generic/pt-atfork.c
+new file mode 100644
+index 0000000..304d7ef
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-atfork.c
 @@ -0,0 +1,33 @@
 +/* Register fork handlers.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -3928,71 +4294,28 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +   You should have received a copy of the GNU Library General Public
 +   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+   Boston, MA 02111-1307, USA.  */
-+
-+#include <pthread.h>
-+#include <pt-internal.h>
-+
-+/* This is defined by newer gcc version unique for each module.  */
-+extern void *__dso_handle __attribute__ ((__weak__,
-+					  __visibility__ ("hidden")));
-+
-+int
-+pthread_atfork (void (*prepare) (void),
-+		void (*parent) (void),
-+		void (*child) (void))
-+{
-+  return __register_atfork (prepare, parent, child, &__dso_handle == NULL ? NULL : __dso_handle);
-+}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-attr.c glibc-2.24/libpthread/sysdeps/generic/pt-attr.c
---- glibc/libpthread/sysdeps/generic/pt-attr.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-attr.c	2015-11-01 12:03:30.579924091 +0100
-@@ -0,0 +1,41 @@
-+/* Default attributes.  Generic version.
-+   Copyright (C) 2000,02 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 Library General Public License as
-+   published by the Free Software Foundation; either version 2 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
-+   Library General Public License for more details.
-+
-+   You should have received a copy of the GNU Library General Public
-+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+   Boston, MA 02111-1307, USA.  */
-+
-+#include <pthread.h>
-+#include <sched.h>
-+#include <stddef.h>
-+#include <limits.h>
++   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
 +
++#include <pthread.h>
 +#include <pt-internal.h>
 +
-+const struct __pthread_attr __pthread_default_attr =
++/* This is defined by newer gcc version unique for each module.  */
++extern void *__dso_handle __attribute__ ((__weak__,
++					  __visibility__ ("hidden")));
++
++int
++pthread_atfork (void (*prepare) (void),
++		void (*parent) (void),
++		void (*child) (void))
 +{
-+  __schedparam: { sched_priority: 0 },
-+  __stacksize: 0,
-+  __stackaddr: NULL,
-+#ifdef PAGESIZE
-+  __guardsize: PAGESIZE,
-+#else
-+  __guardsize: 1,
-+#endif /* PAGESIZE */
-+  __detachstate: PTHREAD_CREATE_JOINABLE,
-+  __inheritsched: PTHREAD_EXPLICIT_SCHED,
-+  __contentionscope: PTHREAD_SCOPE_SYSTEM,
-+  __schedpolicy: SCHED_OTHER
-+};
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-attr-destroy.c glibc-2.24/libpthread/sysdeps/generic/pt-attr-destroy.c
---- glibc/libpthread/sysdeps/generic/pt-attr-destroy.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-attr-destroy.c	2012-04-22 01:03:32.972396697 +0200
++  return __register_atfork (prepare, parent, child, &__dso_handle == NULL ? NULL : __dso_handle);
++}
+diff --git glibc/libpthread/sysdeps/generic/pt-attr-destroy.c glibc/libpthread/sysdeps/generic/pt-attr-destroy.c
+new file mode 100644
+index 0000000..b9bd374
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-attr-destroy.c
 @@ -0,0 +1,28 @@
 +/* pthread_attr_destroy.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -4022,9 +4345,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  return 0;
 +}
 +strong_alias (__pthread_attr_destroy, pthread_attr_destroy);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-attr-getdetachstate.c glibc-2.24/libpthread/sysdeps/generic/pt-attr-getdetachstate.c
---- glibc/libpthread/sysdeps/generic/pt-attr-getdetachstate.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-attr-getdetachstate.c	2015-03-22 23:10:39.724431794 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-attr-getdetachstate.c glibc/libpthread/sysdeps/generic/pt-attr-getdetachstate.c
+new file mode 100644
+index 0000000..6a1de67
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-attr-getdetachstate.c
 @@ -0,0 +1,31 @@
 +/* pthread_attr_getdetachstate.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -4057,9 +4382,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__pthread_attr_getdetachstate, pthread_attr_getdetachstate);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-attr-getguardsize.c glibc-2.24/libpthread/sysdeps/generic/pt-attr-getguardsize.c
---- glibc/libpthread/sysdeps/generic/pt-attr-getguardsize.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-attr-getguardsize.c	2015-03-22 23:10:32.120658698 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-attr-getguardsize.c glibc/libpthread/sysdeps/generic/pt-attr-getguardsize.c
+new file mode 100644
+index 0000000..909f301
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-attr-getguardsize.c
 @@ -0,0 +1,29 @@
 +/* pthread_attr_getguardsize.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -4090,9 +4417,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  *guardsize = attr->__guardsize;
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-attr-getinheritsched.c glibc-2.24/libpthread/sysdeps/generic/pt-attr-getinheritsched.c
---- glibc/libpthread/sysdeps/generic/pt-attr-getinheritsched.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-attr-getinheritsched.c	2015-03-22 23:10:48.504169805 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-attr-getinheritsched.c glibc/libpthread/sysdeps/generic/pt-attr-getinheritsched.c
+new file mode 100644
+index 0000000..5d5fc84
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-attr-getinheritsched.c
 @@ -0,0 +1,31 @@
 +/* pthread_attr_getinheritsched.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -4125,9 +4454,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__pthread_attr_getinheritsched, pthread_attr_getinheritsched);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-attr-getschedparam.c glibc-2.24/libpthread/sysdeps/generic/pt-attr-getschedparam.c
---- glibc/libpthread/sysdeps/generic/pt-attr-getschedparam.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-attr-getschedparam.c	2015-03-22 23:10:18.273071939 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-attr-getschedparam.c glibc/libpthread/sysdeps/generic/pt-attr-getschedparam.c
+new file mode 100644
+index 0000000..85e07a1
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-attr-getschedparam.c
 @@ -0,0 +1,34 @@
 +/* pthread_attr_getschedparam.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -4163,9 +4494,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__pthread_attr_getschedparam, pthread_attr_getschedparam);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-attr-getschedpolicy.c glibc-2.24/libpthread/sysdeps/generic/pt-attr-getschedpolicy.c
---- glibc/libpthread/sysdeps/generic/pt-attr-getschedpolicy.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-attr-getschedpolicy.c	2015-03-22 23:11:04.887680943 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-attr-getschedpolicy.c glibc/libpthread/sysdeps/generic/pt-attr-getschedpolicy.c
+new file mode 100644
+index 0000000..caf8a7b
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-attr-getschedpolicy.c
 @@ -0,0 +1,31 @@
 +/* pthread_attr_getschedpolicy.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -4198,9 +4531,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__pthread_attr_getschedpolicy, pthread_attr_getschedpolicy);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-attr-getscope.c glibc-2.24/libpthread/sysdeps/generic/pt-attr-getscope.c
---- glibc/libpthread/sysdeps/generic/pt-attr-getscope.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-attr-getscope.c	2015-03-22 23:10:56.987916658 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-attr-getscope.c glibc/libpthread/sysdeps/generic/pt-attr-getscope.c
+new file mode 100644
+index 0000000..5e0c1a0
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-attr-getscope.c
 @@ -0,0 +1,31 @@
 +/* pthread_attr_getscope.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -4233,11 +4568,13 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__pthread_attr_getscope, pthread_attr_getscope);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-attr-getstackaddr.c glibc-2.24/libpthread/sysdeps/generic/pt-attr-getstackaddr.c
---- glibc/libpthread/sysdeps/generic/pt-attr-getstackaddr.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-attr-getstackaddr.c	2015-03-22 23:10:08.849353176 +0100
-@@ -0,0 +1,29 @@
-+/* pthread_attr_getstackaddr.  Generic version.
+diff --git glibc/libpthread/sysdeps/generic/pt-attr-getstack.c glibc/libpthread/sysdeps/generic/pt-attr-getstack.c
+new file mode 100644
+index 0000000..7beb79f
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-attr-getstack.c
+@@ -0,0 +1,31 @@
++/* pthread_attr_getstack.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -4260,17 +4597,21 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pt-internal.h>
 +
 +int
-+pthread_attr_getstackaddr (const pthread_attr_t *attr,
-+			   void **stackaddr)
++pthread_attr_getstack (const pthread_attr_t *attr,
++		       void **stackaddr,
++		       size_t *stacksize)
 +{
-+  *stackaddr = attr->__stackaddr;
++  pthread_attr_getstackaddr (attr, stackaddr);
++  pthread_attr_getstacksize (attr, stacksize);
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-attr-getstack.c glibc-2.24/libpthread/sysdeps/generic/pt-attr-getstack.c
---- glibc/libpthread/sysdeps/generic/pt-attr-getstack.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-attr-getstack.c	2009-07-11 11:29:35.000000000 +0200
-@@ -0,0 +1,31 @@
-+/* pthread_attr_getstack.  Generic version.
+diff --git glibc/libpthread/sysdeps/generic/pt-attr-getstackaddr.c glibc/libpthread/sysdeps/generic/pt-attr-getstackaddr.c
+new file mode 100644
+index 0000000..0360701
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-attr-getstackaddr.c
+@@ -0,0 +1,29 @@
++/* pthread_attr_getstackaddr.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -4293,17 +4634,17 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pt-internal.h>
 +
 +int
-+pthread_attr_getstack (const pthread_attr_t *attr,
-+		       void **stackaddr,
-+		       size_t *stacksize)
++pthread_attr_getstackaddr (const pthread_attr_t *attr,
++			   void **stackaddr)
 +{
-+  pthread_attr_getstackaddr (attr, stackaddr);
-+  pthread_attr_getstacksize (attr, stacksize);
++  *stackaddr = attr->__stackaddr;
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-attr-getstacksize.c glibc-2.24/libpthread/sysdeps/generic/pt-attr-getstacksize.c
---- glibc/libpthread/sysdeps/generic/pt-attr-getstacksize.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-attr-getstacksize.c	2015-03-22 23:10:25.292862451 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-attr-getstacksize.c glibc/libpthread/sysdeps/generic/pt-attr-getstacksize.c
+new file mode 100644
+index 0000000..428aaa3
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-attr-getstacksize.c
 @@ -0,0 +1,29 @@
 +/* pthread_attr_getstacksize.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -4334,9 +4675,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  *stacksize = attr->__stacksize;
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-attr-init.c glibc-2.24/libpthread/sysdeps/generic/pt-attr-init.c
---- glibc/libpthread/sysdeps/generic/pt-attr-init.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-attr-init.c	2012-04-22 01:03:32.972396697 +0200
+diff --git glibc/libpthread/sysdeps/generic/pt-attr-init.c glibc/libpthread/sysdeps/generic/pt-attr-init.c
+new file mode 100644
+index 0000000..f9eb361
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-attr-init.c
 @@ -0,0 +1,29 @@
 +/* pthread_attr_init.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -4367,9 +4710,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  return 0;
 +}
 +strong_alias (__pthread_attr_init, pthread_attr_init);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-attr-setdetachstate.c glibc-2.24/libpthread/sysdeps/generic/pt-attr-setdetachstate.c
---- glibc/libpthread/sysdeps/generic/pt-attr-setdetachstate.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-attr-setdetachstate.c	2015-03-22 23:10:39.732431555 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-attr-setdetachstate.c glibc/libpthread/sysdeps/generic/pt-attr-setdetachstate.c
+new file mode 100644
+index 0000000..cf3ebea
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-attr-setdetachstate.c
 @@ -0,0 +1,40 @@
 +/* pthread_attr_setdetachstate.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -4411,9 +4756,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__pthread_attr_setdetachstate, pthread_attr_setdetachstate);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-attr-setguardsize.c glibc-2.24/libpthread/sysdeps/generic/pt-attr-setguardsize.c
---- glibc/libpthread/sysdeps/generic/pt-attr-setguardsize.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-attr-setguardsize.c	2015-03-22 23:10:32.128658459 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-attr-setguardsize.c glibc/libpthread/sysdeps/generic/pt-attr-setguardsize.c
+new file mode 100644
+index 0000000..ab68dba
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-attr-setguardsize.c
 @@ -0,0 +1,29 @@
 +/* pthread_attr_setguardsize.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -4444,9 +4791,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  attr->__guardsize = guardsize;
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-attr-setinheritsched.c glibc-2.24/libpthread/sysdeps/generic/pt-attr-setinheritsched.c
---- glibc/libpthread/sysdeps/generic/pt-attr-setinheritsched.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-attr-setinheritsched.c	2015-03-22 23:10:48.512169567 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-attr-setinheritsched.c glibc/libpthread/sysdeps/generic/pt-attr-setinheritsched.c
+new file mode 100644
+index 0000000..e4a7368
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-attr-setinheritsched.c
 @@ -0,0 +1,40 @@
 +/* pthread_attr_setinheritsched.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -4488,9 +4837,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__pthread_attr_setinheritsched, pthread_attr_setinheritsched);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-attr-setschedparam.c glibc-2.24/libpthread/sysdeps/generic/pt-attr-setschedparam.c
---- glibc/libpthread/sysdeps/generic/pt-attr-setschedparam.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-attr-setschedparam.c	2015-03-22 23:12:24.909293621 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-attr-setschedparam.c glibc/libpthread/sysdeps/generic/pt-attr-setschedparam.c
+new file mode 100644
+index 0000000..201729e
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-attr-setschedparam.c
 @@ -0,0 +1,40 @@
 +/* pthread_attr_getschedparam.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -4532,9 +4883,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__pthread_attr_setschedparam, pthread_attr_setschedparam);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-attr-setschedpolicy.c glibc-2.24/libpthread/sysdeps/generic/pt-attr-setschedpolicy.c
---- glibc/libpthread/sysdeps/generic/pt-attr-setschedpolicy.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-attr-setschedpolicy.c	2015-03-22 23:11:04.895680704 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-attr-setschedpolicy.c glibc/libpthread/sysdeps/generic/pt-attr-setschedpolicy.c
+new file mode 100644
+index 0000000..070948c
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-attr-setschedpolicy.c
 @@ -0,0 +1,44 @@
 +/* pthread_attr_getschedpolicy.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -4580,9 +4933,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__pthread_attr_setschedpolicy, pthread_attr_setschedpolicy);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-attr-setscope.c glibc-2.24/libpthread/sysdeps/generic/pt-attr-setscope.c
---- glibc/libpthread/sysdeps/generic/pt-attr-setscope.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-attr-setscope.c	2015-03-22 23:12:50.944517049 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-attr-setscope.c glibc/libpthread/sysdeps/generic/pt-attr-setscope.c
+new file mode 100644
+index 0000000..09c5d84
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-attr-setscope.c
 @@ -0,0 +1,43 @@
 +/* pthread_attr_setscope.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -4627,42 +4982,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__pthread_attr_setscope, pthread_attr_setscope);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-attr-setstackaddr.c glibc-2.24/libpthread/sysdeps/generic/pt-attr-setstackaddr.c
---- glibc/libpthread/sysdeps/generic/pt-attr-setstackaddr.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-attr-setstackaddr.c	2015-03-22 23:10:08.853353057 +0100
-@@ -0,0 +1,29 @@
-+/* pthread_attr_setstackaddr.  Generic version.
-+   Copyright (C) 2002 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 Library General Public License as
-+   published by the Free Software Foundation; either version 2 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
-+   Library General Public License for more details.
-+
-+   You should have received a copy of the GNU Library General Public
-+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+   Boston, MA 02111-1307, USA.  */
-+
-+#include <pthread.h>
-+#include <pt-internal.h>
-+
-+int
-+pthread_attr_setstackaddr (pthread_attr_t *attr,
-+			   void *stackaddr)
-+{
-+  attr->__stackaddr = stackaddr;
-+  return 0;
-+}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-attr-setstack.c glibc-2.24/libpthread/sysdeps/generic/pt-attr-setstack.c
---- glibc/libpthread/sysdeps/generic/pt-attr-setstack.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-attr-setstack.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/generic/pt-attr-setstack.c glibc/libpthread/sysdeps/generic/pt-attr-setstack.c
+new file mode 100644
+index 0000000..360d27a
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-attr-setstack.c
 @@ -0,0 +1,51 @@
 +/* pthread_attr_setstack.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -4715,76 +5039,13 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +      
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-attr-setstacksize.c glibc-2.24/libpthread/sysdeps/generic/pt-attr-setstacksize.c
---- glibc/libpthread/sysdeps/generic/pt-attr-setstacksize.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-attr-setstacksize.c	2015-03-22 23:10:25.296862332 +0100
-@@ -0,0 +1,30 @@
-+/* pthread_attr_setstacksize.  Generic version.
-+   Copyright (C) 2002 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 Library General Public License as
-+   published by the Free Software Foundation; either version 2 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
-+   Library General Public License for more details.
-+
-+   You should have received a copy of the GNU Library General Public
-+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+   Boston, MA 02111-1307, USA.  */
-+
-+#include <pthread.h>
-+#include <pt-internal.h>
-+
-+int
-+pthread_attr_setstacksize (pthread_attr_t *attr,
-+			   size_t stacksize)
-+{
-+  attr->__stacksize = stacksize;
-+
-+  return 0;
-+}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-barrierattr-destroy.c glibc-2.24/libpthread/sysdeps/generic/pt-barrierattr-destroy.c
---- glibc/libpthread/sysdeps/generic/pt-barrierattr-destroy.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-barrierattr-destroy.c	2009-07-11 11:29:35.000000000 +0200
-@@ -0,0 +1,27 @@
-+/* pthread_barrierattr_destroy.  Generic version.
-+   Copyright (C) 2002 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 Library General Public License as
-+   published by the Free Software Foundation; either version 2 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
-+   Library General Public License for more details.
-+
-+   You should have received a copy of the GNU Library General Public
-+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+   Boston, MA 02111-1307, USA.  */
-+
-+#include <pthread.h>
-+#include <pt-internal.h>
-+
-+int
-+pthread_barrierattr_destroy (pthread_barrierattr_t *attr)
-+{
-+  return 0;
-+}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-barrierattr-getpshared.c glibc-2.24/libpthread/sysdeps/generic/pt-barrierattr-getpshared.c
---- glibc/libpthread/sysdeps/generic/pt-barrierattr-getpshared.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-barrierattr-getpshared.c	2015-03-22 22:42:38.642801524 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-attr-setstackaddr.c glibc/libpthread/sysdeps/generic/pt-attr-setstackaddr.c
+new file mode 100644
+index 0000000..2e292e5
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-attr-setstackaddr.c
 @@ -0,0 +1,29 @@
-+/* pthread_barrierattr_getpshared.  Generic version.
++/* pthread_attr_setstackaddr.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -4807,17 +5068,19 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pt-internal.h>
 +
 +int
-+pthread_barrierattr_getpshared (const pthread_barrierattr_t *attr,
-+				int *pshared)
++pthread_attr_setstackaddr (pthread_attr_t *attr,
++			   void *stackaddr)
 +{
-+  *pshared = attr->__pshared;
++  attr->__stackaddr = stackaddr;
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-barrierattr-init.c glibc-2.24/libpthread/sysdeps/generic/pt-barrierattr-init.c
---- glibc/libpthread/sysdeps/generic/pt-barrierattr-init.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-barrierattr-init.c	2009-07-11 11:29:35.000000000 +0200
-@@ -0,0 +1,28 @@
-+/* pthread_barrierattr_init.  Generic version.
+diff --git glibc/libpthread/sysdeps/generic/pt-attr-setstacksize.c glibc/libpthread/sysdeps/generic/pt-attr-setstacksize.c
+new file mode 100644
+index 0000000..da754d7
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-attr-setstacksize.c
+@@ -0,0 +1,30 @@
++/* pthread_attr_setstacksize.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -4840,17 +5103,21 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pt-internal.h>
 +
 +int
-+pthread_barrierattr_init (pthread_barrierattr_t *attr)
++pthread_attr_setstacksize (pthread_attr_t *attr,
++			   size_t stacksize)
 +{
-+  *attr = __pthread_default_barrierattr;
++  attr->__stacksize = stacksize;
++
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-barrierattr-setpshared.c glibc-2.24/libpthread/sysdeps/generic/pt-barrierattr-setpshared.c
---- glibc/libpthread/sysdeps/generic/pt-barrierattr-setpshared.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-barrierattr-setpshared.c	2015-03-22 22:42:38.646801403 +0100
-@@ -0,0 +1,39 @@
-+/* pthread_barrierattr_setpshared.  Generic version.
-+   Copyright (C) 2002 Free Software Foundation, Inc.
+diff --git glibc/libpthread/sysdeps/generic/pt-attr.c glibc/libpthread/sysdeps/generic/pt-attr.c
+new file mode 100644
+index 0000000..064b6ea
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-attr.c
+@@ -0,0 +1,41 @@
++/* Default attributes.  Generic version.
++   Copyright (C) 2000,02 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
@@ -4869,58 +5136,32 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +   Boston, MA 02111-1307, USA.  */
 +
 +#include <pthread.h>
-+#include <pt-internal.h>
-+
-+int
-+pthread_barrierattr_setpshared (pthread_barrierattr_t *attr,
-+				int pshared)
-+{
-+  switch (pshared)
-+    {
-+    case PTHREAD_PROCESS_PRIVATE:
-+      attr->__pshared = pshared;
-+      return 0;
-+
-+    case PTHREAD_PROCESS_SHARED:
-+      return ENOTSUP;
-+
-+    default:
-+      return EINVAL;
-+    }
-+}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-barrier.c glibc-2.24/libpthread/sysdeps/generic/pt-barrier.c
---- glibc/libpthread/sysdeps/generic/pt-barrier.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-barrier.c	2015-03-22 22:44:06.004159912 +0100
-@@ -0,0 +1,26 @@
-+/* Default barrier attributes.  Generic version.
-+   Copyright (C) 2002 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 Library General Public License as
-+   published by the Free Software Foundation; either version 2 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
-+   Library General Public License for more details.
-+
-+   You should have received a copy of the GNU Library General Public
-+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+   Boston, MA 02111-1307, USA.  */
++#include <sched.h>
++#include <stddef.h>
++#include <limits.h>
 +
-+#include <pthread.h>
 +#include <pt-internal.h>
 +
-+const struct __pthread_barrierattr __pthread_default_barrierattr =
++const struct __pthread_attr __pthread_default_attr =
 +{
-+  __pshared: PTHREAD_PROCESS_PRIVATE
++  __schedparam: { sched_priority: 0 },
++  __stacksize: 0,
++  __stackaddr: NULL,
++#ifdef PAGESIZE
++  __guardsize: PAGESIZE,
++#else
++  __guardsize: 1,
++#endif /* PAGESIZE */
++  __detachstate: PTHREAD_CREATE_JOINABLE,
++  __inheritsched: PTHREAD_EXPLICIT_SCHED,
++  __contentionscope: PTHREAD_SCOPE_SYSTEM,
++  __schedpolicy: SCHED_OTHER
 +};
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-barrier-destroy.c glibc-2.24/libpthread/sysdeps/generic/pt-barrier-destroy.c
---- glibc/libpthread/sysdeps/generic/pt-barrier-destroy.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-barrier-destroy.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/generic/pt-barrier-destroy.c glibc/libpthread/sysdeps/generic/pt-barrier-destroy.c
+new file mode 100644
+index 0000000..01b938b
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-barrier-destroy.c
 @@ -0,0 +1,27 @@
 +/* pthread_barrier_destroy.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -4949,9 +5190,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +{
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-barrier-init.c glibc-2.24/libpthread/sysdeps/generic/pt-barrier-init.c
---- glibc/libpthread/sysdeps/generic/pt-barrier-init.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-barrier-init.c	2015-03-22 22:46:50.739200278 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-barrier-init.c glibc/libpthread/sysdeps/generic/pt-barrier-init.c
+new file mode 100644
+index 0000000..056dd1f
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-barrier-init.c
 @@ -0,0 +1,53 @@
 +/* pthread_barrier_init.  Generic version.
 +   Copyright (C) 2002, 2005 Free Software Foundation, Inc.
@@ -5006,9 +5249,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  *barrier->__attr = *attr;
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-barrier-wait.c glibc-2.24/libpthread/sysdeps/generic/pt-barrier-wait.c
---- glibc/libpthread/sysdeps/generic/pt-barrier-wait.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-barrier-wait.c	2015-03-22 22:46:43.307423451 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-barrier-wait.c glibc/libpthread/sysdeps/generic/pt-barrier-wait.c
+new file mode 100644
+index 0000000..2dd1cc3
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-barrier-wait.c
 @@ -0,0 +1,69 @@
 +/* pthread_barrier_wait.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -5072,51 +5317,20 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +      struct __pthread *self = _pthread_self ();
 +
 +      /* Add ourselves to the list of waiters.  */
-+      __pthread_enqueue (&barrier->__queue, self);
-+      __pthread_spin_unlock (&barrier->__lock);
-+
-+      __pthread_block (self);
-+      return 0;
-+    }
-+}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-condattr-destroy.c glibc-2.24/libpthread/sysdeps/generic/pt-condattr-destroy.c
---- glibc/libpthread/sysdeps/generic/pt-condattr-destroy.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-condattr-destroy.c	2012-04-22 01:03:32.976396611 +0200
-@@ -0,0 +1,29 @@
-+/* pthread_condattr_destroy.  Generic version.
-+   Copyright (C) 2002 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 Library General Public License as
-+   published by the Free Software Foundation; either version 2 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
-+   Library General Public License for more details.
-+
-+   You should have received a copy of the GNU Library General Public
-+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+   Boston, MA 02111-1307, USA.  */
-+
-+#include <pthread.h>
-+#include <pt-internal.h>
-+
-+int
-+__pthread_condattr_destroy (pthread_condattr_t *cond)
-+{
-+  return 0;
-+}
++      __pthread_enqueue (&barrier->__queue, self);
++      __pthread_spin_unlock (&barrier->__lock);
 +
-+strong_alias (__pthread_condattr_destroy, pthread_condattr_destroy);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-condattr-getclock.c glibc-2.24/libpthread/sysdeps/generic/pt-condattr-getclock.c
---- glibc/libpthread/sysdeps/generic/pt-condattr-getclock.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-condattr-getclock.c	2015-03-22 22:54:16.293835713 +0100
-@@ -0,0 +1,31 @@
-+/* pthread_condattr_getclock.  Generic version.
++      __pthread_block (self);
++      return 0;
++    }
++}
+diff --git glibc/libpthread/sysdeps/generic/pt-barrier.c glibc/libpthread/sysdeps/generic/pt-barrier.c
+new file mode 100644
+index 0000000..28a2ef1
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-barrier.c
+@@ -0,0 +1,26 @@
++/* Default barrier attributes.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -5136,22 +5350,19 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +   Boston, MA 02111-1307, USA.  */
 +
 +#include <pthread.h>
-+#include <time.h>
-+
 +#include <pt-internal.h>
 +
-+int
-+pthread_condattr_getclock (const pthread_condattr_t *attr,
-+			   clockid_t *clock)
++const struct __pthread_barrierattr __pthread_default_barrierattr =
 +{
-+  *clock = attr->__clock;
-+  return 0;
-+}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-condattr-getpshared.c glibc-2.24/libpthread/sysdeps/generic/pt-condattr-getpshared.c
---- glibc/libpthread/sysdeps/generic/pt-condattr-getpshared.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-condattr-getpshared.c	2015-03-22 22:54:08.518068703 +0100
-@@ -0,0 +1,29 @@
-+/* pthread_condattr_getpshared.  Generic version.
++  __pshared: PTHREAD_PROCESS_PRIVATE
++};
+diff --git glibc/libpthread/sysdeps/generic/pt-barrierattr-destroy.c glibc/libpthread/sysdeps/generic/pt-barrierattr-destroy.c
+new file mode 100644
+index 0000000..eb39634
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-barrierattr-destroy.c
+@@ -0,0 +1,27 @@
++/* pthread_barrierattr_destroy.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -5174,17 +5385,17 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pt-internal.h>
 +
 +int
-+pthread_condattr_getpshared (const pthread_condattr_t *attr,
-+			     int *pshared)
++pthread_barrierattr_destroy (pthread_barrierattr_t *attr)
 +{
-+  *pshared = attr->__pshared;
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-condattr-init.c glibc-2.24/libpthread/sysdeps/generic/pt-condattr-init.c
---- glibc/libpthread/sysdeps/generic/pt-condattr-init.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-condattr-init.c	2012-04-22 01:03:32.976396611 +0200
-@@ -0,0 +1,30 @@
-+/* pthread_condattr_init.  Generic version.
+diff --git glibc/libpthread/sysdeps/generic/pt-barrierattr-getpshared.c glibc/libpthread/sysdeps/generic/pt-barrierattr-getpshared.c
+new file mode 100644
+index 0000000..f87f2ae
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-barrierattr-getpshared.c
+@@ -0,0 +1,29 @@
++/* pthread_barrierattr_getpshared.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -5207,18 +5418,19 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pt-internal.h>
 +
 +int
-+__pthread_condattr_init (pthread_condattr_t *attr)
++pthread_barrierattr_getpshared (const pthread_barrierattr_t *attr,
++				int *pshared)
 +{
-+  *attr = __pthread_default_condattr;
++  *pshared = attr->__pshared;
 +  return 0;
 +}
-+
-+strong_alias (__pthread_condattr_init, pthread_condattr_init);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-condattr-setclock.c glibc-2.24/libpthread/sysdeps/generic/pt-condattr-setclock.c
---- glibc/libpthread/sysdeps/generic/pt-condattr-setclock.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-condattr-setclock.c	2015-03-22 22:54:16.301835474 +0100
-@@ -0,0 +1,52 @@
-+/* pthread_condattr_setclock.  Generic version.
+diff --git glibc/libpthread/sysdeps/generic/pt-barrierattr-init.c glibc/libpthread/sysdeps/generic/pt-barrierattr-init.c
+new file mode 100644
+index 0000000..45f16cc
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-barrierattr-init.c
+@@ -0,0 +1,28 @@
++/* pthread_barrierattr_init.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -5241,40 +5453,18 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pt-internal.h>
 +
 +int
-+pthread_condattr_setclock (pthread_condattr_t *attr, clockid_t clock)
++pthread_barrierattr_init (pthread_barrierattr_t *attr)
 +{
-+  /* Only a few clocks are allowed.  CLOCK_REALTIME is always allowed.
-+     CLOCK_MONOTONIC only if the kernel has the necessary support.  */
-+  if (clock == CLOCK_MONOTONIC)
-+    {
-+      /* Check whether the clock is available.  */
-+      static int avail;
-+
-+      if (avail == 0)
-+	{
-+	  struct timespec ts;
-+	  int res;
-+
-+	  res = clock_gettime (CLOCK_MONOTONIC, &ts);
-+	  avail = res < 0 ? -1 : 1;
-+	}
-+
-+      if (avail < 0)
-+	/* Not available.  */
-+	return EINVAL;
-+    }
-+  else if (clock != CLOCK_REALTIME)
-+    return EINVAL;
-+
-+  attr->__clock = clock;
-+
++  *attr = __pthread_default_barrierattr;
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-condattr-setpshared.c glibc-2.24/libpthread/sysdeps/generic/pt-condattr-setpshared.c
---- glibc/libpthread/sysdeps/generic/pt-condattr-setpshared.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-condattr-setpshared.c	2015-03-22 22:54:08.526068463 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-barrierattr-setpshared.c glibc/libpthread/sysdeps/generic/pt-barrierattr-setpshared.c
+new file mode 100644
+index 0000000..ecad630
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-barrierattr-setpshared.c
 @@ -0,0 +1,39 @@
-+/* pthread_condattr_setpshared.  Generic version.
++/* pthread_barrierattr_setpshared.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -5297,8 +5487,8 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pt-internal.h>
 +
 +int
-+pthread_condattr_setpshared (pthread_condattr_t *attr,
-+			     int pshared)
++pthread_barrierattr_setpshared (pthread_barrierattr_t *attr,
++				int pshared)
 +{
 +  switch (pshared)
 +    {
@@ -5313,9 +5503,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +      return EINVAL;
 +    }
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-cond-brdcast.c glibc-2.24/libpthread/sysdeps/generic/pt-cond-brdcast.c
---- glibc/libpthread/sysdeps/generic/pt-cond-brdcast.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-cond-brdcast.c	2014-11-02 02:30:18.671231651 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-cond-brdcast.c glibc/libpthread/sysdeps/generic/pt-cond-brdcast.c
+new file mode 100644
+index 0000000..f2a2987
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-cond-brdcast.c
 @@ -0,0 +1,45 @@
 +/* Broadcast a condition.  Generic version.
 +   Copyright (C) 2000, 2002 Free Software Foundation, Inc.
@@ -5362,42 +5554,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__pthread_cond_broadcast, pthread_cond_broadcast);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-cond.c glibc-2.24/libpthread/sysdeps/generic/pt-cond.c
---- glibc/libpthread/sysdeps/generic/pt-cond.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-cond.c	2015-03-22 22:55:17.987987438 +0100
-@@ -0,0 +1,29 @@
-+/* Default condition attributes.  Generic version.
-+   Copyright (C) 2002 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 Library General Public License as
-+   published by the Free Software Foundation; either version 2 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
-+   Library General Public License for more details.
-+
-+   You should have received a copy of the GNU Library General Public
-+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+   Boston, MA 02111-1307, USA.  */
-+
-+#include <pthread.h>
-+#include <time.h>
-+
-+#include <pt-internal.h>
-+
-+const struct __pthread_condattr __pthread_default_condattr =
-+{
-+  __pshared: PTHREAD_PROCESS_PRIVATE,
-+  __clock: CLOCK_REALTIME
-+};
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-cond-destroy.c glibc-2.24/libpthread/sysdeps/generic/pt-cond-destroy.c
---- glibc/libpthread/sysdeps/generic/pt-cond-destroy.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-cond-destroy.c	2012-04-22 01:03:32.972396697 +0200
+diff --git glibc/libpthread/sysdeps/generic/pt-cond-destroy.c glibc/libpthread/sysdeps/generic/pt-cond-destroy.c
+new file mode 100644
+index 0000000..d72ea75
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-cond-destroy.c
 @@ -0,0 +1,29 @@
 +/* pthread_cond_destroy.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -5428,9 +5589,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__pthread_cond_destroy, pthread_cond_destroy);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-cond-init.c glibc-2.24/libpthread/sysdeps/generic/pt-cond-init.c
---- glibc/libpthread/sysdeps/generic/pt-cond-init.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-cond-init.c	2012-04-22 01:03:32.972396697 +0200
+diff --git glibc/libpthread/sysdeps/generic/pt-cond-init.c glibc/libpthread/sysdeps/generic/pt-cond-init.c
+new file mode 100644
+index 0000000..350f2eb
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-cond-init.c
 @@ -0,0 +1,47 @@
 +/* pthread_cond_init.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -5479,9 +5642,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__pthread_cond_init, pthread_cond_init);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-cond-signal.c glibc-2.24/libpthread/sysdeps/generic/pt-cond-signal.c
---- glibc/libpthread/sysdeps/generic/pt-cond-signal.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-cond-signal.c	2013-02-10 10:49:14.689444866 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-cond-signal.c glibc/libpthread/sysdeps/generic/pt-cond-signal.c
+new file mode 100644
+index 0000000..4b5450c
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-cond-signal.c
 @@ -0,0 +1,43 @@
 +/* Signal a condition.  Generic version.
 +   Copyright (C) 2000 Free Software Foundation, Inc.
@@ -5526,9 +5691,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__pthread_cond_signal, pthread_cond_signal);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-cond-timedwait.c glibc-2.24/libpthread/sysdeps/generic/pt-cond-timedwait.c
---- glibc/libpthread/sysdeps/generic/pt-cond-timedwait.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-cond-timedwait.c	2015-03-22 22:56:22.438057158 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-cond-timedwait.c glibc/libpthread/sysdeps/generic/pt-cond-timedwait.c
+new file mode 100644
+index 0000000..e44d9ad
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-cond-timedwait.c
 @@ -0,0 +1,178 @@
 +/* Wait on a condition.  Generic version.
 +   Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc.
@@ -5708,9 +5875,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return err;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-cond-wait.c glibc-2.24/libpthread/sysdeps/generic/pt-cond-wait.c
---- glibc/libpthread/sysdeps/generic/pt-cond-wait.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-cond-wait.c	2012-04-22 01:03:32.976396611 +0200
+diff --git glibc/libpthread/sysdeps/generic/pt-cond-wait.c glibc/libpthread/sysdeps/generic/pt-cond-wait.c
+new file mode 100644
+index 0000000..38a2ae6
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-cond-wait.c
 @@ -0,0 +1,39 @@
 +/* Wait on a condition.  Generic version.
 +   Copyright (C) 2000,02 Free Software Foundation, Inc.
@@ -5751,11 +5920,13 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__pthread_cond_wait, pthread_cond_wait);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-destroy-specific.c glibc-2.24/libpthread/sysdeps/generic/pt-destroy-specific.c
---- glibc/libpthread/sysdeps/generic/pt-destroy-specific.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-destroy-specific.c	2009-07-11 11:29:35.000000000 +0200
-@@ -0,0 +1,28 @@
-+/* __pthread_destory_specific.  Generic version.
+diff --git glibc/libpthread/sysdeps/generic/pt-cond.c glibc/libpthread/sysdeps/generic/pt-cond.c
+new file mode 100644
+index 0000000..05f0520
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-cond.c
+@@ -0,0 +1,29 @@
++/* Default condition attributes.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -5775,54 +5946,22 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +   Boston, MA 02111-1307, USA.  */
 +
 +#include <pthread.h>
-+#include <pt-internal.h>
-+
-+void
-+__pthread_destory_specifc (struct __pthread *thread)
-+{
-+  /* Not support, thus there cannot be any.  */
-+  return;
-+}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-equal.c glibc-2.24/libpthread/sysdeps/generic/pt-equal.c
---- glibc/libpthread/sysdeps/generic/pt-equal.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-equal.c	2012-04-22 01:03:32.976396611 +0200
-@@ -0,0 +1,31 @@
-+/* Default attributes.  Generic version.
-+   Copyright (C) 2000,02 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 Library General Public License as
-+   published by the Free Software Foundation; either version 2 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
-+   Library General Public License for more details.
-+
-+   You should have received a copy of the GNU Library General Public
-+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+   Boston, MA 02111-1307, USA.  */
++#include <time.h>
 +
-+#include <pthread.h>
 +#include <pt-internal.h>
 +
-+/* Return true if __T1 and __T2 both name the same thread.  Otherwise,
-+   false.  */
-+int
-+__pthread_equal (pthread_t __t1, pthread_t __t2)
++const struct __pthread_condattr __pthread_default_condattr =
 +{
-+  return __t1 == __t2;
-+}
-+
-+strong_alias (__pthread_equal, pthread_equal);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-getconcurrency.c glibc-2.24/libpthread/sysdeps/generic/pt-getconcurrency.c
---- glibc/libpthread/sysdeps/generic/pt-getconcurrency.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-getconcurrency.c	2009-07-11 11:29:35.000000000 +0200
-@@ -0,0 +1,27 @@
-+/* Get the current level of desired concurrency.  Generic version.
++  __pshared: PTHREAD_PROCESS_PRIVATE,
++  __clock: CLOCK_REALTIME
++};
+diff --git glibc/libpthread/sysdeps/generic/pt-condattr-destroy.c glibc/libpthread/sysdeps/generic/pt-condattr-destroy.c
+new file mode 100644
+index 0000000..9fd55b1
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-condattr-destroy.c
+@@ -0,0 +1,29 @@
++/* pthread_condattr_destroy.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -5845,15 +5984,19 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pt-internal.h>
 +
 +int
-+pthread_getconcurrency (void)
++__pthread_condattr_destroy (pthread_condattr_t *cond)
 +{
-+  return __pthread_concurrency;
++  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-getcpuclockid.c glibc-2.24/libpthread/sysdeps/generic/pt-getcpuclockid.c
---- glibc/libpthread/sysdeps/generic/pt-getcpuclockid.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-getcpuclockid.c	2014-01-01 18:30:36.095798996 +0100
-@@ -0,0 +1,35 @@
-+/* Return a thread's cpu clockid.  Generic version.
++
++strong_alias (__pthread_condattr_destroy, pthread_condattr_destroy);
+diff --git glibc/libpthread/sysdeps/generic/pt-condattr-getclock.c glibc/libpthread/sysdeps/generic/pt-condattr-getclock.c
+new file mode 100644
+index 0000000..4885b13
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-condattr-getclock.c
+@@ -0,0 +1,31 @@
++/* pthread_condattr_getclock.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -5878,21 +6021,19 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pt-internal.h>
 +
 +int
-+pthread_getcpuclockid (pthread_t thread, clockid_t *clock)
++pthread_condattr_getclock (const pthread_condattr_t *attr,
++			   clockid_t *clock)
 +{
-+#ifdef CLOCK_THREAD_CPUTIME_ID
-+  *clock = CLOCK_THREAD_CPUTIME_ID;
++  *clock = attr->__clock;
 +  return 0;
-+#else
-+  return ENOSYS;
-+stub_warning (pthread_getcpuclockid)
-+#endif
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-getschedparam.c glibc-2.24/libpthread/sysdeps/generic/pt-getschedparam.c
---- glibc/libpthread/sysdeps/generic/pt-getschedparam.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-getschedparam.c	2014-01-01 18:30:36.099798940 +0100
-@@ -0,0 +1,31 @@
-+/* Get the scheduling parameters for a thread.  Generic version.
+diff --git glibc/libpthread/sysdeps/generic/pt-condattr-getpshared.c glibc/libpthread/sysdeps/generic/pt-condattr-getpshared.c
+new file mode 100644
+index 0000000..a27dbc4
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-condattr-getpshared.c
+@@ -0,0 +1,29 @@
++/* pthread_condattr_getpshared.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -5915,19 +6056,19 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pt-internal.h>
 +
 +int
-+__pthread_getschedparam (pthread_t thread, int *policy,
-+		       struct sched_param *param)
++pthread_condattr_getpshared (const pthread_condattr_t *attr,
++			     int *pshared)
 +{
-+  return ENOSYS;
++  *pshared = attr->__pshared;
++  return 0;
 +}
-+
-+strong_alias (__pthread_getschedparam, pthread_getschedparam);
-+stub_warning (pthread_getschedparam)
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-getspecific.c glibc-2.24/libpthread/sysdeps/generic/pt-getspecific.c
---- glibc/libpthread/sysdeps/generic/pt-getspecific.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-getspecific.c	2015-03-01 16:34:08.062262869 +0100
-@@ -0,0 +1,27 @@
-+/* pthread_getspecific.  Generic version.
+diff --git glibc/libpthread/sysdeps/generic/pt-condattr-init.c glibc/libpthread/sysdeps/generic/pt-condattr-init.c
+new file mode 100644
+index 0000000..8570fd1
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-condattr-init.c
+@@ -0,0 +1,30 @@
++/* pthread_condattr_init.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -5950,46 +6091,20 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pt-internal.h>
 +
 +int
-+pthread_getspecific (pthread_key_t key)
-+{
-+  return EINVAL;
-+}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-init-specific.c glibc-2.24/libpthread/sysdeps/generic/pt-init-specific.c
---- glibc/libpthread/sysdeps/generic/pt-init-specific.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-init-specific.c	2009-07-11 11:29:35.000000000 +0200
-@@ -0,0 +1,27 @@
-+/* __pthread_init_specific.  Generic version.
-+   Copyright (C) 2002 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 Library General Public License as
-+   published by the Free Software Foundation; either version 2 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
-+   Library General Public License for more details.
-+
-+   You should have received a copy of the GNU Library General Public
-+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+   Boston, MA 02111-1307, USA.  */
-+
-+#include <pthread.h>
-+#include <pt-internal.h>
-+
-+error_t
-+__pthread_init_specific (struct __pthread *thread)
++__pthread_condattr_init (pthread_condattr_t *attr)
 +{
++  *attr = __pthread_default_condattr;
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-key-create.c glibc-2.24/libpthread/sysdeps/generic/pt-key-create.c
---- glibc/libpthread/sysdeps/generic/pt-key-create.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-key-create.c	2016-03-19 03:51:18.240546186 +0100
-@@ -0,0 +1,30 @@
-+/* pthread_key_create.  Generic version.
++
++strong_alias (__pthread_condattr_init, pthread_condattr_init);
+diff --git glibc/libpthread/sysdeps/generic/pt-condattr-setclock.c glibc/libpthread/sysdeps/generic/pt-condattr-setclock.c
+new file mode 100644
+index 0000000..ad28834
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-condattr-setclock.c
+@@ -0,0 +1,52 @@
++/* pthread_condattr_setclock.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -6012,51 +6127,42 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pt-internal.h>
 +
 +int
-+__pthread_key_create (pthread_key_t *key, void (*destructor) (void *))
++pthread_condattr_setclock (pthread_condattr_t *attr, clockid_t clock)
 +{
-+  return ENOSYS;
-+}
-+
-+strong_alias (__pthread_key_create, pthread_key_create)
-+stub_warning (pthread_key_create)
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-key-delete.c glibc-2.24/libpthread/sysdeps/generic/pt-key-delete.c
---- glibc/libpthread/sysdeps/generic/pt-key-delete.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-key-delete.c	2014-01-01 18:30:36.099798940 +0100
-@@ -0,0 +1,29 @@
-+/* pthread_key_delete.  Generic version.
-+   Copyright (C) 2002 Free Software Foundation, Inc.
-+   This file is part of the GNU C Library.
++  /* Only a few clocks are allowed.  CLOCK_REALTIME is always allowed.
++     CLOCK_MONOTONIC only if the kernel has the necessary support.  */
++  if (clock == CLOCK_MONOTONIC)
++    {
++      /* Check whether the clock is available.  */
++      static int avail;
 +
-+   The GNU C Library is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU Library General Public License as
-+   published by the Free Software Foundation; either version 2 of the
-+   License, or (at your option) any later version.
++      if (avail == 0)
++	{
++	  struct timespec ts;
++	  int res;
 +
-+   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
-+   Library General Public License for more details.
++	  res = clock_gettime (CLOCK_MONOTONIC, &ts);
++	  avail = res < 0 ? -1 : 1;
++	}
 +
-+   You should have received a copy of the GNU Library General Public
-+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+   Boston, MA 02111-1307, USA.  */
++      if (avail < 0)
++	/* Not available.  */
++	return EINVAL;
++    }
++  else if (clock != CLOCK_REALTIME)
++    return EINVAL;
 +
-+#include <pthread.h>
-+#include <pt-internal.h>
++  attr->__clock = clock;
 +
-+int
-+pthread_key_delete (pthread_key_t key)
-+{
-+  return ENOSYS;
++  return 0;
 +}
-+
-+stub_warning (pthread_key_delete)
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-key.h glibc-2.24/libpthread/sysdeps/generic/pt-key.h
---- glibc/libpthread/sysdeps/generic/pt-key.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-key.h	2009-07-11 11:29:35.000000000 +0200
-@@ -0,0 +1,22 @@
-+/* pthread_key internal declatations.  Generic version.
+diff --git glibc/libpthread/sysdeps/generic/pt-condattr-setpshared.c glibc/libpthread/sysdeps/generic/pt-condattr-setpshared.c
+new file mode 100644
+index 0000000..0316b4d
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-condattr-setpshared.c
+@@ -0,0 +1,39 @@
++/* pthread_condattr_setpshared.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -6076,51 +6182,33 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +   Boston, MA 02111-1307, USA.  */
 +
 +#include <pthread.h>
-+
-+#define PTHREAD_KEY_MEMBERS
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-kill.c glibc-2.24/libpthread/sysdeps/generic/pt-kill.c
---- glibc/libpthread/sysdeps/generic/pt-kill.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-kill.c	2016-09-21 00:05:53.993837636 +0200
-@@ -0,0 +1,33 @@
-+/* pthread-kill.c - Generic pthread-kill implementation.
-+   Copyright (C) 2008 Free Software Foundation, Inc.
-+   Written by Neal H. Walfield <neal@gnu.org>.
-+
-+   This file is part of the GNU Hurd.
-+
-+   The GNU Hurd 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 3 of
-+   the License, or (at your option) any later version.
-+
-+   The GNU Hurd 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 this program.  If not, see
-+   <http://www.gnu.org/licenses/>.  */
-+
-+#include <pthreadP.h>
-+#include "sig-internal.h"
++#include <pt-internal.h>
 +
 +int
-+__pthread_kill (pthread_t tid, int signo)
++pthread_condattr_setpshared (pthread_condattr_t *attr,
++			     int pshared)
 +{
-+  siginfo_t si;
-+  memset (&si, 0, sizeof (si));
-+  si.si_signo = signo;
++  switch (pshared)
++    {
++    case PTHREAD_PROCESS_PRIVATE:
++      attr->__pshared = pshared;
++      return 0;
 +
-+  return pthread_kill_siginfo_np (tid, si);
++    case PTHREAD_PROCESS_SHARED:
++      return ENOTSUP;
++
++    default:
++      return EINVAL;
++    }
 +}
-+strong_alias (__pthread_kill, pthread_kill)
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-mutexattr.c glibc-2.24/libpthread/sysdeps/generic/pt-mutexattr.c
---- glibc/libpthread/sysdeps/generic/pt-mutexattr.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-mutexattr.c	2015-03-22 23:00:29.254670142 +0100
-@@ -0,0 +1,45 @@
-+/* Default mutex attributes.  Generic version.
-+   Copyright (C) 2000, 2002, 2008 Free Software Foundation, Inc.
+diff --git glibc/libpthread/sysdeps/generic/pt-destroy-specific.c glibc/libpthread/sysdeps/generic/pt-destroy-specific.c
+new file mode 100644
+index 0000000..b627f87
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-destroy-specific.c
+@@ -0,0 +1,28 @@
++/* __pthread_destory_specific.  Generic version.
++   Copyright (C) 2002 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
@@ -6141,35 +6229,20 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pthread.h>
 +#include <pt-internal.h>
 +
-+const struct __pthread_mutexattr __pthread_default_mutexattr =
-+{
-+  __prioceiling: 0,
-+  __protocol: PTHREAD_PRIO_NONE,
-+  __pshared: PTHREAD_PROCESS_PRIVATE,
-+  __mutex_type: PTHREAD_MUTEX_DEFAULT
-+};
-+
-+const struct __pthread_mutexattr __pthread_errorcheck_mutexattr =
-+{
-+  __prioceiling: 0,
-+  __protocol: PTHREAD_PRIO_NONE,
-+  __pshared: PTHREAD_PROCESS_PRIVATE,
-+  __mutex_type: PTHREAD_MUTEX_ERRORCHECK
-+};
-+
-+const struct __pthread_mutexattr __pthread_recursive_mutexattr =
++void
++__pthread_destory_specifc (struct __pthread *thread)
 +{
-+  __prioceiling: 0,
-+  __protocol: PTHREAD_PRIO_NONE,
-+  __pshared: PTHREAD_PROCESS_PRIVATE,
-+  __mutex_type: PTHREAD_MUTEX_RECURSIVE
-+};
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-mutexattr-destroy.c glibc-2.24/libpthread/sysdeps/generic/pt-mutexattr-destroy.c
---- glibc/libpthread/sysdeps/generic/pt-mutexattr-destroy.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-mutexattr-destroy.c	2009-07-11 11:29:35.000000000 +0200
-@@ -0,0 +1,27 @@
-+/* pthread_mutexattr_destroy.  Generic version.
-+   Copyright (C) 2002 Free Software Foundation, Inc.
++  /* Not support, thus there cannot be any.  */
++  return;
++}
+diff --git glibc/libpthread/sysdeps/generic/pt-equal.c glibc/libpthread/sysdeps/generic/pt-equal.c
+new file mode 100644
+index 0000000..72fc7e6
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-equal.c
+@@ -0,0 +1,31 @@
++/* Default attributes.  Generic version.
++   Copyright (C) 2000,02 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
@@ -6190,16 +6263,22 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pthread.h>
 +#include <pt-internal.h>
 +
++/* Return true if __T1 and __T2 both name the same thread.  Otherwise,
++   false.  */
 +int
-+pthread_mutexattr_destroy (pthread_mutexattr_t *attr)
++__pthread_equal (pthread_t __t1, pthread_t __t2)
 +{
-+  return 0;
++  return __t1 == __t2;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-mutexattr-getprioceiling.c glibc-2.24/libpthread/sysdeps/generic/pt-mutexattr-getprioceiling.c
---- glibc/libpthread/sysdeps/generic/pt-mutexattr-getprioceiling.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-mutexattr-getprioceiling.c	2014-01-01 18:30:36.099798940 +0100
-@@ -0,0 +1,30 @@
-+/* pthread_mutexattr_getprioceiling.  Generic version.
++
++strong_alias (__pthread_equal, pthread_equal);
+diff --git glibc/libpthread/sysdeps/generic/pt-getconcurrency.c glibc/libpthread/sysdeps/generic/pt-getconcurrency.c
+new file mode 100644
+index 0000000..b55c8ee
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-getconcurrency.c
+@@ -0,0 +1,27 @@
++/* Get the current level of desired concurrency.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -6222,18 +6301,17 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pt-internal.h>
 +
 +int
-+pthread_mutexattr_getprioceiling (const pthread_mutexattr_t *attr,
-+				  int *prioceiling)
++pthread_getconcurrency (void)
 +{
-+  return ENOSYS;
++  return __pthread_concurrency;
 +}
-+
-+stub_warning (pthread_mutexattr_getprioceiling)
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-mutexattr-getprotocol.c glibc-2.24/libpthread/sysdeps/generic/pt-mutexattr-getprotocol.c
---- glibc/libpthread/sysdeps/generic/pt-mutexattr-getprotocol.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-mutexattr-getprotocol.c	2015-03-22 22:59:04.997190998 +0100
-@@ -0,0 +1,29 @@
-+/* pthread_mutexattr_getprotocol.  Generic version.
+diff --git glibc/libpthread/sysdeps/generic/pt-getcpuclockid.c glibc/libpthread/sysdeps/generic/pt-getcpuclockid.c
+new file mode 100644
+index 0000000..03868d3
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-getcpuclockid.c
+@@ -0,0 +1,35 @@
++/* Return a thread's cpu clockid.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -6253,20 +6331,28 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +   Boston, MA 02111-1307, USA.  */
 +
 +#include <pthread.h>
++#include <time.h>
++
 +#include <pt-internal.h>
 +
 +int
-+pthread_mutexattr_getprotocol (const pthread_mutexattr_t *attr,
-+			       int *protocol)
++pthread_getcpuclockid (pthread_t thread, clockid_t *clock)
 +{
-+  *protocol = attr->__protocol;
++#ifdef CLOCK_THREAD_CPUTIME_ID
++  *clock = CLOCK_THREAD_CPUTIME_ID;
 +  return 0;
++#else
++  return ENOSYS;
++stub_warning (pthread_getcpuclockid)
++#endif
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-mutexattr-getpshared.c glibc-2.24/libpthread/sysdeps/generic/pt-mutexattr-getpshared.c
---- glibc/libpthread/sysdeps/generic/pt-mutexattr-getpshared.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-mutexattr-getpshared.c	2015-03-22 22:59:12.076979146 +0100
-@@ -0,0 +1,29 @@
-+/* pthread_mutexattr_getpshared.  Generic version.
+diff --git glibc/libpthread/sysdeps/generic/pt-getschedparam.c glibc/libpthread/sysdeps/generic/pt-getschedparam.c
+new file mode 100644
+index 0000000..00974cf
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-getschedparam.c
+@@ -0,0 +1,31 @@
++/* Get the scheduling parameters for a thread.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -6289,17 +6375,21 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pt-internal.h>
 +
 +int
-+pthread_mutexattr_getpshared (const pthread_mutexattr_t *attr,
-+			      int *pshared)
++__pthread_getschedparam (pthread_t thread, int *policy,
++		       struct sched_param *param)
 +{
-+  *pshared = attr->__pshared;
-+  return 0;
++  return ENOSYS;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-mutexattr-gettype.c glibc-2.24/libpthread/sysdeps/generic/pt-mutexattr-gettype.c
---- glibc/libpthread/sysdeps/generic/pt-mutexattr-gettype.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-mutexattr-gettype.c	2015-03-22 22:59:19.980742645 +0100
-@@ -0,0 +1,28 @@
-+/* pthread_mutexattr_gettype.  Generic version.
++
++strong_alias (__pthread_getschedparam, pthread_getschedparam);
++stub_warning (pthread_getschedparam)
+diff --git glibc/libpthread/sysdeps/generic/pt-getspecific.c glibc/libpthread/sysdeps/generic/pt-getspecific.c
+new file mode 100644
+index 0000000..2a7c4a9
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-getspecific.c
+@@ -0,0 +1,27 @@
++/* pthread_getspecific.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -6322,16 +6412,17 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pt-internal.h>
 +
 +int
-+pthread_mutexattr_gettype (const pthread_mutexattr_t *attr, int *type)
++pthread_getspecific (pthread_key_t key)
 +{
-+  *type = attr->__mutex_type;
-+  return 0;
++  return EINVAL;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-mutexattr-init.c glibc-2.24/libpthread/sysdeps/generic/pt-mutexattr-init.c
---- glibc/libpthread/sysdeps/generic/pt-mutexattr-init.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-mutexattr-init.c	2009-07-11 11:29:35.000000000 +0200
-@@ -0,0 +1,28 @@
-+/* pthread_mutexattr_init.  Generic version.
+diff --git glibc/libpthread/sysdeps/generic/pt-init-specific.c glibc/libpthread/sysdeps/generic/pt-init-specific.c
+new file mode 100644
+index 0000000..00744fb
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-init-specific.c
+@@ -0,0 +1,27 @@
++/* __pthread_init_specific.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -6353,17 +6444,18 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pthread.h>
 +#include <pt-internal.h>
 +
-+int
-+pthread_mutexattr_init (pthread_mutexattr_t *attr)
++error_t
++__pthread_init_specific (struct __pthread *thread)
 +{
-+  *attr = __pthread_default_mutexattr;
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-mutexattr-setprioceiling.c glibc-2.24/libpthread/sysdeps/generic/pt-mutexattr-setprioceiling.c
---- glibc/libpthread/sysdeps/generic/pt-mutexattr-setprioceiling.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-mutexattr-setprioceiling.c	2014-01-01 18:30:36.099798940 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-key-create.c glibc/libpthread/sysdeps/generic/pt-key-create.c
+new file mode 100644
+index 0000000..33f691b
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-key-create.c
 @@ -0,0 +1,30 @@
-+/* pthread_mutexattr_setprioceiling.  Generic version.
++/* pthread_key_create.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -6386,18 +6478,20 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pt-internal.h>
 +
 +int
-+pthread_mutexattr_setprioceiling (pthread_mutexattr_t *attr,
-+				  int prioceiling)
++__pthread_key_create (pthread_key_t *key, void (*destructor) (void *))
 +{
 +  return ENOSYS;
 +}
 +
-+stub_warning (pthread_mutexattr_setprioceiling)
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-mutexattr-setprotocol.c glibc-2.24/libpthread/sysdeps/generic/pt-mutexattr-setprotocol.c
---- glibc/libpthread/sysdeps/generic/pt-mutexattr-setprotocol.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-mutexattr-setprotocol.c	2015-03-22 23:00:45.106195989 +0100
-@@ -0,0 +1,42 @@
-+/* pthread_mutexattr_setprotocol.  Generic version.
++strong_alias (__pthread_key_create, pthread_key_create)
++stub_warning (pthread_key_create)
+diff --git glibc/libpthread/sysdeps/generic/pt-key-delete.c glibc/libpthread/sysdeps/generic/pt-key-delete.c
+new file mode 100644
+index 0000000..7b4ff63
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-key-delete.c
+@@ -0,0 +1,29 @@
++/* pthread_key_delete.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -6420,30 +6514,19 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pt-internal.h>
 +
 +int
-+pthread_mutexattr_setprotocol (pthread_mutexattr_t *attr,
-+			       int protocol)
++pthread_key_delete (pthread_key_t key)
 +{
-+  if (protocol == __pthread_default_mutexattr.__protocol)
-+    {
-+      attr->__protocol = protocol;
-+      return 0;
-+    }
-+
-+  switch (protocol)
-+    {
-+    case PTHREAD_PRIO_NONE:
-+    case PTHREAD_PRIO_INHERIT:
-+    case PTHREAD_PRIO_PROTECT:
-+      return ENOTSUP;
-+    default:
-+      return EINVAL;
-+    }
++  return ENOSYS;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-mutexattr-setpshared.c glibc-2.24/libpthread/sysdeps/generic/pt-mutexattr-setpshared.c
---- glibc/libpthread/sysdeps/generic/pt-mutexattr-setpshared.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-mutexattr-setpshared.c	2015-03-22 22:59:12.084978907 +0100
-@@ -0,0 +1,39 @@
-+/* pthread_mutexattr_setpshared.  Generic version.
++
++stub_warning (pthread_key_delete)
+diff --git glibc/libpthread/sysdeps/generic/pt-key.h glibc/libpthread/sysdeps/generic/pt-key.h
+new file mode 100644
+index 0000000..544eb20
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-key.h
+@@ -0,0 +1,22 @@
++/* pthread_key internal declatations.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -6463,69 +6546,52 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +   Boston, MA 02111-1307, USA.  */
 +
 +#include <pthread.h>
-+#include <pt-internal.h>
-+
-+int
-+pthread_mutexattr_setpshared (pthread_mutexattr_t *attr,
-+			      int pshared)
-+{
-+  switch (pshared)
-+    {
-+    case PTHREAD_PROCESS_PRIVATE:
-+      attr->__pshared = pshared;
-+      return 0;
 +
-+    case PTHREAD_PROCESS_SHARED:
-+      return ENOTSUP;
++#define PTHREAD_KEY_MEMBERS
+diff --git glibc/libpthread/sysdeps/generic/pt-kill.c glibc/libpthread/sysdeps/generic/pt-kill.c
+new file mode 100644
+index 0000000..fc83f93
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-kill.c
+@@ -0,0 +1,33 @@
++/* pthread-kill.c - Generic pthread-kill implementation.
++   Copyright (C) 2008 Free Software Foundation, Inc.
++   Written by Neal H. Walfield <neal@gnu.org>.
 +
-+    default:
-+      return EINVAL;
-+    }
-+}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-mutexattr-settype.c glibc-2.24/libpthread/sysdeps/generic/pt-mutexattr-settype.c
---- glibc/libpthread/sysdeps/generic/pt-mutexattr-settype.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-mutexattr-settype.c	2015-03-22 22:59:19.984742526 +0100
-@@ -0,0 +1,37 @@
-+/* pthread_mutexattr_settype.  Generic version.
-+   Copyright (C) 2002 Free Software Foundation, Inc.
-+   This file is part of the GNU C Library.
++   This file is part of the GNU Hurd.
 +
-+   The GNU C Library is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU Library General Public License as
-+   published by the Free Software Foundation; either version 2 of the
-+   License, or (at your option) any later version.
++   The GNU Hurd 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 3 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
++   The GNU Hurd 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
-+   Library General Public License for more details.
++   Lesser General Public License for more details.
 +
-+   You should have received a copy of the GNU Library General Public
-+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+   Boston, MA 02111-1307, USA.  */
++   You should have received a copy of the GNU Lesser General Public
++   License along with this program.  If not, see
++   <http://www.gnu.org/licenses/>.  */
 +
-+#include <pthread.h>
-+#include <pt-internal.h>
++#include <pthreadP.h>
++#include "sig-internal.h"
 +
 +int
-+pthread_mutexattr_settype (pthread_mutexattr_t *attr, int type)
++__pthread_kill (pthread_t tid, int signo)
 +{
-+  switch (type)
-+    {
-+    case PTHREAD_MUTEX_NORMAL:
-+    case PTHREAD_MUTEX_ERRORCHECK:
-+    case PTHREAD_MUTEX_RECURSIVE:
-+      attr->__mutex_type = type;
-+      return 0;
++  siginfo_t si;
++  memset (&si, 0, sizeof (si));
++  si.si_signo = signo;
 +
-+    default:
-+      return EINVAL;
-+    }
++  return pthread_kill_siginfo_np (tid, si);
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-mutex-destroy.c glibc-2.24/libpthread/sysdeps/generic/pt-mutex-destroy.c
---- glibc/libpthread/sysdeps/generic/pt-mutex-destroy.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-mutex-destroy.c	2015-03-22 22:34:50.824975697 +0100
++strong_alias (__pthread_kill, pthread_kill)
+diff --git glibc/libpthread/sysdeps/generic/pt-mutex-destroy.c glibc/libpthread/sysdeps/generic/pt-mutex-destroy.c
+new file mode 100644
+index 0000000..3a3cb89
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-mutex-destroy.c
 @@ -0,0 +1,39 @@
 +/* Destroy a mutex.  Generic version.
 +   Copyright (C) 2000, 2002, 2006 Free Software Foundation, Inc.
@@ -6566,9 +6632,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (_pthread_mutex_destroy, pthread_mutex_destroy);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-mutex-getprioceiling.c glibc-2.24/libpthread/sysdeps/generic/pt-mutex-getprioceiling.c
---- glibc/libpthread/sysdeps/generic/pt-mutex-getprioceiling.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-mutex-getprioceiling.c	2014-01-01 18:30:36.099798940 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-mutex-getprioceiling.c glibc/libpthread/sysdeps/generic/pt-mutex-getprioceiling.c
+new file mode 100644
+index 0000000..ac886a8
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-mutex-getprioceiling.c
 @@ -0,0 +1,30 @@
 +/* Get a mutex' priority ceiling.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -6600,9 +6668,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +stub_warning (pthread_mutex_getprioceiling)
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-mutex-init.c glibc-2.24/libpthread/sysdeps/generic/pt-mutex-init.c
---- glibc/libpthread/sysdeps/generic/pt-mutex-init.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-mutex-init.c	2015-03-22 22:34:50.836975333 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-mutex-init.c glibc/libpthread/sysdeps/generic/pt-mutex-init.c
+new file mode 100644
+index 0000000..7f21511
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-mutex-init.c
 @@ -0,0 +1,50 @@
 +/* Initialize a mutex.  Generic version.
 +   Copyright (C) 2000, 2002, 2005, 2006, 2008 Free Software Foundation, Inc.
@@ -6654,9 +6724,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (_pthread_mutex_init, pthread_mutex_init);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-mutex-lock.c glibc-2.24/libpthread/sysdeps/generic/pt-mutex-lock.c
---- glibc/libpthread/sysdeps/generic/pt-mutex-lock.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-mutex-lock.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/generic/pt-mutex-lock.c glibc/libpthread/sysdeps/generic/pt-mutex-lock.c
+new file mode 100644
+index 0000000..528e593
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-mutex-lock.c
 @@ -0,0 +1,37 @@
 +/* Lock a mutex.  Generic version.
 +   Copyright (C) 2000, 2002, 2006 Free Software Foundation, Inc.
@@ -6695,9 +6767,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +strong_alias (__pthread_mutex_lock, _pthread_mutex_lock);
 +strong_alias (__pthread_mutex_lock, pthread_mutex_lock);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-mutex-setprioceiling.c glibc-2.24/libpthread/sysdeps/generic/pt-mutex-setprioceiling.c
---- glibc/libpthread/sysdeps/generic/pt-mutex-setprioceiling.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-mutex-setprioceiling.c	2014-01-01 18:30:36.099798940 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-mutex-setprioceiling.c glibc/libpthread/sysdeps/generic/pt-mutex-setprioceiling.c
+new file mode 100644
+index 0000000..1358b37
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-mutex-setprioceiling.c
 @@ -0,0 +1,30 @@
 +/* Set a mutex' priority ceiling.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -6729,9 +6803,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +stub_warning (pthread_mutex_setprioceiling)
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-mutex-timedlock.c glibc-2.24/libpthread/sysdeps/generic/pt-mutex-timedlock.c
---- glibc/libpthread/sysdeps/generic/pt-mutex-timedlock.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-mutex-timedlock.c	2015-03-22 22:59:19.948743603 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-mutex-timedlock.c glibc/libpthread/sysdeps/generic/pt-mutex-timedlock.c
+new file mode 100644
+index 0000000..0f8d447
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-mutex-timedlock.c
 @@ -0,0 +1,196 @@
 +/* Lock a mutex with a timeout.  Generic version.
 +   Copyright (C) 2000, 2002, 2005, 2008 Free Software Foundation, Inc.
@@ -6929,9 +7005,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +{
 +  return __pthread_mutex_timedlock_internal (mutex, abstime);
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-mutex-transfer-np.c glibc-2.24/libpthread/sysdeps/generic/pt-mutex-transfer-np.c
---- glibc/libpthread/sysdeps/generic/pt-mutex-transfer-np.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-mutex-transfer-np.c	2015-03-22 22:59:19.956743363 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-mutex-transfer-np.c glibc/libpthread/sysdeps/generic/pt-mutex-transfer-np.c
+new file mode 100644
+index 0000000..21fc040
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-mutex-transfer-np.c
 @@ -0,0 +1,66 @@
 +/* Transfer ownership of a mutex.  Generic version.
 +   Copyright (C) 2008 Free Software Foundation, Inc.
@@ -6999,9 +7077,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__pthread_mutex_transfer_np, pthread_mutex_transfer_np)
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-mutex-trylock.c glibc-2.24/libpthread/sysdeps/generic/pt-mutex-trylock.c
---- glibc/libpthread/sysdeps/generic/pt-mutex-trylock.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-mutex-trylock.c	2015-03-22 22:59:19.964743125 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-mutex-trylock.c glibc/libpthread/sysdeps/generic/pt-mutex-trylock.c
+new file mode 100644
+index 0000000..0d5ce7d
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-mutex-trylock.c
 @@ -0,0 +1,112 @@
 +/* Try to Lock a mutex.  Generic version.
 +   Copyright (C) 2002, 2005, 2008 Free Software Foundation, Inc.
@@ -7115,9 +7195,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +strong_alias (__pthread_mutex_trylock, _pthread_mutex_trylock);
 +strong_alias (__pthread_mutex_trylock, pthread_mutex_trylock);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-mutex-unlock.c glibc-2.24/libpthread/sysdeps/generic/pt-mutex-unlock.c
---- glibc/libpthread/sysdeps/generic/pt-mutex-unlock.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-mutex-unlock.c	2015-03-22 22:59:19.972742885 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-mutex-unlock.c glibc/libpthread/sysdeps/generic/pt-mutex-unlock.c
+new file mode 100644
+index 0000000..08f5975
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-mutex-unlock.c
 @@ -0,0 +1,108 @@
 +/* Unlock a mutex.  Generic version.
 +   Copyright (C) 2000, 2002, 2008 Free Software Foundation, Inc.
@@ -7227,11 +7309,13 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +strong_alias (__pthread_mutex_unlock, _pthread_mutex_unlock);
 +strong_alias (__pthread_mutex_unlock, pthread_mutex_unlock);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-once.c glibc-2.24/libpthread/sysdeps/generic/pt-once.c
---- glibc/libpthread/sysdeps/generic/pt-once.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-once.c	2015-03-23 01:53:34.686753146 +0100
-@@ -0,0 +1,45 @@
-+/* pthread_once.  Generic version.
+diff --git glibc/libpthread/sysdeps/generic/pt-mutexattr-destroy.c glibc/libpthread/sysdeps/generic/pt-mutexattr-destroy.c
+new file mode 100644
+index 0000000..fe7e95d
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-mutexattr-destroy.c
+@@ -0,0 +1,27 @@
++/* pthread_mutexattr_destroy.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -7251,36 +7335,278 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +   Boston, MA 02111-1307, USA.  */
 +
 +#include <pthread.h>
-+#include <bits/memory.h>
++#include <pt-internal.h>
++
++int
++pthread_mutexattr_destroy (pthread_mutexattr_t *attr)
++{
++  return 0;
++}
+diff --git glibc/libpthread/sysdeps/generic/pt-mutexattr-getprioceiling.c glibc/libpthread/sysdeps/generic/pt-mutexattr-getprioceiling.c
+new file mode 100644
+index 0000000..4865676
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-mutexattr-getprioceiling.c
+@@ -0,0 +1,30 @@
++/* pthread_mutexattr_getprioceiling.  Generic version.
++   Copyright (C) 2002 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 Library General Public License as
++   published by the Free Software Foundation; either version 2 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
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If not,
++   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
 +
++#include <pthread.h>
 +#include <pt-internal.h>
 +
 +int
-+__pthread_once (pthread_once_t *once_control, void (*init_routine) (void))
++pthread_mutexattr_getprioceiling (const pthread_mutexattr_t *attr,
++				  int *prioceiling)
 +{
-+  __memory_barrier ();
-+  if (once_control->__run == 0)
-+    {
-+      __pthread_spin_lock (&once_control->__lock);
++  return ENOSYS;
++}
 +
-+      if (once_control->__run == 0)
-+	{
-+	  init_routine ();
-+	  __memory_barrier ();
-+	  once_control->__run = 1;
-+	}
++stub_warning (pthread_mutexattr_getprioceiling)
+diff --git glibc/libpthread/sysdeps/generic/pt-mutexattr-getprotocol.c glibc/libpthread/sysdeps/generic/pt-mutexattr-getprotocol.c
+new file mode 100644
+index 0000000..c53d755
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-mutexattr-getprotocol.c
+@@ -0,0 +1,29 @@
++/* pthread_mutexattr_getprotocol.  Generic version.
++   Copyright (C) 2002 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
 +
-+      __pthread_spin_unlock (&once_control->__lock);
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Library General Public License as
++   published by the Free Software Foundation; either version 2 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
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If not,
++   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++#include <pthread.h>
++#include <pt-internal.h>
++
++int
++pthread_mutexattr_getprotocol (const pthread_mutexattr_t *attr,
++			       int *protocol)
++{
++  *protocol = attr->__protocol;
++  return 0;
++}
+diff --git glibc/libpthread/sysdeps/generic/pt-mutexattr-getpshared.c glibc/libpthread/sysdeps/generic/pt-mutexattr-getpshared.c
+new file mode 100644
+index 0000000..494b2de
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-mutexattr-getpshared.c
+@@ -0,0 +1,29 @@
++/* pthread_mutexattr_getpshared.  Generic version.
++   Copyright (C) 2002 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 Library General Public License as
++   published by the Free Software Foundation; either version 2 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
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If not,
++   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++#include <pthread.h>
++#include <pt-internal.h>
++
++int
++pthread_mutexattr_getpshared (const pthread_mutexattr_t *attr,
++			      int *pshared)
++{
++  *pshared = attr->__pshared;
++  return 0;
++}
+diff --git glibc/libpthread/sysdeps/generic/pt-mutexattr-gettype.c glibc/libpthread/sysdeps/generic/pt-mutexattr-gettype.c
+new file mode 100644
+index 0000000..28fee9a
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-mutexattr-gettype.c
+@@ -0,0 +1,28 @@
++/* pthread_mutexattr_gettype.  Generic version.
++   Copyright (C) 2002 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 Library General Public License as
++   published by the Free Software Foundation; either version 2 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
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If not,
++   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++#include <pthread.h>
++#include <pt-internal.h>
++
++int
++pthread_mutexattr_gettype (const pthread_mutexattr_t *attr, int *type)
++{
++  *type = attr->__mutex_type;
++  return 0;
++}
+diff --git glibc/libpthread/sysdeps/generic/pt-mutexattr-init.c glibc/libpthread/sysdeps/generic/pt-mutexattr-init.c
+new file mode 100644
+index 0000000..2f23673
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-mutexattr-init.c
+@@ -0,0 +1,28 @@
++/* pthread_mutexattr_init.  Generic version.
++   Copyright (C) 2002 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 Library General Public License as
++   published by the Free Software Foundation; either version 2 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
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If not,
++   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++#include <pthread.h>
++#include <pt-internal.h>
++
++int
++pthread_mutexattr_init (pthread_mutexattr_t *attr)
++{
++  *attr = __pthread_default_mutexattr;
++  return 0;
++}
+diff --git glibc/libpthread/sysdeps/generic/pt-mutexattr-setprioceiling.c glibc/libpthread/sysdeps/generic/pt-mutexattr-setprioceiling.c
+new file mode 100644
+index 0000000..bb8a3d6
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-mutexattr-setprioceiling.c
+@@ -0,0 +1,30 @@
++/* pthread_mutexattr_setprioceiling.  Generic version.
++   Copyright (C) 2002 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 Library General Public License as
++   published by the Free Software Foundation; either version 2 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
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If not,
++   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++#include <pthread.h>
++#include <pt-internal.h>
++
++int
++pthread_mutexattr_setprioceiling (pthread_mutexattr_t *attr,
++				  int prioceiling)
++{
++  return ENOSYS;
++}
++
++stub_warning (pthread_mutexattr_setprioceiling)
+diff --git glibc/libpthread/sysdeps/generic/pt-mutexattr-setprotocol.c glibc/libpthread/sysdeps/generic/pt-mutexattr-setprotocol.c
+new file mode 100644
+index 0000000..e11dc35
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-mutexattr-setprotocol.c
+@@ -0,0 +1,42 @@
++/* pthread_mutexattr_setprotocol.  Generic version.
++   Copyright (C) 2002 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 Library General Public License as
++   published by the Free Software Foundation; either version 2 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
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If not,
++   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++#include <pthread.h>
++#include <pt-internal.h>
++
++int
++pthread_mutexattr_setprotocol (pthread_mutexattr_t *attr,
++			       int protocol)
++{
++  if (protocol == __pthread_default_mutexattr.__protocol)
++    {
++      attr->__protocol = protocol;
++      return 0;
 +    }
 +
-+  return 0;
++  switch (protocol)
++    {
++    case PTHREAD_PRIO_NONE:
++    case PTHREAD_PRIO_INHERIT:
++    case PTHREAD_PRIO_PROTECT:
++      return ENOTSUP;
++    default:
++      return EINVAL;
++    }
 +}
-+strong_alias (__pthread_once, pthread_once);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-rwlock-attr.c glibc-2.24/libpthread/sysdeps/generic/pt-rwlock-attr.c
---- glibc/libpthread/sysdeps/generic/pt-rwlock-attr.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-rwlock-attr.c	2015-03-22 23:06:26.815982322 +0100
-@@ -0,0 +1,26 @@
-+/* Default rwlock attributes.  Generic version.
+diff --git glibc/libpthread/sysdeps/generic/pt-mutexattr-setpshared.c glibc/libpthread/sysdeps/generic/pt-mutexattr-setpshared.c
+new file mode 100644
+index 0000000..b7dc1f0
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-mutexattr-setpshared.c
+@@ -0,0 +1,39 @@
++/* pthread_mutexattr_setpshared.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -7302,15 +7628,30 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pthread.h>
 +#include <pt-internal.h>
 +
-+const struct __pthread_rwlockattr __pthread_default_rwlockattr =
++int
++pthread_mutexattr_setpshared (pthread_mutexattr_t *attr,
++			      int pshared)
 +{
-+  __pshared: PTHREAD_PROCESS_PRIVATE
-+};
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-rwlockattr-destroy.c glibc-2.24/libpthread/sysdeps/generic/pt-rwlockattr-destroy.c
---- glibc/libpthread/sysdeps/generic/pt-rwlockattr-destroy.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-rwlockattr-destroy.c	2009-07-11 11:29:35.000000000 +0200
-@@ -0,0 +1,27 @@
-+/* pthread_rwlockattr_destroy.  Generic version.
++  switch (pshared)
++    {
++    case PTHREAD_PROCESS_PRIVATE:
++      attr->__pshared = pshared;
++      return 0;
++
++    case PTHREAD_PROCESS_SHARED:
++      return ENOTSUP;
++
++    default:
++      return EINVAL;
++    }
++}
+diff --git glibc/libpthread/sysdeps/generic/pt-mutexattr-settype.c glibc/libpthread/sysdeps/generic/pt-mutexattr-settype.c
+new file mode 100644
+index 0000000..5c46010
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-mutexattr-settype.c
+@@ -0,0 +1,37 @@
++/* pthread_mutexattr_settype.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -7333,16 +7674,28 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pt-internal.h>
 +
 +int
-+pthread_rwlockattr_destroy (pthread_rwlockattr_t *attr)
++pthread_mutexattr_settype (pthread_mutexattr_t *attr, int type)
 +{
-+  return 0;
++  switch (type)
++    {
++    case PTHREAD_MUTEX_NORMAL:
++    case PTHREAD_MUTEX_ERRORCHECK:
++    case PTHREAD_MUTEX_RECURSIVE:
++      attr->__mutex_type = type;
++      return 0;
++
++    default:
++      return EINVAL;
++    }
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-rwlockattr-getpshared.c glibc-2.24/libpthread/sysdeps/generic/pt-rwlockattr-getpshared.c
---- glibc/libpthread/sysdeps/generic/pt-rwlockattr-getpshared.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-rwlockattr-getpshared.c	2015-03-22 23:05:22.273910394 +0100
-@@ -0,0 +1,29 @@
-+/* pthread_rwlockattr_getpshared.  Generic version.
-+   Copyright (C) 2002 Free Software Foundation, Inc.
+diff --git glibc/libpthread/sysdeps/generic/pt-mutexattr.c glibc/libpthread/sysdeps/generic/pt-mutexattr.c
+new file mode 100644
+index 0000000..f9282af
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-mutexattr.c
+@@ -0,0 +1,45 @@
++/* Default mutex attributes.  Generic version.
++   Copyright (C) 2000, 2002, 2008 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
@@ -7363,18 +7716,36 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pthread.h>
 +#include <pt-internal.h>
 +
-+int
-+pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *attr,
-+			       int *pshared)
++const struct __pthread_mutexattr __pthread_default_mutexattr =
 +{
-+  *pshared = attr->__pshared;
-+  return 0;
-+}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-rwlockattr-init.c glibc-2.24/libpthread/sysdeps/generic/pt-rwlockattr-init.c
---- glibc/libpthread/sysdeps/generic/pt-rwlockattr-init.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-rwlockattr-init.c	2009-07-11 11:29:35.000000000 +0200
-@@ -0,0 +1,28 @@
-+/* pthread_rwlockattr_init.  Generic version.
++  __prioceiling: 0,
++  __protocol: PTHREAD_PRIO_NONE,
++  __pshared: PTHREAD_PROCESS_PRIVATE,
++  __mutex_type: PTHREAD_MUTEX_DEFAULT
++};
++
++const struct __pthread_mutexattr __pthread_errorcheck_mutexattr =
++{
++  __prioceiling: 0,
++  __protocol: PTHREAD_PRIO_NONE,
++  __pshared: PTHREAD_PROCESS_PRIVATE,
++  __mutex_type: PTHREAD_MUTEX_ERRORCHECK
++};
++
++const struct __pthread_mutexattr __pthread_recursive_mutexattr =
++{
++  __prioceiling: 0,
++  __protocol: PTHREAD_PRIO_NONE,
++  __pshared: PTHREAD_PROCESS_PRIVATE,
++  __mutex_type: PTHREAD_MUTEX_RECURSIVE
++};
+diff --git glibc/libpthread/sysdeps/generic/pt-once.c glibc/libpthread/sysdeps/generic/pt-once.c
+new file mode 100644
+index 0000000..cfa45d5
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-once.c
+@@ -0,0 +1,45 @@
++/* pthread_once.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -7394,19 +7765,38 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +   Boston, MA 02111-1307, USA.  */
 +
 +#include <pthread.h>
++#include <bits/memory.h>
++
 +#include <pt-internal.h>
 +
 +int
-+pthread_rwlockattr_init (pthread_rwlockattr_t *attr)
++__pthread_once (pthread_once_t *once_control, void (*init_routine) (void))
 +{
-+  *attr = __pthread_default_rwlockattr;
++  __memory_barrier ();
++  if (once_control->__run == 0)
++    {
++      __pthread_spin_lock (&once_control->__lock);
++
++      if (once_control->__run == 0)
++	{
++	  init_routine ();
++	  __memory_barrier ();
++	  once_control->__run = 1;
++	}
++
++      __pthread_spin_unlock (&once_control->__lock);
++    }
++
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-rwlockattr-setpshared.c glibc-2.24/libpthread/sysdeps/generic/pt-rwlockattr-setpshared.c
---- glibc/libpthread/sysdeps/generic/pt-rwlockattr-setpshared.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-rwlockattr-setpshared.c	2015-03-22 23:05:22.281910155 +0100
-@@ -0,0 +1,39 @@
-+/* pthread_rwlockattr_setpshared.  Generic version.
++strong_alias (__pthread_once, pthread_once);
+diff --git glibc/libpthread/sysdeps/generic/pt-rwlock-attr.c glibc/libpthread/sysdeps/generic/pt-rwlock-attr.c
+new file mode 100644
+index 0000000..8de96f1
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-rwlock-attr.c
+@@ -0,0 +1,26 @@
++/* Default rwlock attributes.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -7428,26 +7818,15 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pthread.h>
 +#include <pt-internal.h>
 +
-+int
-+pthread_rwlockattr_setpshared (pthread_rwlockattr_t *attr,
-+			       int pshared)
++const struct __pthread_rwlockattr __pthread_default_rwlockattr =
 +{
-+  switch (pshared)
-+    {
-+    case PTHREAD_PROCESS_PRIVATE:
-+      attr->__pshared = pshared;
-+      return 0;
-+
-+    case PTHREAD_PROCESS_SHARED:
-+      return ENOTSUP;
-+
-+    default:
-+      return EINVAL;
-+    }
-+}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-rwlock-destroy.c glibc-2.24/libpthread/sysdeps/generic/pt-rwlock-destroy.c
---- glibc/libpthread/sysdeps/generic/pt-rwlock-destroy.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-rwlock-destroy.c	2009-07-11 11:29:35.000000000 +0200
++  __pshared: PTHREAD_PROCESS_PRIVATE
++};
+diff --git glibc/libpthread/sysdeps/generic/pt-rwlock-destroy.c glibc/libpthread/sysdeps/generic/pt-rwlock-destroy.c
+new file mode 100644
+index 0000000..045eebd
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-rwlock-destroy.c
 @@ -0,0 +1,29 @@
 +/* Destroy a rwlock.  Generic version.
 +   Copyright (C) 2002, 2006 Free Software Foundation, Inc.
@@ -7478,9 +7857,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (_pthread_rwlock_destroy, pthread_rwlock_destroy);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-rwlock-init.c glibc-2.24/libpthread/sysdeps/generic/pt-rwlock-init.c
---- glibc/libpthread/sysdeps/generic/pt-rwlock-init.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-rwlock-init.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/generic/pt-rwlock-init.c glibc/libpthread/sysdeps/generic/pt-rwlock-init.c
+new file mode 100644
+index 0000000..c9ff9b2
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-rwlock-init.c
 @@ -0,0 +1,45 @@
 +/* Initialize a rwlock.  Generic version.
 +   Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc.
@@ -7527,9 +7908,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (_pthread_rwlock_init, pthread_rwlock_init);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-rwlock-rdlock.c glibc-2.24/libpthread/sysdeps/generic/pt-rwlock-rdlock.c
---- glibc/libpthread/sysdeps/generic/pt-rwlock-rdlock.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-rwlock-rdlock.c	2015-03-01 16:34:44.854010207 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-rwlock-rdlock.c glibc/libpthread/sysdeps/generic/pt-rwlock-rdlock.c
+new file mode 100644
+index 0000000..6eca601
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-rwlock-rdlock.c
 @@ -0,0 +1,33 @@
 +/* Acquire a rwlock for reading.  Generic version.
 +   Copyright (C) 2002, 2005 Free Software Foundation, Inc.
@@ -7564,9 +7947,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  return __pthread_rwlock_timedrdlock_internal (rwlock, 0);
 +}
 +strong_alias (__pthread_rwlock_rdlock, pthread_rwlock_rdlock);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-rwlock-timedrdlock.c glibc-2.24/libpthread/sysdeps/generic/pt-rwlock-timedrdlock.c
---- glibc/libpthread/sysdeps/generic/pt-rwlock-timedrdlock.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-rwlock-timedrdlock.c	2015-03-22 23:08:09.256923092 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-rwlock-timedrdlock.c glibc/libpthread/sysdeps/generic/pt-rwlock-timedrdlock.c
+new file mode 100644
+index 0000000..69bc757
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-rwlock-timedrdlock.c
 @@ -0,0 +1,120 @@
 +/* Acquire a rwlock for reading.  Generic version.
 +   Copyright (C) 2002, 2005 Free Software Foundation, Inc.
@@ -7688,9 +8073,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +{
 +  return __pthread_rwlock_timedrdlock_internal (rwlock, abstime);
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-rwlock-timedwrlock.c glibc-2.24/libpthread/sysdeps/generic/pt-rwlock-timedwrlock.c
---- glibc/libpthread/sysdeps/generic/pt-rwlock-timedwrlock.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-rwlock-timedwrlock.c	2015-03-22 23:08:09.264922853 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-rwlock-timedwrlock.c glibc/libpthread/sysdeps/generic/pt-rwlock-timedwrlock.c
+new file mode 100644
+index 0000000..be25629
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-rwlock-timedwrlock.c
 @@ -0,0 +1,103 @@
 +/* Acquire a rwlock for writing.  Generic version.
 +   Copyright (C) 2002, 2005 Free Software Foundation, Inc.
@@ -7795,9 +8182,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +{
 +  return __pthread_rwlock_timedwrlock_internal (rwlock, abstime);
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-rwlock-tryrdlock.c glibc-2.24/libpthread/sysdeps/generic/pt-rwlock-tryrdlock.c
---- glibc/libpthread/sysdeps/generic/pt-rwlock-tryrdlock.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-rwlock-tryrdlock.c	2015-03-22 23:08:09.272922614 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-rwlock-tryrdlock.c glibc/libpthread/sysdeps/generic/pt-rwlock-tryrdlock.c
+new file mode 100644
+index 0000000..30cb6cf
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-rwlock-tryrdlock.c
 @@ -0,0 +1,56 @@
 +/* Try to acquire a rwlock for reading.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -7855,9 +8244,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return EBUSY;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-rwlock-trywrlock.c glibc-2.24/libpthread/sysdeps/generic/pt-rwlock-trywrlock.c
---- glibc/libpthread/sysdeps/generic/pt-rwlock-trywrlock.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-rwlock-trywrlock.c	2015-03-22 23:08:09.280922376 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-rwlock-trywrlock.c glibc/libpthread/sysdeps/generic/pt-rwlock-trywrlock.c
+new file mode 100644
+index 0000000..af8f911
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-rwlock-trywrlock.c
 @@ -0,0 +1,46 @@
 +/* Try to acquire a rwlock for writing.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -7905,9 +8296,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return EBUSY;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-rwlock-unlock.c glibc-2.24/libpthread/sysdeps/generic/pt-rwlock-unlock.c
---- glibc/libpthread/sysdeps/generic/pt-rwlock-unlock.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-rwlock-unlock.c	2015-03-22 23:08:09.288922137 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-rwlock-unlock.c glibc/libpthread/sysdeps/generic/pt-rwlock-unlock.c
+new file mode 100644
+index 0000000..d538544
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-rwlock-unlock.c
 @@ -0,0 +1,99 @@
 +/* Unlock a rwlock.  Generic version.
 +   Copyright (C) 2000,02 Free Software Foundation, Inc.
@@ -8008,9 +8401,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  return 0;
 +}
 +strong_alias (__pthread_rwlock_unlock, pthread_rwlock_unlock);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-rwlock-wrlock.c glibc-2.24/libpthread/sysdeps/generic/pt-rwlock-wrlock.c
---- glibc/libpthread/sysdeps/generic/pt-rwlock-wrlock.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-rwlock-wrlock.c	2015-03-01 16:34:51.385965045 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-rwlock-wrlock.c glibc/libpthread/sysdeps/generic/pt-rwlock-wrlock.c
+new file mode 100644
+index 0000000..68254d1
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-rwlock-wrlock.c
 @@ -0,0 +1,35 @@
 +/* Acquire a rwlock for writing.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -8040,16 +8435,165 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +extern int __pthread_rwlock_timedwrlock_internal (struct __pthread_rwlock *rwlock,
 +						  const struct timespec *abstime);
 +
-+/* Acquire RWLOCK for writing.  */
++/* Acquire RWLOCK for writing.  */
++int
++__pthread_rwlock_wrlock (struct __pthread_rwlock *rwlock)
++{
++  return __pthread_rwlock_timedwrlock_internal (rwlock, 0);
++}
++strong_alias (__pthread_rwlock_wrlock, pthread_rwlock_wrlock);
+diff --git glibc/libpthread/sysdeps/generic/pt-rwlockattr-destroy.c glibc/libpthread/sysdeps/generic/pt-rwlockattr-destroy.c
+new file mode 100644
+index 0000000..eabfcbe
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-rwlockattr-destroy.c
+@@ -0,0 +1,27 @@
++/* pthread_rwlockattr_destroy.  Generic version.
++   Copyright (C) 2002 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 Library General Public License as
++   published by the Free Software Foundation; either version 2 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
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If not,
++   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++#include <pthread.h>
++#include <pt-internal.h>
++
++int
++pthread_rwlockattr_destroy (pthread_rwlockattr_t *attr)
++{
++  return 0;
++}
+diff --git glibc/libpthread/sysdeps/generic/pt-rwlockattr-getpshared.c glibc/libpthread/sysdeps/generic/pt-rwlockattr-getpshared.c
+new file mode 100644
+index 0000000..1565cf1
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-rwlockattr-getpshared.c
+@@ -0,0 +1,29 @@
++/* pthread_rwlockattr_getpshared.  Generic version.
++   Copyright (C) 2002 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 Library General Public License as
++   published by the Free Software Foundation; either version 2 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
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If not,
++   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++#include <pthread.h>
++#include <pt-internal.h>
++
++int
++pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *attr,
++			       int *pshared)
++{
++  *pshared = attr->__pshared;
++  return 0;
++}
+diff --git glibc/libpthread/sysdeps/generic/pt-rwlockattr-init.c glibc/libpthread/sysdeps/generic/pt-rwlockattr-init.c
+new file mode 100644
+index 0000000..34da6bf
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-rwlockattr-init.c
+@@ -0,0 +1,28 @@
++/* pthread_rwlockattr_init.  Generic version.
++   Copyright (C) 2002 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 Library General Public License as
++   published by the Free Software Foundation; either version 2 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
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If not,
++   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++#include <pthread.h>
++#include <pt-internal.h>
++
++int
++pthread_rwlockattr_init (pthread_rwlockattr_t *attr)
++{
++  *attr = __pthread_default_rwlockattr;
++  return 0;
++}
+diff --git glibc/libpthread/sysdeps/generic/pt-rwlockattr-setpshared.c glibc/libpthread/sysdeps/generic/pt-rwlockattr-setpshared.c
+new file mode 100644
+index 0000000..71f5c68
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-rwlockattr-setpshared.c
+@@ -0,0 +1,39 @@
++/* pthread_rwlockattr_setpshared.  Generic version.
++   Copyright (C) 2002 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 Library General Public License as
++   published by the Free Software Foundation; either version 2 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
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If not,
++   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++#include <pthread.h>
++#include <pt-internal.h>
++
 +int
-+__pthread_rwlock_wrlock (struct __pthread_rwlock *rwlock)
++pthread_rwlockattr_setpshared (pthread_rwlockattr_t *attr,
++			       int pshared)
 +{
-+  return __pthread_rwlock_timedwrlock_internal (rwlock, 0);
++  switch (pshared)
++    {
++    case PTHREAD_PROCESS_PRIVATE:
++      attr->__pshared = pshared;
++      return 0;
++
++    case PTHREAD_PROCESS_SHARED:
++      return ENOTSUP;
++
++    default:
++      return EINVAL;
++    }
 +}
-+strong_alias (__pthread_rwlock_wrlock, pthread_rwlock_wrlock);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-setconcurrency.c glibc-2.24/libpthread/sysdeps/generic/pt-setconcurrency.c
---- glibc/libpthread/sysdeps/generic/pt-setconcurrency.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-setconcurrency.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/generic/pt-setconcurrency.c glibc/libpthread/sysdeps/generic/pt-setconcurrency.c
+new file mode 100644
+index 0000000..cd55b1b
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-setconcurrency.c
 @@ -0,0 +1,34 @@
 +/* Set the desired level of concurrency.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -8085,9 +8629,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-setschedparam.c glibc-2.24/libpthread/sysdeps/generic/pt-setschedparam.c
---- glibc/libpthread/sysdeps/generic/pt-setschedparam.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-setschedparam.c	2014-01-01 18:30:36.099798940 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-setschedparam.c glibc/libpthread/sysdeps/generic/pt-setschedparam.c
+new file mode 100644
+index 0000000..29e2a4e
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-setschedparam.c
 @@ -0,0 +1,31 @@
 +/* Set the scheduling parameters for a thread.  Generic version.
 +   Copyright (C) 2002, 2005 Free Software Foundation, Inc.
@@ -8120,9 +8666,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +strong_alias (__pthread_setschedparam, pthread_setschedparam);
 +stub_warning (pthread_setschedparam)
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-setschedprio.c glibc-2.24/libpthread/sysdeps/generic/pt-setschedprio.c
---- glibc/libpthread/sysdeps/generic/pt-setschedprio.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-setschedprio.c	2014-01-01 18:30:36.099798940 +0100
+diff --git glibc/libpthread/sysdeps/generic/pt-setschedprio.c glibc/libpthread/sysdeps/generic/pt-setschedprio.c
+new file mode 100644
+index 0000000..d79690e
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-setschedprio.c
 @@ -0,0 +1,29 @@
 +/* Set the scheduling priority of a thread.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -8153,9 +8701,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +stub_warning (pthread_setschedprio)
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-setspecific.c glibc-2.24/libpthread/sysdeps/generic/pt-setspecific.c
---- glibc/libpthread/sysdeps/generic/pt-setspecific.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-setspecific.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/generic/pt-setspecific.c glibc/libpthread/sysdeps/generic/pt-setspecific.c
+new file mode 100644
+index 0000000..d520c5d
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-setspecific.c
 @@ -0,0 +1,27 @@
 +/* pthread_setspecific.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -8184,9 +8734,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +{
 +  return EINVAL;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/pt-startup.c glibc-2.24/libpthread/sysdeps/generic/pt-startup.c
---- glibc/libpthread/sysdeps/generic/pt-startup.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/pt-startup.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/generic/pt-startup.c glibc/libpthread/sysdeps/generic/pt-startup.c
+new file mode 100644
+index 0000000..c21a181
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/pt-startup.c
 @@ -0,0 +1,25 @@
 +/* Thread initialization.  Generic version.
 +   Copyright (C) 2008 Free Software Foundation, Inc.
@@ -8213,9 +8765,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +__pthread_startup (void)
 +{
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/raise.c glibc-2.24/libpthread/sysdeps/generic/raise.c
---- glibc/libpthread/sysdeps/generic/raise.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/raise.c	2016-09-21 00:05:53.993837636 +0200
+diff --git glibc/libpthread/sysdeps/generic/raise.c glibc/libpthread/sysdeps/generic/raise.c
+new file mode 100644
+index 0000000..cc18b39
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/raise.c
 @@ -0,0 +1,50 @@
 +/* raise.c - Generic raise implementation.
 +   Copyright (C) 2008 Free Software Foundation, Inc.
@@ -8267,9 +8821,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +libc_hidden_def (raise)
 +weak_alias (raise, gsignal)
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/sem-close.c glibc-2.24/libpthread/sysdeps/generic/sem-close.c
---- glibc/libpthread/sysdeps/generic/sem-close.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/sem-close.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/generic/sem-close.c glibc/libpthread/sysdeps/generic/sem-close.c
+new file mode 100644
+index 0000000..9f48032
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/sem-close.c
 @@ -0,0 +1,32 @@
 +/* Close a named semaphore.  Generic version.
 +   Copyright (C) 2005 Free Software Foundation, Inc.
@@ -8303,9 +8859,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__sem_close, sem_close);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/sem-destroy.c glibc-2.24/libpthread/sysdeps/generic/sem-destroy.c
---- glibc/libpthread/sysdeps/generic/sem-destroy.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/sem-destroy.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/generic/sem-destroy.c glibc/libpthread/sysdeps/generic/sem-destroy.c
+new file mode 100644
+index 0000000..6486599
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/sem-destroy.c
 @@ -0,0 +1,38 @@
 +/* Destroy a semaphore.  Generic version.
 +   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
@@ -8345,9 +8903,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__sem_destroy, sem_destroy);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/sem-getvalue.c glibc-2.24/libpthread/sysdeps/generic/sem-getvalue.c
---- glibc/libpthread/sysdeps/generic/sem-getvalue.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/sem-getvalue.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/generic/sem-getvalue.c glibc/libpthread/sysdeps/generic/sem-getvalue.c
+new file mode 100644
+index 0000000..7762089
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/sem-getvalue.c
 @@ -0,0 +1,33 @@
 +/* Get the value of a semaphore.  Generic version.
 +   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
@@ -8382,9 +8942,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__sem_getvalue, sem_getvalue);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/sem-init.c glibc-2.24/libpthread/sysdeps/generic/sem-init.c
---- glibc/libpthread/sysdeps/generic/sem-init.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/sem-init.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/generic/sem-init.c glibc/libpthread/sysdeps/generic/sem-init.c
+new file mode 100644
+index 0000000..d2414f5
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/sem-init.c
 @@ -0,0 +1,46 @@
 +/* Initialize a semaphore.  Generic version.
 +   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
@@ -8432,9 +8994,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__sem_init, sem_init);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/sem-open.c glibc-2.24/libpthread/sysdeps/generic/sem-open.c
---- glibc/libpthread/sysdeps/generic/sem-open.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/sem-open.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/generic/sem-open.c glibc/libpthread/sysdeps/generic/sem-open.c
+new file mode 100644
+index 0000000..bae87ed
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/sem-open.c
 @@ -0,0 +1,32 @@
 +/* Open a named semaphore.  Generic version.
 +   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
@@ -8468,9 +9032,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__sem_open, sem_open);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/sem-post.c glibc-2.24/libpthread/sysdeps/generic/sem-post.c
---- glibc/libpthread/sysdeps/generic/sem-post.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/sem-post.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/generic/sem-post.c glibc/libpthread/sysdeps/generic/sem-post.c
+new file mode 100644
+index 0000000..6d438bf
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/sem-post.c
 @@ -0,0 +1,62 @@
 +/* Post a semaphore.  Generic version.
 +   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
@@ -8534,9 +9100,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__sem_post, sem_post);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/sem-timedwait.c glibc-2.24/libpthread/sysdeps/generic/sem-timedwait.c
---- glibc/libpthread/sysdeps/generic/sem-timedwait.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/sem-timedwait.c	2013-02-10 10:49:14.701444604 +0100
+diff --git glibc/libpthread/sysdeps/generic/sem-timedwait.c glibc/libpthread/sysdeps/generic/sem-timedwait.c
+new file mode 100644
+index 0000000..7ab1583
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/sem-timedwait.c
 @@ -0,0 +1,100 @@
 +/* Wait on a semaphore with a timeout.  Generic version.
 +   Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
@@ -8638,9 +9206,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__sem_timedwait, sem_timedwait);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/sem-trywait.c glibc-2.24/libpthread/sysdeps/generic/sem-trywait.c
---- glibc/libpthread/sysdeps/generic/sem-trywait.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/sem-trywait.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/generic/sem-trywait.c glibc/libpthread/sysdeps/generic/sem-trywait.c
+new file mode 100644
+index 0000000..437e282
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/sem-trywait.c
 @@ -0,0 +1,42 @@
 +/* Lock a semaphore if it does not require blocking.  Generic version.
 +   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
@@ -8684,9 +9254,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__sem_trywait, sem_trywait);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/sem-unlink.c glibc-2.24/libpthread/sysdeps/generic/sem-unlink.c
---- glibc/libpthread/sysdeps/generic/sem-unlink.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/sem-unlink.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/generic/sem-unlink.c glibc/libpthread/sysdeps/generic/sem-unlink.c
+new file mode 100644
+index 0000000..570ed61
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/sem-unlink.c
 @@ -0,0 +1,32 @@
 +/* Unlink a named semaphore.  Generic version.
 +   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
@@ -8720,9 +9292,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__sem_unlink, sem_unlink);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/sem-wait.c glibc-2.24/libpthread/sysdeps/generic/sem-wait.c
---- glibc/libpthread/sysdeps/generic/sem-wait.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/sem-wait.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/generic/sem-wait.c glibc/libpthread/sysdeps/generic/sem-wait.c
+new file mode 100644
+index 0000000..8347480
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/sem-wait.c
 @@ -0,0 +1,32 @@
 +/* Wait on a semaphore.  Generic version.
 +   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
@@ -8756,9 +9330,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__sem_wait, sem_wait);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/generic/shm-directory.h glibc-2.24/libpthread/sysdeps/generic/shm-directory.h
---- glibc/libpthread/sysdeps/generic/shm-directory.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/generic/shm-directory.h	2016-03-19 03:51:18.240546186 +0100
+diff --git glibc/libpthread/sysdeps/generic/shm-directory.h glibc/libpthread/sysdeps/generic/shm-directory.h
+new file mode 100644
+index 0000000..8950284
+--- /dev/null
++++ glibc/libpthread/sysdeps/generic/shm-directory.h
 @@ -0,0 +1,31 @@
 +/* Header for directory for shm/sem files.  libpthread version.
 +   Copyright (C) 2014-2015 Free Software Foundation, Inc.
@@ -8791,9 +9367,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#endif
 +
 +#endif  /* shm-directory.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/hurd/pt-destroy-specific.c glibc-2.24/libpthread/sysdeps/hurd/pt-destroy-specific.c
---- glibc/libpthread/sysdeps/hurd/pt-destroy-specific.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/hurd/pt-destroy-specific.c	2011-11-06 13:17:28.798988815 +0100
+diff --git glibc/libpthread/sysdeps/hurd/pt-destroy-specific.c glibc/libpthread/sysdeps/hurd/pt-destroy-specific.c
+new file mode 100644
+index 0000000..f7896e5
+--- /dev/null
++++ glibc/libpthread/sysdeps/hurd/pt-destroy-specific.c
 @@ -0,0 +1,79 @@
 +/* __pthread_destory_specific.  Hurd version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -8874,9 +9452,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  hurd_ihash_free (thread->thread_specifics);
 +  thread->thread_specifics = 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/hurd/pt-getspecific.c glibc-2.24/libpthread/sysdeps/hurd/pt-getspecific.c
---- glibc/libpthread/sysdeps/hurd/pt-getspecific.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/hurd/pt-getspecific.c	2015-03-01 16:34:27.570129263 +0100
+diff --git glibc/libpthread/sysdeps/hurd/pt-getspecific.c glibc/libpthread/sysdeps/hurd/pt-getspecific.c
+new file mode 100644
+index 0000000..8a01470
+--- /dev/null
++++ glibc/libpthread/sysdeps/hurd/pt-getspecific.c
 @@ -0,0 +1,40 @@
 +/* pthread_getspecific.  Hurd version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -8918,9 +9498,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  return hurd_ihash_find (self->thread_specifics, key);
 +}
 +strong_alias (__pthread_getspecific, pthread_getspecific);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/hurd/pt-init-specific.c glibc-2.24/libpthread/sysdeps/hurd/pt-init-specific.c
---- glibc/libpthread/sysdeps/hurd/pt-init-specific.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/hurd/pt-init-specific.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/hurd/pt-init-specific.c glibc/libpthread/sysdeps/hurd/pt-init-specific.c
+new file mode 100644
+index 0000000..c1bacbc
+--- /dev/null
++++ glibc/libpthread/sysdeps/hurd/pt-init-specific.c
 @@ -0,0 +1,30 @@
 +/* __pthread_init_specific.  Hurd version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -8952,9 +9534,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  thread->thread_specifics = 0;
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/hurd/pt-key-create.c glibc-2.24/libpthread/sysdeps/hurd/pt-key-create.c
---- glibc/libpthread/sysdeps/hurd/pt-key-create.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/hurd/pt-key-create.c	2016-03-19 03:51:18.240546186 +0100
+diff --git glibc/libpthread/sysdeps/hurd/pt-key-create.c glibc/libpthread/sysdeps/hurd/pt-key-create.c
+new file mode 100644
+index 0000000..f26ec36
+--- /dev/null
++++ glibc/libpthread/sysdeps/hurd/pt-key-create.c
 @@ -0,0 +1,110 @@
 +/* pthread_key_create.  Hurd version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -9066,9 +9650,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  return 0;
 +}
 +strong_alias (__pthread_key_create, pthread_key_create)
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/hurd/pt-key-delete.c glibc-2.24/libpthread/sysdeps/hurd/pt-key-delete.c
---- glibc/libpthread/sysdeps/hurd/pt-key-delete.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/hurd/pt-key-delete.c	2016-09-21 00:05:53.993837636 +0200
+diff --git glibc/libpthread/sysdeps/hurd/pt-key-delete.c glibc/libpthread/sysdeps/hurd/pt-key-delete.c
+new file mode 100644
+index 0000000..8b2c8bb
+--- /dev/null
++++ glibc/libpthread/sysdeps/hurd/pt-key-delete.c
 @@ -0,0 +1,64 @@
 +/* pthread_key_delete.  Hurd version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -9134,9 +9720,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return err;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/hurd/pt-key.h glibc-2.24/libpthread/sysdeps/hurd/pt-key.h
---- glibc/libpthread/sysdeps/hurd/pt-key.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/hurd/pt-key.h	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/hurd/pt-key.h glibc/libpthread/sysdeps/hurd/pt-key.h
+new file mode 100644
+index 0000000..494e01d
+--- /dev/null
++++ glibc/libpthread/sysdeps/hurd/pt-key.h
 @@ -0,0 +1,76 @@
 +/* pthread_key internal declatations for the Hurd version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -9214,9 +9802,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  pthread_once (&o, do_init);
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/hurd/pt-kill.c glibc-2.24/libpthread/sysdeps/hurd/pt-kill.c
---- glibc/libpthread/sysdeps/hurd/pt-kill.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/hurd/pt-kill.c	2016-09-21 00:05:53.993837636 +0200
+diff --git glibc/libpthread/sysdeps/hurd/pt-kill.c glibc/libpthread/sysdeps/hurd/pt-kill.c
+new file mode 100644
+index 0000000..6aaf241
+--- /dev/null
++++ glibc/libpthread/sysdeps/hurd/pt-kill.c
 @@ -0,0 +1,52 @@
 +/* pthread_kill.  Hurd version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -9270,9 +9860,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  return _hurd_raise_signal (ss, sig, &detail);
 +}
 +strong_alias (__pthread_kill, pthread_kill)
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/hurd/pt-setspecific.c glibc-2.24/libpthread/sysdeps/hurd/pt-setspecific.c
---- glibc/libpthread/sysdeps/hurd/pt-setspecific.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/hurd/pt-setspecific.c	2015-03-01 16:34:34.558081205 +0100
+diff --git glibc/libpthread/sysdeps/hurd/pt-setspecific.c glibc/libpthread/sysdeps/hurd/pt-setspecific.c
+new file mode 100644
+index 0000000..b3976cc
+--- /dev/null
++++ glibc/libpthread/sysdeps/hurd/pt-setspecific.c
 @@ -0,0 +1,48 @@
 +/* pthread_setspecific.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -9322,9 +9914,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  return 0;
 +}
 +strong_alias (__pthread_setspecific, pthread_setspecific);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/i386/bits/memory.h glibc-2.24/libpthread/sysdeps/i386/bits/memory.h
---- glibc/libpthread/sysdeps/i386/bits/memory.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/i386/bits/memory.h	2012-09-15 21:43:27.807249556 +0200
+diff --git glibc/libpthread/sysdeps/i386/bits/memory.h glibc/libpthread/sysdeps/i386/bits/memory.h
+new file mode 100644
+index 0000000..932c408
+--- /dev/null
++++ glibc/libpthread/sysdeps/i386/bits/memory.h
 @@ -0,0 +1,40 @@
 +/* Memory barrier operations.  i386 version.
 +   Copyright (C) 2002, 2008 Free Software Foundation, Inc.
@@ -9366,9 +9960,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#define __memory_write_barrier __memory_barrier
 +
 +#endif
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/i386/bits/pt-atomic.h glibc-2.24/libpthread/sysdeps/i386/bits/pt-atomic.h
---- glibc/libpthread/sysdeps/i386/bits/pt-atomic.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/i386/bits/pt-atomic.h	2012-09-15 21:43:27.807249556 +0200
+diff --git glibc/libpthread/sysdeps/i386/bits/pt-atomic.h glibc/libpthread/sysdeps/i386/bits/pt-atomic.h
+new file mode 100644
+index 0000000..0dfc1f6
+--- /dev/null
++++ glibc/libpthread/sysdeps/i386/bits/pt-atomic.h
 @@ -0,0 +1,66 @@
 +/* Atomic operations.  i386 version.
 +   Copyright (C) 2000 Free Software Foundation, Inc.
@@ -9436,9 +10032,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +#endif
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/i386/machine-sp.h glibc-2.24/libpthread/sysdeps/i386/machine-sp.h
---- glibc/libpthread/sysdeps/i386/machine-sp.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/i386/machine-sp.h	2012-09-15 21:43:27.807249556 +0200
+diff --git glibc/libpthread/sysdeps/i386/machine-sp.h glibc/libpthread/sysdeps/i386/machine-sp.h
+new file mode 100644
+index 0000000..cef6ab7
+--- /dev/null
++++ glibc/libpthread/sysdeps/i386/machine-sp.h
 @@ -0,0 +1,30 @@
 +/* Machine-specific function to return the stack pointer.  i386 version.
 +   Copyright (C) 1994, 1997, 2001, 2006 Free Software Foundation, Inc.
@@ -9470,9 +10068,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +})
 +
 +#endif	/* machine-sp.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/i386/pt-machdep.h glibc-2.24/libpthread/sysdeps/i386/pt-machdep.h
---- glibc/libpthread/sysdeps/i386/pt-machdep.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/i386/pt-machdep.h	2012-09-15 21:43:27.807249556 +0200
+diff --git glibc/libpthread/sysdeps/i386/pt-machdep.h glibc/libpthread/sysdeps/i386/pt-machdep.h
+new file mode 100644
+index 0000000..6d45636
+--- /dev/null
++++ glibc/libpthread/sysdeps/i386/pt-machdep.h
 @@ -0,0 +1,29 @@
 +/* Machine dependent pthreads internal defenitions.  i386 version.
 +   Copyright (C) 2000 Free Software Foundation, Inc.
@@ -9503,51 +10103,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +};
 +
 +#endif /* pt-machdep.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/bits/spin-lock.h glibc-2.24/libpthread/sysdeps/mach/bits/spin-lock.h
---- glibc/libpthread/sysdeps/mach/bits/spin-lock.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/bits/spin-lock.h	2009-07-11 11:29:35.000000000 +0200
-@@ -0,0 +1,38 @@
-+/* Definitions of user-visible names for spin locks.
-+   Copyright (C) 1994, 1997, 2002, 2008, 2009 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, write to the Free
-+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+   02111-1307 USA.  */
-+
-+#ifndef _BITS_SPIN_LOCK_H
-+#define _BITS_SPIN_LOCK_H	1
-+
-+#include <features.h>
-+#include <machine-lock.h>	/* This does all the work.  */
-+
-+__BEGIN_DECLS
-+
-+/* The type of a spin lock object.  */
-+typedef __spin_lock_t __pthread_spinlock_t;
-+
-+/* Initializer for a spin lock object.  */
-+#ifndef __PTHREAD_SPIN_LOCK_INITIALIZER
-+#error __PTHREAD_SPIN_LOCK_INITIALIZER undefined: should be defined by <lock-intern.h>.
-+#endif
-+
-+__END_DECLS
-+
-+#endif /* bits/spin-lock.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/bits/spin-lock-inline.h glibc-2.24/libpthread/sysdeps/mach/bits/spin-lock-inline.h
---- glibc/libpthread/sysdeps/mach/bits/spin-lock-inline.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/bits/spin-lock-inline.h	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/mach/bits/spin-lock-inline.h glibc/libpthread/sysdeps/mach/bits/spin-lock-inline.h
+new file mode 100644
+index 0000000..f9f7c29
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/bits/spin-lock-inline.h
 @@ -0,0 +1,90 @@
 +/* Definitions of user-visible names for spin locks.
 +   Copyright (C) 1994, 1997, 2002, 2008, 2009 Free Software Foundation, Inc.
@@ -9639,9 +10199,63 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +__END_DECLS
 +
 +#endif /* bits/spin-lock.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/hurd/bits/pthread-np.h glibc-2.24/libpthread/sysdeps/mach/hurd/bits/pthread-np.h
---- glibc/libpthread/sysdeps/mach/hurd/bits/pthread-np.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/hurd/bits/pthread-np.h	2015-11-01 12:03:30.579924091 +0100
+diff --git glibc/libpthread/sysdeps/mach/bits/spin-lock.h glibc/libpthread/sysdeps/mach/bits/spin-lock.h
+new file mode 100644
+index 0000000..537dac9
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/bits/spin-lock.h
+@@ -0,0 +1,38 @@
++/* Definitions of user-visible names for spin locks.
++   Copyright (C) 1994, 1997, 2002, 2008, 2009 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, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#ifndef _BITS_SPIN_LOCK_H
++#define _BITS_SPIN_LOCK_H	1
++
++#include <features.h>
++#include <machine-lock.h>	/* This does all the work.  */
++
++__BEGIN_DECLS
++
++/* The type of a spin lock object.  */
++typedef __spin_lock_t __pthread_spinlock_t;
++
++/* Initializer for a spin lock object.  */
++#ifndef __PTHREAD_SPIN_LOCK_INITIALIZER
++#error __PTHREAD_SPIN_LOCK_INITIALIZER undefined: should be defined by <lock-intern.h>.
++#endif
++
++__END_DECLS
++
++#endif /* bits/spin-lock.h */
+diff --git glibc/libpthread/sysdeps/mach/hurd/Implies glibc/libpthread/sysdeps/mach/hurd/Implies
+new file mode 100644
+index 0000000..c32378a
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/hurd/Implies
+@@ -0,0 +1,2 @@
++hurd
++pthread
+diff --git glibc/libpthread/sysdeps/mach/hurd/bits/pthread-np.h glibc/libpthread/sysdeps/mach/hurd/bits/pthread-np.h
+new file mode 100644
+index 0000000..4487ffd
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/hurd/bits/pthread-np.h
 @@ -0,0 +1,38 @@
 +/* Non-portable functions. Hurd on Mach version.
 +   Copyright (C) 2008 Free Software Foundation, Inc.
@@ -9681,9 +10295,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +					   const struct timespec *__abstime);
 +
 +#endif /* bits/pthread-np.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/hurd/i386/pt-machdep.c glibc-2.24/libpthread/sysdeps/mach/hurd/i386/pt-machdep.c
---- glibc/libpthread/sysdeps/mach/hurd/i386/pt-machdep.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/hurd/i386/pt-machdep.c	2012-09-15 21:43:27.807249556 +0200
+diff --git glibc/libpthread/sysdeps/mach/hurd/i386/pt-machdep.c glibc/libpthread/sysdeps/mach/hurd/i386/pt-machdep.c
+new file mode 100644
+index 0000000..f3c8cf5
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/hurd/i386/pt-machdep.c
 @@ -0,0 +1,83 @@
 +/* Machine dependent pthreads code.  Hurd/i386 version.
 +   Copyright (C) 2000, 2002, 2007 Free Software Foundation, Inc.
@@ -9768,9 +10384,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/hurd/i386/pt-setup.c glibc-2.24/libpthread/sysdeps/mach/hurd/i386/pt-setup.c
---- glibc/libpthread/sysdeps/mach/hurd/i386/pt-setup.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/hurd/i386/pt-setup.c	2014-05-23 20:44:39.167033951 +0200
+diff --git glibc/libpthread/sysdeps/mach/hurd/i386/pt-setup.c glibc/libpthread/sysdeps/mach/hurd/i386/pt-setup.c
+new file mode 100644
+index 0000000..4511463
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/hurd/i386/pt-setup.c
 @@ -0,0 +1,110 @@
 +/* Setup thread stack.  Hurd/i386 version.
 +   Copyright (C) 2000, 2002, 2005, 2007, 2008 Free Software Foundation, Inc.
@@ -9882,15 +10500,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/hurd/Implies glibc-2.24/libpthread/sysdeps/mach/hurd/Implies
---- glibc/libpthread/sysdeps/mach/hurd/Implies	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/hurd/Implies	2013-01-25 01:58:57.719212276 +0100
-@@ -0,0 +1,2 @@
-+hurd
-+pthread
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/hurd/pt-attr-setstackaddr.c glibc-2.24/libpthread/sysdeps/mach/hurd/pt-attr-setstackaddr.c
---- glibc/libpthread/sysdeps/mach/hurd/pt-attr-setstackaddr.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/hurd/pt-attr-setstackaddr.c	2015-03-22 23:10:08.857352938 +0100
+diff --git glibc/libpthread/sysdeps/mach/hurd/pt-attr-setstackaddr.c glibc/libpthread/sysdeps/mach/hurd/pt-attr-setstackaddr.c
+new file mode 100644
+index 0000000..864835f
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/hurd/pt-attr-setstackaddr.c
 @@ -0,0 +1,29 @@
 +/* pthread_attr_setstackaddr.  Hurd on Mach version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -9921,9 +10535,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  attr->__stackaddr = stackaddr;
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/hurd/pt-attr-setstacksize.c glibc-2.24/libpthread/sysdeps/mach/hurd/pt-attr-setstacksize.c
---- glibc/libpthread/sysdeps/mach/hurd/pt-attr-setstacksize.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/hurd/pt-attr-setstacksize.c	2015-03-22 23:10:25.300862212 +0100
+diff --git glibc/libpthread/sysdeps/mach/hurd/pt-attr-setstacksize.c glibc/libpthread/sysdeps/mach/hurd/pt-attr-setstacksize.c
+new file mode 100644
+index 0000000..7757bac
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/hurd/pt-attr-setstacksize.c
 @@ -0,0 +1,29 @@
 +/* pthread_attr_setstacksize.  Hurd on Mach version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -9954,9 +10570,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  attr->__stacksize = stacksize;
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/hurd/pt-docancel.c glibc-2.24/libpthread/sysdeps/mach/hurd/pt-docancel.c
---- glibc/libpthread/sysdeps/mach/hurd/pt-docancel.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/hurd/pt-docancel.c	2013-02-10 10:49:14.701444604 +0100
+diff --git glibc/libpthread/sysdeps/mach/hurd/pt-docancel.c glibc/libpthread/sysdeps/mach/hurd/pt-docancel.c
+new file mode 100644
+index 0000000..b3a5507
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/hurd/pt-docancel.c
 @@ -0,0 +1,66 @@
 +/* Cancel a thread.
 +   Copyright (C) 2002, 2007, 2008 Free Software Foundation, Inc.
@@ -10024,9 +10642,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/hurd/pt-hurd-cond-timedwait.c glibc-2.24/libpthread/sysdeps/mach/hurd/pt-hurd-cond-timedwait.c
---- glibc/libpthread/sysdeps/mach/hurd/pt-hurd-cond-timedwait.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/hurd/pt-hurd-cond-timedwait.c	2015-03-22 22:57:12.040571947 +0100
+diff --git glibc/libpthread/sysdeps/mach/hurd/pt-hurd-cond-timedwait.c glibc/libpthread/sysdeps/mach/hurd/pt-hurd-cond-timedwait.c
+new file mode 100644
+index 0000000..3d1fe53
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/hurd/pt-hurd-cond-timedwait.c
 @@ -0,0 +1,169 @@
 +/* pthread_hurd_cond_timedwait_np.  Hurd-specific wait on a condition.
 +   Copyright (C) 2012 Free Software Foundation, Inc.
@@ -10197,9 +10817,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/hurd/pt-hurd-cond-wait.c glibc-2.24/libpthread/sysdeps/mach/hurd/pt-hurd-cond-wait.c
---- glibc/libpthread/sysdeps/mach/hurd/pt-hurd-cond-wait.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/hurd/pt-hurd-cond-wait.c	2013-02-24 17:22:32.215652839 +0100
+diff --git glibc/libpthread/sysdeps/mach/hurd/pt-hurd-cond-wait.c glibc/libpthread/sysdeps/mach/hurd/pt-hurd-cond-wait.c
+new file mode 100644
+index 0000000..5e7c007
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/hurd/pt-hurd-cond-wait.c
 @@ -0,0 +1,41 @@
 +/* pthread_hurd_cond_wait.  Hurd-specific wait on a condition.
 +   Copyright (C) 2012 Free Software Foundation, Inc.
@@ -10242,11 +10864,13 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +
 +strong_alias (__pthread_hurd_cond_wait_np, pthread_hurd_cond_wait_np);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/hurd/pt-sigstate.c glibc-2.24/libpthread/sysdeps/mach/hurd/pt-sigstate.c
---- glibc/libpthread/sysdeps/mach/hurd/pt-sigstate.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/hurd/pt-sigstate.c	2016-03-19 03:51:18.240546186 +0100
-@@ -0,0 +1,80 @@
-+/* Set a thread's signal state.  Hurd on Mach version.
+diff --git glibc/libpthread/sysdeps/mach/hurd/pt-sigstate-destroy.c glibc/libpthread/sysdeps/mach/hurd/pt-sigstate-destroy.c
+new file mode 100644
+index 0000000..d5e28d2
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/hurd/pt-sigstate-destroy.c
+@@ -0,0 +1,28 @@
++/* Destroy the signal state.  Hurd on Mach version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -10266,71 +10890,21 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +   Boston, MA 02111-1307, USA.  */
 +
 +#include <pthread.h>
-+#include <assert.h>
-+#include <signal.h>
-+#include <hurd/signal.h>
-+#include <hurd/msg.h>
 +
 +#include <pt-internal.h>
 +
-+error_t
-+__pthread_sigstate (struct __pthread *thread, int how,
-+		    const sigset_t *set, sigset_t *oset,
-+		    int clear_pending)
++void
++__pthread_sigstate_destroy (struct __pthread *thread)
 +{
-+  error_t err = 0;
-+  struct hurd_sigstate *ss;
-+  sigset_t pending;
-+
-+  ss = _hurd_thread_sigstate (thread->kernel_thread);
-+  assert (ss);
-+
-+  _hurd_sigstate_lock (ss);
-+
-+  if (oset)
-+    *oset = ss->blocked;
-+
-+  if (set)
-+    {
-+      switch (how)
-+	{
-+	case SIG_BLOCK:
-+	  ss->blocked |= *set;
-+	  break;
-+
-+	case SIG_SETMASK:
-+	  ss->blocked = *set;
-+	  break;
-+
-+	case SIG_UNBLOCK:
-+	  ss->blocked &= ~*set;
-+	  break;
-+
-+	default:
-+	  err = EINVAL;
-+	  break;
-+	}
-+      ss->blocked &= ~_SIG_CANT_MASK;
-+    }
-+
-+  if (! err && clear_pending)
-+    __sigemptyset (&ss->pending);
-+
-+  pending = _hurd_sigstate_pending (ss) & ~ss->blocked;
-+  _hurd_sigstate_unlock (ss);
-+
-+  if (! err && pending)
-+    /* Send a message to the signal thread so it
-+       will wake up and check for pending signals.  */
-+    __msg_sig_post (_hurd_msgport, 0, 0, __mach_task_self ());
-+
-+  return err;
++  _hurd_sigstate_delete (thread->kernel_thread);
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/hurd/pt-sigstate-destroy.c glibc-2.24/libpthread/sysdeps/mach/hurd/pt-sigstate-destroy.c
---- glibc/libpthread/sysdeps/mach/hurd/pt-sigstate-destroy.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/hurd/pt-sigstate-destroy.c	2014-01-01 19:57:55.168746553 +0100
-@@ -0,0 +1,28 @@
-+/* Destroy the signal state.  Hurd on Mach version.
+diff --git glibc/libpthread/sysdeps/mach/hurd/pt-sigstate-init.c glibc/libpthread/sysdeps/mach/hurd/pt-sigstate-init.c
+new file mode 100644
+index 0000000..500b4d4
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/hurd/pt-sigstate-init.c
+@@ -0,0 +1,44 @@
++/* Initialize the signal state.  Hurd on Mach version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -10350,19 +10924,37 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +   Boston, MA 02111-1307, USA.  */
 +
 +#include <pthread.h>
-+
 +#include <pt-internal.h>
 +
-+void
-+__pthread_sigstate_destroy (struct __pthread *thread)
++error_t
++__pthread_sigstate_init (struct __pthread *thread)
 +{
-+  _hurd_sigstate_delete (thread->kernel_thread);
++  static int do_init_global;
++
++  /* Mark the thread as a global signal receiver so as to conform with
++     the pthread semantics.  However, we must be careful.  The first
++     pthread created is the main thread, during libpthread initialization.
++     We must not mark it, otherwise the sigprocmask call in
++     __pthread_create would try to access _hurd_global_sigstate,
++     which is not initialized yet.  When glibc runs _hurdsig_init later
++     on, the message thread is created, which must not be marked either.  */
++  if (do_init_global)
++    {
++      struct hurd_sigstate *ss = _hurd_thread_sigstate (thread->kernel_thread);
++      _hurd_sigstate_set_global_rcv (ss);
++    }
++  else if (__pthread_num_threads >= 2)
++    do_init_global = 1;
++
++  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/hurd/pt-sigstate-init.c glibc-2.24/libpthread/sysdeps/mach/hurd/pt-sigstate-init.c
---- glibc/libpthread/sysdeps/mach/hurd/pt-sigstate-init.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/hurd/pt-sigstate-init.c	2014-01-01 19:57:55.168746553 +0100
-@@ -0,0 +1,44 @@
-+/* Initialize the signal state.  Hurd on Mach version.
+diff --git glibc/libpthread/sysdeps/mach/hurd/pt-sigstate.c glibc/libpthread/sysdeps/mach/hurd/pt-sigstate.c
+new file mode 100644
+index 0000000..74fd72a
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/hurd/pt-sigstate.c
+@@ -0,0 +1,80 @@
++/* Set a thread's signal state.  Hurd on Mach version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +
@@ -10382,33 +10974,71 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +   Boston, MA 02111-1307, USA.  */
 +
 +#include <pthread.h>
++#include <assert.h>
++#include <signal.h>
++#include <hurd/signal.h>
++#include <hurd/msg.h>
++
 +#include <pt-internal.h>
 +
 +error_t
-+__pthread_sigstate_init (struct __pthread *thread)
++__pthread_sigstate (struct __pthread *thread, int how,
++		    const sigset_t *set, sigset_t *oset,
++		    int clear_pending)
 +{
-+  static int do_init_global;
++  error_t err = 0;
++  struct hurd_sigstate *ss;
++  sigset_t pending;
 +
-+  /* Mark the thread as a global signal receiver so as to conform with
-+     the pthread semantics.  However, we must be careful.  The first
-+     pthread created is the main thread, during libpthread initialization.
-+     We must not mark it, otherwise the sigprocmask call in
-+     __pthread_create would try to access _hurd_global_sigstate,
-+     which is not initialized yet.  When glibc runs _hurdsig_init later
-+     on, the message thread is created, which must not be marked either.  */
-+  if (do_init_global)
++  ss = _hurd_thread_sigstate (thread->kernel_thread);
++  assert (ss);
++
++  _hurd_sigstate_lock (ss);
++
++  if (oset)
++    *oset = ss->blocked;
++
++  if (set)
 +    {
-+      struct hurd_sigstate *ss = _hurd_thread_sigstate (thread->kernel_thread);
-+      _hurd_sigstate_set_global_rcv (ss);
++      switch (how)
++	{
++	case SIG_BLOCK:
++	  ss->blocked |= *set;
++	  break;
++
++	case SIG_SETMASK:
++	  ss->blocked = *set;
++	  break;
++
++	case SIG_UNBLOCK:
++	  ss->blocked &= ~*set;
++	  break;
++
++	default:
++	  err = EINVAL;
++	  break;
++	}
++      ss->blocked &= ~_SIG_CANT_MASK;
 +    }
-+  else if (__pthread_num_threads >= 2)
-+    do_init_global = 1;
 +
-+  return 0;
++  if (! err && clear_pending)
++    __sigemptyset (&ss->pending);
++
++  pending = _hurd_sigstate_pending (ss) & ~ss->blocked;
++  _hurd_sigstate_unlock (ss);
++
++  if (! err && pending)
++    /* Send a message to the signal thread so it
++       will wake up and check for pending signals.  */
++    __msg_sig_post (_hurd_msgport, 0, 0, __mach_task_self ());
++
++  return err;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/hurd/pt-sysdep.c glibc-2.24/libpthread/sysdeps/mach/hurd/pt-sysdep.c
---- glibc/libpthread/sysdeps/mach/hurd/pt-sysdep.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/hurd/pt-sysdep.c	2015-11-01 12:03:30.579924091 +0100
+diff --git glibc/libpthread/sysdeps/mach/hurd/pt-sysdep.c glibc/libpthread/sysdeps/mach/hurd/pt-sysdep.c
+new file mode 100644
+index 0000000..939194b
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/hurd/pt-sysdep.c
 @@ -0,0 +1,98 @@
 +/* System dependent pthreads code.  Hurd version.
 +   Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc.
@@ -10508,9 +11138,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  _init_routine (__libc_stack_end);
 +}
 +#endif
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/hurd/pt-sysdep.h glibc-2.24/libpthread/sysdeps/mach/hurd/pt-sysdep.h
---- glibc/libpthread/sysdeps/mach/hurd/pt-sysdep.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/hurd/pt-sysdep.h	2014-01-01 19:57:55.172746500 +0100
+diff --git glibc/libpthread/sysdeps/mach/hurd/pt-sysdep.h glibc/libpthread/sysdeps/mach/hurd/pt-sysdep.h
+new file mode 100644
+index 0000000..35912a3
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/hurd/pt-sysdep.h
 @@ -0,0 +1,67 @@
 +/* Internal defenitions for pthreads library.
 +   Copyright (C) 2000, 2002, 2007, 2008 Free Software Foundation, Inc.
@@ -10579,52 +11211,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +
 +#endif /* pt-sysdep.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/i386/bits/spin-lock.h glibc-2.24/libpthread/sysdeps/mach/i386/bits/spin-lock.h
---- glibc/libpthread/sysdeps/mach/i386/bits/spin-lock.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/i386/bits/spin-lock.h	2015-11-01 11:58:39.571925608 +0100
-@@ -0,0 +1,39 @@
-+/* Machine-specific definitions for spin locks.  i386 version.
-+   Copyright (C) 2000, 2005, 2008, 2009 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 Library General Public License as
-+   published by the Free Software Foundation; either version 2 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
-+   Library General Public License for more details.
-+
-+   You should have received a copy of the GNU Library General Public
-+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+   Boston, MA 02111-1307, USA.  */
-+
-+/*
-+ * Never include this file directly; use <pthread.h> or <cthreads.h> instead.
-+ */
-+
-+#ifndef _BITS_SPIN_LOCK_H
-+#define _BITS_SPIN_LOCK_H	1
-+
-+#include <features.h>
-+
-+__BEGIN_DECLS
-+
-+/* The type of a spin lock object.  */
-+typedef __volatile int __pthread_spinlock_t;
-+
-+/* Initializer for a spin lock object.  */
-+# define __PTHREAD_SPIN_LOCK_INITIALIZER ((__pthread_spinlock_t) 0)
-+
-+__END_DECLS
-+
-+#endif /* bits/spin-lock.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/i386/bits/spin-lock-inline.h glibc-2.24/libpthread/sysdeps/mach/i386/bits/spin-lock-inline.h
---- glibc/libpthread/sysdeps/mach/i386/bits/spin-lock-inline.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/i386/bits/spin-lock-inline.h	2015-11-01 11:58:39.571925608 +0100
+diff --git glibc/libpthread/sysdeps/mach/i386/bits/spin-lock-inline.h glibc/libpthread/sysdeps/mach/i386/bits/spin-lock-inline.h
+new file mode 100644
+index 0000000..e5ed3de
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/i386/bits/spin-lock-inline.h
 @@ -0,0 +1,98 @@
 +/* Machine-specific definitions for spin locks.  i386 version.
 +   Copyright (C) 2000, 2005, 2008, 2009 Free Software Foundation, Inc.
@@ -10724,9 +11315,56 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +__END_DECLS
 +
 +#endif /* bits/spin-lock.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/pt-block.c glibc-2.24/libpthread/sysdeps/mach/pt-block.c
---- glibc/libpthread/sysdeps/mach/pt-block.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/pt-block.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/mach/i386/bits/spin-lock.h glibc/libpthread/sysdeps/mach/i386/bits/spin-lock.h
+new file mode 100644
+index 0000000..5ae81e1
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/i386/bits/spin-lock.h
+@@ -0,0 +1,39 @@
++/* Machine-specific definitions for spin locks.  i386 version.
++   Copyright (C) 2000, 2005, 2008, 2009 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 Library General Public License as
++   published by the Free Software Foundation; either version 2 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
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If not,
++   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++/*
++ * Never include this file directly; use <pthread.h> or <cthreads.h> instead.
++ */
++
++#ifndef _BITS_SPIN_LOCK_H
++#define _BITS_SPIN_LOCK_H	1
++
++#include <features.h>
++
++__BEGIN_DECLS
++
++/* The type of a spin lock object.  */
++typedef __volatile int __pthread_spinlock_t;
++
++/* Initializer for a spin lock object.  */
++# define __PTHREAD_SPIN_LOCK_INITIALIZER ((__pthread_spinlock_t) 0)
++
++__END_DECLS
++
++#endif /* bits/spin-lock.h */
+diff --git glibc/libpthread/sysdeps/mach/pt-block.c glibc/libpthread/sysdeps/mach/pt-block.c
+new file mode 100644
+index 0000000..a947b27
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/pt-block.c
 @@ -0,0 +1,39 @@
 +/* Block a thread.  Mach version.
 +   Copyright (C) 2000 Free Software Foundation, Inc.
@@ -10767,9 +11405,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +		    MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
 +  assert_perror (err);
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/pt-spin.c glibc-2.24/libpthread/sysdeps/mach/pt-spin.c
---- glibc/libpthread/sysdeps/mach/pt-spin.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/pt-spin.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/mach/pt-spin.c glibc/libpthread/sysdeps/mach/pt-spin.c
+new file mode 100644
+index 0000000..d9a2a32
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/pt-spin.c
 @@ -0,0 +1,36 @@
 +/* Spin locks.  Mach version.
 +   Copyright (C) 2002, 2004 Free Software Foundation, Inc.
@@ -10807,9 +11447,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +weak_alias (_pthread_spin_lock, pthread_spin_lock);
 +weak_alias (_pthread_spin_lock, __pthread_spin_lock);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/pt-stack-alloc.c glibc-2.24/libpthread/sysdeps/mach/pt-stack-alloc.c
---- glibc/libpthread/sysdeps/mach/pt-stack-alloc.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/pt-stack-alloc.c	2013-12-26 17:44:13.572260390 +0100
+diff --git glibc/libpthread/sysdeps/mach/pt-stack-alloc.c glibc/libpthread/sysdeps/mach/pt-stack-alloc.c
+new file mode 100644
+index 0000000..121c189
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/pt-stack-alloc.c
 @@ -0,0 +1,69 @@
 +/* Allocate a new stack.  Mach version.
 +   Copyright (C) 2000,02 Free Software Foundation, Inc.
@@ -10880,9 +11522,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  (*stackaddr) = (void *) base;
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/pt-thread-alloc.c glibc-2.24/libpthread/sysdeps/mach/pt-thread-alloc.c
---- glibc/libpthread/sysdeps/mach/pt-thread-alloc.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/pt-thread-alloc.c	2014-01-01 19:57:55.172746500 +0100
+diff --git glibc/libpthread/sysdeps/mach/pt-thread-alloc.c glibc/libpthread/sysdeps/mach/pt-thread-alloc.c
+new file mode 100644
+index 0000000..77aa933
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/pt-thread-alloc.c
 @@ -0,0 +1,95 @@
 +/* Start thread.  Mach version.
 +   Copyright (C) 2000, 2002, 2005, 2008 Free Software Foundation, Inc.
@@ -10979,9 +11623,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/pt-thread-start.c glibc-2.24/libpthread/sysdeps/mach/pt-thread-start.c
---- glibc/libpthread/sysdeps/mach/pt-thread-start.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/pt-thread-start.c	2014-01-01 19:57:55.172746500 +0100
+diff --git glibc/libpthread/sysdeps/mach/pt-thread-start.c glibc/libpthread/sysdeps/mach/pt-thread-start.c
+new file mode 100644
+index 0000000..df490ab
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/pt-thread-start.c
 @@ -0,0 +1,51 @@
 +/* Start thread.  Mach version.
 +   Copyright (C) 2000,02 Free Software Foundation, Inc.
@@ -11034,9 +11680,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/pt-thread-terminate.c glibc-2.24/libpthread/sysdeps/mach/pt-thread-terminate.c
---- glibc/libpthread/sysdeps/mach/pt-thread-terminate.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/pt-thread-terminate.c	2016-09-21 00:05:53.993837636 +0200
+diff --git glibc/libpthread/sysdeps/mach/pt-thread-terminate.c glibc/libpthread/sysdeps/mach/pt-thread-terminate.c
+new file mode 100644
+index 0000000..5d9da26
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/pt-thread-terminate.c
 @@ -0,0 +1,85 @@
 +/* Deallocate the kernel thread resources.  Mach version.
 +   Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc.
@@ -11123,9 +11771,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  /* We are out of luck.  */
 +  assert_perror (err);
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/pt-timedblock.c glibc-2.24/libpthread/sysdeps/mach/pt-timedblock.c
---- glibc/libpthread/sysdeps/mach/pt-timedblock.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/pt-timedblock.c	2012-04-22 01:20:02.255030549 +0200
+diff --git glibc/libpthread/sysdeps/mach/pt-timedblock.c glibc/libpthread/sysdeps/mach/pt-timedblock.c
+new file mode 100644
+index 0000000..d72ef73
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/pt-timedblock.c
 @@ -0,0 +1,68 @@
 +/* Block a thread with a timeout.  Mach version.
 +   Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc.
@@ -11195,9 +11845,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  assert_perror (err);
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/mach/pt-wakeup.c glibc-2.24/libpthread/sysdeps/mach/pt-wakeup.c
---- glibc/libpthread/sysdeps/mach/pt-wakeup.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/mach/pt-wakeup.c	2013-02-10 10:49:14.701444604 +0100
+diff --git glibc/libpthread/sysdeps/mach/pt-wakeup.c glibc/libpthread/sysdeps/mach/pt-wakeup.c
+new file mode 100644
+index 0000000..95fdbf9
+--- /dev/null
++++ glibc/libpthread/sysdeps/mach/pt-wakeup.c
 @@ -0,0 +1,38 @@
 +/* Wakeup a thread.  Mach version.
 +   Copyright (C) 2000, 2002 Free Software Foundation, Inc.
@@ -11237,9 +11889,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +		    0 , MACH_PORT_NULL);
 +  assert_perror (err);
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/posix/pt-spin.c glibc-2.24/libpthread/sysdeps/posix/pt-spin.c
---- glibc/libpthread/sysdeps/posix/pt-spin.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/posix/pt-spin.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/posix/pt-spin.c glibc/libpthread/sysdeps/posix/pt-spin.c
+new file mode 100644
+index 0000000..cb809c6
+--- /dev/null
++++ glibc/libpthread/sysdeps/posix/pt-spin.c
 @@ -0,0 +1,54 @@
 +/* Spin locks.
 +   Copyright (C) 2000, 2004, 2005 Free Software Foundation, Inc.
@@ -11295,9 +11949,21 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +weak_alias (_pthread_spin_lock, pthread_spin_lock);
 +weak_alias (_pthread_spin_lock, __pthread_spin_lock);
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/bits/barrier-attr.h glibc-2.24/libpthread/sysdeps/pthread/bits/barrier-attr.h
---- glibc/libpthread/sysdeps/pthread/bits/barrier-attr.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/bits/barrier-attr.h	2015-03-22 22:42:37.118847619 +0100
+diff --git glibc/libpthread/sysdeps/pthread/Makefile glibc/libpthread/sysdeps/pthread/Makefile
+new file mode 100644
+index 0000000..0596130
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/Makefile
+@@ -0,0 +1,4 @@
++ifeq ($(subdir),posix)
++  # FIXME: this is not getting $(pthread-version) from libpthread/Makefile!
++CFLAGS-confstr.c += -DLIBPTHREAD_VERSION='"libpthread $(pthread-version)"'
++endif
+diff --git glibc/libpthread/sysdeps/pthread/bits/barrier-attr.h glibc/libpthread/sysdeps/pthread/bits/barrier-attr.h
+new file mode 100644
+index 0000000..7734069
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/bits/barrier-attr.h
 @@ -0,0 +1,32 @@
 +/* Thread barrier attribute type.  Generic version.
 +   Copyright (C) 2002, 2008 Free Software Foundation, Inc.
@@ -11331,9 +11997,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +};
 +
 +#endif /* bits/barrier-attr.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/bits/barrier.h glibc-2.24/libpthread/sysdeps/pthread/bits/barrier.h
---- glibc/libpthread/sysdeps/pthread/bits/barrier.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/bits/barrier.h	2015-03-22 22:46:13.576316347 +0100
+diff --git glibc/libpthread/sysdeps/pthread/bits/barrier.h glibc/libpthread/sysdeps/pthread/bits/barrier.h
+new file mode 100644
+index 0000000..dabe86f
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/bits/barrier.h
 @@ -0,0 +1,39 @@
 +/* Thread barrier attribute type.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -11374,9 +12042,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +
 +#endif /* bits/barrier.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/bits/cancelation.h glibc-2.24/libpthread/sysdeps/pthread/bits/cancelation.h
---- glibc/libpthread/sysdeps/pthread/bits/cancelation.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/bits/cancelation.h	2015-03-22 22:51:57.765987782 +0100
+diff --git glibc/libpthread/sysdeps/pthread/bits/cancelation.h glibc/libpthread/sysdeps/pthread/bits/cancelation.h
+new file mode 100644
+index 0000000..1ed16c6
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/bits/cancelation.h
 @@ -0,0 +1,51 @@
 +/* Cancelation.  Generic version.
 +   Copyright (C) 2002, 2008 Free Software Foundation, Inc.
@@ -11429,9 +12099,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +	}
 +
 +#endif /* _BITS_CANCELATION_H */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/bits/condition-attr.h glibc-2.24/libpthread/sysdeps/pthread/bits/condition-attr.h
---- glibc/libpthread/sysdeps/pthread/bits/condition-attr.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/bits/condition-attr.h	2015-03-22 22:54:01.818269459 +0100
+diff --git glibc/libpthread/sysdeps/pthread/bits/condition-attr.h glibc/libpthread/sysdeps/pthread/bits/condition-attr.h
+new file mode 100644
+index 0000000..19c92bb
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/bits/condition-attr.h
 @@ -0,0 +1,34 @@
 +/* Condition attribute type.  Generic version.
 +   Copyright (C) 2002, 2008 Free Software Foundation, Inc.
@@ -11467,9 +12139,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  };
 +
 +#endif /* bits/condition.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/bits/condition.h glibc-2.24/libpthread/sysdeps/pthread/bits/condition.h
---- glibc/libpthread/sysdeps/pthread/bits/condition.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/bits/condition.h	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/pthread/bits/condition.h glibc/libpthread/sysdeps/pthread/bits/condition.h
+new file mode 100644
+index 0000000..bf13ada
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/bits/condition.h
 @@ -0,0 +1,39 @@
 +/* Condition type.  Generic version.
 +   Copyright (C) 2000, 2005, 2009 Free Software Foundation, Inc.
@@ -11510,9 +12184,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  { __PTHREAD_SPIN_LOCK_INITIALIZER, NULL, NULL, NULL, NULL }
 +
 +#endif /* bits/condition.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/bits/mutex-attr.h glibc-2.24/libpthread/sysdeps/pthread/bits/mutex-attr.h
---- glibc/libpthread/sysdeps/pthread/bits/mutex-attr.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/bits/mutex-attr.h	2015-03-22 22:58:49.301660687 +0100
+diff --git glibc/libpthread/sysdeps/pthread/bits/mutex-attr.h glibc/libpthread/sysdeps/pthread/bits/mutex-attr.h
+new file mode 100644
+index 0000000..f3d0752
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/bits/mutex-attr.h
 @@ -0,0 +1,41 @@
 +/* Mutex attribute type.  Generic version.
 +   Copyright (C) 2002, 2008 Free Software Foundation, Inc.
@@ -11555,9 +12231,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +extern const struct __pthread_mutexattr __pthread_recursive_mutexattr;
 +
 +#endif /* bits/mutex-attr.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/bits/mutex.h glibc-2.24/libpthread/sysdeps/pthread/bits/mutex.h
---- glibc/libpthread/sysdeps/pthread/bits/mutex.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/bits/mutex.h	2015-03-22 22:40:43.542284381 +0100
+diff --git glibc/libpthread/sysdeps/pthread/bits/mutex.h glibc/libpthread/sysdeps/pthread/bits/mutex.h
+new file mode 100644
+index 0000000..3120237
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/bits/mutex.h
 @@ -0,0 +1,75 @@
 +/* Mutex type.  Generic version.
 +
@@ -11634,9 +12312,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#endif /* Not __pthread_mutex_defined.  */
 +
 +#endif /* bits/mutex.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/bits/once.h glibc-2.24/libpthread/sysdeps/pthread/bits/once.h
---- glibc/libpthread/sysdeps/pthread/bits/once.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/bits/once.h	2016-09-21 00:05:53.993837636 +0200
+diff --git glibc/libpthread/sysdeps/pthread/bits/once.h glibc/libpthread/sysdeps/pthread/bits/once.h
+new file mode 100644
+index 0000000..53dbfd3
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/bits/once.h
 @@ -0,0 +1,34 @@
 +/* Dynamic package initialization data structures.  Generic version.
 +   Copyright (C) 2002, 2009 Free Software Foundation, Inc.
@@ -11672,9 +12352,44 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +	(struct __pthread_once) { 0, __PTHREAD_SPIN_LOCK_INITIALIZER }
 +
 +#endif /* bits/once.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/bits/pthread.h glibc-2.24/libpthread/sysdeps/pthread/bits/pthread.h
---- glibc/libpthread/sysdeps/pthread/bits/pthread.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/bits/pthread.h	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/pthread/bits/pthread-np.h glibc/libpthread/sysdeps/pthread/bits/pthread-np.h
+new file mode 100644
+index 0000000..d5ddbb0
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/bits/pthread-np.h
+@@ -0,0 +1,27 @@
++/* Non-portable functions. Generic version.
++   Copyright (C) 2008 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 Library General Public License as
++   published by the Free Software Foundation; either version 2 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
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with the GNU C Library; see the file COPYING.LIB.  If not,
++   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++/*
++ * Never include this file directly; use <pthread.h> or <cthreads.h> instead.
++ */
++
++#ifndef _BITS_PTHREAD_NP_H
++#define _BITS_PTHREAD_NP_H	1
++
++#endif /* bits/pthread-np.h */
+diff --git glibc/libpthread/sysdeps/pthread/bits/pthread.h glibc/libpthread/sysdeps/pthread/bits/pthread.h
+new file mode 100644
+index 0000000..80e6b09
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/bits/pthread.h
 @@ -0,0 +1,38 @@
 +/* Pthread data structures.  Generic version.
 +   Copyright (C) 2002, 2008 Free Software Foundation, Inc.
@@ -11714,40 +12429,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#endif
 +
 +#endif /* bits/pthread.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/bits/pthread-np.h glibc-2.24/libpthread/sysdeps/pthread/bits/pthread-np.h
---- glibc/libpthread/sysdeps/pthread/bits/pthread-np.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/bits/pthread-np.h	2009-07-11 11:29:35.000000000 +0200
-@@ -0,0 +1,27 @@
-+/* Non-portable functions. Generic version.
-+   Copyright (C) 2008 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 Library General Public License as
-+   published by the Free Software Foundation; either version 2 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
-+   Library General Public License for more details.
-+
-+   You should have received a copy of the GNU Library General Public
-+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+   Boston, MA 02111-1307, USA.  */
-+
-+/*
-+ * Never include this file directly; use <pthread.h> or <cthreads.h> instead.
-+ */
-+
-+#ifndef _BITS_PTHREAD_NP_H
-+#define _BITS_PTHREAD_NP_H	1
-+
-+#endif /* bits/pthread-np.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/bits/pthreadtypes.h glibc-2.24/libpthread/sysdeps/pthread/bits/pthreadtypes.h
---- glibc/libpthread/sysdeps/pthread/bits/pthreadtypes.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/bits/pthreadtypes.h	2012-04-23 02:02:28.983488587 +0200
+diff --git glibc/libpthread/sysdeps/pthread/bits/pthreadtypes.h glibc/libpthread/sysdeps/pthread/bits/pthreadtypes.h
+new file mode 100644
+index 0000000..70368ff
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/bits/pthreadtypes.h
 @@ -0,0 +1,29 @@
 +/* 
 +   Copyright (C) 2000 Free Software Foundation, Inc.
@@ -11778,9 +12464,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#include <pthread/pthreadtypes.h>
 +
 +#endif /* bits/pthreadtypes.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/bits/rwlock-attr.h glibc-2.24/libpthread/sysdeps/pthread/bits/rwlock-attr.h
---- glibc/libpthread/sysdeps/pthread/bits/rwlock-attr.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/bits/rwlock-attr.h	2015-03-22 23:04:55.750702868 +0100
+diff --git glibc/libpthread/sysdeps/pthread/bits/rwlock-attr.h glibc/libpthread/sysdeps/pthread/bits/rwlock-attr.h
+new file mode 100644
+index 0000000..e78b91e
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/bits/rwlock-attr.h
 @@ -0,0 +1,32 @@
 +/* Thread rwlock attribute type.  Generic version.
 +   Copyright (C) 2002, 2008 Free Software Foundation, Inc.
@@ -11814,9 +12502,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +};
 +
 +#endif /* bits/rwlock-attr.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/bits/rwlock.h glibc-2.24/libpthread/sysdeps/pthread/bits/rwlock.h
---- glibc/libpthread/sysdeps/pthread/bits/rwlock.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/bits/rwlock.h	2015-03-22 23:07:51.281459812 +0100
+diff --git glibc/libpthread/sysdeps/pthread/bits/rwlock.h glibc/libpthread/sysdeps/pthread/bits/rwlock.h
+new file mode 100644
+index 0000000..bc27726
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/bits/rwlock.h
 @@ -0,0 +1,46 @@
 +/* rwlock type.  Generic version.
 +   Copyright (C) 2002, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
@@ -11864,9 +12554,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +
 +#endif /* bits/rwlock.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/bits/semaphore.h glibc-2.24/libpthread/sysdeps/pthread/bits/semaphore.h
---- glibc/libpthread/sysdeps/pthread/bits/semaphore.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/bits/semaphore.h	2015-11-01 11:55:57.073044900 +0100
+diff --git glibc/libpthread/sysdeps/pthread/bits/semaphore.h glibc/libpthread/sysdeps/pthread/bits/semaphore.h
+new file mode 100644
+index 0000000..4c78409
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/bits/semaphore.h
 @@ -0,0 +1,44 @@
 +/* Semaphore type.  Generic version.
 +   Copyright (C) 2005, 2009 Free Software Foundation, Inc.
@@ -11912,9 +12604,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  { __PTHREAD_SPIN_LOCK_INITIALIZER, NULL, (pshared), (value), NULL }
 +
 +#endif /* bits/mutex.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/bits/thread-attr.h glibc-2.24/libpthread/sysdeps/pthread/bits/thread-attr.h
---- glibc/libpthread/sysdeps/pthread/bits/thread-attr.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/bits/thread-attr.h	2015-03-22 23:10:03.133523761 +0100
+diff --git glibc/libpthread/sysdeps/pthread/bits/thread-attr.h glibc/libpthread/sysdeps/pthread/bits/thread-attr.h
+new file mode 100644
+index 0000000..d9456b0
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/bits/thread-attr.h
 @@ -0,0 +1,47 @@
 +/* Thread attribute type.  Generic version.
 +   Copyright (C) 2000, 2002, 2008 Free Software Foundation, Inc.
@@ -11963,9 +12657,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +};
 +
 +#endif /* bits/thread-attr.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/bits/thread-specific.h glibc-2.24/libpthread/sysdeps/pthread/bits/thread-specific.h
---- glibc/libpthread/sysdeps/pthread/bits/thread-specific.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/bits/thread-specific.h	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/sysdeps/pthread/bits/thread-specific.h glibc/libpthread/sysdeps/pthread/bits/thread-specific.h
+new file mode 100644
+index 0000000..b42d99e
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/bits/thread-specific.h
 @@ -0,0 +1,25 @@
 +/* Thread specific data.  Generic version.
 +   Copyright (C) 2002 Free Software Foundation, Inc.
@@ -11992,9 +12688,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +typedef int __pthread_key;
 +
 +#endif /* bits/thread-specific.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/flockfile.c glibc-2.24/libpthread/sysdeps/pthread/flockfile.c
---- glibc/libpthread/sysdeps/pthread/flockfile.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/flockfile.c	2016-09-21 00:05:53.993837636 +0200
+diff --git glibc/libpthread/sysdeps/pthread/flockfile.c glibc/libpthread/sysdeps/pthread/flockfile.c
+new file mode 100644
+index 0000000..0153a2c
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/flockfile.c
 @@ -0,0 +1,32 @@
 +/* Copyright (C) 2002-2014 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
@@ -12028,9 +12726,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +weak_alias (__flockfile, _IO_flockfile)
 +weak_alias (__flockfile, flockfile)
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/ftrylockfile.c glibc-2.24/libpthread/sysdeps/pthread/ftrylockfile.c
---- glibc/libpthread/sysdeps/pthread/ftrylockfile.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/ftrylockfile.c	2016-09-21 00:05:53.993837636 +0200
+diff --git glibc/libpthread/sysdeps/pthread/ftrylockfile.c glibc/libpthread/sysdeps/pthread/ftrylockfile.c
+new file mode 100644
+index 0000000..48420de
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/ftrylockfile.c
 @@ -0,0 +1,35 @@
 +/* Copyright (C) 2002-2014 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
@@ -12067,9 +12767,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +weak_alias (__ftrylockfile, _IO_ftrylockfile)
 +weak_alias (__ftrylockfile, ftrylockfile)
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/funlockfile.c glibc-2.24/libpthread/sysdeps/pthread/funlockfile.c
---- glibc/libpthread/sysdeps/pthread/funlockfile.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/funlockfile.c	2016-09-21 00:05:53.993837636 +0200
+diff --git glibc/libpthread/sysdeps/pthread/funlockfile.c glibc/libpthread/sysdeps/pthread/funlockfile.c
+new file mode 100644
+index 0000000..78fd211
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/funlockfile.c
 @@ -0,0 +1,33 @@
 +/* Copyright (C) 2002-2014 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
@@ -12104,9 +12806,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +}
 +weak_alias (__funlockfile, _IO_funlockfile)
 +weak_alias (__funlockfile, funlockfile)
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/libc-lockP.h glibc-2.24/libpthread/sysdeps/pthread/libc-lockP.h
---- glibc/libpthread/sysdeps/pthread/libc-lockP.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/libc-lockP.h	2016-09-21 00:05:49.973857307 +0200
+diff --git glibc/libpthread/sysdeps/pthread/libc-lockP.h glibc/libpthread/sysdeps/pthread/libc-lockP.h
+new file mode 100644
+index 0000000..2631e0c
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/libc-lockP.h
 @@ -0,0 +1,158 @@
 +/* Private libc-internal interface for mutex locks.
 +   Copyright (C) 2015 Free Software Foundation, Inc.
@@ -12266,17 +12970,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +#endif
 +
 +#endif	/* bits/libc-lockP.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/Makefile glibc-2.24/libpthread/sysdeps/pthread/Makefile
---- glibc/libpthread/sysdeps/pthread/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/Makefile	2015-03-21 02:56:04.989989673 +0100
-@@ -0,0 +1,4 @@
-+ifeq ($(subdir),posix)
-+  # FIXME: this is not getting $(pthread-version) from libpthread/Makefile!
-+CFLAGS-confstr.c += -DLIBPTHREAD_VERSION='"libpthread $(pthread-version)"'
-+endif
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/pthread-functions.h glibc-2.24/libpthread/sysdeps/pthread/pthread-functions.h
---- glibc/libpthread/sysdeps/pthread/pthread-functions.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/pthread-functions.h	2016-09-21 00:05:49.973857307 +0200
+diff --git glibc/libpthread/sysdeps/pthread/pthread-functions.h glibc/libpthread/sysdeps/pthread/pthread-functions.h
+new file mode 100644
+index 0000000..f9e367c
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/pthread-functions.h
 @@ -0,0 +1,141 @@
 +/* Copyright (C) 2003, 2012 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
@@ -12419,9 +13117,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +    __libc_pthread_functions.fct params
 +
 +#endif	/* pthread-functions.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/sysdeps/pthread/semaphore.h glibc-2.24/libpthread/sysdeps/pthread/semaphore.h
---- glibc/libpthread/sysdeps/pthread/semaphore.h	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/sysdeps/pthread/semaphore.h	2015-11-01 11:55:57.073044900 +0100
+diff --git glibc/libpthread/sysdeps/pthread/semaphore.h glibc/libpthread/sysdeps/pthread/semaphore.h
+new file mode 100644
+index 0000000..64249f6
+--- /dev/null
++++ glibc/libpthread/sysdeps/pthread/semaphore.h
 @@ -0,0 +1,81 @@
 +/* Copyright (C) 2005, 2007 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
@@ -12504,14 +13204,18 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +__END_DECLS
 +
 +#endif /* semaphore.h */
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/tests/.cvsignore glibc-2.24/libpthread/tests/.cvsignore
---- glibc/libpthread/tests/.cvsignore	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/tests/.cvsignore	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/tests/.cvsignore glibc/libpthread/tests/.cvsignore
+new file mode 100644
+index 0000000..70845e0
+--- /dev/null
++++ glibc/libpthread/tests/.cvsignore
 @@ -0,0 +1 @@
 +Makefile.in
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/tests/Makefile glibc-2.24/libpthread/tests/Makefile
---- glibc/libpthread/tests/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/tests/Makefile	2012-09-15 21:43:27.799249718 +0200
+diff --git glibc/libpthread/tests/Makefile glibc/libpthread/tests/Makefile
+new file mode 100644
+index 0000000..7177ad1
+--- /dev/null
++++ glibc/libpthread/tests/Makefile
 @@ -0,0 +1,40 @@
 +ifdef INSTALL_ROOT
 +INSTALL_ROOT_CPPFLAGS = -isystem $(INSTALL_ROOT)/include
@@ -12553,10 +13257,12 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +clean:
 +	rm -f $(CHECK_OBJS) $(CHECK_PROGS) \
 +	  $(addsuffix .out,$(basename $(notdir $(CHECK_PROGS))))
-\ Pas de fin de ligne à la fin du fichier
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/tests/README glibc-2.24/libpthread/tests/README
---- glibc/libpthread/tests/README	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/tests/README	2012-09-15 21:43:27.799249718 +0200
+\ No newline at end of file
+diff --git glibc/libpthread/tests/README glibc/libpthread/tests/README
+new file mode 100644
+index 0000000..230f1b2
+--- /dev/null
++++ glibc/libpthread/tests/README
 @@ -0,0 +1,6 @@
 +Testing of installed package:
 +
@@ -12564,9 +13270,67 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +    $ make
 +    $ make install
 +    $ make -C [libpthread]/tests/ INSTALL_ROOT=[install_root] clean check
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/tests/test-10.c glibc-2.24/libpthread/tests/test-10.c
---- glibc/libpthread/tests/test-10.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/tests/test-10.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/tests/test-1.c glibc/libpthread/tests/test-1.c
+new file mode 100644
+index 0000000..6ec1afb
+--- /dev/null
++++ glibc/libpthread/tests/test-1.c
+@@ -0,0 +1,50 @@
++#define _GNU_SOURCE
++
++#include <pthread.h>
++#include <assert.h>
++#include <unistd.h>
++#include <error.h>
++#include <errno.h>
++#include <stdio.h>
++
++#define THREADS 500
++
++void *
++foo (void *arg)
++{
++  pthread_mutex_t *mutex = arg;
++  pthread_mutex_lock (mutex);
++  pthread_mutex_unlock (mutex);
++  return mutex;
++}
++
++int
++main (int argc, char **argv)
++{
++  int i;
++  error_t err;
++  pthread_t tid[THREADS];
++  pthread_mutex_t mutex[THREADS];
++
++  for (i = 0; i < THREADS; i ++)
++    {
++      pthread_mutex_init (&mutex[i], 0);
++      pthread_mutex_lock (&mutex[i]);
++      err = pthread_create (&tid[i], 0, foo, &mutex[i]);
++      if (err)
++	error (1, err, "pthread_create");
++      sched_yield ();
++    }
++
++  for (i = THREADS - 1; i >= 0; i --)
++    {
++      void *ret;
++      pthread_mutex_unlock (&mutex[i]);
++      err = pthread_join (tid[i], &ret);
++      if (err)
++	error (1, err, "pthread_join");
++      assert (ret == &mutex[i]);
++    }
++
++  return 0;
++}
+diff --git glibc/libpthread/tests/test-10.c glibc/libpthread/tests/test-10.c
+new file mode 100644
+index 0000000..bec05c1
+--- /dev/null
++++ glibc/libpthread/tests/test-10.c
 @@ -0,0 +1,46 @@
 +/* Test error checking mutexes.  */
 +
@@ -12614,9 +13378,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/tests/test-11.c glibc-2.24/libpthread/tests/test-11.c
---- glibc/libpthread/tests/test-11.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/tests/test-11.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/tests/test-11.c glibc/libpthread/tests/test-11.c
+new file mode 100644
+index 0000000..de779a4
+--- /dev/null
++++ glibc/libpthread/tests/test-11.c
 @@ -0,0 +1,143 @@
 +/* Test rwlocks.  */
 +
@@ -12761,9 +13527,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/tests/test-12.c glibc-2.24/libpthread/tests/test-12.c
---- glibc/libpthread/tests/test-12.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/tests/test-12.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/tests/test-12.c glibc/libpthread/tests/test-12.c
+new file mode 100644
+index 0000000..2b78490
+--- /dev/null
++++ glibc/libpthread/tests/test-12.c
 @@ -0,0 +1,29 @@
 +/* Test concurrency level.  */
 +
@@ -12794,9 +13562,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/tests/test-13.c glibc-2.24/libpthread/tests/test-13.c
---- glibc/libpthread/tests/test-13.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/tests/test-13.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/tests/test-13.c glibc/libpthread/tests/test-13.c
+new file mode 100644
+index 0000000..13b0905
+--- /dev/null
++++ glibc/libpthread/tests/test-13.c
 @@ -0,0 +1,66 @@
 +/* Test condition attributes and pthread_cond_timedwait.  */
 +
@@ -12864,9 +13634,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/tests/test-14.c glibc-2.24/libpthread/tests/test-14.c
---- glibc/libpthread/tests/test-14.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/tests/test-14.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/tests/test-14.c glibc/libpthread/tests/test-14.c
+new file mode 100644
+index 0000000..b1dbfa6
+--- /dev/null
++++ glibc/libpthread/tests/test-14.c
 @@ -0,0 +1,44 @@
 +/* Test pthread_mutex_timedlock.  */
 +
@@ -12912,9 +13684,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/tests/test-15.c glibc-2.24/libpthread/tests/test-15.c
---- glibc/libpthread/tests/test-15.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/tests/test-15.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/tests/test-15.c glibc/libpthread/tests/test-15.c
+new file mode 100644
+index 0000000..173f8b6
+--- /dev/null
++++ glibc/libpthread/tests/test-15.c
 @@ -0,0 +1,87 @@
 +/* Test pthread_rwlock_timedrdlock and pthread_rwlock_timedwrlock.  */
 +
@@ -13003,9 +13777,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/tests/test-16.c glibc-2.24/libpthread/tests/test-16.c
---- glibc/libpthread/tests/test-16.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/tests/test-16.c	2011-09-15 00:08:41.803197207 +0200
+diff --git glibc/libpthread/tests/test-16.c glibc/libpthread/tests/test-16.c
+new file mode 100644
+index 0000000..3660f5f
+--- /dev/null
++++ glibc/libpthread/tests/test-16.c
 @@ -0,0 +1,71 @@
 +/* Test pthread_kill.c.  */
 +
@@ -13078,9 +13854,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/tests/test-17.c glibc-2.24/libpthread/tests/test-17.c
---- glibc/libpthread/tests/test-17.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/tests/test-17.c	2011-11-05 21:26:10.870602444 +0100
+diff --git glibc/libpthread/tests/test-17.c glibc/libpthread/tests/test-17.c
+new file mode 100644
+index 0000000..a8bd150
+--- /dev/null
++++ glibc/libpthread/tests/test-17.c
 @@ -0,0 +1,57 @@
 +/* Test that the key reuse inside libpthread does not cause thread
 +   specific values to persist. */
@@ -13135,67 +13913,15 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +  int i;
 +
 +  for (i = 0; i < 8; ++i)
-+    work (i + 1);
-+
-+  return 0;
-+}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/tests/test-1.c glibc-2.24/libpthread/tests/test-1.c
---- glibc/libpthread/tests/test-1.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/tests/test-1.c	2011-09-15 00:08:41.803197207 +0200
-@@ -0,0 +1,50 @@
-+#define _GNU_SOURCE
-+
-+#include <pthread.h>
-+#include <assert.h>
-+#include <unistd.h>
-+#include <error.h>
-+#include <errno.h>
-+#include <stdio.h>
-+
-+#define THREADS 500
-+
-+void *
-+foo (void *arg)
-+{
-+  pthread_mutex_t *mutex = arg;
-+  pthread_mutex_lock (mutex);
-+  pthread_mutex_unlock (mutex);
-+  return mutex;
-+}
-+
-+int
-+main (int argc, char **argv)
-+{
-+  int i;
-+  error_t err;
-+  pthread_t tid[THREADS];
-+  pthread_mutex_t mutex[THREADS];
-+
-+  for (i = 0; i < THREADS; i ++)
-+    {
-+      pthread_mutex_init (&mutex[i], 0);
-+      pthread_mutex_lock (&mutex[i]);
-+      err = pthread_create (&tid[i], 0, foo, &mutex[i]);
-+      if (err)
-+	error (1, err, "pthread_create");
-+      sched_yield ();
-+    }
-+
-+  for (i = THREADS - 1; i >= 0; i --)
-+    {
-+      void *ret;
-+      pthread_mutex_unlock (&mutex[i]);
-+      err = pthread_join (tid[i], &ret);
-+      if (err)
-+	error (1, err, "pthread_join");
-+      assert (ret == &mutex[i]);
-+    }
++    work (i + 1);
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/tests/test-2.c glibc-2.24/libpthread/tests/test-2.c
---- glibc/libpthread/tests/test-2.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/tests/test-2.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/tests/test-2.c glibc/libpthread/tests/test-2.c
+new file mode 100644
+index 0000000..701462e
+--- /dev/null
++++ glibc/libpthread/tests/test-2.c
 @@ -0,0 +1,39 @@
 +/* Test detachability.  */
 +#define _GNU_SOURCE
@@ -13236,9 +13962,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/tests/test-3.c glibc-2.24/libpthread/tests/test-3.c
---- glibc/libpthread/tests/test-3.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/tests/test-3.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/tests/test-3.c glibc/libpthread/tests/test-3.c
+new file mode 100644
+index 0000000..7db2e43
+--- /dev/null
++++ glibc/libpthread/tests/test-3.c
 @@ -0,0 +1,55 @@
 +/* Test the thread attribute get and set methods.  */
 +
@@ -13295,9 +14023,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/tests/test-4.c glibc-2.24/libpthread/tests/test-4.c
---- glibc/libpthread/tests/test-4.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/tests/test-4.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/tests/test-4.c glibc/libpthread/tests/test-4.c
+new file mode 100644
+index 0000000..de9c8fe
+--- /dev/null
++++ glibc/libpthread/tests/test-4.c
 @@ -0,0 +1,86 @@
 +/* Test the stack guard.  */
 +
@@ -13385,9 +14115,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/tests/test-5.c glibc-2.24/libpthread/tests/test-5.c
---- glibc/libpthread/tests/test-5.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/tests/test-5.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/tests/test-5.c glibc/libpthread/tests/test-5.c
+new file mode 100644
+index 0000000..0f5000b
+--- /dev/null
++++ glibc/libpthread/tests/test-5.c
 @@ -0,0 +1,75 @@
 +/* Test signals.  */
 +
@@ -13464,9 +14196,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/tests/test-6.c glibc-2.24/libpthread/tests/test-6.c
---- glibc/libpthread/tests/test-6.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/tests/test-6.c	2011-09-15 00:08:41.803197207 +0200
+diff --git glibc/libpthread/tests/test-6.c glibc/libpthread/tests/test-6.c
+new file mode 100644
+index 0000000..edf2919
+--- /dev/null
++++ glibc/libpthread/tests/test-6.c
 @@ -0,0 +1,96 @@
 +#define _GNU_SOURCE
 +
@@ -13564,9 +14298,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/tests/test-7.c glibc-2.24/libpthread/tests/test-7.c
---- glibc/libpthread/tests/test-7.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/tests/test-7.c	2011-11-06 13:12:14.418025579 +0100
+diff --git glibc/libpthread/tests/test-7.c glibc/libpthread/tests/test-7.c
+new file mode 100644
+index 0000000..22fb1ca
+--- /dev/null
++++ glibc/libpthread/tests/test-7.c
 @@ -0,0 +1,70 @@
 +#define _GNU_SOURCE
 +
@@ -13638,9 +14374,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/tests/test-8.c glibc-2.24/libpthread/tests/test-8.c
---- glibc/libpthread/tests/test-8.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/tests/test-8.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/tests/test-8.c glibc/libpthread/tests/test-8.c
+new file mode 100644
+index 0000000..85a7f8f
+--- /dev/null
++++ glibc/libpthread/tests/test-8.c
 @@ -0,0 +1,60 @@
 +#define _GNU_SOURCE
 +
@@ -13702,9 +14440,11 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  return 0;
 +}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/tests/test-9.c glibc-2.24/libpthread/tests/test-9.c
---- glibc/libpthread/tests/test-9.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/tests/test-9.c	2009-07-11 11:29:35.000000000 +0200
+diff --git glibc/libpthread/tests/test-9.c glibc/libpthread/tests/test-9.c
+new file mode 100644
+index 0000000..8205157
+--- /dev/null
++++ glibc/libpthread/tests/test-9.c
 @@ -0,0 +1,88 @@
 +/* Test recursive mutexes.  */
 +
@@ -13728,441 +14468,158 @@ diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpth
 +
 +  foo = pthread_self ();
 +
-+  for (i = 0; i < 500; i ++)
-+    pthread_mutex_lock (arg);
-+  for (i = 0; i < 500; i ++)
-+    pthread_mutex_unlock (arg);
-+
-+  assert (foo == pthread_self ());
-+
-+  pthread_mutex_unlock (arg);
-+
-+  return 0;
-+}
-+
-+int
-+main (int argc, char **argv)
-+{
-+  error_t err;
-+  int i;
-+  pthread_t tid[THREADS];
-+  pthread_mutexattr_t mattr;
-+  pthread_mutex_t mutex;
-+
-+  err = pthread_mutexattr_init (&mattr);
-+  if (err)
-+    error (1, err, "pthread_mutexattr_init");
-+
-+  err = pthread_mutexattr_settype (&mattr, PTHREAD_MUTEX_RECURSIVE);
-+  if (err)
-+    error (1, err, "pthread_mutexattr_settype");
-+
-+  err = pthread_mutex_init (&mutex, &mattr);
-+  if (err)
-+    error (1, err, "pthread_mutex_init");
-+
-+  err = pthread_mutexattr_destroy (&mattr);
-+  if (err)
-+    error (1, err, "pthread_mutexattr_destroy");
-+
-+  pthread_mutex_lock (&mutex);
-+  pthread_mutex_lock (&mutex);
-+  pthread_mutex_unlock (&mutex);
-+  pthread_mutex_unlock (&mutex);
-+
-+  for (i = 0; i < THREADS; i ++)
-+    {
-+      err = pthread_create (&tid[i], 0, thr, &mutex);
-+      if (err)
-+	error (1, err, "pthread_create (%d)", i);
-+    }
-+
-+  for (i = 0; i < THREADS; i ++)
-+    {
-+      void *ret;
-+
-+      err = pthread_join (tid[i], &ret);
-+      if (err)
-+	error (1, err, "pthread_join");
-+
-+      assert (ret == 0);
-+    }
-+
-+  err = pthread_mutex_destroy (&mutex);
-+  if (err)
-+    error (1, err, "pthread_mutex_destroy");
-+
-+  return 0;
-+}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/tests/test-__pthread_destroy_specific-skip.c glibc-2.24/libpthread/tests/test-__pthread_destroy_specific-skip.c
---- glibc/libpthread/tests/test-__pthread_destroy_specific-skip.c	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/tests/test-__pthread_destroy_specific-skip.c	2011-11-06 13:17:28.798988815 +0100
-@@ -0,0 +1,83 @@
-+/* Check that __pthread_destroy_specific works correctly if it has to skip
-+   unused slots.  */
-+
-+#define _GNU_SOURCE
-+
-+#include <error.h>
-+#include <pthread.h>
-+#include <stdio.h>
-+
-+
-+#define N_k 42
-+
-+static volatile int v;
-+
-+static void
-+d (void *x)
-+{
-+  int *i = (int *) x;
-+
-+  if (v != *i)
-+    error (1, 0, "FAILED %d %d", v, *i);
-+  v += 2;
-+
-+  printf ("%s %d\n", __FUNCTION__, *i);
-+  fflush (stdout);
-+}
-+
-+static void *
-+test (void *x)
-+{
-+  pthread_key_t k[N_k];
-+  static int k_v[N_k];
-+
-+  int err, i;
-+
-+  for (i = 0; i < N_k; i += 1)
-+    {
-+      err = pthread_key_create (&k[i], &d);
-+      if (err != 0)
-+        error (1, err, "pthread_key_create %d", i);
-+    }
-+
-+  for (i = 0; i < N_k; i += 1)
-+    {
-+      k_v[i] = i;
-+      err = pthread_setspecific (k[i], &k_v[i]);
-+      if (err != 0)
-+        error (1, err, "pthread_setspecific %d", i);
-+    }
-+
-+  /* Delete every even key.  */
-+  for (i = 0; i < N_k; i += 2)
-+    {
-+      err = pthread_key_delete (k[i]);
-+      if (err != 0)
-+        error (1, err, "pthread_key_delete %d", i);
-+    }
-+
-+  v = 1;
-+  pthread_exit (NULL);
-+
-+  return NULL;
-+}
-+
-+
-+int main(void)
-+{
-+  pthread_t tid;
-+  int err;
-+
-+  err = pthread_create (&tid, 0, test, NULL);
-+  if (err != 0)
-+    error (1, err, "pthread_create");
-+
-+  err = pthread_join(tid, NULL);
-+  if (err)
-+    error (1, err, "pthread_join");
-+
-+  if (v != N_k + 1)
-+    error (1, 0, "FAILED END %d %d", v, N_k + 1);
-+
-+  return 0;
-+}
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/TODO glibc-2.24/libpthread/TODO
---- glibc/libpthread/TODO	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/TODO	2014-04-07 23:16:41.081322612 +0200
-@@ -0,0 +1,131 @@
-+-*- Mode: outline -*-
-+
-+* Interfaces
-+** All interfaces specified by IEEE Std 1003.1-2001 are present, however,
-+   pthread_kill and pthread_sigmask are defined in <pthread.h> and not
-+   <signal.h> as they should be.  Once we are compiled with glibc,
-+   this should be eaiser.
-+
-+* Test cases.  Can never have enough.
-+
-+* Ports
-+  Port to other kernels (e.g. Linux and FreeBSD) and test on other
-+  platforms.
-+
-+* Implementation details
-+** pthread_atfork
-+   This cannot be implemented without either changing glibc to export
-+   some hooks (c.f. libc/sysdeps/mach/hurd/fork.c) or by providing a
-+   custom fork implementation that wraps the origial using dlopen et
-+   al.
-+
-+** Scheduling and priorities
-+
-+   We do not support scheduling right now in any way what so ever.
-+
-+   This affects:
-+     pthread_attr_getinheritsched
-+     pthread_attr_setinheritsched
-+     pthread_attr_getschedparam
-+     pthread_attr_setschedparam
-+     pthread_attr_getschedpolicy
-+     pthread_attr_setschedpolicy
-+     pthread_attr_getscope
-+     pthread_attr_setscope
-+
-+     pthread_mutexattr_getprioceiling
-+     pthread_mutexattr_setprioceiling
-+     pthread_mutexattr_getprotocol
-+     pthread_mutexattr_setprotocol
-+     pthread_mutex_getprioceiling
-+     pthread_mutex_setprioceiling
-+
-+     pthread_setschedprio
-+     pthread_getschedparam
-+     pthread_setschedparam
-+
-+** Cancelation
-+*** Cancelation points
-+    The only cancelation points are pthread_join, pthread_cond_wait,
-+    pthead_cond_timedwait and pthread_testcancel.  Need to explore if
-+    the hurd_sigstate->cancel_hook (c.f. <hurd/signal.h>) provides the
-+    desired semantics.  If not, must either wrap the some functions
-+    using dlsym or wait until integration with glibc.
-+*** Async cancelation
-+    We inject a new IP into the cancelled (running) thread and then
-+    run the cancelation handlers
-+    (c.f. sysdeps/mach/hurd/pt-docancel.c).  The handlers need to have
-+    access to the stack as they may use local variables.  I think that
-+    this method may leave the frame pointer in a corrupted state if
-+    the thread was in, for instance, the middle of a function call.
-+    The robustness needs to be confirmed.
-+
-+** Process Shared Attribute
-+
-+   Currently, there is no real support for the process shared
-+   attribute.  spinlocks work because we just use a test and set loop,
-+   however, barriers, conditions mutexes and rwlocks, however, signal
-+   wakeups via ports of which the names are process local.
-+
-+   We could have some process local data that is hashed to via the
-+   address of the data structure.  Then the first thread that blocks
-+   per process would spin on the shared memory area and all others
-+   would then block as normal.  When the resource became available,
-+   the first thread would signal the other local threads as necessary.
-+   Alternatively, there could be some server, however, this opens a
-+   new question: what can we use as an authentication agent.
-+
-+** Locking algorithm
-+
-+   When a thread blocks, it puts itself on a queue and then waits for
-+   a message on a thread local port.  The thread which eventually does
-+   the wakeup sends a message to the waiter thereby waking it up.  If
-+   the wakeup is a broadcast wakeup (e.g. pthread_cond_broadcast,
-+   pthread_barrier_wait and pthread_rdlock_unlock), the thread must
-+   send O(N) messages where N is the number of waiting threads.  If
-+   all the threads instead received on a lock local (rather than
-+   thread local) port then the thread which eventually does the wake
-+   need just do one operation, mach_port_destroy and all of the
-+   waiting threads would wakeup and get MACH_RCV_PORT_DIED back from
-+   mach_msg.  Note that the trade off is that the port must be
-+   recreated.  This needs to be benchmarked.
-+
-+   A possible problem with this is scheduling priorities.  There may
-+   be a preference for certain threads to wakeup before others
-+   (especially if we are not doing a broadcast, for instance,
-+   pthread_mutex_unlock and pthread_cond_signal).  If we take this
-+   approach, the kernel chooses which threads are awakened.  If we
-+   find that the kernel makes the wrong choices, we can still overcome
-+   this by merging the two algorithms: have a list of ports sorted in
-+   priority order and the waker does a mach_port_destroy on each as
-+   appropriate.
-+
-+** Barriers
-+
-+   Barriers can be very slow and the contention can be very high.  The
-+   above algorithm is very appealing, however, this may be augmented
-+   with an initial number of spins and yields.  It is expected that
-+   all of the threads reach the barrier within close succession, thus
-+   queuing a message may be more expensive.  This needs to be
-+   benchmarked.
++  for (i = 0; i < 500; i ++)
++    pthread_mutex_lock (arg);
++  for (i = 0; i < 500; i ++)
++    pthread_mutex_unlock (arg);
 +
-+** Clocks
-+*** pthread_condattr_setclock allows a process to specify a clock for
-+    use with pthread_cond_timedwaits.  What is the correct default for
-+    this, right now, we use CLOCK_REALTIME, however, we are really
-+    using the system clock which, if I understand correctly, is
-+    completely different.
-+*** Could we even use other clocks? mach_msg uses a relative time against
-+    the system clock.
-+*** pthread_getcpuclockid just returns CLOCK_THREAD_CPUTIME_ID if defined.
-+    Is this the correct behavior?
++  assert (foo == pthread_self ());
 +
-+** Timed Blocking
-+*** pthread_cond_timedwait, pthead_mutex_timedlock, pthread_rwlock_timedrdlock
-+    and pthread_rwlock_timedwrlock all take absolute times.  We need
-+    to convert them to relative times for mach_msg.  Is there a way
-+    around this?  How will clock skew affect us?
++  pthread_mutex_unlock (arg);
 +
-+** weak aliases
-+   Use them consistently and correctly and start by reading
-+   http://sources.redhat.com/ml/libc-alpha/2002-08/msg00278.html.
-diff --exclude .svn --exclude .git --exclude CVS --exclude .hg -urN glibc/libpthread/Versions glibc-2.24/libpthread/Versions
---- glibc/libpthread/Versions	1970-01-01 01:00:00.000000000 +0100
-+++ glibc-2.24/libpthread/Versions	2016-09-21 00:05:53.993837636 +0200
-@@ -0,0 +1,146 @@
-+libc {
-+  GLIBC_2.13 {
-+    pthread_attr_destroy; pthread_attr_getdetachstate;
-+    pthread_attr_getinheritsched; pthread_attr_getschedparam;
-+    pthread_attr_getschedpolicy; pthread_attr_getscope; pthread_attr_init;
-+    pthread_attr_setdetachstate; pthread_attr_setinheritsched;
-+    pthread_attr_setschedparam; pthread_attr_setschedpolicy;
-+    pthread_attr_setscope;
-+    pthread_condattr_destroy; pthread_condattr_init;
-+    pthread_cond_broadcast; pthread_cond_destroy;
-+    pthread_cond_init; pthread_cond_signal; pthread_cond_wait;
-+    pthread_cond_timedwait;
-+    pthread_equal;
-+    pthread_exit; pthread_getschedparam; pthread_setschedparam;
-+    pthread_mutex_destroy; pthread_mutex_init;
-+    pthread_mutex_lock; pthread_mutex_trylock; pthread_mutex_unlock;
-+    pthread_self; pthread_setcancelstate; pthread_setcanceltype;
-+    __pthread_get_cleanup_stack;
-+  }
-+  GLIBC_2.22 {
-+    __register_atfork;
-+  }
-+  GLIBC_PRIVATE {
-+    __libc_alloca_cutoff;
-+    __libc_pthread_init;
-+  }
++  return 0;
 +}
 +
-+libpthread {
-+  GLIBC_2.2.6 {
-+    _IO_flockfile; _IO_ftrylockfile; _IO_funlockfile;
-+  }
-+  GLIBC_2.12 {
-+    __pthread_errorcheck_mutexattr; __pthread_recursive_mutexattr;
++int
++main (int argc, char **argv)
++{
++  error_t err;
++  int i;
++  pthread_t tid[THREADS];
++  pthread_mutexattr_t mattr;
++  pthread_mutex_t mutex;
 +
-+    __pthread_get_cleanup_stack;
++  err = pthread_mutexattr_init (&mattr);
++  if (err)
++    error (1, err, "pthread_mutexattr_init");
 +
-+    __pthread_mutex_transfer_np;
++  err = pthread_mutexattr_settype (&mattr, PTHREAD_MUTEX_RECURSIVE);
++  if (err)
++    error (1, err, "pthread_mutexattr_settype");
 +
-+    _pthread_mutex_destroy; _pthread_mutex_init;
-+    _pthread_mutex_lock; _pthread_mutex_trylock; _pthread_mutex_unlock;
-+    _pthread_rwlock_destroy; _pthread_rwlock_init;
++  err = pthread_mutex_init (&mutex, &mattr);
++  if (err)
++    error (1, err, "pthread_mutex_init");
 +
-+    _cthread_init_routine;
++  err = pthread_mutexattr_destroy (&mattr);
++  if (err)
++    error (1, err, "pthread_mutexattr_destroy");
 +
-+    cthread_detach;
-+    cthread_fork;
-+    cthread_keycreate;
-+    cthread_getspecific;
-+    cthread_setspecific;
-+    __mutex_lock_solid;
-+    __mutex_unlock_solid;
-+    _cthreads_flockfile;
-+    _cthreads_ftrylockfile;
-+    _cthreads_funlockfile;
++  pthread_mutex_lock (&mutex);
++  pthread_mutex_lock (&mutex);
++  pthread_mutex_unlock (&mutex);
++  pthread_mutex_unlock (&mutex);
 +
-+    flockfile; ftrylockfile; funlockfile;
++  for (i = 0; i < THREADS; i ++)
++    {
++      err = pthread_create (&tid[i], 0, thr, &mutex);
++      if (err)
++	error (1, err, "pthread_create (%d)", i);
++    }
 +
-+    pthread_atfork;
++  for (i = 0; i < THREADS; i ++)
++    {
++      void *ret;
 +
-+    pthread_attr_destroy; pthread_attr_getdetachstate;
-+    pthread_attr_getguardsize; pthread_attr_getinheritsched;
-+    pthread_attr_getschedparam; pthread_attr_getschedpolicy;
-+    pthread_attr_getscope; pthread_attr_getstack; pthread_attr_getstackaddr;
-+    pthread_attr_getstacksize; pthread_attr_init; pthread_attr_setdetachstate;
-+    pthread_attr_setguardsize; pthread_attr_setinheritsched;
-+    pthread_attr_setschedparam; pthread_attr_setschedpolicy;
-+    pthread_attr_setscope; pthread_attr_setstack; pthread_attr_setstackaddr;
-+    pthread_attr_setstacksize;
++      err = pthread_join (tid[i], &ret);
++      if (err)
++	error (1, err, "pthread_join");
 +
-+    pthread_barrier_destroy; pthread_barrier_init; pthread_barrier_wait;
-+    pthread_barrierattr_destroy; pthread_barrierattr_getpshared;
-+    pthread_barrierattr_init; pthread_barrierattr_setpshared;
++      assert (ret == 0);
++    }
 +
-+    pthread_cancel;
++  err = pthread_mutex_destroy (&mutex);
++  if (err)
++    error (1, err, "pthread_mutex_destroy");
 +
-+    pthread_cond_broadcast; pthread_cond_destroy; pthread_cond_init;
-+    pthread_cond_signal; pthread_cond_timedwait; pthread_cond_wait;
++  return 0;
++}
+diff --git glibc/libpthread/tests/test-__pthread_destroy_specific-skip.c glibc/libpthread/tests/test-__pthread_destroy_specific-skip.c
+new file mode 100644
+index 0000000..b2c4c0b
+--- /dev/null
++++ glibc/libpthread/tests/test-__pthread_destroy_specific-skip.c
+@@ -0,0 +1,83 @@
++/* Check that __pthread_destroy_specific works correctly if it has to skip
++   unused slots.  */
 +
-+    pthread_condattr_destroy; pthread_condattr_getclock;
-+    pthread_condattr_getpshared; pthread_condattr_init;
-+    pthread_condattr_setclock; pthread_condattr_setpshared;
++#define _GNU_SOURCE
 +
-+    pthread_create; pthread_detach; pthread_equal; pthread_exit;
++#include <error.h>
++#include <pthread.h>
++#include <stdio.h>
 +
-+    pthread_getattr_np;
 +
-+    pthread_getconcurrency; pthread_getcpuclockid;
-+    pthread_getschedparam; pthread_getspecific;
++#define N_k 42
 +
-+    pthread_join;
++static volatile int v;
 +
-+    pthread_key_create; pthread_key_delete;
-+    __pthread_key_create;
++static void
++d (void *x)
++{
++  int *i = (int *) x;
 +
-+    pthread_kill;
-+    __pthread_kill;
++  if (v != *i)
++    error (1, 0, "FAILED %d %d", v, *i);
++  v += 2;
 +
-+    pthread_mutex_destroy; pthread_mutex_getprioceiling;
-+    pthread_mutex_init; pthread_mutex_lock; pthread_mutex_setprioceiling;
-+    pthread_mutex_timedlock; pthread_mutex_transfer_np;
-+    pthread_mutex_trylock; pthread_mutex_unlock;
++  printf ("%s %d\n", __FUNCTION__, *i);
++  fflush (stdout);
++}
 +
-+    pthread_mutexattr_destroy; pthread_mutexattr_getprioceiling;
-+    pthread_mutexattr_getprotocol; pthread_mutexattr_getpshared;
-+    pthread_mutexattr_gettype; pthread_mutexattr_init;
-+    pthread_mutexattr_setprioceiling; pthread_mutexattr_setprotocol;
-+    pthread_mutexattr_setpshared; pthread_mutexattr_settype;
++static void *
++test (void *x)
++{
++  pthread_key_t k[N_k];
++  static int k_v[N_k];
 +
-+    pthread_once;
++  int err, i;
 +
-+    pthread_rwlock_destroy; pthread_rwlock_init; pthread_rwlock_rdlock;
-+    pthread_rwlock_timedrdlock; pthread_rwlock_timedwrlock;
-+    pthread_rwlock_tryrdlock; pthread_rwlock_trywrlock;
-+    pthread_rwlock_unlock; pthread_rwlock_wrlock;
++  for (i = 0; i < N_k; i += 1)
++    {
++      err = pthread_key_create (&k[i], &d);
++      if (err != 0)
++        error (1, err, "pthread_key_create %d", i);
++    }
 +
-+    pthread_rwlockattr_destroy; pthread_rwlockattr_getpshared;
-+    pthread_rwlockattr_init; pthread_rwlockattr_setpshared;
++  for (i = 0; i < N_k; i += 1)
++    {
++      k_v[i] = i;
++      err = pthread_setspecific (k[i], &k_v[i]);
++      if (err != 0)
++        error (1, err, "pthread_setspecific %d", i);
++    }
 +
-+    pthread_self;
++  /* Delete every even key.  */
++  for (i = 0; i < N_k; i += 2)
++    {
++      err = pthread_key_delete (k[i]);
++      if (err != 0)
++        error (1, err, "pthread_key_delete %d", i);
++    }
 +
-+    pthread_setcancelstate; pthread_setcanceltype;
-+    pthread_setconcurrency; pthread_setschedparam;
-+    pthread_setschedprio; pthread_setspecific;
++  v = 1;
++  pthread_exit (NULL);
 +
-+    pthread_sigmask;
-+    pthread_testcancel;
-+    pthread_yield;
++  return NULL;
++}
 +
-+    sem_close; sem_destroy; sem_getvalue; sem_init; sem_open; sem_post;
-+    sem_timedwait; sem_trywait; sem_unlink; sem_wait;
 +
-+    pthread_spin_destroy; pthread_spin_init; pthread_spin_lock;
-+    pthread_spin_trylock; pthread_spin_unlock;
-+    __pthread_spin_destroy; __pthread_spin_init;
-+    __pthread_spin_lock; __pthread_spin_trylock; __pthread_spin_unlock;
-+    _pthread_spin_lock;
-+  }
-+  GLIBC_2.17 {
-+    pthread_hurd_cond_wait_np;
-+    pthread_hurd_cond_timedwait_np;
-+  }
-+  GLIBC_PRIVATE {
-+    __shm_directory;
-+  }
++int main(void)
++{
++  pthread_t tid;
++  int err;
++
++  err = pthread_create (&tid, 0, test, NULL);
++  if (err != 0)
++    error (1, err, "pthread_create");
++
++  err = pthread_join(tid, NULL);
++  if (err)
++    error (1, err, "pthread_join");
++
++  if (v != N_k + 1)
++    error (1, 0, "FAILED END %d %d", v, N_k + 1);
++
++  return 0;
 +}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-glibc/glibc.git


Reply to: