This is an automated email from the git hooks/post-receive script. sthibault pushed a commit to branch glibc-2.27 in repository glibc.
commit ebb6ce6d6a4fb16aa589b4cddbd048fc1ff0ef7d Author: Aurelien Jarno <aurel...@aurel32.net> Date: Sat Jan 6 18:50:39 2018 +0100 hurd: Fix build * debian/sysdeps/hurd.mk: Do not add libpthread add-on since add-ons mechanism is no more. * debian/patches/hurd-i386/git-jmp_buf-macros.h.diff: New patch to fix build. * debian/patches/hurd-i386/libpthread_build.diff: Add more Implies to fix build. Drop deprecated internal_function. * debian/patches/hurd-i386/libpthread_includes.diff: Move headers for sysdeps to find them. * debian/patches/hurd-i386/git-glob64.diff: Fix glob symlink compatibility for GNU. * debian/patches/hurd-i386/git-hidden-def.diff: Fix reference to rtld hidden symbol. * debian/patches/hurd-i386/git-math-ulps-i386-update.diff: Update ULPs. * debian/patches/hurd-i386/git-glob-PATH_MAX.diff: Fix posix glob test hurd build. --- debian/changelog | 13 + debian/patches/hurd-i386/git-glob-PATH_MAX.diff | 22 + debian/patches/hurd-i386/git-glob64.diff | 134 ++ debian/patches/hurd-i386/git-hidden-def.diff | 42 + .../hurd-i386/git-math-ulps-i386-update.diff | 90 + debian/patches/hurd-i386/libpthread_build.diff | 63 +- debian/patches/hurd-i386/libpthread_includes.diff | 2050 ++++++++++++++++++++ debian/patches/hurd-i386/tg-gsync-libc.diff | 3 +- debian/patches/series | 7 +- debian/sysdeps/hurd.mk | 1 - 10 files changed, 2418 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index 62e4987..428fd72 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,23 @@ glibc (2.26.9000+20180105.a6d0afb5-0experimental1) UNRELEASED; urgency=medium [ Samuel Thibault ] + * debian/sysdeps/hurd.mk: Do not add libpthread add-on since add-ons + mechanism is no more. * debian/patches/hurd-i386/submitted-net.diff: rebased. * debian/patches/hurd-i386/unsubmitted-prof-eintr.diff: rebased. * debian/patches/hurd-i386/git-jmp_buf-macros.h.diff: New patch to fix build. + * debian/patches/hurd-i386/libpthread_build.diff: Add more Implies to fix + build. Drop deprecated internal_function. + * debian/patches/hurd-i386/libpthread_includes.diff: Move headers for + sysdeps to find them. + * debian/patches/hurd-i386/git-glob64.diff: Fix glob symlink compatibility + for GNU. + * debian/patches/hurd-i386/git-hidden-def.diff: Fix reference to rtld hidden + symbol. + * debian/patches/hurd-i386/tg-gsync-libc.diff: Update. + * debian/patches/hurd-i386/git-math-ulps-i386-update.diff: Update ULPs. + * debian/patches/hurd-i386/git-glob-PATH_MAX.diff: Fix posix glob test hurd build. [ Aurelien Jarno ] * debian/control.in/main: Update Vcs-Git to point to the 2.27 branch. diff --git a/debian/patches/hurd-i386/git-glob-PATH_MAX.diff b/debian/patches/hurd-i386/git-glob-PATH_MAX.diff new file mode 100644 index 0000000..beafa87 --- /dev/null +++ b/debian/patches/hurd-i386/git-glob-PATH_MAX.diff @@ -0,0 +1,22 @@ +commit 01c7e549b2b978e69d6509864d4d067c555cb81b +Author: Samuel Thibault <samuel.thiba...@ens-lyon.org> +Date: Sat Jan 6 22:19:13 2018 +0100 + + hurd: Fix posix glob test + + * posix/tst-glob_symlinks.c [!PATH_MAX]: Define PATH_MAX macro. + +diff --git a/posix/tst-glob_symlinks.c b/posix/tst-glob_symlinks.c +index 0f3478d3d0..df3baa8757 100644 +--- a/posix/tst-glob_symlinks.c ++++ b/posix/tst-glob_symlinks.c +@@ -57,6 +57,9 @@ create_link (const char *base, const char *fname, char *linkname, + add_temp_file (linkname); + } + ++#ifndef PATH_MAX ++# define PATH_MAX 1024 ++#endif + static char valid_link[PATH_MAX]; + static char dangling_link[PATH_MAX]; + static char dangling_dir[PATH_MAX]; diff --git a/debian/patches/hurd-i386/git-glob64.diff b/debian/patches/hurd-i386/git-glob64.diff new file mode 100644 index 0000000..c53224a --- /dev/null +++ b/debian/patches/hurd-i386/git-glob64.diff @@ -0,0 +1,134 @@ +commit f417d92c1714406b85d887c96736801498962ff5 +Author: Samuel Thibault <samuel.thiba...@ens-lyon.org> +Date: Sat Jan 6 22:28:36 2018 +0100 + + hurd: Fix glob64 compatibility symbols + + This follows ccf970c7a ('posix: Add compat glob symbol to not follow + dangling symbols') by adding to gnu/ the same compatibility as for Linux. + + * sysdeps/gnu/glob64.c (__glob): Define macro instead of glob macro. + (__glob64): Define GLIBC_2_27 versioned symbol instead of glob64. + * sysdeps/gnu/glob-lstat-compat.c: New file. + * sysdeps/gnu/glob64-lstat-compat.c: New file. + +diff --git a/sysdeps/gnu/glob-lstat-compat.c b/sysdeps/gnu/glob-lstat-compat.c +new file mode 100644 +index 0000000000..7cb52d4fee +--- /dev/null ++++ b/sysdeps/gnu/glob-lstat-compat.c +@@ -0,0 +1,38 @@ ++/* Compat glob which does not use gl_lstat for GLOB_ALTDIRFUNC. ++ GNU version ++ Copyright (C) 2017-2018 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ <http://www.gnu.org/licenses/>. */ ++ ++#include <sys/stat.h> ++#include <shlib-compat.h> ++ ++#define glob64 __no_glob64_decl ++#include <glob.h> ++#undef glob64 ++ ++#define __glob __glob_lstat_compat ++ ++#define GLOB_ATTRIBUTE attribute_compat_text_section ++ ++/* Avoid calling gl_lstat with GLOB_ALTDIRFUNC. */ ++#define GLOB_NO_LSTAT ++ ++#include <posix/glob.c> ++ ++#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_27) ++compat_symbol (libc, __glob_lstat_compat, glob, GLIBC_2_0); ++#endif +diff --git a/sysdeps/gnu/glob64-lstat-compat.c b/sysdeps/gnu/glob64-lstat-compat.c +new file mode 100644 +index 0000000000..e237407e0b +--- /dev/null ++++ b/sysdeps/gnu/glob64-lstat-compat.c +@@ -0,0 +1,48 @@ ++/* Compat glob which does not use gl_lstat for GLOB_ALTDIRFUNC. ++ GNU version ++ Copyright (C) 2017-2018 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ <http://www.gnu.org/licenses/>. */ ++ ++#include <dirent.h> ++#include <glob.h> ++#include <sys/stat.h> ++#include <shlib-compat.h> ++ ++#define dirent dirent64 ++#define __readdir(dirp) __readdir64 (dirp) ++ ++#define glob_t glob64_t ++#define __glob __glob64_lstat_compat ++#define globfree globfree64 ++ ++#undef stat ++#define stat stat64 ++#undef __stat ++#define __stat(file, buf) __xstat64 (_STAT_VER, file, buf) ++ ++#define COMPILE_GLOB64 1 ++ ++#define GLOB_ATTRIBUTE attribute_compat_text_section ++ ++/* Avoid calling gl_lstat with GLOB_ALTDIRFUNC. */ ++#define GLOB_NO_LSTAT ++ ++#include <posix/glob.c> ++ ++#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_27) ++compat_symbol (libc, __glob64_lstat_compat, glob64, GLIBC_2_1); ++#endif +diff --git a/sysdeps/gnu/glob64.c b/sysdeps/gnu/glob64.c +index 52e97e2f6a..42b5b225ca 100644 +--- a/sysdeps/gnu/glob64.c ++++ b/sysdeps/gnu/glob64.c +@@ -6,8 +6,7 @@ + #define __readdir(dirp) __readdir64 (dirp) + + #define glob_t glob64_t +-#define glob(pattern, flags, errfunc, pglob) \ +- glob64 (pattern, flags, errfunc, pglob) ++#define __glob __glob64 + #define globfree(pglob) globfree64 (pglob) + + #undef stat +@@ -19,4 +18,6 @@ + + #include <posix/glob.c> + +-libc_hidden_def (glob64) ++libc_hidden_def (__glob64) ++versioned_symbol (libc, __glob64, glob64, GLIBC_2_27); ++libc_hidden_ver (__glob64, glob64) diff --git a/debian/patches/hurd-i386/git-hidden-def.diff b/debian/patches/hurd-i386/git-hidden-def.diff new file mode 100644 index 0000000..467da5d --- /dev/null +++ b/debian/patches/hurd-i386/git-hidden-def.diff @@ -0,0 +1,42 @@ +commit 4a5ce6e908c6b45d976fb78b65434b489dc570b6 +Author: Samuel Thibault <samuel.thiba...@ens-lyon.org> +Date: Sat Jan 6 18:18:49 2018 +0100 + + hurd: Fix build without NO_HIDDEN + + * sysdeps/i386/dl-tlsdesc.S (_dl_tlsdesc_dynamic) [NO_RTLD_HIDDEN]: Call + JUMPTARGET (___tls_get_addr) instead of HIDDEN_JUMPTARGET (___tls_get_addr). + * sysdeps/x86_64/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Likewise. + +diff --git a/sysdeps/i386/dl-tlsdesc.S b/sysdeps/i386/dl-tlsdesc.S +index 8c2c40b7ec..2c4764d1aa 100644 +--- a/sysdeps/i386/dl-tlsdesc.S ++++ b/sysdeps/i386/dl-tlsdesc.S +@@ -126,7 +126,11 @@ _dl_tlsdesc_dynamic: + .p2align 4,,7 + .Lslow: + cfi_adjust_cfa_offset (28) ++#ifdef NO_RTLD_HIDDEN ++ call JUMPTARGET (___tls_get_addr) ++#else + call HIDDEN_JUMPTARGET (___tls_get_addr) ++#endif + jmp .Lret + cfi_endproc + .size _dl_tlsdesc_dynamic, .-_dl_tlsdesc_dynamic +diff --git a/sysdeps/x86_64/dl-tlsdesc.S b/sysdeps/x86_64/dl-tlsdesc.S +index 6c4e6b6c91..437bd8cde7 100644 +--- a/sysdeps/x86_64/dl-tlsdesc.S ++++ b/sysdeps/x86_64/dl-tlsdesc.S +@@ -128,7 +128,11 @@ _dl_tlsdesc_dynamic: + movq %r10, 40(%rsp) + movq %r11, 48(%rsp) + /* %rdi already points to the tlsinfo data structure. */ ++#ifdef NO_RTLD_HIDDEN ++ call JUMPTARGET (__tls_get_addr) ++#else + call HIDDEN_JUMPTARGET (__tls_get_addr) ++#endif + movq 8(%rsp), %rdx + movq 16(%rsp), %rcx + movq 24(%rsp), %r8 diff --git a/debian/patches/hurd-i386/git-math-ulps-i386-update.diff b/debian/patches/hurd-i386/git-math-ulps-i386-update.diff new file mode 100644 index 0000000..633b841 --- /dev/null +++ b/debian/patches/hurd-i386/git-math-ulps-i386-update.diff @@ -0,0 +1,90 @@ +commit 107a35a5751586926dbc0fed4d044a34f79c084e +Author: Samuel Thibault <samuel.thiba...@ens-lyon.org> +Date: Sat Jan 6 22:09:42 2018 +0100 + + i386: Regenerate libm-test-ulps for for gcc 7 on i686 + + * sysdeps/i386/fpu/libm-test-ulps: Regenerated for GCC 7 with + "-O2 -march=i686". + +diff --git a/sysdeps/i386/fpu/libm-test-ulps b/sysdeps/i386/fpu/libm-test-ulps +index 93e12af4e5..862a74e09d 100644 +--- a/sysdeps/i386/fpu/libm-test-ulps ++++ b/sysdeps/i386/fpu/libm-test-ulps +@@ -935,10 +935,10 @@ ldouble: 1 + + Function: Real part of "ccosh_downward": + double: 1 +-float: 1 ++float: 2 + float128: 2 + idouble: 1 +-ifloat: 1 ++ifloat: 2 + ifloat128: 2 + ildouble: 3 + ldouble: 3 +@@ -1637,20 +1637,20 @@ ldouble: 1 + + Function: Real part of "ctan_downward": + double: 1 +-float: 1 ++float: 2 + float128: 4 + idouble: 1 +-ifloat: 1 ++ifloat: 2 + ifloat128: 4 + ildouble: 5 + ldouble: 5 + + Function: Imaginary part of "ctan_downward": + double: 2 +-float: 1 ++float: 2 + float128: 5 + idouble: 2 +-ifloat: 1 ++ifloat: 2 + ifloat128: 5 + ildouble: 4 + ldouble: 4 +@@ -2099,10 +2099,10 @@ ldouble: 4 + + Function: "j1": + double: 2 +-float: 1 ++float: 2 + float128: 4 + idouble: 2 +-ifloat: 1 ++ifloat: 2 + ifloat128: 4 + ildouble: 1 + ldouble: 1 +@@ -2643,10 +2643,10 @@ ldouble: 1 + + Function: "y0_downward": + double: 2 +-float: 2 ++float: 3 + float128: 4 + idouble: 2 +-ifloat: 2 ++ifloat: 3 + ifloat128: 4 + ildouble: 5 + ldouble: 5 +@@ -2723,10 +2723,10 @@ ldouble: 4 + + Function: "yn_downward": + double: 2 +-float: 2 ++float: 3 + float128: 5 + idouble: 2 +-ifloat: 2 ++ifloat: 3 + ifloat128: 5 + ildouble: 5 + ldouble: 5 diff --git a/debian/patches/hurd-i386/libpthread_build.diff b/debian/patches/hurd-i386/libpthread_build.diff index 45704a3..05631a4 100644 --- a/debian/patches/hurd-i386/libpthread_build.diff +++ b/debian/patches/hurd-i386/libpthread_build.diff @@ -1,8 +1,63 @@ ---- a/sysdeps/mach/hurd/Implies.orig 2015-08-20 21:22:34.000000000 +0000 -+++ b/sysdeps/mach/hurd/Implies 2015-08-20 21:22:48.000000000 +0000 -@@ -3,3 +3,5 @@ +Index: glibc-2.27/sysdeps/mach/hurd/Implies +=================================================================== +--- glibc-2.27.orig/sysdeps/mach/hurd/Implies ++++ glibc-2.27/sysdeps/mach/hurd/Implies +@@ -3,3 +3,9 @@ gnu # The Hurd provides a rough superset of the functionality of 4.4 BSD. unix/bsd -+# libpthread provides generic bits ++libpthread ++../libpthread/sysdeps/mach/hurd ++../libpthread/sysdeps/hurd ++../libpthread/sysdeps/mach ++../libpthread/sysdeps/posix +../libpthread/sysdeps/generic +Index: glibc-2.27/sysdeps/mach/hurd/i386/Implies +=================================================================== +--- glibc-2.27.orig/sysdeps/mach/hurd/i386/Implies ++++ glibc-2.27/sysdeps/mach/hurd/i386/Implies +@@ -1 +1,3 @@ + mach/hurd/x86 ++../libpthread/sysdeps/mach/hurd/i386 ++../libpthread/sysdeps/i386 +Index: glibc-2.27/sysdeps/mach/hurd/Subdirs +=================================================================== +--- glibc-2.27.orig/sysdeps/mach/hurd/Subdirs ++++ glibc-2.27/sysdeps/mach/hurd/Subdirs +@@ -7,3 +7,5 @@ + # way with more somewhat expensive `make' invocations. + + first hurd ++ ++libpthread +Index: glibc-2.27/libpthread/sysdeps/pthread/pthread-functions.h +=================================================================== +--- glibc-2.27.orig/libpthread/sysdeps/pthread/pthread-functions.h ++++ glibc-2.27/libpthread/sysdeps/pthread/pthread-functions.h +@@ -133,7 +133,7 @@ struct pthread_functions + extern struct pthread_functions __libc_pthread_functions attribute_hidden; + extern int __libc_pthread_functions_init attribute_hidden; + +-void __libc_pthread_init (const struct pthread_functions *functions) internal_function; ++void __libc_pthread_init (const struct pthread_functions *functions); + + # define PTHFCT_CALL(fct, params) \ + __libc_pthread_functions.fct params +Index: glibc-2.27/libpthread/libc_pthread_init.c +=================================================================== +--- glibc-2.27.orig/libpthread/libc_pthread_init.c ++++ glibc-2.27/libpthread/libc_pthread_init.c +@@ -21,7 +21,6 @@ + #include <pthread-functions.h> + + void +-internal_function + __libc_pthread_init (const struct pthread_functions *functions) + { + #ifdef SHARED +Index: glibc-2.27/sysdeps/libpthread/Makeconfig +=================================================================== +--- /dev/null ++++ glibc-2.27/sysdeps/libpthread/Makeconfig +@@ -0,0 +1 @@ ++include $(..)libpthread/Makeconfig diff --git a/debian/patches/hurd-i386/libpthread_includes.diff b/debian/patches/hurd-i386/libpthread_includes.diff new file mode 100644 index 0000000..8c7f050 --- /dev/null +++ b/debian/patches/hurd-i386/libpthread_includes.diff @@ -0,0 +1,2050 @@ +Index: glibc-2.27/libpthread/include/pthread/pthread.h +=================================================================== +--- glibc-2.27.orig/libpthread/include/pthread/pthread.h ++++ /dev/null +@@ -1,852 +0,0 @@ +-/* Copyright (C) 2000, 2002, 2005, 2006, 2007, 2008, 2009, 2010 +- 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. */ +- +-/* +- * POSIX Threads Extension: ??? <pthread.h> +- */ +- +-#ifndef _PTHREAD_H +-#define _PTHREAD_H 1 +- +-#include <features.h> +- +-#include <sys/cdefs.h> +-#ifndef __extern_inline +-/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 +- inline semantics, unless -fgnu89-inline is used. */ +-# if !defined __cplusplus || __GNUC_PREREQ (4,3) +-# if defined __GNUC_STDC_INLINE__ || defined __cplusplus +-# define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) +-# if __GNUC_PREREQ (4,3) +-# define __extern_always_inline \ +- extern __always_inline __attribute__ ((__gnu_inline__, __artificial__)) +-# else +-# define __extern_always_inline \ +- extern __always_inline __attribute__ ((__gnu_inline__)) +-# endif +-# else +-# define __extern_inline extern __inline +-# define __extern_always_inline extern __always_inline +-# endif +-# endif +-#endif +- +-#include <sched.h> +-#include <time.h> +- +-__BEGIN_DECLS +- +-#include <pthread/pthreadtypes.h> +- +-#include <bits/pthread.h> +- +-/* Possible values for the process shared attribute. */ +-#define PTHREAD_PROCESS_PRIVATE __PTHREAD_PROCESS_PRIVATE +-#define PTHREAD_PROCESS_SHARED __PTHREAD_PROCESS_SHARED +- +- +-/* Thread attributes. */ +- +-/* Possible values for the inheritsched attribute. */ +-#define PTHREAD_EXPLICIT_SCHED __PTHREAD_EXPLICIT_SCHED +-#define PTHREAD_INHERIT_SCHED __PTHREAD_INHERIT_SCHED +- +-/* Possible values for the `contentionscope' attribute. */ +-#define PTHREAD_SCOPE_SYSTEM __PTHREAD_SCOPE_SYSTEM +-#define PTHREAD_SCOPE_PROCESS __PTHREAD_SCOPE_PROCESS +- +-/* Possible values for the `detachstate' attribute. */ +-#define PTHREAD_CREATE_JOINABLE __PTHREAD_CREATE_JOINABLE +-#define PTHREAD_CREATE_DETACHED __PTHREAD_CREATE_DETACHED +- +-#include <bits/thread-attr.h> +- +-/* Initialize the thread attribute object in *ATTR to the default +- values. */ +-extern int pthread_attr_init (pthread_attr_t *__attr) __THROW __nonnull ((1)); +- +-/* Destroy the thread attribute object in *ATTR. */ +-extern int pthread_attr_destroy (pthread_attr_t *__attr) +- __THROW __nonnull ((1)); +- +- +-/* Return the value of the inheritsched attribute in *ATTR in +- *INHERITSCHED. */ +-extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict __attr, +- int *__restrict __inheritsched) +- __THROW __nonnull ((1, 2)); +- +-/* Set the value of the inheritsched attribute in *ATTR to +- INHERITSCHED. */ +-extern int pthread_attr_setinheritsched (pthread_attr_t *__attr, +- int __inheritsched) +- __THROW __nonnull ((1)); +- +- +-/* Return the value of the schedparam attribute in *ATTR in *PARAM. */ +-extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr, +- struct sched_param *__restrict __param) +- __THROW __nonnull ((1, 2)); +- +-/* Set the value of the schedparam attribute in *ATTR to PARAM. */ +-extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr, +- const struct sched_param *__restrict +- __param) __THROW __nonnull ((1, 2)); +- +- +-/* Return the value of the schedpolicy attribute in *ATTR to *POLICY. */ +-extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict __attr, +- int *__restrict __policy) +- __THROW __nonnull ((1, 2)); +- +-/* Set the value of the schedpolicy attribute in *ATTR to POLICY. */ +-extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, +- int __policy) +- __THROW __nonnull ((1)); +- +- +-/* Return the value of the contentionscope attribute in *ATTR in +- *CONTENTIONSCOPE. */ +-extern int pthread_attr_getscope (const pthread_attr_t *__restrict __attr, +- int *__restrict __contentionscope) +- __THROW __nonnull ((1, 2)); +- +-/* Set the value of the contentionscope attribute in *ATTR to +- CONTENTIONSCOPE. */ +-extern int pthread_attr_setscope (pthread_attr_t *__attr, +- int __contentionscope) +- __THROW __nonnull ((1)); +- +- +-/* Return the value of the stackaddr attribute in *ATTR in +- *STACKADDR. */ +-extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict __attr, +- void **__restrict __stackaddr) +- __THROW __nonnull ((1, 2)); +- +-/* Set the value of the stackaddr attribute in *ATTR to STACKADDR. */ +-extern int pthread_attr_setstackaddr (pthread_attr_t *__attr, +- void *__stackaddr) +- __THROW __nonnull ((1)); +- +- +-#ifdef __USE_XOPEN2K +-/* Return the value of the stackaddr and stacksize attributes in *ATTR +- in *STACKADDR and *STACKSIZE respectively. */ +-extern int pthread_attr_getstack (const pthread_attr_t *__restrict __attr, +- void **__restrict __stackaddr, +- size_t *__restrict __stacksize) +- __THROW __nonnull ((1, 2, 3)); +- +-/* Set the value of the stackaddr and stacksize attributes in *ATTR to +- STACKADDR and STACKSIZE respectively. */ +-extern int pthread_attr_setstack (pthread_attr_t *__attr, +- void *__stackaddr, +- size_t __stacksize) +- __THROW __nonnull ((1)); +-#endif +- +- +-/* Return the value of the detachstate attribute in *ATTR in +- *DETACHSTATE. */ +-extern int pthread_attr_getdetachstate (const pthread_attr_t *__attr, +- int *__detachstate) +- __THROW __nonnull ((1, 2)); +- +-/* Set the value of the detachstate attribute in *ATTR to +- DETACHSTATE. */ +-extern int pthread_attr_setdetachstate (pthread_attr_t *__attr, +- int __detachstate) +- __THROW __nonnull ((1)); +- +- +-/* Return the value of the guardsize attribute in *ATTR in +- *GUARDSIZE. */ +-extern int pthread_attr_getguardsize (const pthread_attr_t *__restrict __attr, +- size_t *__restrict __guardsize) +- __THROW __nonnull ((1, 2)); +- +-/* Set the value of the guardsize attribute in *ATTR to GUARDSIZE. */ +-extern int pthread_attr_setguardsize (pthread_attr_t *__attr, +- size_t __guardsize) +- __THROW __nonnull ((1)); +- +- +-/* Return the value of the stacksize attribute in *ATTR in +- *STACKSIZE. */ +-extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict __attr, +- size_t *__restrict __stacksize) +- __THROW __nonnull ((1, 2)); +- +-/* Set the value of the stacksize attribute in *ATTR to STACKSIZE. */ +-extern int pthread_attr_setstacksize (pthread_attr_t *__attr, +- size_t __stacksize) +- __THROW __nonnull ((1)); +- +-#ifdef __USE_GNU +-/* Initialize thread attribute *ATTR with attributes corresponding to the +- already running thread THREAD. It shall be called on an uninitialized ATTR +- and destroyed with pthread_attr_destroy when no longer needed. */ +-extern int pthread_getattr_np (pthread_t __thr, pthread_attr_t *__attr) +- __THROW __nonnull ((2)); +-#endif +- +- +-/* Create a thread with attributes given by ATTR, executing +- START_ROUTINE with argument ARG. */ +-extern int pthread_create (pthread_t *__restrict __threadp, +- __const pthread_attr_t *__restrict __attr, +- void *(*__start_routine)(void *), +- void *__restrict __arg) __THROWNL __nonnull ((1, 3)); +- +-/* Terminate the current thread and make STATUS available to any +- thread that might join us. */ +-extern void pthread_exit (void *__status) __attribute__ ((__noreturn__)); +- +-/* Make calling thread wait for termination of thread THREAD. Return +- the exit status of the thread in *STATUS. */ +-extern int pthread_join (pthread_t __threadp, void **__status); +- +-/* Indicate that the storage for THREAD can be reclaimed when it +- terminates. */ +-extern int pthread_detach (pthread_t __threadp); +- +-/* Compare thread IDs T1 and T2. Return nonzero if they are equal, 0 +- if they are not. */ +-extern int pthread_equal (pthread_t __t1, pthread_t __t2); +- +-# ifdef __USE_EXTERN_INLINES +- +-__extern_inline int +-pthread_equal (pthread_t __t1, pthread_t __t2) +-{ +- return __pthread_equal (__t1, __t2); +-} +- +-# endif /* Use extern inlines. */ +- +- +-/* Return the thread ID of the calling thread. */ +-extern pthread_t pthread_self (void) __THROW; +- +- +-/* Mutex attributes. */ +- +-#define PTHREAD_PRIO_NONE_NP __PTHREAD_PRIO_NONE +-#define PTHREAD_PRIO_INHERIT_NP __PTHREAD_PRIO_INHERIT +-#define PTHREAD_PRIO_PROTECT_NP __PTHREAD_PRIO_PROTECT +-#ifdef __USE_UNIX98 +-#define PTHREAD_PRIO_NONE PTHREAD_PRIO_NONE_NP +-#define PTHREAD_PRIO_INHERIT PTHREAD_PRIO_INHERIT_NP +-#define PTHREAD_PRIO_PROTECT PTHREAD_PRIO_PROTECT_NP +-#endif +- +-#define PTHREAD_MUTEX_TIMED_NP __PTHREAD_MUTEX_TIMED +-#define PTHREAD_MUTEX_ERRORCHECK_NP __PTHREAD_MUTEX_ERRORCHECK +-#define PTHREAD_MUTEX_RECURSIVE_NP __PTHREAD_MUTEX_RECURSIVE +-#if defined __USE_UNIX98 || defined __USE_XOPEN2K8 +-#define PTHREAD_MUTEX_NORMAL PTHREAD_MUTEX_TIMED_NP +-#define PTHREAD_MUTEX_ERRORCHECK PTHREAD_MUTEX_ERRORCHECK_NP +-#define PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP +-#define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL +-#endif +-#ifdef __USE_GNU +-/* For compatibility. */ +-#define PTHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_TIMED_NP +-#endif +- +-#ifdef __USE_XOPEN2K +-#define PTHREAD_MUTEX_STALLED __PTHREAD_MUTEX_STALLED +-#define PTHREAD_MUTEX_ROBUST __PTHREAD_MUTEX_ROBUST +-#endif +- +-#include <bits/mutex-attr.h> +- +-/* Initialize the mutex attribute object in *ATTR to the default +- values. */ +-extern int pthread_mutexattr_init(pthread_mutexattr_t *__attr) +- __THROW __nonnull ((1)); +- +-/* Destroy the mutex attribute structure in *ATTR. */ +-extern int pthread_mutexattr_destroy(pthread_mutexattr_t *__attr) +- __THROW __nonnull ((1)); +- +- +-#ifdef __USE_UNIX98 +-/* Return the value of the prioceiling attribute in *ATTR in +- *PRIOCEILING. */ +-extern int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *__restrict __attr, +- int *__restrict __prioceiling) +- __THROW __nonnull ((1, 2)); +- +-/* Set the value of the prioceiling attribute in *ATTR to +- PRIOCEILING. */ +-extern int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *__attr, +- int __prioceiling) +- __THROW __nonnull ((1)); +- +- +-/* Return the value of the protocol attribute in *ATTR in +- *PROTOCOL. */ +-extern int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *__restrict __attr, +- int *__restrict __protocol) +- __THROW __nonnull ((1, 2)); +- +-/* Set the value of the protocol attribute in *ATTR to PROTOCOL. */ +-extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t *__attr, +- int __protocol) +- __THROW __nonnull ((1)); +-#endif +- +- +-/* Return the value of the process shared attribute in *ATTR in +- *PSHARED. */ +-extern int pthread_mutexattr_getpshared(const pthread_mutexattr_t *__restrict __attr, +- int *__restrict __pshared) +- __THROW __nonnull ((1, 2)); +- +-/* Set the value of the process shared attribute in *ATTR to +- PSHARED. */ +-extern int pthread_mutexattr_setpshared(pthread_mutexattr_t *__attr, +- int __pshared) +- __THROW __nonnull ((1)); +- +- +-#if defined __USE_UNIX98 || defined __USE_XOPEN2K8 +-/* Return the value of the type attribute in *ATTR in *TYPE. */ +-extern int pthread_mutexattr_gettype(const pthread_mutexattr_t *__restrict __attr, +- int *__restrict __type) +- __THROW __nonnull ((1, 2)); +- +-/* Set the value of the type attribute in *ATTR to TYPE. */ +-extern int pthread_mutexattr_settype(pthread_mutexattr_t *__attr, +- int __type) +- __THROW __nonnull ((1)); +-#endif +- +- +-/* Mutexes. */ +- +-#include <bits/mutex.h> +- +-#define PTHREAD_MUTEX_INITIALIZER __PTHREAD_MUTEX_INITIALIZER +-/* Static initializer for recursive mutexes. */ +- +-#ifdef __USE_GNU +-# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ +- __PTHREAD_ERRORCHECK_MUTEX_INITIALIZER +-# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ +- __PTHREAD_RECURSIVE_MUTEX_INITIALIZER +-#endif +- +-/* Create a mutex with attributes given by ATTR and store it in +- *__MUTEX. */ +-extern int pthread_mutex_init (struct __pthread_mutex *__restrict __mutex, +- const pthread_mutexattr_t *__restrict __attr) +- __THROW __nonnull ((1)); +- +-/* Destroy the mutex __MUTEX. */ +-extern int pthread_mutex_destroy (struct __pthread_mutex *__mutex) +- __THROW __nonnull ((1)); +- +-/* Wait until lock for MUTEX becomes available and lock it. */ +-extern int pthread_mutex_lock (pthread_mutex_t *__mutex); +- +-/* Try to lock MUTEX. */ +-extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) +- __THROWNL __nonnull ((1)); +- +-#ifdef __USE_XOPEN2K +-/* Try to lock MUTEX, block until *ABSTIME if it is already held. */ +-extern int pthread_mutex_timedlock (struct __pthread_mutex *__restrict __mutex, +- const struct timespec *__restrict __abstime) +- __THROWNL __nonnull ((1, 2)); +-#endif +- +-/* Unlock MUTEX. */ +-extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) +- __THROWNL __nonnull ((1)); +- +-/* Transfer ownership of the mutex MUTEX to the thread TID. The +- caller must own the lock. */ +-extern int __pthread_mutex_transfer_np (struct __pthread_mutex *__mutex, +- pthread_t __tid) +- __THROWNL __nonnull ((1)); +- +- +-#ifdef __USE_UNIX98 +-/* Return the priority ceiling of mutex *MUTEX in *PRIOCEILING. */ +-extern int pthread_mutex_getprioceiling (const pthread_mutex_t *__restrict __mutex, +- int *__restrict __prioceiling) +- __THROW __nonnull ((1, 2)); +- +-/* After acquiring the mutex *MUTEX, set its priority ceiling to PRIO +- and return the old priority ceiling in *OLDPRIO. Before returning, +- release the mutex. */ +-extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex, +- int __prio, int *__restrict __oldprio) +- __THROW __nonnull ((1, 3)); +-#endif +- +-#ifdef __USE_XOPEN2K8 +- +-/* Declare the state protected by robust mutex MTXP as consistent. */ +-extern int pthread_mutex_consistent (pthread_mutex_t *__mtxp) +- __THROW __nonnull ((1)); +- +-# ifdef __USE_GNU +-extern int pthread_mutex_consistent_np (pthread_mutex_t *__mtxp) +- __THROW __nonnull ((1)); +-# endif +-#endif +- +- +- +-/* Condition attributes. */ +- +-#include <bits/condition-attr.h> +- +-/* Initialize the condition attribute in *ATTR to the default +- values. */ +-extern int pthread_condattr_init (pthread_condattr_t *__attr) +- __THROW __nonnull ((1)); +- +-/* Destroy the condition attribute structure in *ATTR. */ +-extern int pthread_condattr_destroy (pthread_condattr_t *__attr) +- __THROW __nonnull ((1)); +- +- +-#ifdef __USE_XOPEN2K +-/* Return the value of the clock attribute in *ATTR in *CLOCK_ID. */ +-extern int pthread_condattr_getclock (const pthread_condattr_t *__restrict __attr, +- __clockid_t *__restrict __clock_id) +- __THROW __nonnull ((1, 2)); +- +-/* Set the value of the clock attribute in *ATTR to CLOCK_ID. */ +-extern int pthread_condattr_setclock (pthread_condattr_t *__attr, +- __clockid_t __clock_id) +- __THROW __nonnull ((1)); +-#endif +- +- +-/* Return the value of the process shared attribute in *ATTR in +- *PSHARED. */ +-extern int pthread_condattr_getpshared (const pthread_condattr_t *__restrict __attr, +- int *__restrict __pshared) +- __THROW __nonnull ((1, 2)); +- +-/* Set the value of the process shared attribute in *ATTR to +- PSHARED. */ +-extern int pthread_condattr_setpshared (pthread_condattr_t *__attr, +- int __pshared) +- __THROW __nonnull ((1)); +- +- +-/* Condition variables. */ +- +-#include <bits/condition.h> +- +-#define PTHREAD_COND_INITIALIZER __PTHREAD_COND_INITIALIZER +- +-extern int pthread_cond_init (pthread_cond_t *__restrict __cond, +- const pthread_condattr_t *__restrict __attr) +- __THROW __nonnull ((1)); +- +-extern int pthread_cond_destroy (pthread_cond_t *__cond) +- __THROW __nonnull ((1)); +- +-/* Unblock at least one of the threads that are blocked on condition +- variable COND. */ +-extern int pthread_cond_signal (pthread_cond_t *__cond) +- __THROWNL __nonnull ((1)); +- +-/* Unblock all threads that are blocked on condition variable COND. */ +-extern int pthread_cond_broadcast (pthread_cond_t *__cond) +- __THROWNL __nonnull ((1)); +- +-/* Block on condition variable COND. MUTEX should be held by the +- calling thread. On success, MUTEX will be held by the calling +- thread. */ +-extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, +- pthread_mutex_t *__restrict __mutex) +- __nonnull ((1, 2)); +- +-/* Block on condition variable COND. MUTEX should be held by the +- calling thread. On success, MUTEX will be held by the calling +- thread. If the time specified by ABSTIME passes, ETIMEDOUT is +- returned, and MUTEX will nevertheless be held. */ +-extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, +- pthread_mutex_t *__restrict __mutex, +- __const struct timespec *__restrict __abstime) +- __nonnull ((1, 2, 3)); +- +- +-/* Spin locks. */ +- +-#ifdef __USE_XOPEN2K +- +-# include <bits/spin-lock.h> +- +-#define PTHREAD_SPINLOCK_INITIALIZER __PTHREAD_SPIN_LOCK_INITIALIZER +- +-/* Destroy the spin lock object LOCK. */ +-extern int pthread_spin_destroy (pthread_spinlock_t *__lock) +- __nonnull ((1)); +- +-/* Initialize the spin lock object LOCK. PSHARED determines whether +- the spin lock can be operated upon by multiple processes. */ +-extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared) +- __nonnull ((1)); +- +-/* Lock the spin lock object LOCK. If the lock is held by another +- thread spin until it becomes available. */ +-extern int pthread_spin_lock (pthread_spinlock_t *__lock) +- __nonnull ((1)); +- +-/* Lock the spin lock object LOCK. Fail if the lock is held by +- another thread. */ +-extern int pthread_spin_trylock (pthread_spinlock_t *__lock) +- __nonnull ((1)); +- +-/* Unlock the spin lock object LOCK. */ +-extern int pthread_spin_unlock (pthread_spinlock_t *__lock) +- __nonnull ((1)); +- +-# if defined __USE_EXTERN_INLINES && defined _LIBC +- +-# include <bits/spin-lock-inline.h> +- +-__extern_inline int +-pthread_spin_destroy (pthread_spinlock_t *__lock) +-{ +- return __pthread_spin_destroy (__lock); +-} +- +-__extern_inline int +-pthread_spin_init (pthread_spinlock_t *__lock, int __pshared) +-{ +- return __pthread_spin_init (__lock, __pshared); +-} +- +-__extern_inline int +-pthread_spin_lock (pthread_spinlock_t *__lock) +-{ +- return __pthread_spin_lock (__lock); +-} +- +-__extern_inline int +-pthread_spin_trylock (pthread_spinlock_t *__lock) +-{ +- return __pthread_spin_trylock (__lock); +-} +- +-__extern_inline int +-pthread_spin_unlock (pthread_spinlock_t *__lock) +-{ +- return __pthread_spin_unlock (__lock); +-} +- +-# endif /* Use extern inlines. */ +- +-#endif /* XPG6. */ +- +- +-/* rwlock attributes. */ +- +-#if defined __USE_UNIX98 || defined __USE_XOPEN2K +- +-#include <bits/rwlock-attr.h> +- +-/* Initialize rwlock attribute object in *ATTR to the default +- values. */ +-extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) +- __THROW __nonnull ((1)); +- +-/* Destroy the rwlock attribute object in *ATTR. */ +-extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) +- __THROW __nonnull ((1)); +- +- +-/* Return the value of the process shared attribute in *ATTR in +- *PSHARED. */ +-extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *__restrict __attr, +- int *__restrict __pshared) +- __THROW __nonnull ((1, 2)); +- +-/* Set the value of the process shared atrribute in *ATTR to +- PSHARED. */ +-extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr, +- int __pshared) +- __THROW __nonnull ((1)); +- +- +-/* rwlocks. */ +- +-#include <bits/rwlock.h> +- +-#define PTHREAD_RWLOCK_INITIALIZER __PTHREAD_RWLOCK_INITIALIZER +-/* Create a rwlock object with attributes given by ATTR and strore the +- result in *RWLOCK. */ +-extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock, +- const pthread_rwlockattr_t *__restrict __attr) +- __THROW __nonnull ((1)); +- +-/* Destroy the rwlock *RWLOCK. */ +-extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) +- __THROW __nonnull ((1)); +- +-/* Acquire the rwlock *RWLOCK for reading. */ +-extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) +- __THROWNL __nonnull ((1)); +- +-/* Acquire the rwlock *RWLOCK for reading. */ +-extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) +- __THROWNL __nonnull ((1)); +- +-# ifdef __USE_XOPEN2K +-/* Acquire the rwlock *RWLOCK for reading blocking until *ABSTIME if +- it is already held. */ +-extern int pthread_rwlock_timedrdlock (struct __pthread_rwlock *__restrict __rwlock, +- const struct timespec *__restrict __abstime) +- __THROWNL __nonnull ((1, 2)); +-# endif +- +-/* Acquire the rwlock *RWLOCK for writing. */ +-extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) +- __THROWNL __nonnull ((1)); +- +-/* Try to acquire the rwlock *RWLOCK for writing. */ +-extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) +- __THROWNL __nonnull ((1)); +- +-# ifdef __USE_XOPEN2K +-/* Acquire the rwlock *RWLOCK for writing blocking until *ABSTIME if +- it is already held. */ +-extern int pthread_rwlock_timedwrlock (struct __pthread_rwlock *__restrict __rwlock, +- const struct timespec *__restrict __abstime) +- __THROWNL __nonnull ((1, 2)); +-# endif +- +-/* Release the lock held by the current thread on *RWLOCK. */ +-extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) +- __THROWNL __nonnull ((1)); +- +-#endif /* __USE_UNIX98 || __USE_XOPEN2K */ +- +- +- +-/* Cancelation. */ +- +-/* Register a cleanup handler. */ +-extern void pthread_cleanup_push (void (*__routine) (void *), void *__arg); +- +-/* Unregister a cleanup handler. */ +-extern void pthread_cleanup_pop (int __execute); +- +-#include <bits/cancelation.h> +- +-#define pthread_cleanup_push(rt, rtarg) __pthread_cleanup_push(rt, rtarg) +-#define pthread_cleanup_pop(execute) __pthread_cleanup_pop(execute) +- +-#define PTHREAD_CANCEL_DISABLE 0 +-#define PTHREAD_CANCEL_ENABLE 1 +- +-/* Return the calling thread's cancelation state in *OLDSTATE and set +- its state to STATE. */ +-extern int pthread_setcancelstate (int __state, int *__oldstate); +- +-#define PTHREAD_CANCEL_DEFERRED 0 +-#define PTHREAD_CANCEL_ASYNCHRONOUS 1 +- +-/* Return the calling thread's cancelation type in *OLDTYPE and set +- its type to TYPE. */ +-extern int pthread_setcanceltype (int __type, int *__oldtype); +- +-/* Value returned by pthread_join if the target thread was +- canceled. */ +-#define PTHREAD_CANCELED ((void *) -1) +- +-/* Cancel THEAD. */ +-extern int pthread_cancel (pthread_t __thr); +- +-/* Add an explicit cancelation point. */ +-extern void pthread_testcancel (void); +- +- +-/* Barriers attributes. */ +- +-#ifdef __USE_XOPEN2K +- +-#include <bits/barrier-attr.h> +- +-/* Initialize barrier attribute object in *ATTR to the default +- values. */ +-extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr) +- __THROW __nonnull ((1)); +- +-/* Destroy the barrier attribute object in *ATTR. */ +-extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr) +- __THROW __nonnull ((1)); +- +- +-/* Return the value of the process shared attribute in *ATTR in +- *PSHARED. */ +-extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t *__restrict __attr, +- int *__restrict __pshared) +- __THROW __nonnull ((1, 2)); +- +-/* Set the value of the process shared atrribute in *ATTR to +- PSHARED. */ +-extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr, +- int __pshared) +- __THROW __nonnull ((1)); +- +- +-/* Barriers. */ +- +-#include <bits/barrier.h> +- +-/* Returned by pthread_barrier_wait to exactly one thread each time a +- barrier is passed. */ +-#define PTHREAD_BARRIER_SERIAL_THREAD -1 +- +-/* Initialize barrier BARRIER. */ +-extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier, +- const pthread_barrierattr_t *__restrict __attr, +- unsigned __count) +- __THROW __nonnull ((1)); +- +-/* Destroy barrier BARRIER. */ +-extern int pthread_barrier_destroy (pthread_barrier_t *__barrier) +- __THROW __nonnull ((1)); +- +-/* Wait on barrier BARRIER. */ +-extern int pthread_barrier_wait (pthread_barrier_t *__barrier) +- __THROWNL __nonnull ((1)); +- +-#endif /* __USE_XOPEN2K */ +- +- +- +-/* Thread specific data. */ +- +-#include <bits/thread-specific.h> +- +-/* Create a thread specific data key in KEY visible to all threads. +- On thread destruction, DESTRUCTOR shall be called with the thread +- specific data associate with KEY if it is not NULL. */ +-extern int pthread_key_create (pthread_key_t *__key, +- void (*__destructor) (void *)) +- __THROW __nonnull ((1)); +- +-/* Delete the thread specific data key KEY. The associated destructor +- function is not called. */ +-extern int pthread_key_delete (pthread_key_t __key) __THROW; +- +-/* Return the caller thread's thread specific value of KEY. */ +-extern void *pthread_getspecific (pthread_key_t __key) __THROW; +- +-/* Set the caller thread's thread specific value of KEY to VALUE. */ +-extern int pthread_setspecific (pthread_key_t __key, const void *__value) +- __THROW; +- +- +-/* Dynamic package initialization. */ +- +-#include <bits/once.h> +- +-#define PTHREAD_ONCE_INIT __PTHREAD_ONCE_INIT +- +-/* Call INIT_ROUTINE if this function has never been called with +- *ONCE_CONTROL, otherwise do nothing. */ +-extern int pthread_once (pthread_once_t *__once_control, +- void (*__init_routine) (void)) __nonnull ((1, 2)); +- +- +-/* Concurrency. */ +- +-#ifdef __USE_UNIX98 +-/* Set the desired concurrency level to NEW_LEVEL. */ +-extern int pthread_setconcurrency (int __new_level) __THROW; +- +-/* Get the current concurrency level. */ +-extern int pthread_getconcurrency (void) __THROW; +-#endif +- +- +-/* Forking. */ +- +-/* Register the function PREPARE to be run before the process forks, +- the function PARENT to be run after a fork in the parent and the +- function CHILD to be run in the child after the fork. If no +- handling is desired then any of PREPARE, PARENT and CHILD may be +- NULL. The prepare handles will be called in the reverse order +- which they were registered and the parent and child handlers in the +- order in which they were registered. */ +-extern int pthread_atfork (void (*__prepare) (void), void (*__parent) (void), +- void (*__child) (void)) __THROW; +- +- +-/* Signals (should be in <signal.h>). */ +- +-/* Send signal SIGNO to thread THREAD. */ +-extern int pthread_kill (pthread_t __thr, int __signo) __THROW; +- +- +-/* Time. */ +- +-#ifdef __USE_XOPEN2K +-/* Return the thread cpu clock. */ +-extern int pthread_getcpuclockid (pthread_t __thr, __clockid_t *__clock) +- __THROW __nonnull ((2)); +-#endif +- +- +-/* Scheduling. */ +- +-/* Return thread THREAD's scheduling paramters. */ +-extern int pthread_getschedparam (pthread_t __thr, int *__restrict __policy, +- struct sched_param *__restrict __param) +- __THROW __nonnull ((2, 3)); +- +-/* Set thread THREAD's scheduling paramters. */ +-extern int pthread_setschedparam (pthread_t __thr, int __policy, +- const struct sched_param *__param) +- __THROW __nonnull ((3)); +- +-/* Set thread THREAD's scheduling priority. */ +-extern int pthread_setschedprio (pthread_t __thr, int __prio) __THROW; +- +-#ifdef __USE_GNU +-/* Yield the processor to another thread or process. +- This function is similar to the POSIX `sched_yield' function but +- might be differently implemented in the case of a m-on-n thread +- implementation. */ +-extern int pthread_yield (void) __THROW; +-#endif +- +- +-/* Kernel-specific interfaces. */ +- +-#include <bits/pthread-np.h> +- +- +-__END_DECLS +- +-#endif /* pthread.h */ +Index: glibc-2.27/libpthread/include/pthread/pthreadtypes.h +=================================================================== +--- glibc-2.27.orig/libpthread/include/pthread/pthreadtypes.h ++++ /dev/null +@@ -1,131 +0,0 @@ +-/* Copyright (C) 2000, 2002, 2005, 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. */ +- +-/* +- * POSIX Threads Extension: ??? <pthreadtypes.h> +- */ +- +-#ifndef _PTHREADTYPES_H +-#define _PTHREADTYPES_H 1 +- +-#include <features.h> +- +-#include <bits/types.h> +- +-__BEGIN_DECLS +- +-#include <bits/pthread.h> +-typedef __pthread_t pthread_t; +- +-/* Possible values for the process shared attribute. */ +-enum __pthread_process_shared +- { +- __PTHREAD_PROCESS_PRIVATE = 0, +- __PTHREAD_PROCESS_SHARED +- }; +- +-/* Possible values for the inheritsched attribute. */ +-enum __pthread_inheritsched +- { +- __PTHREAD_EXPLICIT_SCHED = 0, +- __PTHREAD_INHERIT_SCHED +- }; +- +-/* Possible values for the `contentionscope' attribute. */ +-enum __pthread_contentionscope +- { +- __PTHREAD_SCOPE_SYSTEM = 0, +- __PTHREAD_SCOPE_PROCESS +- }; +- +-/* Possible values for the `detachstate' attribute. */ +-enum __pthread_detachstate +- { +- __PTHREAD_CREATE_JOINABLE = 0, +- __PTHREAD_CREATE_DETACHED +- }; +- +-#include <bits/thread-attr.h> +-typedef struct __pthread_attr pthread_attr_t; +- +-enum __pthread_mutex_protocol +- { +- __PTHREAD_PRIO_NONE= 0, +- __PTHREAD_PRIO_INHERIT, +- __PTHREAD_PRIO_PROTECT +- }; +- +-enum __pthread_mutex_type +- { +- __PTHREAD_MUTEX_TIMED, +- __PTHREAD_MUTEX_ERRORCHECK, +- __PTHREAD_MUTEX_RECURSIVE +- }; +- +-enum __pthread_mutex_robustness +- { +- __PTHREAD_MUTEX_STALLED, +- __PTHREAD_MUTEX_ROBUST = 0x100 +- }; +- +-#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 */ +Index: glibc-2.27/libpthread/sysdeps/generic/pthread/pthread.h +=================================================================== +--- /dev/null ++++ glibc-2.27/libpthread/sysdeps/generic/pthread/pthread.h +@@ -0,0 +1,852 @@ ++/* Copyright (C) 2000, 2002, 2005, 2006, 2007, 2008, 2009, 2010 ++ 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. */ ++ ++/* ++ * POSIX Threads Extension: ??? <pthread.h> ++ */ ++ ++#ifndef _PTHREAD_H ++#define _PTHREAD_H 1 ++ ++#include <features.h> ++ ++#include <sys/cdefs.h> ++#ifndef __extern_inline ++/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 ++ inline semantics, unless -fgnu89-inline is used. */ ++# if !defined __cplusplus || __GNUC_PREREQ (4,3) ++# if defined __GNUC_STDC_INLINE__ || defined __cplusplus ++# define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) ++# if __GNUC_PREREQ (4,3) ++# define __extern_always_inline \ ++ extern __always_inline __attribute__ ((__gnu_inline__, __artificial__)) ++# else ++# define __extern_always_inline \ ++ extern __always_inline __attribute__ ((__gnu_inline__)) ++# endif ++# else ++# define __extern_inline extern __inline ++# define __extern_always_inline extern __always_inline ++# endif ++# endif ++#endif ++ ++#include <sched.h> ++#include <time.h> ++ ++__BEGIN_DECLS ++ ++#include <pthread/pthreadtypes.h> ++ ++#include <bits/pthread.h> ++ ++/* Possible values for the process shared attribute. */ ++#define PTHREAD_PROCESS_PRIVATE __PTHREAD_PROCESS_PRIVATE ++#define PTHREAD_PROCESS_SHARED __PTHREAD_PROCESS_SHARED ++ ++ ++/* Thread attributes. */ ++ ++/* Possible values for the inheritsched attribute. */ ++#define PTHREAD_EXPLICIT_SCHED __PTHREAD_EXPLICIT_SCHED ++#define PTHREAD_INHERIT_SCHED __PTHREAD_INHERIT_SCHED ++ ++/* Possible values for the `contentionscope' attribute. */ ++#define PTHREAD_SCOPE_SYSTEM __PTHREAD_SCOPE_SYSTEM ++#define PTHREAD_SCOPE_PROCESS __PTHREAD_SCOPE_PROCESS ++ ++/* Possible values for the `detachstate' attribute. */ ++#define PTHREAD_CREATE_JOINABLE __PTHREAD_CREATE_JOINABLE ++#define PTHREAD_CREATE_DETACHED __PTHREAD_CREATE_DETACHED ++ ++#include <bits/thread-attr.h> ++ ++/* Initialize the thread attribute object in *ATTR to the default ++ values. */ ++extern int pthread_attr_init (pthread_attr_t *__attr) __THROW __nonnull ((1)); ++ ++/* Destroy the thread attribute object in *ATTR. */ ++extern int pthread_attr_destroy (pthread_attr_t *__attr) ++ __THROW __nonnull ((1)); ++ ++ ++/* Return the value of the inheritsched attribute in *ATTR in ++ *INHERITSCHED. */ ++extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict __attr, ++ int *__restrict __inheritsched) ++ __THROW __nonnull ((1, 2)); ++ ++/* Set the value of the inheritsched attribute in *ATTR to ++ INHERITSCHED. */ ++extern int pthread_attr_setinheritsched (pthread_attr_t *__attr, ++ int __inheritsched) ++ __THROW __nonnull ((1)); ++ ++ ++/* Return the value of the schedparam attribute in *ATTR in *PARAM. */ ++extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr, ++ struct sched_param *__restrict __param) ++ __THROW __nonnull ((1, 2)); ++ ++/* Set the value of the schedparam attribute in *ATTR to PARAM. */ ++extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr, ++ const struct sched_param *__restrict ++ __param) __THROW __nonnull ((1, 2)); ++ ++ ++/* Return the value of the schedpolicy attribute in *ATTR to *POLICY. */ ++extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict __attr, ++ int *__restrict __policy) ++ __THROW __nonnull ((1, 2)); ++ ++/* Set the value of the schedpolicy attribute in *ATTR to POLICY. */ ++extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, ++ int __policy) ++ __THROW __nonnull ((1)); ++ ++ ++/* Return the value of the contentionscope attribute in *ATTR in ++ *CONTENTIONSCOPE. */ ++extern int pthread_attr_getscope (const pthread_attr_t *__restrict __attr, ++ int *__restrict __contentionscope) ++ __THROW __nonnull ((1, 2)); ++ ++/* Set the value of the contentionscope attribute in *ATTR to ++ CONTENTIONSCOPE. */ ++extern int pthread_attr_setscope (pthread_attr_t *__attr, ++ int __contentionscope) ++ __THROW __nonnull ((1)); ++ ++ ++/* Return the value of the stackaddr attribute in *ATTR in ++ *STACKADDR. */ ++extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict __attr, ++ void **__restrict __stackaddr) ++ __THROW __nonnull ((1, 2)); ++ ++/* Set the value of the stackaddr attribute in *ATTR to STACKADDR. */ ++extern int pthread_attr_setstackaddr (pthread_attr_t *__attr, ++ void *__stackaddr) ++ __THROW __nonnull ((1)); ++ ++ ++#ifdef __USE_XOPEN2K ++/* Return the value of the stackaddr and stacksize attributes in *ATTR ++ in *STACKADDR and *STACKSIZE respectively. */ ++extern int pthread_attr_getstack (const pthread_attr_t *__restrict __attr, ++ void **__restrict __stackaddr, ++ size_t *__restrict __stacksize) ++ __THROW __nonnull ((1, 2, 3)); ++ ++/* Set the value of the stackaddr and stacksize attributes in *ATTR to ++ STACKADDR and STACKSIZE respectively. */ ++extern int pthread_attr_setstack (pthread_attr_t *__attr, ++ void *__stackaddr, ++ size_t __stacksize) ++ __THROW __nonnull ((1)); ++#endif ++ ++ ++/* Return the value of the detachstate attribute in *ATTR in ++ *DETACHSTATE. */ ++extern int pthread_attr_getdetachstate (const pthread_attr_t *__attr, ++ int *__detachstate) ++ __THROW __nonnull ((1, 2)); ++ ++/* Set the value of the detachstate attribute in *ATTR to ++ DETACHSTATE. */ ++extern int pthread_attr_setdetachstate (pthread_attr_t *__attr, ++ int __detachstate) ++ __THROW __nonnull ((1)); ++ ++ ++/* Return the value of the guardsize attribute in *ATTR in ++ *GUARDSIZE. */ ++extern int pthread_attr_getguardsize (const pthread_attr_t *__restrict __attr, ++ size_t *__restrict __guardsize) ++ __THROW __nonnull ((1, 2)); ++ ++/* Set the value of the guardsize attribute in *ATTR to GUARDSIZE. */ ++extern int pthread_attr_setguardsize (pthread_attr_t *__attr, ++ size_t __guardsize) ++ __THROW __nonnull ((1)); ++ ++ ++/* Return the value of the stacksize attribute in *ATTR in ++ *STACKSIZE. */ ++extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict __attr, ++ size_t *__restrict __stacksize) ++ __THROW __nonnull ((1, 2)); ++ ++/* Set the value of the stacksize attribute in *ATTR to STACKSIZE. */ ++extern int pthread_attr_setstacksize (pthread_attr_t *__attr, ++ size_t __stacksize) ++ __THROW __nonnull ((1)); ++ ++#ifdef __USE_GNU ++/* Initialize thread attribute *ATTR with attributes corresponding to the ++ already running thread THREAD. It shall be called on an uninitialized ATTR ++ and destroyed with pthread_attr_destroy when no longer needed. */ ++extern int pthread_getattr_np (pthread_t __thr, pthread_attr_t *__attr) ++ __THROW __nonnull ((2)); ++#endif ++ ++ ++/* Create a thread with attributes given by ATTR, executing ++ START_ROUTINE with argument ARG. */ ++extern int pthread_create (pthread_t *__restrict __threadp, ++ __const pthread_attr_t *__restrict __attr, ++ void *(*__start_routine)(void *), ++ void *__restrict __arg) __THROWNL __nonnull ((1, 3)); ++ ++/* Terminate the current thread and make STATUS available to any ++ thread that might join us. */ ++extern void pthread_exit (void *__status) __attribute__ ((__noreturn__)); ++ ++/* Make calling thread wait for termination of thread THREAD. Return ++ the exit status of the thread in *STATUS. */ ++extern int pthread_join (pthread_t __threadp, void **__status); ++ ++/* Indicate that the storage for THREAD can be reclaimed when it ++ terminates. */ ++extern int pthread_detach (pthread_t __threadp); ++ ++/* Compare thread IDs T1 and T2. Return nonzero if they are equal, 0 ++ if they are not. */ ++extern int pthread_equal (pthread_t __t1, pthread_t __t2); ++ ++# ifdef __USE_EXTERN_INLINES ++ ++__extern_inline int ++pthread_equal (pthread_t __t1, pthread_t __t2) ++{ ++ return __pthread_equal (__t1, __t2); ++} ++ ++# endif /* Use extern inlines. */ ++ ++ ++/* Return the thread ID of the calling thread. */ ++extern pthread_t pthread_self (void) __THROW; ++ ++ ++/* Mutex attributes. */ ++ ++#define PTHREAD_PRIO_NONE_NP __PTHREAD_PRIO_NONE ++#define PTHREAD_PRIO_INHERIT_NP __PTHREAD_PRIO_INHERIT ++#define PTHREAD_PRIO_PROTECT_NP __PTHREAD_PRIO_PROTECT ++#ifdef __USE_UNIX98 ++#define PTHREAD_PRIO_NONE PTHREAD_PRIO_NONE_NP ++#define PTHREAD_PRIO_INHERIT PTHREAD_PRIO_INHERIT_NP ++#define PTHREAD_PRIO_PROTECT PTHREAD_PRIO_PROTECT_NP ++#endif ++ ++#define PTHREAD_MUTEX_TIMED_NP __PTHREAD_MUTEX_TIMED ++#define PTHREAD_MUTEX_ERRORCHECK_NP __PTHREAD_MUTEX_ERRORCHECK ++#define PTHREAD_MUTEX_RECURSIVE_NP __PTHREAD_MUTEX_RECURSIVE ++#if defined __USE_UNIX98 || defined __USE_XOPEN2K8 ++#define PTHREAD_MUTEX_NORMAL PTHREAD_MUTEX_TIMED_NP ++#define PTHREAD_MUTEX_ERRORCHECK PTHREAD_MUTEX_ERRORCHECK_NP ++#define PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP ++#define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL ++#endif ++#ifdef __USE_GNU ++/* For compatibility. */ ++#define PTHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_TIMED_NP ++#endif ++ ++#ifdef __USE_XOPEN2K ++#define PTHREAD_MUTEX_STALLED __PTHREAD_MUTEX_STALLED ++#define PTHREAD_MUTEX_ROBUST __PTHREAD_MUTEX_ROBUST ++#endif ++ ++#include <bits/mutex-attr.h> ++ ++/* Initialize the mutex attribute object in *ATTR to the default ++ values. */ ++extern int pthread_mutexattr_init(pthread_mutexattr_t *__attr) ++ __THROW __nonnull ((1)); ++ ++/* Destroy the mutex attribute structure in *ATTR. */ ++extern int pthread_mutexattr_destroy(pthread_mutexattr_t *__attr) ++ __THROW __nonnull ((1)); ++ ++ ++#ifdef __USE_UNIX98 ++/* Return the value of the prioceiling attribute in *ATTR in ++ *PRIOCEILING. */ ++extern int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *__restrict __attr, ++ int *__restrict __prioceiling) ++ __THROW __nonnull ((1, 2)); ++ ++/* Set the value of the prioceiling attribute in *ATTR to ++ PRIOCEILING. */ ++extern int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *__attr, ++ int __prioceiling) ++ __THROW __nonnull ((1)); ++ ++ ++/* Return the value of the protocol attribute in *ATTR in ++ *PROTOCOL. */ ++extern int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *__restrict __attr, ++ int *__restrict __protocol) ++ __THROW __nonnull ((1, 2)); ++ ++/* Set the value of the protocol attribute in *ATTR to PROTOCOL. */ ++extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t *__attr, ++ int __protocol) ++ __THROW __nonnull ((1)); ++#endif ++ ++ ++/* Return the value of the process shared attribute in *ATTR in ++ *PSHARED. */ ++extern int pthread_mutexattr_getpshared(const pthread_mutexattr_t *__restrict __attr, ++ int *__restrict __pshared) ++ __THROW __nonnull ((1, 2)); ++ ++/* Set the value of the process shared attribute in *ATTR to ++ PSHARED. */ ++extern int pthread_mutexattr_setpshared(pthread_mutexattr_t *__attr, ++ int __pshared) ++ __THROW __nonnull ((1)); ++ ++ ++#if defined __USE_UNIX98 || defined __USE_XOPEN2K8 ++/* Return the value of the type attribute in *ATTR in *TYPE. */ ++extern int pthread_mutexattr_gettype(const pthread_mutexattr_t *__restrict __attr, ++ int *__restrict __type) ++ __THROW __nonnull ((1, 2)); ++ ++/* Set the value of the type attribute in *ATTR to TYPE. */ ++extern int pthread_mutexattr_settype(pthread_mutexattr_t *__attr, ++ int __type) ++ __THROW __nonnull ((1)); ++#endif ++ ++ ++/* Mutexes. */ ++ ++#include <bits/mutex.h> ++ ++#define PTHREAD_MUTEX_INITIALIZER __PTHREAD_MUTEX_INITIALIZER ++/* Static initializer for recursive mutexes. */ ++ ++#ifdef __USE_GNU ++# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ ++ __PTHREAD_ERRORCHECK_MUTEX_INITIALIZER ++# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ ++ __PTHREAD_RECURSIVE_MUTEX_INITIALIZER ++#endif ++ ++/* Create a mutex with attributes given by ATTR and store it in ++ *__MUTEX. */ ++extern int pthread_mutex_init (struct __pthread_mutex *__restrict __mutex, ++ const pthread_mutexattr_t *__restrict __attr) ++ __THROW __nonnull ((1)); ++ ++/* Destroy the mutex __MUTEX. */ ++extern int pthread_mutex_destroy (struct __pthread_mutex *__mutex) ++ __THROW __nonnull ((1)); ++ ++/* Wait until lock for MUTEX becomes available and lock it. */ ++extern int pthread_mutex_lock (pthread_mutex_t *__mutex); ++ ++/* Try to lock MUTEX. */ ++extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) ++ __THROWNL __nonnull ((1)); ++ ++#ifdef __USE_XOPEN2K ++/* Try to lock MUTEX, block until *ABSTIME if it is already held. */ ++extern int pthread_mutex_timedlock (struct __pthread_mutex *__restrict __mutex, ++ const struct timespec *__restrict __abstime) ++ __THROWNL __nonnull ((1, 2)); ++#endif ++ ++/* Unlock MUTEX. */ ++extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) ++ __THROWNL __nonnull ((1)); ++ ++/* Transfer ownership of the mutex MUTEX to the thread TID. The ++ caller must own the lock. */ ++extern int __pthread_mutex_transfer_np (struct __pthread_mutex *__mutex, ++ pthread_t __tid) ++ __THROWNL __nonnull ((1)); ++ ++ ++#ifdef __USE_UNIX98 ++/* Return the priority ceiling of mutex *MUTEX in *PRIOCEILING. */ ++extern int pthread_mutex_getprioceiling (const pthread_mutex_t *__restrict __mutex, ++ int *__restrict __prioceiling) ++ __THROW __nonnull ((1, 2)); ++ ++/* After acquiring the mutex *MUTEX, set its priority ceiling to PRIO ++ and return the old priority ceiling in *OLDPRIO. Before returning, ++ release the mutex. */ ++extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex, ++ int __prio, int *__restrict __oldprio) ++ __THROW __nonnull ((1, 3)); ++#endif ++ ++#ifdef __USE_XOPEN2K8 ++ ++/* Declare the state protected by robust mutex MTXP as consistent. */ ++extern int pthread_mutex_consistent (pthread_mutex_t *__mtxp) ++ __THROW __nonnull ((1)); ++ ++# ifdef __USE_GNU ++extern int pthread_mutex_consistent_np (pthread_mutex_t *__mtxp) ++ __THROW __nonnull ((1)); ++# endif ++#endif ++ ++ ++ ++/* Condition attributes. */ ++ ++#include <bits/condition-attr.h> ++ ++/* Initialize the condition attribute in *ATTR to the default ++ values. */ ++extern int pthread_condattr_init (pthread_condattr_t *__attr) ++ __THROW __nonnull ((1)); ++ ++/* Destroy the condition attribute structure in *ATTR. */ ++extern int pthread_condattr_destroy (pthread_condattr_t *__attr) ++ __THROW __nonnull ((1)); ++ ++ ++#ifdef __USE_XOPEN2K ++/* Return the value of the clock attribute in *ATTR in *CLOCK_ID. */ ++extern int pthread_condattr_getclock (const pthread_condattr_t *__restrict __attr, ++ __clockid_t *__restrict __clock_id) ++ __THROW __nonnull ((1, 2)); ++ ++/* Set the value of the clock attribute in *ATTR to CLOCK_ID. */ ++extern int pthread_condattr_setclock (pthread_condattr_t *__attr, ++ __clockid_t __clock_id) ++ __THROW __nonnull ((1)); ++#endif ++ ++ ++/* Return the value of the process shared attribute in *ATTR in ++ *PSHARED. */ ++extern int pthread_condattr_getpshared (const pthread_condattr_t *__restrict __attr, ++ int *__restrict __pshared) ++ __THROW __nonnull ((1, 2)); ++ ++/* Set the value of the process shared attribute in *ATTR to ++ PSHARED. */ ++extern int pthread_condattr_setpshared (pthread_condattr_t *__attr, ++ int __pshared) ++ __THROW __nonnull ((1)); ++ ++ ++/* Condition variables. */ ++ ++#include <bits/condition.h> ++ ++#define PTHREAD_COND_INITIALIZER __PTHREAD_COND_INITIALIZER ++ ++extern int pthread_cond_init (pthread_cond_t *__restrict __cond, ++ const pthread_condattr_t *__restrict __attr) ++ __THROW __nonnull ((1)); ++ ++extern int pthread_cond_destroy (pthread_cond_t *__cond) ++ __THROW __nonnull ((1)); ++ ++/* Unblock at least one of the threads that are blocked on condition ++ variable COND. */ ++extern int pthread_cond_signal (pthread_cond_t *__cond) ++ __THROWNL __nonnull ((1)); ++ ++/* Unblock all threads that are blocked on condition variable COND. */ ++extern int pthread_cond_broadcast (pthread_cond_t *__cond) ++ __THROWNL __nonnull ((1)); ++ ++/* Block on condition variable COND. MUTEX should be held by the ++ calling thread. On success, MUTEX will be held by the calling ++ thread. */ ++extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, ++ pthread_mutex_t *__restrict __mutex) ++ __nonnull ((1, 2)); ++ ++/* Block on condition variable COND. MUTEX should be held by the ++ calling thread. On success, MUTEX will be held by the calling ++ thread. If the time specified by ABSTIME passes, ETIMEDOUT is ++ returned, and MUTEX will nevertheless be held. */ ++extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, ++ pthread_mutex_t *__restrict __mutex, ++ __const struct timespec *__restrict __abstime) ++ __nonnull ((1, 2, 3)); ++ ++ ++/* Spin locks. */ ++ ++#ifdef __USE_XOPEN2K ++ ++# include <bits/spin-lock.h> ++ ++#define PTHREAD_SPINLOCK_INITIALIZER __PTHREAD_SPIN_LOCK_INITIALIZER ++ ++/* Destroy the spin lock object LOCK. */ ++extern int pthread_spin_destroy (pthread_spinlock_t *__lock) ++ __nonnull ((1)); ++ ++/* Initialize the spin lock object LOCK. PSHARED determines whether ++ the spin lock can be operated upon by multiple processes. */ ++extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared) ++ __nonnull ((1)); ++ ++/* Lock the spin lock object LOCK. If the lock is held by another ++ thread spin until it becomes available. */ ++extern int pthread_spin_lock (pthread_spinlock_t *__lock) ++ __nonnull ((1)); ++ ++/* Lock the spin lock object LOCK. Fail if the lock is held by ++ another thread. */ ++extern int pthread_spin_trylock (pthread_spinlock_t *__lock) ++ __nonnull ((1)); ++ ++/* Unlock the spin lock object LOCK. */ ++extern int pthread_spin_unlock (pthread_spinlock_t *__lock) ++ __nonnull ((1)); ++ ++# if defined __USE_EXTERN_INLINES && defined _LIBC ++ ++# include <bits/spin-lock-inline.h> ++ ++__extern_inline int ++pthread_spin_destroy (pthread_spinlock_t *__lock) ++{ ++ return __pthread_spin_destroy (__lock); ++} ++ ++__extern_inline int ++pthread_spin_init (pthread_spinlock_t *__lock, int __pshared) ++{ ++ return __pthread_spin_init (__lock, __pshared); ++} ++ ++__extern_inline int ++pthread_spin_lock (pthread_spinlock_t *__lock) ++{ ++ return __pthread_spin_lock (__lock); ++} ++ ++__extern_inline int ++pthread_spin_trylock (pthread_spinlock_t *__lock) ++{ ++ return __pthread_spin_trylock (__lock); ++} ++ ++__extern_inline int ++pthread_spin_unlock (pthread_spinlock_t *__lock) ++{ ++ return __pthread_spin_unlock (__lock); ++} ++ ++# endif /* Use extern inlines. */ ++ ++#endif /* XPG6. */ ++ ++ ++/* rwlock attributes. */ ++ ++#if defined __USE_UNIX98 || defined __USE_XOPEN2K ++ ++#include <bits/rwlock-attr.h> ++ ++/* Initialize rwlock attribute object in *ATTR to the default ++ values. */ ++extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) ++ __THROW __nonnull ((1)); ++ ++/* Destroy the rwlock attribute object in *ATTR. */ ++extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) ++ __THROW __nonnull ((1)); ++ ++ ++/* Return the value of the process shared attribute in *ATTR in ++ *PSHARED. */ ++extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *__restrict __attr, ++ int *__restrict __pshared) ++ __THROW __nonnull ((1, 2)); ++ ++/* Set the value of the process shared atrribute in *ATTR to ++ PSHARED. */ ++extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr, ++ int __pshared) ++ __THROW __nonnull ((1)); ++ ++ ++/* rwlocks. */ ++ ++#include <bits/rwlock.h> ++ ++#define PTHREAD_RWLOCK_INITIALIZER __PTHREAD_RWLOCK_INITIALIZER ++/* Create a rwlock object with attributes given by ATTR and strore the ++ result in *RWLOCK. */ ++extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock, ++ const pthread_rwlockattr_t *__restrict __attr) ++ __THROW __nonnull ((1)); ++ ++/* Destroy the rwlock *RWLOCK. */ ++extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) ++ __THROW __nonnull ((1)); ++ ++/* Acquire the rwlock *RWLOCK for reading. */ ++extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) ++ __THROWNL __nonnull ((1)); ++ ++/* Acquire the rwlock *RWLOCK for reading. */ ++extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) ++ __THROWNL __nonnull ((1)); ++ ++# ifdef __USE_XOPEN2K ++/* Acquire the rwlock *RWLOCK for reading blocking until *ABSTIME if ++ it is already held. */ ++extern int pthread_rwlock_timedrdlock (struct __pthread_rwlock *__restrict __rwlock, ++ const struct timespec *__restrict __abstime) ++ __THROWNL __nonnull ((1, 2)); ++# endif ++ ++/* Acquire the rwlock *RWLOCK for writing. */ ++extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) ++ __THROWNL __nonnull ((1)); ++ ++/* Try to acquire the rwlock *RWLOCK for writing. */ ++extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) ++ __THROWNL __nonnull ((1)); ++ ++# ifdef __USE_XOPEN2K ++/* Acquire the rwlock *RWLOCK for writing blocking until *ABSTIME if ++ it is already held. */ ++extern int pthread_rwlock_timedwrlock (struct __pthread_rwlock *__restrict __rwlock, ++ const struct timespec *__restrict __abstime) ++ __THROWNL __nonnull ((1, 2)); ++# endif ++ ++/* Release the lock held by the current thread on *RWLOCK. */ ++extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) ++ __THROWNL __nonnull ((1)); ++ ++#endif /* __USE_UNIX98 || __USE_XOPEN2K */ ++ ++ ++ ++/* Cancelation. */ ++ ++/* Register a cleanup handler. */ ++extern void pthread_cleanup_push (void (*__routine) (void *), void *__arg); ++ ++/* Unregister a cleanup handler. */ ++extern void pthread_cleanup_pop (int __execute); ++ ++#include <bits/cancelation.h> ++ ++#define pthread_cleanup_push(rt, rtarg) __pthread_cleanup_push(rt, rtarg) ++#define pthread_cleanup_pop(execute) __pthread_cleanup_pop(execute) ++ ++#define PTHREAD_CANCEL_DISABLE 0 ++#define PTHREAD_CANCEL_ENABLE 1 ++ ++/* Return the calling thread's cancelation state in *OLDSTATE and set ++ its state to STATE. */ ++extern int pthread_setcancelstate (int __state, int *__oldstate); ++ ++#define PTHREAD_CANCEL_DEFERRED 0 ++#define PTHREAD_CANCEL_ASYNCHRONOUS 1 ++ ++/* Return the calling thread's cancelation type in *OLDTYPE and set ++ its type to TYPE. */ ++extern int pthread_setcanceltype (int __type, int *__oldtype); ++ ++/* Value returned by pthread_join if the target thread was ++ canceled. */ ++#define PTHREAD_CANCELED ((void *) -1) ++ ++/* Cancel THEAD. */ ++extern int pthread_cancel (pthread_t __thr); ++ ++/* Add an explicit cancelation point. */ ++extern void pthread_testcancel (void); ++ ++ ++/* Barriers attributes. */ ++ ++#ifdef __USE_XOPEN2K ++ ++#include <bits/barrier-attr.h> ++ ++/* Initialize barrier attribute object in *ATTR to the default ++ values. */ ++extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr) ++ __THROW __nonnull ((1)); ++ ++/* Destroy the barrier attribute object in *ATTR. */ ++extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr) ++ __THROW __nonnull ((1)); ++ ++ ++/* Return the value of the process shared attribute in *ATTR in ++ *PSHARED. */ ++extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t *__restrict __attr, ++ int *__restrict __pshared) ++ __THROW __nonnull ((1, 2)); ++ ++/* Set the value of the process shared atrribute in *ATTR to ++ PSHARED. */ ++extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr, ++ int __pshared) ++ __THROW __nonnull ((1)); ++ ++ ++/* Barriers. */ ++ ++#include <bits/barrier.h> ++ ++/* Returned by pthread_barrier_wait to exactly one thread each time a ++ barrier is passed. */ ++#define PTHREAD_BARRIER_SERIAL_THREAD -1 ++ ++/* Initialize barrier BARRIER. */ ++extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier, ++ const pthread_barrierattr_t *__restrict __attr, ++ unsigned __count) ++ __THROW __nonnull ((1)); ++ ++/* Destroy barrier BARRIER. */ ++extern int pthread_barrier_destroy (pthread_barrier_t *__barrier) ++ __THROW __nonnull ((1)); ++ ++/* Wait on barrier BARRIER. */ ++extern int pthread_barrier_wait (pthread_barrier_t *__barrier) ++ __THROWNL __nonnull ((1)); ++ ++#endif /* __USE_XOPEN2K */ ++ ++ ++ ++/* Thread specific data. */ ++ ++#include <bits/thread-specific.h> ++ ++/* Create a thread specific data key in KEY visible to all threads. ++ On thread destruction, DESTRUCTOR shall be called with the thread ++ specific data associate with KEY if it is not NULL. */ ++extern int pthread_key_create (pthread_key_t *__key, ++ void (*__destructor) (void *)) ++ __THROW __nonnull ((1)); ++ ++/* Delete the thread specific data key KEY. The associated destructor ++ function is not called. */ ++extern int pthread_key_delete (pthread_key_t __key) __THROW; ++ ++/* Return the caller thread's thread specific value of KEY. */ ++extern void *pthread_getspecific (pthread_key_t __key) __THROW; ++ ++/* Set the caller thread's thread specific value of KEY to VALUE. */ ++extern int pthread_setspecific (pthread_key_t __key, const void *__value) ++ __THROW; ++ ++ ++/* Dynamic package initialization. */ ++ ++#include <bits/once.h> ++ ++#define PTHREAD_ONCE_INIT __PTHREAD_ONCE_INIT ++ ++/* Call INIT_ROUTINE if this function has never been called with ++ *ONCE_CONTROL, otherwise do nothing. */ ++extern int pthread_once (pthread_once_t *__once_control, ++ void (*__init_routine) (void)) __nonnull ((1, 2)); ++ ++ ++/* Concurrency. */ ++ ++#ifdef __USE_UNIX98 ++/* Set the desired concurrency level to NEW_LEVEL. */ ++extern int pthread_setconcurrency (int __new_level) __THROW; ++ ++/* Get the current concurrency level. */ ++extern int pthread_getconcurrency (void) __THROW; ++#endif ++ ++ ++/* Forking. */ ++ ++/* Register the function PREPARE to be run before the process forks, ++ the function PARENT to be run after a fork in the parent and the ++ function CHILD to be run in the child after the fork. If no ++ handling is desired then any of PREPARE, PARENT and CHILD may be ++ NULL. The prepare handles will be called in the reverse order ++ which they were registered and the parent and child handlers in the ++ order in which they were registered. */ ++extern int pthread_atfork (void (*__prepare) (void), void (*__parent) (void), ++ void (*__child) (void)) __THROW; ++ ++ ++/* Signals (should be in <signal.h>). */ ++ ++/* Send signal SIGNO to thread THREAD. */ ++extern int pthread_kill (pthread_t __thr, int __signo) __THROW; ++ ++ ++/* Time. */ ++ ++#ifdef __USE_XOPEN2K ++/* Return the thread cpu clock. */ ++extern int pthread_getcpuclockid (pthread_t __thr, __clockid_t *__clock) ++ __THROW __nonnull ((2)); ++#endif ++ ++ ++/* Scheduling. */ ++ ++/* Return thread THREAD's scheduling paramters. */ ++extern int pthread_getschedparam (pthread_t __thr, int *__restrict __policy, ++ struct sched_param *__restrict __param) ++ __THROW __nonnull ((2, 3)); ++ ++/* Set thread THREAD's scheduling paramters. */ ++extern int pthread_setschedparam (pthread_t __thr, int __policy, ++ const struct sched_param *__param) ++ __THROW __nonnull ((3)); ++ ++/* Set thread THREAD's scheduling priority. */ ++extern int pthread_setschedprio (pthread_t __thr, int __prio) __THROW; ++ ++#ifdef __USE_GNU ++/* Yield the processor to another thread or process. ++ This function is similar to the POSIX `sched_yield' function but ++ might be differently implemented in the case of a m-on-n thread ++ implementation. */ ++extern int pthread_yield (void) __THROW; ++#endif ++ ++ ++/* Kernel-specific interfaces. */ ++ ++#include <bits/pthread-np.h> ++ ++ ++__END_DECLS ++ ++#endif /* pthread.h */ +Index: glibc-2.27/libpthread/sysdeps/generic/pthread/pthreadtypes.h +=================================================================== +--- /dev/null ++++ glibc-2.27/libpthread/sysdeps/generic/pthread/pthreadtypes.h +@@ -0,0 +1,131 @@ ++/* Copyright (C) 2000, 2002, 2005, 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. */ ++ ++/* ++ * POSIX Threads Extension: ??? <pthreadtypes.h> ++ */ ++ ++#ifndef _PTHREADTYPES_H ++#define _PTHREADTYPES_H 1 ++ ++#include <features.h> ++ ++#include <bits/types.h> ++ ++__BEGIN_DECLS ++ ++#include <bits/pthread.h> ++typedef __pthread_t pthread_t; ++ ++/* Possible values for the process shared attribute. */ ++enum __pthread_process_shared ++ { ++ __PTHREAD_PROCESS_PRIVATE = 0, ++ __PTHREAD_PROCESS_SHARED ++ }; ++ ++/* Possible values for the inheritsched attribute. */ ++enum __pthread_inheritsched ++ { ++ __PTHREAD_EXPLICIT_SCHED = 0, ++ __PTHREAD_INHERIT_SCHED ++ }; ++ ++/* Possible values for the `contentionscope' attribute. */ ++enum __pthread_contentionscope ++ { ++ __PTHREAD_SCOPE_SYSTEM = 0, ++ __PTHREAD_SCOPE_PROCESS ++ }; ++ ++/* Possible values for the `detachstate' attribute. */ ++enum __pthread_detachstate ++ { ++ __PTHREAD_CREATE_JOINABLE = 0, ++ __PTHREAD_CREATE_DETACHED ++ }; ++ ++#include <bits/thread-attr.h> ++typedef struct __pthread_attr pthread_attr_t; ++ ++enum __pthread_mutex_protocol ++ { ++ __PTHREAD_PRIO_NONE= 0, ++ __PTHREAD_PRIO_INHERIT, ++ __PTHREAD_PRIO_PROTECT ++ }; ++ ++enum __pthread_mutex_type ++ { ++ __PTHREAD_MUTEX_TIMED, ++ __PTHREAD_MUTEX_ERRORCHECK, ++ __PTHREAD_MUTEX_RECURSIVE ++ }; ++ ++enum __pthread_mutex_robustness ++ { ++ __PTHREAD_MUTEX_STALLED, ++ __PTHREAD_MUTEX_ROBUST = 0x100 ++ }; ++ ++#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 */ +Index: glibc-2.27/libpthread/pthreadP.h +=================================================================== +--- glibc-2.27.orig/libpthread/pthreadP.h ++++ /dev/null +@@ -1,27 +0,0 @@ +-/* Copyright (C) 2016 Free Software Foundation, Inc. +- This file is part of the GNU C Library. +- +- The GNU C Library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. +- +- The GNU C Library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public +- License along with the GNU C Library; if not, see +- <http://www.gnu.org/licenses/>. */ +- +-#ifndef _PTHREADP_H +-#define _PTHREADP_H 1 +- +-#include <pthread.h> +- +-extern pthread_t __pthread_self (void); +-extern int __pthread_kill (pthread_t threadid, int signo); +-extern struct __pthread **__pthread_threads; +- +-#endif /* pthreadP.h */ +Index: glibc-2.27/libpthread/sysdeps/pthread/pthreadP.h +=================================================================== +--- /dev/null ++++ glibc-2.27/libpthread/sysdeps/pthread/pthreadP.h +@@ -0,0 +1,27 @@ ++/* Copyright (C) 2016 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ <http://www.gnu.org/licenses/>. */ ++ ++#ifndef _PTHREADP_H ++#define _PTHREADP_H 1 ++ ++#include <pthread.h> ++ ++extern pthread_t __pthread_self (void); ++extern int __pthread_kill (pthread_t threadid, int signo); ++extern struct __pthread **__pthread_threads; ++ ++#endif /* pthreadP.h */ diff --git a/debian/patches/hurd-i386/tg-gsync-libc.diff b/debian/patches/hurd-i386/tg-gsync-libc.diff index 440713a..54cf571 100644 --- a/debian/patches/hurd-i386/tg-gsync-libc.diff +++ b/debian/patches/hurd-i386/tg-gsync-libc.diff @@ -772,7 +772,7 @@ Index: glibc-2.26/sysdeps/mach/Makefile =================================================================== --- glibc-2.26.orig/sysdeps/mach/Makefile +++ glibc-2.26/sysdeps/mach/Makefile -@@ -50,4 +50,22 @@ mach-before-compile: +@@ -50,4 +50,23 @@ mach-before-compile: before-compile += $(mach-before-compile) endif @@ -788,6 +788,7 @@ Index: glibc-2.26/sysdeps/mach/Makefile +else ifeq (nss,$(subdir)) + LDLIBS-nss.so += $(objdir)/mach/libmachuser.so + LDLIBS-nss_files.so += $(objdir)/mach/libmachuser.so ++ LDLIBS-nss_compat.so += $(objdir)/mach/libmachuser.so +else ifeq (posix,$(subdir)) + LDLIBS-tst-rfc3484 += $(objdir)/mach/libmachuser.so + LDLIBS-tst-rfc3484-2 += $(objdir)/mach/libmachuser.so diff --git a/debian/patches/series b/debian/patches/series index e0601ce..c43494e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -120,6 +120,12 @@ hurd-i386/local-nocheck-installed-headers.diff hurd-i386/tg2.26-sigsetops.h.diff hurd-i386/git-libpthread-2.26.diff hurd-i386/tg-thread-linkspace.diff +hurd-i386/git-jmp_buf-macros.h.diff +hurd-i386/libpthread_includes.diff +hurd-i386/git-glob64.diff +hurd-i386/git-hidden-def.diff +hurd-i386/git-math-ulps-i386-update.diff +hurd-i386/git-glob-PATH_MAX.diff i386/local-biarch.diff i386/unsubmitted-quiet-ldconfig.diff @@ -183,4 +189,3 @@ any/local-bootstrap-headers.diff any/submitted-resolv-unaligned.diff any/submitted-intl-tstgettext.diff any/local-cudacc-float128.diff -hurd-i386/git-jmp_buf-macros.h.diff diff --git a/debian/sysdeps/hurd.mk b/debian/sysdeps/hurd.mk index 6e8fff7..82ee0c2 100644 --- a/debian/sysdeps/hurd.mk +++ b/debian/sysdeps/hurd.mk @@ -8,7 +8,6 @@ pldd = no # Linuxthreads Config (we claim "no threads" as nptl keys off this) threads = no -libc_add-ons = libpthread $(add-ons) # MIG generates a lot of warnings extra_config_options = --disable-werror -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-glibc/glibc.git