summaryrefslogtreecommitdiff
path: root/libpthread/linuxthreads/sysdeps/pthread
diff options
context:
space:
mode:
Diffstat (limited to 'libpthread/linuxthreads/sysdeps/pthread')
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/.cvsignore2
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/bits/initspin.h28
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/bits/libc-lock.h140
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/bits/libc-tsd.h22
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h24
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/bits/typesizes.h66
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/errno-loc.c45
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/flockfile.c33
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/ftrylockfile.c33
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/funlockfile.c33
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/getcpuclockid.c117
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/herrno-loc.c43
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/list.h114
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/malloc-machine.h67
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/not-cancel.h65
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/posix-timer.h204
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/pt-initfini.c124
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/pthread-functions.h98
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/pthread.h172
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/ptlongjmp.c39
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/res-state.c47
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/semaphore.h1
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/sigaction.c57
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/tcb-offsets.h1
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/timer_create.c170
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/timer_delete.c70
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/timer_getoverr.c45
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/timer_gettime.c77
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/timer_routines.c573
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/timer_settime.c137
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/tls.h80
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/tst-timer.c114
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/uClibc-glue.h47
33 files changed, 320 insertions, 2568 deletions
diff --git a/libpthread/linuxthreads/sysdeps/pthread/.cvsignore b/libpthread/linuxthreads/sysdeps/pthread/.cvsignore
deleted file mode 100644
index 7ee8f5969..000000000
--- a/libpthread/linuxthreads/sysdeps/pthread/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.cvsignore
-*.os
diff --git a/libpthread/linuxthreads/sysdeps/pthread/bits/initspin.h b/libpthread/linuxthreads/sysdeps/pthread/bits/initspin.h
deleted file mode 100644
index a19ec077e..000000000
--- a/libpthread/linuxthreads/sysdeps/pthread/bits/initspin.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Generic definitions for spinlock initializers.
- Copyright (C) 2000, 2001 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* Initial value of a spinlock. Most platforms should use zero,
- unless they only implement a "test and clear" operation instead of
- the usual "test and set". */
-#define __LT_SPINLOCK_INIT 0
-
-/* Macros for lock initializers, using the above definition. */
-#define __LOCK_INITIALIZER { 0, __LT_SPINLOCK_INIT }
-#define __ALT_LOCK_INITIALIZER { 0, __LT_SPINLOCK_INIT }
-#define __ATOMIC_INITIALIZER { 0, __LT_SPINLOCK_INIT }
diff --git a/libpthread/linuxthreads/sysdeps/pthread/bits/libc-lock.h b/libpthread/linuxthreads/sysdeps/pthread/bits/libc-lock.h
index 2299b3af5..c00d60bf0 100644
--- a/libpthread/linuxthreads/sysdeps/pthread/bits/libc-lock.h
+++ b/libpthread/linuxthreads/sysdeps/pthread/bits/libc-lock.h
@@ -1,5 +1,5 @@
/* libc-internal interface for mutex locks. LinuxThreads version.
- Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003,2006
+ Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -14,9 +14,8 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ License along with the GNU C Library; see the file COPYING.LIB. If
+ not, see <http://www.gnu.org/licenses/>. */
#ifndef _BITS_LIBC_LOCK_H
#define _BITS_LIBC_LOCK_H 1
@@ -30,7 +29,7 @@
/* Mutex type. */
#if defined(_LIBC) || defined(_IO_MTSAFE_IO)
typedef pthread_mutex_t __libc_lock_t;
-typedef struct { pthread_mutex_t mutex; } __libc_lock_recursive_t;
+typedef pthread_mutex_t __libc_lock_recursive_t;
# ifdef __USE_UNIX98
typedef pthread_rwlock_t __libc_rwlock_t;
# else
@@ -106,13 +105,8 @@ typedef pthread_key_t __libc_key_t;
(FUNC != NULL ? FUNC ARGS : ELSE)
# endif
#endif
-#if defined _LIBC && !defined NOT_IN_libc && defined SHARED
-# define __libc_maybe_call2(FUNC, ARGS, ELSE) \
- ({__builtin_expect (__libc_pthread_functions.ptr_##FUNC != NULL, 0) \
- ? __libc_pthread_functions.ptr_##FUNC ARGS : ELSE; })
-#else
-# define __libc_maybe_call2(FUNC, ARGS, ELSE) __libc_maybe_call (__##FUNC, ARGS, ELSE)
-#endif
+
+#define __libc_maybe_call2(FUNC, ARGS, ELSE) __libc_maybe_call (__##FUNC, ARGS, ELSE)
/* Initialize the named lock variable, leaving it in a consistent, unlocked
state. */
@@ -132,15 +126,39 @@ typedef pthread_key_t __libc_key_t;
#define __libc_rwlock_init(NAME) \
(__libc_maybe_call (__pthread_rwlock_init, (&(NAME), NULL), 0));
+/* Same as last but this time we initialize an adaptive mutex. */
+#if defined _LIBC && !defined NOT_IN_libc && defined SHARED
+#define __libc_lock_init_adaptive(NAME) \
+ ({ \
+ (NAME).__m_count = 0; \
+ (NAME).__m_owner = NULL; \
+ (NAME).__m_kind = PTHREAD_MUTEX_ADAPTIVE_NP; \
+ (NAME).__m_lock.__status = 0; \
+ (NAME).__m_lock.__spinlock = __LT_SPINLOCK_INIT; \
+ 0; })
+#else
+#define __libc_lock_init_adaptive(NAME) \
+ do { \
+ if (__pthread_mutex_init != NULL) \
+ { \
+ pthread_mutexattr_t __attr; \
+ __pthread_mutexattr_init (&__attr); \
+ __pthread_mutexattr_settype (&__attr, PTHREAD_MUTEX_ADAPTIVE_NP); \
+ __pthread_mutex_init (&(NAME), &__attr); \
+ __pthread_mutexattr_destroy (&__attr); \
+ } \
+ } while (0);
+#endif
+
/* Same as last but this time we initialize a recursive mutex. */
#if defined _LIBC && !defined NOT_IN_libc && defined SHARED
#define __libc_lock_init_recursive(NAME) \
({ \
- (NAME).mutex.__m_count = 0; \
- (NAME).mutex.__m_owner = NULL; \
- (NAME).mutex.__m_kind = PTHREAD_MUTEX_RECURSIVE_NP; \
- (NAME).mutex.__m_lock.__status = 0; \
- (NAME).mutex.__m_lock.__spinlock = __LT_SPINLOCK_INIT; \
+ (NAME).__m_count = 0; \
+ (NAME).__m_owner = NULL; \
+ (NAME).__m_kind = PTHREAD_MUTEX_RECURSIVE_NP; \
+ (NAME).__m_lock.__status = 0; \
+ (NAME).__m_lock.__spinlock = __LT_SPINLOCK_INIT; \
0; })
#else
#define __libc_lock_init_recursive(NAME) \
@@ -150,7 +168,7 @@ typedef pthread_key_t __libc_key_t;
pthread_mutexattr_t __attr; \
__pthread_mutexattr_init (&__attr); \
__pthread_mutexattr_settype (&__attr, PTHREAD_MUTEX_RECURSIVE_NP); \
- __pthread_mutex_init (&(NAME).mutex, &__attr); \
+ __pthread_mutex_init (&(NAME), &__attr); \
__pthread_mutexattr_destroy (&__attr); \
} \
} while (0);
@@ -203,23 +221,6 @@ typedef pthread_key_t __libc_key_t;
/* Unlock the recursive named lock variable. */
#define __libc_lock_unlock_recursive(NAME) __libc_lock_unlock ((NAME).mutex)
-#if defined _LIBC && defined SHARED
-# define __rtld_lock_default_lock_recursive(lock) \
- ++((pthread_mutex_t *)(lock))->__m_count;
-
-# define __rtld_lock_default_unlock_recursive(lock) \
- --((pthread_mutex_t *)(lock))->__m_count;
-
-# define __rtld_lock_lock_recursive(NAME) \
- GL(dl_rtld_lock_recursive) (&(NAME).mutex)
-
-# define __rtld_lock_unlock_recursive(NAME) \
- GL(dl_rtld_unlock_recursive) (&(NAME).mutex)
-#else
-#define __rtld_lock_lock_recursive(NAME) __libc_lock_lock_recursive (NAME)
-#define __rtld_lock_unlock_recursive(NAME) __libc_lock_unlock_recursive (NAME)
-#endif
-
/* Define once control variable. */
#if PTHREAD_ONCE_INIT == 0
/* Special case for static variables where we can avoid the initialization
@@ -238,7 +239,7 @@ typedef pthread_key_t __libc_key_t;
__pthread_once (&(ONCE_CONTROL), (INIT_FUNCTION)); \
else if ((ONCE_CONTROL) == PTHREAD_ONCE_INIT) { \
INIT_FUNCTION (); \
- (ONCE_CONTROL) = 2; \
+ (ONCE_CONTROL) = !PTHREAD_ONCE_INIT; \
} \
} while (0)
@@ -264,6 +265,7 @@ typedef pthread_key_t __libc_key_t;
_pthread_cleanup_pop_restore (&_buffer, (DOIT)); \
}
+#if 0
#define __libc_cleanup_push(fct, arg) \
{ struct _pthread_cleanup_buffer _buffer; \
__libc_maybe_call (_pthread_cleanup_push, (&_buffer, (fct), (arg)), 0)
@@ -271,6 +273,7 @@ typedef pthread_key_t __libc_key_t;
#define __libc_cleanup_pop(execute) \
__libc_maybe_call (_pthread_cleanup_pop, (&_buffer, execute), 0); \
}
+#endif
/* Create thread-specific key. */
#define __libc_key_create(KEY, DESTRUCTOR) \
@@ -293,7 +296,7 @@ typedef pthread_key_t __libc_key_t;
library. */
extern int __pthread_mutex_init (pthread_mutex_t *__mutex,
- __const pthread_mutexattr_t *__mutex_attr);
+ const pthread_mutexattr_t *__mutex_attr);
extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex);
@@ -312,7 +315,7 @@ extern int __pthread_mutexattr_settype (pthread_mutexattr_t *__attr,
#ifdef __USE_UNIX98
extern int __pthread_rwlock_init (pthread_rwlock_t *__rwlock,
- __const pthread_rwlockattr_t *__attr);
+ const pthread_rwlockattr_t *__attr);
extern int __pthread_rwlock_destroy (pthread_rwlock_t *__rwlock);
@@ -331,7 +334,7 @@ extern int __pthread_key_create (pthread_key_t *__key,
void (*__destr_function) (void *));
extern int __pthread_setspecific (pthread_key_t __key,
- __const void *__pointer);
+ const void *__pointer);
extern void *__pthread_getspecific (pthread_key_t __key);
@@ -343,65 +346,6 @@ extern int __pthread_atfork (void (*__prepare) (void),
void (*__child) (void));
-
-/* Make the pthread functions weak so that we can elide them from
- single-threaded processes. */
-#ifndef __NO_WEAK_PTHREAD_ALIASES
-# ifdef weak_extern
-# define BP_SYM(sym) sym
-weak_extern (BP_SYM (__pthread_mutex_init))
-weak_extern (BP_SYM (__pthread_mutex_destroy))
-weak_extern (BP_SYM (__pthread_mutex_lock))
-weak_extern (BP_SYM (__pthread_mutex_trylock))
-weak_extern (BP_SYM (__pthread_mutex_unlock))
-weak_extern (BP_SYM (__pthread_mutexattr_init))
-weak_extern (BP_SYM (__pthread_mutexattr_destroy))
-weak_extern (BP_SYM (__pthread_mutexattr_settype))
-weak_extern (BP_SYM (__pthread_rwlock_init))
-weak_extern (BP_SYM (__pthread_rwlock_destroy))
-weak_extern (BP_SYM (__pthread_rwlock_rdlock))
-weak_extern (BP_SYM (__pthread_rwlock_tryrdlock))
-weak_extern (BP_SYM (__pthread_rwlock_wrlock))
-weak_extern (BP_SYM (__pthread_rwlock_trywrlock))
-weak_extern (BP_SYM (__pthread_rwlock_unlock))
-weak_extern (BP_SYM (__pthread_key_create))
-weak_extern (BP_SYM (__pthread_setspecific))
-weak_extern (BP_SYM (__pthread_getspecific))
-weak_extern (BP_SYM (__pthread_once))
-weak_extern (__pthread_initialize)
-weak_extern (__pthread_atfork)
-weak_extern (BP_SYM (_pthread_cleanup_push))
-weak_extern (BP_SYM (_pthread_cleanup_pop))
-weak_extern (BP_SYM (_pthread_cleanup_push_defer))
-weak_extern (BP_SYM (_pthread_cleanup_pop_restore))
-# else
-# pragma weak __pthread_mutex_init
-# pragma weak __pthread_mutex_destroy
-# pragma weak __pthread_mutex_lock
-# pragma weak __pthread_mutex_trylock
-# pragma weak __pthread_mutex_unlock
-# pragma weak __pthread_mutexattr_init
-# pragma weak __pthread_mutexattr_destroy
-# pragma weak __pthread_mutexattr_settype
-# pragma weak __pthread_rwlock_destroy
-# pragma weak __pthread_rwlock_rdlock
-# pragma weak __pthread_rwlock_tryrdlock
-# pragma weak __pthread_rwlock_wrlock
-# pragma weak __pthread_rwlock_trywrlock
-# pragma weak __pthread_rwlock_unlock
-# pragma weak __pthread_key_create
-# pragma weak __pthread_setspecific
-# pragma weak __pthread_getspecific
-# pragma weak __pthread_once
-# pragma weak __pthread_initialize
-# pragma weak __pthread_atfork
-# pragma weak _pthread_cleanup_push_defer
-# pragma weak _pthread_cleanup_pop_restore
-# pragma weak _pthread_cleanup_push
-# pragma weak _pthread_cleanup_pop
-# endif
-#endif
-
/* We need portable names for some functions. E.g., when they are
used as argument to __libc_cleanup_region_start. */
#define __libc_mutex_unlock __pthread_mutex_unlock
diff --git a/libpthread/linuxthreads/sysdeps/pthread/bits/libc-tsd.h b/libpthread/linuxthreads/sysdeps/pthread/bits/libc-tsd.h
index fa6eb4be2..66b48921a 100644
--- a/libpthread/linuxthreads/sysdeps/pthread/bits/libc-tsd.h
+++ b/libpthread/linuxthreads/sysdeps/pthread/bits/libc-tsd.h
@@ -13,17 +13,27 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ License along with the GNU C Library; see the file COPYING.LIB. If
+ not, see <http://www.gnu.org/licenses/>. */
#ifndef _BITS_LIBC_TSD_H
#define _BITS_LIBC_TSD_H 1
-#include <linuxthreads/descr.h>
-#include <tls.h>
+/* Fast thread-specific data internal to libc. */
+enum __libc_tsd_key_t { _LIBC_TSD_KEY_MALLOC = 0,
+ _LIBC_TSD_KEY_DL_ERROR,
+ _LIBC_TSD_KEY_RPC_VARS,
+ _LIBC_TSD_KEY_LOCALE,
+ _LIBC_TSD_KEY_CTYPE_B,
+ _LIBC_TSD_KEY_CTYPE_TOLOWER,
+ _LIBC_TSD_KEY_CTYPE_TOUPPER,
+ _LIBC_TSD_KEY_N };
+
+#include <features.h>
+#include <linuxthreads/internals.h>
-#if USE_TLS && HAVE___THREAD
+#ifdef __UCLIBC_HAS_TLS__
+#include <tls.h>
/* When __thread works, the generic definition is what we want. */
# include <sysdeps/generic/bits/libc-tsd.h>
diff --git a/libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h b/libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h
index 4ea6d8ac5..638dc75c9 100644
--- a/libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h
+++ b/libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h
@@ -19,9 +19,14 @@
#ifndef _BITS_PTHREADTYPES_H
#define _BITS_PTHREADTYPES_H 1
+#define __need_size_t
+#include <stddef.h>
+
#define __need_schedparam
#include <bits/sched.h>
+#define __SIZEOF_PTHREAD_CONDATTR_T 4
+
/* Fast locks (not abstract because mutexes and conditions aren't abstract). */
struct _pthread_fastlock
{
@@ -53,29 +58,20 @@ typedef struct __pthread_attr_s
/* Conditions (not abstract because of PTHREAD_COND_INITIALIZER */
-
-#ifdef __GLIBC_HAVE_LONG_LONG
-__extension__ typedef long long __pthread_cond_align_t;
-#else
-typedef long __pthread_cond_align_t;
-#endif
-
typedef struct
{
struct _pthread_fastlock __c_lock; /* Protect against concurrent access */
_pthread_descr __c_waiting; /* Threads waiting on this condition */
- char __padding[48 - sizeof (struct _pthread_fastlock)
- - sizeof (_pthread_descr) - sizeof (__pthread_cond_align_t)];
- __pthread_cond_align_t __align;
} pthread_cond_t;
-/* Attribute for conditionally variables. */
-typedef struct
+typedef union
{
- int __dummy;
+ char __size[__SIZEOF_PTHREAD_CONDATTR_T];
+ int __align;
} pthread_condattr_t;
+
/* Keys for thread-specific data */
typedef unsigned int pthread_key_t;
@@ -128,7 +124,7 @@ typedef struct
#ifdef __USE_XOPEN2K
/* POSIX spinlock data type. */
-typedef __volatile__ int pthread_spinlock_t;
+typedef volatile int pthread_spinlock_t;
/* POSIX barrier. */
typedef struct {
diff --git a/libpthread/linuxthreads/sysdeps/pthread/bits/typesizes.h b/libpthread/linuxthreads/sysdeps/pthread/bits/typesizes.h
deleted file mode 100644
index 45264ac9c..000000000
--- a/libpthread/linuxthreads/sysdeps/pthread/bits/typesizes.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* bits/typesizes.h -- underlying types for *_t. Generic version.
- Copyright (C) 2002, 2003 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_TYPES_H
-# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
-#endif
-
-#ifndef _BITS_TYPESIZES_H
-#define _BITS_TYPESIZES_H 1
-
-/* See <bits/types.h> for the meaning of these macros. This file exists so
- that <bits/types.h> need not vary across different GNU platforms. */
-
-#define __DEV_T_TYPE __UQUAD_TYPE
-#define __UID_T_TYPE __U32_TYPE
-#define __GID_T_TYPE __U32_TYPE
-#define __INO_T_TYPE __ULONGWORD_TYPE
-#define __INO64_T_TYPE __UQUAD_TYPE
-#define __MODE_T_TYPE __U32_TYPE
-#define __NLINK_T_TYPE __UWORD_TYPE
-#define __OFF_T_TYPE __SLONGWORD_TYPE
-#define __OFF64_T_TYPE __SQUAD_TYPE
-#define __PID_T_TYPE __S32_TYPE
-#define __RLIM_T_TYPE __ULONGWORD_TYPE
-#define __RLIM64_T_TYPE __UQUAD_TYPE
-#define __BLKCNT_T_TYPE __SLONGWORD_TYPE
-#define __BLKCNT64_T_TYPE __SQUAD_TYPE
-#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE
-#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
-#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
-#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
-#define __ID_T_TYPE __U32_TYPE
-#define __CLOCK_T_TYPE __SLONGWORD_TYPE
-#define __TIME_T_TYPE __SLONGWORD_TYPE
-#define __USECONDS_T_TYPE __U32_TYPE
-#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
-#define __DADDR_T_TYPE __S32_TYPE
-#define __SWBLK_T_TYPE __SLONGWORD_TYPE
-#define __KEY_T_TYPE __S32_TYPE
-#define __CLOCKID_T_TYPE __S32_TYPE
-#define __TIMER_T_TYPE __S32_TYPE
-#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE
-#define __FSID_T_TYPE struct { int __val[2]; }
-#define __SSIZE_T_TYPE __SWORD_TYPE
-
-/* Number of descriptors that can fit in an `fd_set'. */
-#define __FD_SETSIZE 1024
-
-
-#endif /* bits/typesizes.h */
diff --git a/libpthread/linuxthreads/sysdeps/pthread/errno-loc.c b/libpthread/linuxthreads/sysdeps/pthread/errno-loc.c
deleted file mode 100644
index c3b3087e4..000000000
--- a/libpthread/linuxthreads/sysdeps/pthread/errno-loc.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* MT support function to get address of `errno' variable, linuxthreads
- version.
- Copyright (C) 1996, 1998, 2002, 2003, 2004 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. */
-
-#include <errno.h>
-#include <linuxthreads/internals.h>
-#include <sysdep-cancel.h>
-
-#if ! USE___THREAD && !RTLD_PRIVATE_ERRNO
-#undef errno
-extern int errno;
-#endif
-
-int *
-#if ! USE___THREAD
-weak_const_function
-#endif
-__errno_location (void)
-{
-#if ! USE___THREAD && !defined NOT_IN_libc
- if (! SINGLE_THREAD_P)
- {
- pthread_descr self = thread_self();
- return LIBC_THREAD_GETMEM (self, p_errnop);
- }
-#endif
- return &errno;
-}
-libc_hidden_def (__errno_location)
diff --git a/libpthread/linuxthreads/sysdeps/pthread/flockfile.c b/libpthread/linuxthreads/sysdeps/pthread/flockfile.c
deleted file mode 100644
index 918cb84f6..000000000
--- a/libpthread/linuxthreads/sysdeps/pthread/flockfile.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@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 <pthread.h>
-#include <stdio.h>
-#include <libio.h>
-#include <bits/stdio-lock.h>
-
-
-void
-__flockfile (stream)
- FILE *stream;
-{
- _IO_lock_lock (*stream->_lock);
-}
-strong_alias (__flockfile, _IO_flockfile)
-weak_alias (__flockfile, flockfile)
diff --git a/libpthread/linuxthreads/sysdeps/pthread/ftrylockfile.c b/libpthread/linuxthreads/sysdeps/pthread/ftrylockfile.c
deleted file mode 100644
index 21c1ea01e..000000000
--- a/libpthread/linuxthreads/sysdeps/pthread/ftrylockfile.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@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 <errno.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <bits/stdio-lock.h>
-
-
-int
-__ftrylockfile (stream)
- FILE *stream;
-{
- return _IO_lock_trylock (*stream->_lock);
-}
-strong_alias (__ftrylockfile, _IO_ftrylockfile)
-weak_alias (__ftrylockfile, ftrylockfile)
diff --git a/libpthread/linuxthreads/sysdeps/pthread/funlockfile.c b/libpthread/linuxthreads/sysdeps/pthread/funlockfile.c
deleted file mode 100644
index f941fc985..000000000
--- a/libpthread/linuxthreads/sysdeps/pthread/funlockfile.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@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 <pthread.h>
-#include <stdio.h>
-#include <libio.h>
-#include <bits/stdio-lock.h>
-
-
-void
-__funlockfile (stream)
- FILE *stream;
-{
- _IO_lock_unlock (*stream->_lock);
-}
-strong_alias (__funlockfile, _IO_funlockfile)
-weak_alias (__funlockfile, funlockfile)
diff --git a/libpthread/linuxthreads/sysdeps/pthread/getcpuclockid.c b/libpthread/linuxthreads/sysdeps/pthread/getcpuclockid.c
deleted file mode 100644
index cefbd554a..000000000
--- a/libpthread/linuxthreads/sysdeps/pthread/getcpuclockid.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/* pthread_getcpuclockid -- Get POSIX clockid_t for a pthread_t. Linux version
- Copyright (C) 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <errno.h>
-#include <pthread.h>
-#include <sys/time.h>
-#include <time.h>
-#include <internals.h>
-#include <spinlock.h>
-#include <bits/kernel-features.h>
-#include <kernel-posix-cpu-timers.h>
-
-
-#if !(__ASSUME_POSIX_CPU_TIMERS > 0)
-int __libc_missing_posix_cpu_timers attribute_hidden;
-#endif
-#if !(__ASSUME_POSIX_TIMERS > 0)
-int __libc_missing_posix_timers attribute_hidden;
-#endif
-
-int
-pthread_getcpuclockid (pthread_t thread_id, clockid_t *clock_id)
-{
-#ifdef __NR_clock_getres
- pthread_handle handle = thread_handle(thread_id);
- int pid;
-
- __pthread_lock (&handle->h_lock, NULL);
- if (nonexisting_handle (handle, thread_id))
- {
- __pthread_unlock (&handle->h_lock);
- return ESRCH;
- }
- pid = handle->h_descr->p_pid;
- __pthread_unlock (&handle->h_lock);
-
- /* The clockid_t value is a simple computation from the PID.
- But we do a clock_getres call to validate it if we aren't
- yet sure we have the kernel support. */
-
- const clockid_t pidclock = MAKE_PROCESS_CPUCLOCK (pid, CPUCLOCK_SCHED);
-
-# if !(__ASSUME_POSIX_CPU_TIMERS > 0)
-# if !(__ASSUME_POSIX_TIMERS > 0)
- if (__libc_missing_posix_timers && !__libc_missing_posix_cpu_timers)
- __libc_missing_posix_cpu_timers = 1;
-# endif
- if (!__libc_missing_posix_cpu_timers)
- {
- INTERNAL_SYSCALL_DECL (err);
- int r = INTERNAL_SYSCALL (clock_getres, err, 2, pidclock, NULL);
- if (!INTERNAL_SYSCALL_ERR