1 diff -Nur glibc-2.3.2/linuxthreads.old/alloca_cutoff.c glibc-2.3.2/linuxthreads/alloca_cutoff.c
2 --- glibc-2.3.2/linuxthreads.old/alloca_cutoff.c 2002-12-28 05:06:33.000000000 -0500
3 +++ glibc-2.3.2/linuxthreads/alloca_cutoff.c 2003-03-31 19:52:40.000000000 -0500
5 /* Determine whether block of given size can be allocated on the stack or not.
6 - Copyright (C) 2002 Free Software Foundation, Inc.
7 + Copyright (C) 2002, 2003 Free Software Foundation, Inc.
8 This file is part of the GNU C Library.
10 The GNU C Library is free software; you can redistribute it and/or
14 #include <sys/param.h>
15 +#include "internals.h"
16 #include <sysdep-cancel.h>
19 diff -Nur glibc-2.3.2/linuxthreads.old/ChangeLog glibc-2.3.2/linuxthreads/ChangeLog
20 --- glibc-2.3.2/linuxthreads.old/ChangeLog 2003-02-27 17:40:10.000000000 -0500
21 +++ glibc-2.3.2/linuxthreads/ChangeLog 2003-04-02 04:20:07.000000000 -0500
23 -2003-02-27 Roland McGrath <roland@redhat.com>
24 +2003-04-02 Jakub Jelinek <jakub@redhat.com>
26 + * Makefile (libpthread-routines): Add pthread_atfork.
27 + (libpthread-static-only-routines): Add pthread_atfork.
29 +2003-04-01 Jakub Jelinek <jakub@redhat.com>
31 + * pthread.c (__pthread_wait_for_restart_signal): Use
32 + __pthread_sigsuspend instead of sigsuspend.
33 + * internals.h (__pthread_sigsuspend): New prototype.
34 + * Makefile (libpthread-routines): Add pt-sigsuspend.
35 + (tests): Add tst-cancel7.
36 + * sysdeps/unix/sysv/linux/pt-sigsuspend.c: New file.
37 + * sysdeps/unix/sysv/linux/alpha/pt-sigsuspend.S: New file.
38 + * sysdeps/unix/sysv/linux/ia64/pt-sigsuspend.c: New file.
39 + * sysdeps/unix/sysv/linux/s390/s390-64/pt-sigsuspend.c: New file.
40 + * sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c: New file.
41 + * sysdeps/unix/sysv/linux/x86_64/pt-sigsuspend.c: New file.
42 + * tst-cancel7.c: New test.
44 +2003-03-31 Alexandre Oliva <aoliva@redhat.com>
46 + * alloca_cutoff.c: Include internals.h.
47 + * sysdeps/pthread/errno-loc.c: Include linuxthreads/internals.h.
48 + * sysdeps/pthread/herrno-loc.c: Likewise.
49 + * sysdeps/pthread/res-state.c: Likewise.
51 +2003-03-25 Ulrich Drepper <drepper@redhat.com>
53 + * sysdeps/pthread/bits/typesizes.h: New file.
54 + * sysdeps/unix/sysv/linux/alpha/bits/typesizes.h: New file.
55 + * sysdeps/unix/sysv/linux/sparc/bits/typesizes.h: New file.
57 +2003-03-24 Daniel Jacobowitz <drow@mvista.com>
59 + * sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
60 + (DOARGS_5, DOARGS_6, DOARGS_7): Rewritten.
62 +2003-03-22 Jakub Jelinek <jakub@redhat.com>
64 + * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
66 +2003-03-21 Daniel Jacobowitz <drow@mvista.com>
68 + * sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
69 + (SINGLE_THREAD_P_PIC): Use "reg" instead of "lr".
71 +2003-03-21 Jakub Jelinek <jakub@redhat.com>
73 + * sysdeps/i386/tls.h [__ASSUME_SET_THREAD_AREA_SYSCALL]
74 + (TLS_SETUP_GS_SEGMENT): Fix a typo.
76 +2003-03-19 Ulrich Drepper <drepper@redhat.com>
78 + * sysdeps/pthread/Makefile: Fix cut&paste error.
80 +2003-03-18 Roland McGrath <roland@redhat.com>
82 + * Versions (libpthread: GLIBC_2.2): Remove
83 + pthread_barrierattr_getpshared, never really existed.
84 + (libpthread: GLIBC_2.0): Move __pthread_initialize to ...
85 + (libpthread: GLIBC_PRIVATE): ... here.
87 +2003-03-14 Jakub Jelinek <jakub@redhat.com>
89 + * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
90 + * sysdeps/unix/sysv/linux/sparc/Makefile ($(objpfx)specs): Use full
93 +2003-03-14 Alexandre Oliva <aoliva@redhat.com>
95 + * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Don't .set
97 + * sysdeps/mips/pt-machine.h (__compare_and_swap): Likewise.
98 + Handle 64-bit longs on n64.
100 +2003-03-07 Jakub Jelinek <jakub@redhat.com>
102 + * sysdeps/ia64/pspinlock.c (__pthread_spin_lock,
103 + __pthread_spin_trylock): Rewritten.
105 +2003-03-06 Ulrich Drepper <drepper@redhat.com>
107 + * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
110 +2003-03-02 Ulrich Drepper <drepper@redhat.com>
112 + * sysdeps/pthread/timer_create.c (timer_create): Return correct
113 + error for CPU clocks.
115 + * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
116 + _POSIX_MONOTONIC_CLOCK.
117 + * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
119 +2003-03-01 Roland McGrath <roland@redhat.com>
121 + * sysdeps/powerpc/powerpc64/pt-machine.h
122 + (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
124 + * sysdeps/powerpc/tls.h: Don't define those here.
126 + * sysdeps/powerpc/tls.h [! USE_TLS && !__powerpc64__]: Define
127 + tcbhead_t with multiple_threads member.
128 + [USE_TLS] (tcbhead_t): Define minimal one-word version.
129 + [USE_TLS && !__powerpc64__] (TLS_MULTIPLE_THREADS_IN_TCB): Define.
130 + * sysdeps/powerpc/tcb-offsets.sym [USE_TLS]: Use tls.h macros to
131 + derive thread register offset of p_multiple_threads member.
133 + * descr.h (struct _pthread_descr_struct) [!USE_TLS || !TLS_DTV_AT_TP]:
134 + Conditionalize p_header member on this.
135 + [TLS_MULTIPLE_THREADS_IN_TCB]: Add p_multiple_threads alternatively.
136 + * sysdeps/ia64/tls.h [USE_TLS] (TLS_MULTIPLE_THREADS_IN_TCB): Define.
137 + * sysdeps/sh/tls.h: Likewise.
138 + * sysdeps/ia64/tcb-offsets.sym [USE_TLS]: Use p_multiple_threads.
139 + * sysdeps/sh/tcb-offsets.sym: Likewise.
140 + * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
141 + (SINGLE_THREAD_P): Likewise.
142 + * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
143 + (SINGLE_THREAD_P): Likewise.
144 + * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
145 + (SINGLE_THREAD_P): Likewise.
146 + * pthread.c (__pthread_initialize_manager): Likewise.
147 + * manager.c (pthread_handle_create): Likewise.
149 * sysdeps/powerpc/tls.h [HAVE_TLS_SUPPORT]: Define USE_TLS and all
151 diff -Nur glibc-2.3.2/linuxthreads.old/descr.h glibc-2.3.2/linuxthreads/descr.h
152 --- glibc-2.3.2/linuxthreads.old/descr.h 2002-12-28 05:06:33.000000000 -0500
153 +++ glibc-2.3.2/linuxthreads/descr.h 2003-03-02 06:44:20.000000000 -0500
156 #include <sys/types.h>
157 #include <hp-timing.h>
160 /* Fast thread-specific data internal to libc. */
161 enum __libc_tsd_key_t { _LIBC_TSD_KEY_MALLOC = 0,
162 @@ -106,11 +107,14 @@
167 -struct _pthread_descr_struct {
168 - /* XXX Remove this union for IA-64 style TLS module */
171 +struct _pthread_descr_struct
173 +#if !defined USE_TLS || !TLS_DTV_AT_TP
174 + /* This overlaps tcbhead_t (see tls.h), as used for TLS without threads. */
179 void *tcb; /* Pointer to the TCB. This is not always
180 the address of this thread descriptor. */
186 +# define p_multiple_threads p_header.data.multiple_threads
187 +#elif TLS_MULTIPLE_THREADS_IN_TCB
188 + int p_multiple_threads;
191 pthread_descr p_nextlive, p_prevlive;
192 /* Double chaining of active threads */
193 pthread_descr p_nextwaiting; /* Next element in the queue holding the thr */
194 diff -Nur glibc-2.3.2/linuxthreads.old/internals.h glibc-2.3.2/linuxthreads/internals.h
195 --- glibc-2.3.2/linuxthreads.old/internals.h 2003-01-06 19:02:26.000000000 -0500
196 +++ glibc-2.3.2/linuxthreads/internals.h 2003-04-01 19:10:44.000000000 -0500
199 extern void __pthread_wait_for_restart_signal(pthread_descr self);
201 +extern void __pthread_sigsuspend (const sigset_t *mask) attribute_hidden;
203 extern int __pthread_yield (void);
205 extern int __pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
206 diff -Nur glibc-2.3.2/linuxthreads.old/Makefile glibc-2.3.2/linuxthreads/Makefile
207 --- glibc-2.3.2/linuxthreads.old/Makefile 2003-02-21 20:01:16.000000000 -0500
208 +++ glibc-2.3.2/linuxthreads/Makefile 2003-04-02 04:19:59.000000000 -0500
210 install-lib-ldscripts := libpthread.so
212 libpthread-routines := attr cancel condvar join manager mutex ptfork \
213 - ptlongjmp pthread signals specific errno lockfile \
214 - semaphore spinlock rwlock pt-machine \
215 + ptlongjmp pthread pt-sigsuspend signals specific errno \
216 + lockfile semaphore spinlock rwlock pt-machine \
217 oldsemaphore events getcpuclockid pspinlock barrier \
218 ptclock_gettime ptclock_settime sighandler \
219 pthandles libc-tls-loc pt-allocrtsig \
221 ptw-lseek64 ptw-llseek ptw-msync ptw-nanosleep \
222 ptw-open ptw-open64 ptw-pause ptw-pread ptw-pread64 \
223 ptw-pwrite ptw-pwrite64 ptw-tcdrain ptw-wait \
224 - ptw-waitpid pt-system old_pthread_atfork
225 + ptw-waitpid pt-system old_pthread_atfork pthread_atfork
226 # Don't generate deps for calls with no sources. See sysdeps/unix/Makefile.
227 omit-deps = $(unix-syscalls:%=ptw-%)
229 libpthread-shared-only-routines = pt-allocrtsig
230 +libpthread-static-only-routines = pthread_atfork
232 libpthread-nonshared = pthread_atfork
235 tststack $(tests-nodelete-$(have-z-nodelete)) ecmutex ex14 ex15 ex16 \
236 ex17 ex18 tst-cancel tst-context bug-sleep \
237 tst-cancel1 tst-cancel2 tst-cancel3 tst-cancel4 tst-cancel5 \
238 - tst-cancel6 tst-popen tst-popen2
239 + tst-cancel6 tst-cancel7 tst-popen tst-popen2
240 test-srcs = tst-signal
241 # These tests are linked with libc before libpthread
242 tests-reverse += tst-cancel5
243 diff -Nur glibc-2.3.2/linuxthreads.old/manager.c glibc-2.3.2/linuxthreads/manager.c
244 --- glibc-2.3.2/linuxthreads.old/manager.c 2003-01-12 03:37:35.000000000 -0500
245 +++ glibc-2.3.2/linuxthreads/manager.c 2003-03-02 06:44:20.000000000 -0500
246 @@ -638,13 +638,13 @@
247 new_thread_id = sseg + pthread_threads_counter;
248 /* Initialize the thread descriptor. Elements which have to be
249 initialized to zero already have this value. */
250 -#if defined USE_TLS && TLS_DTV_AT_TP
251 - new_thread->p_header.data.tcb = new_thread + 1;
253 +#if !defined USE_TLS || !TLS_DTV_AT_TP
254 new_thread->p_header.data.tcb = new_thread;
256 new_thread->p_header.data.self = new_thread;
257 - new_thread->p_header.data.multiple_threads = 1;
259 +#if TLS_MULTIPLE_THREADS_IN_TCB || !defined USE_TLS || !TLS_DTV_AT_TP
260 + new_thread->p_multiple_threads = 1;
262 new_thread->p_tid = new_thread_id;
263 new_thread->p_lock = &(__pthread_handles[sseg].h_lock);
264 new_thread->p_cancelstate = PTHREAD_CANCEL_ENABLE;
265 diff -Nur glibc-2.3.2/linuxthreads.old/pthread.c glibc-2.3.2/linuxthreads/pthread.c
266 --- glibc-2.3.2/linuxthreads.old/pthread.c 2003-01-16 13:14:41.000000000 -0500
267 +++ glibc-2.3.2/linuxthreads/pthread.c 2003-04-01 19:10:44.000000000 -0500
271 __pthread_multiple_threads = 1;
272 - __pthread_main_thread->p_header.data.multiple_threads = 1;
273 - * __libc_multiple_threads_ptr = 1;
274 +#if TLS_MULTIPLE_THREADS_IN_TCB || !defined USE_TLS || !TLS_DTV_AT_TP
275 + __pthread_main_thread->p_multiple_threads = 1;
277 + *__libc_multiple_threads_ptr = 1;
279 #ifndef HAVE_Z_NODELETE
280 if (__builtin_expect (&__dso_handle != NULL, 1))
282 __pthread_handles[1].h_descr = manager_thread = mgr;
284 /* Initialize the descriptor. */
285 +#if !defined USE_TLS || !TLS_DTV_AT_TP
286 mgr->p_header.data.tcb = tcbp;
287 mgr->p_header.data.self = mgr;
288 mgr->p_header.data.multiple_threads = 1;
289 +#elif TLS_MULTIPLE_THREADS_IN_TCB
290 + mgr->p_multiple_threads = 1;
292 mgr->p_lock = &__pthread_handles[1].h_lock;
293 # ifndef HAVE___THREAD
294 mgr->p_errnop = &mgr->p_errno;
295 @@ -1138,7 +1144,8 @@
296 sigdelset(&mask, __pthread_sig_restart); /* Unblock the restart signal */
297 THREAD_SETMEM(self, p_signal, 0);
299 - sigsuspend(&mask); /* Wait for signal */
300 + __pthread_sigsuspend(&mask); /* Wait for signal. Must not be a
301 + cancellation point. */
302 } while (THREAD_GETMEM(self, p_signal) !=__pthread_sig_restart);
304 READ_MEMORY_BARRIER(); /* See comment in __pthread_restart_new */
305 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/i386/tls.h glibc-2.3.2/linuxthreads/sysdeps/i386/tls.h
306 --- glibc-2.3.2/linuxthreads.old/sysdeps/i386/tls.h 2003-02-25 19:46:32.000000000 -0500
307 +++ glibc-2.3.2/linuxthreads/sysdeps/i386/tls.h 2003-03-21 15:37:16.000000000 -0500
310 # ifdef __ASSUME_SET_THREAD_AREA_SYSCALL
311 # define TLS_SETUP_GS_SEGMENT(descr, secondcall) \
312 - (TLS_DO_SET_THREAD_AREA (descr, firstcall) \
313 + (TLS_DO_SET_THREAD_AREA (descr, secondcall) \
314 ? "set_thread_area failed when setting up thread-local storage" : NULL)
315 # elif defined __NR_set_thread_area
316 # define TLS_SETUP_GS_SEGMENT(descr, secondcall) \
317 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/ia64/pspinlock.c glibc-2.3.2/linuxthreads/sysdeps/ia64/pspinlock.c
318 --- glibc-2.3.2/linuxthreads.old/sysdeps/ia64/pspinlock.c 2002-08-27 00:52:35.000000000 -0400
319 +++ glibc-2.3.2/linuxthreads/sysdeps/ia64/pspinlock.c 2003-03-07 17:22:38.000000000 -0500
321 /* POSIX spinlock implementation. ia64 version.
322 - Copyright (C) 2000 Free Software Foundation, Inc.
323 + Copyright (C) 2000, 2003 Free Software Foundation, Inc.
324 This file is part of the GNU C Library.
325 Contributed by Jes Sorensen <jes@linuxcare.com>
330 #include "internals.h"
331 +#include <ia64intrin.h>
333 /* This implementation is inspired by the implementation used in the
337 __pthread_spin_lock (pthread_spinlock_t *lock)
340 - ("mov ar.ccv = r0\n\t"
346 - "cmp4.eq p0, p7 = r0, r2\n\t"
347 - "(p7) br.cond.spnt.few 1b \n\t"
348 - "cmpxchg4.acq r2 = %0, r3, ar.ccv\n\t"
350 - "cmp4.eq p0, p7 = r0, r2\n\t"
351 - "(p7) br.cond.spnt.few 1b\n\t"
353 - :: "m" (lock) : "r2", "r3", "p7", "memory");
354 + int *p = (int *) lock;
356 + while (__builtin_expect (__sync_val_compare_and_swap_si (p, 0, 1), 0))
358 + /* Spin without using the atomic instruction. */
360 + __asm __volatile ("" : : : "memory");
365 weak_alias (__pthread_spin_lock, pthread_spin_lock)
368 __pthread_spin_trylock (pthread_spinlock_t *lock)
373 - ("mov ar.ccv = r0\n\t"
376 - "cmpxchg4.acq %0 = %1, r2, ar.ccv\n\t"
378 - : "=r" (oldval) : "m" (lock) : "r2", "memory");
379 - return oldval > 0 ? 0 : EBUSY;
380 + return __sync_val_compare_and_swap_si ((int *) lock, 0, 1) == 0 ? 0 : EBUSY;
382 weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
384 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/ia64/tcb-offsets.sym glibc-2.3.2/linuxthreads/sysdeps/ia64/tcb-offsets.sym
385 --- glibc-2.3.2/linuxthreads.old/sysdeps/ia64/tcb-offsets.sym 2003-01-16 13:20:08.000000000 -0500
386 +++ glibc-2.3.2/linuxthreads/sysdeps/ia64/tcb-offsets.sym 2003-03-02 06:44:20.000000000 -0500
391 -MULTIPLE_THREADS_OFFSET offsetof (struct _pthread_descr_struct, p_header.data.multiple_threads) - sizeof (struct _pthread_descr_struct)
392 +MULTIPLE_THREADS_OFFSET offsetof (struct _pthread_descr_struct, p_multiple_threads) - sizeof (struct _pthread_descr_struct)
394 MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads)
396 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/ia64/tls.h glibc-2.3.2/linuxthreads/sysdeps/ia64/tls.h
397 --- glibc-2.3.2/linuxthreads.old/sysdeps/ia64/tls.h 2003-01-16 13:20:08.000000000 -0500
398 +++ glibc-2.3.2/linuxthreads/sysdeps/ia64/tls.h 2003-03-02 06:44:20.000000000 -0500
400 # define INIT_THREAD_SELF(descr, nr) \
401 (__thread_self = (struct _pthread_descr_struct *)(descr) + 1)
403 +# define TLS_MULTIPLE_THREADS_IN_TCB 1
405 /* Get the thread descriptor definition. */
406 # include <linuxthreads/descr.h>
408 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/mips/pspinlock.c glibc-2.3.2/linuxthreads/sysdeps/mips/pspinlock.c
409 --- glibc-2.3.2/linuxthreads.old/sysdeps/mips/pspinlock.c 2002-08-27 00:52:36.000000000 -0400
410 +++ glibc-2.3.2/linuxthreads/sysdeps/mips/pspinlock.c 2003-03-13 23:22:05.000000000 -0500
412 /* POSIX spinlock implementation. MIPS version.
413 - Copyright (C) 2000, 2002 Free Software Foundation, Inc.
414 + Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
415 This file is part of the GNU C Library.
417 The GNU C Library is free software; you can redistribute it and/or
419 ("\t\t\t# spin_lock\n"
422 +#if _MIPS_SIM == _MIPS_SIM_ABI32
428 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/mips/pt-machine.h glibc-2.3.2/linuxthreads/sysdeps/mips/pt-machine.h
429 --- glibc-2.3.2/linuxthreads.old/sysdeps/mips/pt-machine.h 2002-08-27 00:52:36.000000000 -0400
430 +++ glibc-2.3.2/linuxthreads/sysdeps/mips/pt-machine.h 2003-03-13 23:22:05.000000000 -0500
432 /* Machine-dependent pthreads configuration and inline functions.
434 - Copyright (C) 1996, 1997, 1998, 2000, 2002 Free Software Foundation, Inc.
435 + Copyright (C) 1996, 1997, 1998, 2000, 2002, 2003
436 + Free Software Foundation, Inc.
437 This file is part of the GNU C Library.
438 Contributed by Ralf Baechle <ralf@gnu.org>.
439 Based on the Alpha version by Richard Henderson <rth@tamu.edu>.
441 ("/* Inline compare & swap */\n"
444 +#if _MIPS_SIM == _MIPS_SIM_ABI32
447 +#if defined _ABI64 && _MIPS_SIM == _ABI64
455 +#if defined _ABI64 && _MIPS_SIM == _ABI64
463 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/powerpc/powerpc64/pt-machine.h glibc-2.3.2/linuxthreads/sysdeps/powerpc/powerpc64/pt-machine.h
464 --- glibc-2.3.2/linuxthreads.old/sysdeps/powerpc/powerpc64/pt-machine.h 2002-09-14 04:55:04.000000000 -0400
465 +++ glibc-2.3.2/linuxthreads/sysdeps/powerpc/powerpc64/pt-machine.h 2003-03-02 06:44:12.000000000 -0500
467 /* Machine-dependent pthreads configuration and inline functions.
469 - Copyright (C) 2002 Free Software Foundation, Inc.
470 + Copyright (C) 2002, 2003 Free Software Foundation, Inc.
471 This file is part of the GNU C Library.
473 The GNU C Library is free software; you can redistribute it and/or
475 /* Initialize the thread-unique value. */
476 #define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
478 +/* Access to data in the thread descriptor is easy. */
479 +#define THREAD_GETMEM(descr, member) \
480 + ((void) (descr), THREAD_SELF->member)
481 +#define THREAD_GETMEM_NC(descr, member) \
482 + ((void) (descr), THREAD_SELF->member)
483 +#define THREAD_SETMEM(descr, member, value) \
484 + ((void) (descr), THREAD_SELF->member = (value))
485 +#define THREAD_SETMEM_NC(descr, member, value) \
486 + ((void) (descr), THREAD_SELF->member = (value))
488 /* Compare-and-swap for semaphores. */
489 /* note that test-and-set(x) is the same as !compare-and-swap(x, 0, 1) */
491 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/powerpc/tcb-offsets.sym glibc-2.3.2/linuxthreads/sysdeps/powerpc/tcb-offsets.sym
492 --- glibc-2.3.2/linuxthreads.old/sysdeps/powerpc/tcb-offsets.sym 2003-02-17 15:32:09.000000000 -0500
493 +++ glibc-2.3.2/linuxthreads/sysdeps/powerpc/tcb-offsets.sym 2003-03-02 06:44:10.000000000 -0500
498 -MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads)
501 +-- This could go into powerpc32/ instead and conditionalize #include of it.
502 +#ifndef __powerpc64__
506 +-- Abuse tls.h macros to derive offsets relative to the thread register.
507 +# undef __thread_register
508 +# define __thread_register ((void *) 0)
509 +# define thread_offsetof(mem) ((void *) &THREAD_SELF->p_##mem - (void *) 0)
513 +# define thread_offsetof(mem) offsetof (tcbhead_t, mem)
517 +MULTIPLE_THREADS_OFFSET thread_offsetof (multiple_threads)
520 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/powerpc/tls.h glibc-2.3.2/linuxthreads/sysdeps/powerpc/tls.h
521 --- glibc-2.3.2/linuxthreads.old/sysdeps/powerpc/tls.h 2003-02-27 17:40:10.000000000 -0500
522 +++ glibc-2.3.2/linuxthreads/sysdeps/powerpc/tls.h 2003-03-02 06:44:14.000000000 -0500
529 - void *tcb; /* Pointer to the TCB. Not necessary the
530 - thread descriptor used by libpthread. */
532 - void *self; /* Pointer to the thread descriptor. */
533 - int multiple_threads;
536 #else /* __ASSEMBLER__ */
537 # include <tcb-offsets.h>
538 #endif /* __ASSEMBLER__ */
541 # ifndef __ASSEMBLER__
543 +/* This layout is actually wholly private and not affected by the ABI.
544 + Nor does it overlap the pthread data structure, so we need nothing
545 + extra here at all. */
551 /* This is the size of the initial TCB. */
552 # define TLS_INIT_TCB_SIZE sizeof (tcbhead_t)
555 /* This is the size we need before TCB. */
556 # define TLS_PRE_TCB_SIZE sizeof (struct _pthread_descr_struct)
558 -/* The following assumes that TP (R13) is points to the end of the
559 +/* The following assumes that TP (R2 or R13) is points to the end of the
560 TCB + 0x7000 (per the ABI). This implies that TCB address is
561 - R13-(TLS_TCB_SIZE + 0x7000). As we define TLS_DTV_AT_TP we can
562 + TP-(TLS_TCB_SIZE + 0x7000). As we define TLS_DTV_AT_TP we can
563 assume that the pthread_descr is allocated immediately ahead of the
564 TCB. This implies that the pthread_descr address is
565 - R13-(TLS_PRE_TCB_SIZE + TLS_TCB_SIZE + 0x7000). */
566 + TP-(TLS_PRE_TCB_SIZE + TLS_TCB_SIZE + 0x7000). */
567 # define TLS_TCB_OFFSET 0x7000
569 /* The DTV is allocated at the TP; the TCB is placed elsewhere. */
571 special attention since 'errno' is not yet available and if the
572 operation can cause a failure 'errno' must not be touched. */
573 # define TLS_INIT_TP(TCBP, SECONDCALL) \
574 - (__thread_register = (void *) (TCBP) + TLS_TCB_OFFSET + TLS_TCB_SIZE, 0)
575 + (__thread_register = (void *) (TCBP) + TLS_TCB_OFFSET + TLS_TCB_SIZE, NULL)
577 /* Return the address of the dtv for the current thread. */
578 # define THREAD_DTV() \
579 @@ -116,30 +115,36 @@
580 (__thread_register = ((void *) (DESCR) \
581 + TLS_TCB_OFFSET + TLS_TCB_SIZE + TLS_PRE_TCB_SIZE))
583 +/* Make sure we have the p_multiple_threads member in the thread structure.
585 +# ifndef __powerpc64__
586 +# define TLS_MULTIPLE_THREADS_IN_TCB 1
589 /* Get the thread descriptor definition. */
590 # include <linuxthreads/descr.h>
592 -/* Generic bits of LinuxThreads may call these macros with
593 - DESCR set to NULL. We are expected to be able to reference
594 - the "current" value. */
596 -# define THREAD_GETMEM(descr, member) \
597 - ((void) sizeof (descr), THREAD_SELF->member)
598 -# define THREAD_SETMEM(descr, member, value) \
599 - ((void) sizeof (descr), THREAD_SELF->member = (value))
601 -#define THREAD_GETMEM_NC(descr, member) THREAD_GETMEM (descr, member)
602 -#define THREAD_SETMEM_NC(descr, member, value) \
603 - THREAD_SETMEM ((descr), member, (value))
605 # endif /* __ASSEMBLER__ */
607 -#else /* Not HAVE_TLS_SUPPORT. */
608 +#elif !defined __ASSEMBLER__ && !defined __powerpc64__
610 +/* This overlaps the start of the pthread_descr. On PPC32, system
611 + calls and such use this to find the multiple_threads flag and need
612 + to use the same offset relative to the thread register in both
613 + single-threaded and multi-threaded code. On PPC64, the global
614 + variable is always used, so single-threaded code without TLS
615 + never needs to initialize the thread register at all. */
618 + void *tcb; /* Never used. */
619 + dtv_t *dtv; /* Never used. */
620 + void *self; /* Used only if multithreaded, and rarely. */
621 + int multiple_threads; /* Only this member is really used. */
624 #define NONTLS_INIT_TP \
626 - static const tcbhead_t nontls_init_tp \
627 - = { .multiple_threads = 0 }; \
628 + static const tcbhead_t nontls_init_tp = { .multiple_threads = 0 }; \
629 __thread_self = (__typeof (__thread_self)) &nontls_init_tp; \
632 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/pthread/bits/#libc-tsd.h# glibc-2.3.2/linuxthreads/sysdeps/pthread/bits/#libc-tsd.h#
633 --- glibc-2.3.2/linuxthreads.old/sysdeps/pthread/bits/#libc-tsd.h# 2003-01-03 17:10:19.000000000 -0500
634 +++ glibc-2.3.2/linuxthreads/sysdeps/pthread/bits/#libc-tsd.h# 1969-12-31 19:00:00.000000000 -0500
636 -/* libc-internal interface for thread-specific data. LinuxThreads version.
637 - Copyright (C) 1997,98,99,2001,02 Free Software Foundation, Inc.
638 - This file is part of the GNU C Library.
640 - The GNU C Library is free software; you can redistribute it and/or
641 - modify it under the terms of the GNU Lesser General Public License as
642 - published by the Free Software Foundation; either version 2.1 of the
643 - License, or (at your option) any later version.
645 - The GNU C Library is distributed in the hope that it will be useful,
646 - but WITHOUT ANY WARRANTY; without even the implied warranty of
647 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
648 - Lesser General Public License for more details.
650 - You should have received a copy of the GNU Lesser General Public
651 - License along with the GNU C Library; see the file COPYING.LIB. If not,
652 - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
653 - Boston, MA 02111-1307, USA. */
655 -#ifndef _BITS_LIBC_TSD_H
656 -#define _BITS_LIBC_TSD_H 1
658 -#include <linuxthreads/descr.h>
661 -#if USE_TLS && HAVE___THREAD
663 -/* When __thread works, the generic definition is what we want. */
664 -# include <sysdeps/generic/bits/libc-tsd.h>
668 -# include <bits/libc-lock.h>
671 -extern void ** __pthread_internal_tsd_address (int);
672 -extern void *__pthread_internal_tsd_get (int);
673 -extern int __pthread_internal_tsd_set (int, const void *);
675 -weak_extern (__pthread_internal_tsd_address)
676 -weak_extern (__pthread_internal_tsd_get)
677 -weak_extern (__pthread_internal_tsd_set)
680 -#define __libc_tsd_define(CLASS, KEY) CLASS void *__libc_tsd_##KEY##_data;
681 -#define __libc_tsd_address(KEY) \
682 - __libc_maybe_call2 (pthread_internal_tsd_address, \
683 - (_LIBC_TSD_KEY_##KEY), &__libc_tsd_##KEY##_data)
684 -#define __libc_tsd_get(KEY) \
685 - __libc_maybe_call2 (pthread_internal_tsd_get, \
686 - (_LIBC_TSD_KEY_##KEY), __libc_tsd_##KEY##_data)
687 -#define __libc_tsd_set(KEY, VALUE) \
688 - __libc_maybe_call2 (pthread_internal_tsd_set, \
689 - (_LIBC_TSD_KEY_##KEY, (VALUE)), \
690 - (__libc_tsd_##KEY##_data = (VALUE), 0))
694 -#endif /* bits/libc-tsd.h */
695 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/pthread/bits/typesizes.h glibc-2.3.2/linuxthreads/sysdeps/pthread/bits/typesizes.h
696 --- glibc-2.3.2/linuxthreads.old/sysdeps/pthread/bits/typesizes.h 1969-12-31 19:00:00.000000000 -0500
697 +++ glibc-2.3.2/linuxthreads/sysdeps/pthread/bits/typesizes.h 2003-03-25 15:39:24.000000000 -0500
699 +/* bits/typesizes.h -- underlying types for *_t. Generic version.
700 + Copyright (C) 2002, 2003 Free Software Foundation, Inc.
701 + This file is part of the GNU C Library.
703 + The GNU C Library is free software; you can redistribute it and/or
704 + modify it under the terms of the GNU Lesser General Public
705 + License as published by the Free Software Foundation; either
706 + version 2.1 of the License, or (at your option) any later version.
708 + The GNU C Library is distributed in the hope that it will be useful,
709 + but WITHOUT ANY WARRANTY; without even the implied warranty of
710 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
711 + Lesser General Public License for more details.
713 + You should have received a copy of the GNU Lesser General Public
714 + License along with the GNU C Library; if not, write to the Free
715 + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
718 +#ifndef _BITS_TYPES_H
719 +# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
722 +#ifndef _BITS_TYPESIZES_H
723 +#define _BITS_TYPESIZES_H 1
725 +/* See <bits/types.h> for the meaning of these macros. This file exists so
726 + that <bits/types.h> need not vary across different GNU platforms. */
728 +#define __DEV_T_TYPE __UQUAD_TYPE
729 +#define __UID_T_TYPE __U32_TYPE
730 +#define __GID_T_TYPE __U32_TYPE
731 +#define __INO_T_TYPE __ULONGWORD_TYPE
732 +#define __INO64_T_TYPE __UQUAD_TYPE
733 +#define __MODE_T_TYPE __U32_TYPE
734 +#define __NLINK_T_TYPE __UWORD_TYPE
735 +#define __OFF_T_TYPE __SLONGWORD_TYPE
736 +#define __OFF64_T_TYPE __SQUAD_TYPE
737 +#define __PID_T_TYPE __S32_TYPE
738 +#define __RLIM_T_TYPE __ULONGWORD_TYPE
739 +#define __RLIM64_T_TYPE __UQUAD_TYPE
740 +#define __BLKCNT_T_TYPE __SLONGWORD_TYPE
741 +#define __BLKCNT64_T_TYPE __SQUAD_TYPE
742 +#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE
743 +#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
744 +#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
745 +#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
746 +#define __ID_T_TYPE __U32_TYPE
747 +#define __CLOCK_T_TYPE __SLONGWORD_TYPE
748 +#define __TIME_T_TYPE __SLONGWORD_TYPE
749 +#define __USECONDS_T_TYPE __U32_TYPE
750 +#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
751 +#define __DADDR_T_TYPE __S32_TYPE
752 +#define __SWBLK_T_TYPE __SLONGWORD_TYPE
753 +#define __KEY_T_TYPE __S32_TYPE
754 +#define __CLOCKID_T_TYPE __S32_TYPE
755 +#define __TIMER_T_TYPE __S32_TYPE
756 +#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE
757 +#define __FSID_T_TYPE struct { int __val[2]; }
759 +/* Number of descriptors that can fit in an `fd_set'. */
760 +#define __FD_SETSIZE 1024
763 +#endif /* bits/typesizes.h */
764 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/pthread/errno-loc.c glibc-2.3.2/linuxthreads/sysdeps/pthread/errno-loc.c
765 --- glibc-2.3.2/linuxthreads.old/sysdeps/pthread/errno-loc.c 2002-12-31 14:14:22.000000000 -0500
766 +++ glibc-2.3.2/linuxthreads/sysdeps/pthread/errno-loc.c 2003-03-31 19:52:40.000000000 -0500
768 /* MT support function to get address of `errno' variable, linuxthreads
770 - Copyright (C) 1996, 1998, 2002 Free Software Foundation, Inc.
771 + Copyright (C) 1996, 1998, 2002, 2003 Free Software Foundation, Inc.
772 This file is part of the GNU C Library.
774 The GNU C Library is free software; you can redistribute it and/or
779 +#include <linuxthreads/internals.h>
780 #include <sysdep-cancel.h>
783 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/pthread/herrno-loc.c glibc-2.3.2/linuxthreads/sysdeps/pthread/herrno-loc.c
784 --- glibc-2.3.2/linuxthreads.old/sysdeps/pthread/herrno-loc.c 2002-12-31 14:14:22.000000000 -0500
785 +++ glibc-2.3.2/linuxthreads/sysdeps/pthread/herrno-loc.c 2003-03-31 19:52:40.000000000 -0500
787 -/* Copyright (C) 1996, 97, 98, 2002 Free Software Foundation, Inc.
788 +/* Copyright (C) 1996, 97, 98, 2002, 2003 Free Software Foundation, Inc.
789 This file is part of the GNU C Library.
791 The GNU C Library is free software; you can redistribute it and/or
796 +#include <linuxthreads/internals.h>
797 #include <sysdep-cancel.h>
800 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/pthread/Makefile glibc-2.3.2/linuxthreads/sysdeps/pthread/Makefile
801 --- glibc-2.3.2/linuxthreads.old/sysdeps/pthread/Makefile 2003-02-12 16:40:09.000000000 -0500
802 +++ glibc-2.3.2/linuxthreads/sysdeps/pthread/Makefile 2003-03-19 12:57:45.000000000 -0500
806 ifeq ($(subdir),posix)
807 -CFLAGS-confstr.c += -DLIBPTHREAD_VERSION="\"$(shell sed 's/\(.*\) by .*/\1/' ../nptl/Banner)\""
808 +CFLAGS-confstr.c += -DLIBPTHREAD_VERSION="\"$(shell sed 's/\(.*\) by .*/\1/' ../linuxthreads/Banner)\""
810 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/pthread/res-state.c glibc-2.3.2/linuxthreads/sysdeps/pthread/res-state.c
811 --- glibc-2.3.2/linuxthreads.old/sysdeps/pthread/res-state.c 2002-12-31 14:14:22.000000000 -0500
812 +++ glibc-2.3.2/linuxthreads/sysdeps/pthread/res-state.c 2003-03-31 19:52:40.000000000 -0500
814 -/* Copyright (C) 1996, 97, 98, 2002 Free Software Foundation, Inc.
815 +/* Copyright (C) 1996, 97, 98, 2002, 2003 Free Software Foundation, Inc.
816 This file is part of the GNU C Library.
818 The GNU C Library is free software; you can redistribute it and/or
823 +#include <linuxthreads/internals.h>
824 #include <sysdep-cancel.h>
827 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/pthread/timer_create.c glibc-2.3.2/linuxthreads/sysdeps/pthread/timer_create.c
828 --- glibc-2.3.2/linuxthreads.old/sysdeps/pthread/timer_create.c 2002-08-27 00:52:36.000000000 -0400
829 +++ glibc-2.3.2/linuxthreads/sysdeps/pthread/timer_create.c 2003-03-03 00:28:17.000000000 -0500
831 -/* Copyright (C) 2000 Free Software Foundation, Inc.
832 +/* Copyright (C) 2000, 2003 Free Software Foundation, Inc.
833 This file is part of the GNU C Library.
834 Contributed by Kaz Kylheku <kaz@ashi.footprints.net>.
837 struct timer_node *newtimer = NULL;
838 struct thread_node *thread = NULL;
840 - if (clock_id != CLOCK_REALTIME
842 #ifdef _POSIX_CPUTIME
843 - && clock_id != CLOCK_PROCESS_CPUTIME_ID
844 + || clock_id == CLOCK_PROCESS_CPUTIME_ID
846 #ifdef _POSIX_THREAD_CPUTIME
847 - && clock_id != CLOCK_THREAD_CPUTIME_ID
848 + || clock_id == CLOCK_THREAD_CPUTIME_ID
852 + /* We don't allow timers for CPU clocks. At least not in the
854 + __set_errno (ENOTSUP);
858 + if (clock_id != CLOCK_REALTIME)
860 __set_errno (EINVAL);
863 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/sh/tcb-offsets.sym glibc-2.3.2/linuxthreads/sysdeps/sh/tcb-offsets.sym
864 --- glibc-2.3.2/linuxthreads.old/sysdeps/sh/tcb-offsets.sym 2003-02-07 21:29:53.000000000 -0500
865 +++ glibc-2.3.2/linuxthreads/sysdeps/sh/tcb-offsets.sym 2003-03-02 06:44:20.000000000 -0500
870 -MULTIPLE_THREADS_OFFSET offsetof (struct _pthread_descr_struct, p_header.data.multiple_threads)
871 +MULTIPLE_THREADS_OFFSET offsetof (struct _pthread_descr_struct, p_multiple_threads)
872 TLS_PRE_TCB_SIZE sizeof (struct _pthread_descr_struct)
874 MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads)
875 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/sh/tls.h glibc-2.3.2/linuxthreads/sysdeps/sh/tls.h
876 --- glibc-2.3.2/linuxthreads.old/sysdeps/sh/tls.h 2003-02-07 21:29:53.000000000 -0500
877 +++ glibc-2.3.2/linuxthreads/sysdeps/sh/tls.h 2003-03-02 06:44:20.000000000 -0500
879 __asm __volatile ("ldc %0,gbr" : : "r" (__self + 1)); \
882 +# define TLS_MULTIPLE_THREADS_IN_TCB 1
884 /* Get the thread descriptor definition. This must be after the
885 the definition of THREAD_SELF for TLS. */
886 # include <linuxthreads/descr.h>
887 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
888 --- glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h 1969-12-31 19:00:00.000000000 -0500
889 +++ glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h 2003-03-25 17:03:21.000000000 -0500
891 +/* bits/typesizes.h -- underlying types for *_t. Linux/Alpha version.
892 + Copyright (C) 2002 Free Software Foundation, Inc.
893 + This file is part of the GNU C Library.
895 + The GNU C Library is free software; you can redistribute it and/or
896 + modify it under the terms of the GNU Lesser General Public
897 + License as published by the Free Software Foundation; either
898 + version 2.1 of the License, or (at your option) any later version.
900 + The GNU C Library is distributed in the hope that it will be useful,
901 + but WITHOUT ANY WARRANTY; without even the implied warranty of
902 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
903 + Lesser General Public License for more details.
905 + You should have received a copy of the GNU Lesser General Public
906 + License along with the GNU C Library; if not, write to the Free
907 + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
910 +#ifndef _BITS_TYPES_H
911 +# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
914 +#ifndef _BITS_TYPESIZES_H
915 +#define _BITS_TYPESIZES_H 1
917 +/* See <bits/types.h> for the meaning of these macros. This file exists so
918 + that <bits/types.h> need not vary across different GNU platforms. */
920 +#define __DEV_T_TYPE __U64_TYPE
921 +#define __UID_T_TYPE __U32_TYPE
922 +#define __GID_T_TYPE __U32_TYPE
923 +#define __INO_T_TYPE __U32_TYPE
924 +#define __INO64_T_TYPE __U64_TYPE
925 +#define __MODE_T_TYPE __U32_TYPE
926 +#define __NLINK_T_TYPE __U32_TYPE
927 +#define __OFF_T_TYPE __SLONGWORD_TYPE
928 +#define __OFF64_T_TYPE __S64_TYPE
929 +#define __PID_T_TYPE __S32_TYPE
930 +#define __RLIM_T_TYPE __ULONGWORD_TYPE
931 +#define __RLIM64_T_TYPE __U64_TYPE
932 +#define __BLKCNT_T_TYPE __U32_TYPE
933 +#define __BLKCNT64_T_TYPE __U64_TYPE
934 +#define __FSBLKCNT_T_TYPE __S32_TYPE
935 +#define __FSBLKCNT64_T_TYPE __S64_TYPE
936 +#define __FSFILCNT_T_TYPE __U32_TYPE
937 +#define __FSFILCNT64_T_TYPE __U64_TYPE
938 +#define __ID_T_TYPE __U32_TYPE
939 +#define __CLOCK_T_TYPE __SLONGWORD_TYPE
940 +#define __TIME_T_TYPE __SLONGWORD_TYPE
941 +#define __USECONDS_T_TYPE __U32_TYPE
942 +#define __SUSECONDS_T_TYPE __S64_TYPE
943 +#define __DADDR_T_TYPE __S32_TYPE
944 +#define __SWBLK_T_TYPE __SLONGWORD_TYPE
945 +#define __KEY_T_TYPE __S32_TYPE
946 +#define __CLOCKID_T_TYPE __S32_TYPE
947 +#define __TIMER_T_TYPE __S32_TYPE
948 +#define __BLKSIZE_T_TYPE __U32_TYPE
949 +#define __FSID_T_TYPE struct { int __val[2]; }
951 +/* Number of descriptors that can fit in an `fd_set'. */
952 +#define __FD_SETSIZE 1024
955 +#endif /* bits/typesizes.h */
956 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/alpha/pt-sigsuspend.S glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/alpha/pt-sigsuspend.S
957 --- glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/alpha/pt-sigsuspend.S 1969-12-31 19:00:00.000000000 -0500
958 +++ glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/alpha/pt-sigsuspend.S 2003-04-01 19:10:44.000000000 -0500
960 +/* Internal sigsuspend system call for LinuxThreads. Alpha version.
961 + Copyright (C) 2003 Free Software Foundation, Inc.
962 + This file is part of the GNU C Library.
964 + The GNU C Library is free software; you can redistribute it and/or
965 + modify it under the terms of the GNU Lesser General Public
966 + License as published by the Free Software Foundation; either
967 + version 2.1 of the License, or (at your option) any later version.
969 + The GNU C Library is distributed in the hope that it will be useful,
970 + but WITHOUT ANY WARRANTY; without even the implied warranty of
971 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
972 + Lesser General Public License for more details.
974 + You should have received a copy of the GNU Lesser General Public
975 + License along with the GNU C Library; if not, write to the Free
976 + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
981 +#undef PSEUDO_PREPARE_ARGS
982 +#define PSEUDO_PREPARE_ARGS ldq a0, 0(a0);
984 + .hidden __pthread_sigsuspend
985 +PSEUDO_NOERRNO(__pthread_sigsuspend, sigsuspend, 1)
987 +PSEUDO_END_NOERRNO(__pthread_sigsuspend)
988 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
989 --- glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h 2003-01-12 04:13:57.000000000 -0500
990 +++ glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h 2003-03-25 04:44:29.000000000 -0500
993 #if !defined NOT_IN_libc || defined IS_IN_libpthread
995 +/* We push lr onto the stack, so we have to use ldmib instead of ldmia
996 + to find the saved arguments. */
1000 +#define DOARGS_5 str r4, [sp, $-4]!; ldr r4, [sp, $8];
1001 +#define DOARGS_6 mov ip, sp; stmfd sp!, {r4, r5}; ldmib ip, {r4, r5};
1002 +#define DOARGS_7 mov ip, sp; stmfd sp!, {r4, r5, r6}; ldmib ip, {r4, r5, r6};
1005 # define PSEUDO_RET \
1006 ldrcc pc, [sp], $4; \
1011 - ldr ip, [ip, lr]; \
1012 + ldr ip, [ip, reg]; \
1014 # define SINGLE_THREAD_P_INT \
1015 str lr, [sp, $-4]!; \
1016 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/bits/posix_opt.h glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/bits/posix_opt.h
1017 --- glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/bits/posix_opt.h 2002-11-28 20:48:24.000000000 -0500
1018 +++ glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/bits/posix_opt.h 2003-03-02 23:55:24.000000000 -0500
1020 /* Define POSIX options for Linux.
1021 - Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc.
1022 + Copyright (C) 1996-2001, 2002, 2003 Free Software Foundation, Inc.
1023 This file is part of the GNU C Library.
1025 The GNU C Library is free software; you can redistribute it and/or
1027 /* POSIX message queues are not yet supported. */
1028 #undef _POSIX_MESSAGE_PASSING
1030 +/* The monotonic clock might be available. */
1031 +#define _POSIX_MONOTONIC_CLOCK 0
1033 #endif /* posix_opt.h */
1034 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/fork.c glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/fork.c
1035 --- glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/fork.c 2003-01-02 18:26:04.000000000 -0500
1036 +++ glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/fork.c 2003-03-21 19:06:53.000000000 -0500
1038 return __libc_maybe_call2 (pthread_fork, (&__fork_block), ARCH_FORK ());
1040 weak_alias (__libc_fork, __fork)
1041 +libc_hidden_def (__fork)
1042 weak_alias (__libc_fork, fork)
1043 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/i386/bits/posix_opt.h glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
1044 --- glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/i386/bits/posix_opt.h 2002-11-28 20:47:54.000000000 -0500
1045 +++ glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/i386/bits/posix_opt.h 2003-03-02 23:55:24.000000000 -0500
1047 /* Define POSIX options for Linux/ix86.
1048 - Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc.
1049 + Copyright (C) 1996-2001, 2002, 2003 Free Software Foundation, Inc.
1050 This file is part of the GNU C Library.
1052 The GNU C Library is free software; you can redistribute it and/or
1054 /* POSIX message queues are not yet supported. */
1055 #undef _POSIX_MESSAGE_PASSING
1057 +/* The monotonic clock might be available. */
1058 +#define _POSIX_MONOTONIC_CLOCK 0
1060 #endif /* posix_opt.h */
1061 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/ia64/pt-sigsuspend.c glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-sigsuspend.c
1062 --- glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/ia64/pt-sigsuspend.c 1969-12-31 19:00:00.000000000 -0500
1063 +++ glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-sigsuspend.c 2003-04-01 19:10:45.000000000 -0500
1065 +/* Internal sigsuspend system call for LinuxThreads. IA64 version.
1066 + Copyright (C) 2003 Free Software Foundation, Inc.
1067 + This file is part of the GNU C Library.
1069 + The GNU C Library is free software; you can redistribute it and/or
1070 + modify it under the terms of the GNU Lesser General Public
1071 + License as published by the Free Software Foundation; either
1072 + version 2.1 of the License, or (at your option) any later version.
1074 + The GNU C Library is distributed in the hope that it will be useful,
1075 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1076 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1077 + Lesser General Public License for more details.
1079 + You should have received a copy of the GNU Lesser General Public
1080 + License along with the GNU C Library; if not, write to the Free
1081 + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1082 + 02111-1307 USA. */
1085 +#include <signal.h>
1086 +#include <unistd.h>
1088 +#include <sysdep.h>
1089 +#include <sys/syscall.h>
1090 +#include <linuxthreads/internals.h>
1093 +__pthread_sigsuspend (const sigset_t *set)
1095 + INTERNAL_SYSCALL_DECL (err);
1096 + INTERNAL_SYSCALL (rt_sigsuspend, err, 2, set, _NSIG / 8);
1098 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
1099 --- glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h 2003-01-09 14:43:34.000000000 -0500
1100 +++ glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h 2003-03-02 06:44:20.000000000 -0500
1103 # ifndef __ASSEMBLER__
1104 # define SINGLE_THREAD_P \
1105 - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
1106 - p_header.data.multiple_threads) == 0, 1)
1107 + __builtin_expect (THREAD_GETMEM (THREAD_SELF, p_multiple_threads) == 0, 1)
1109 # define SINGLE_THREAD_P \
1110 adds r14 = MULTIPLE_THREADS_OFFSET, r13 ;; ld4 r14 = [r14] ;; cmp4.ne p6, p7 = 0, r14
1111 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
1112 --- glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h 2003-02-17 15:32:09.000000000 -0500
1113 +++ glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h 2003-03-02 06:44:20.000000000 -0500
1116 # ifndef __ASSEMBLER__
1117 # define SINGLE_THREAD_P \
1118 - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
1119 - p_header.data.multiple_threads) == 0, 1)
1120 + __builtin_expect (THREAD_GETMEM (THREAD_SELF, p_multiple_threads) == 0, 1)
1122 # define SINGLE_THREAD_P \
1123 lwz 10,MULTIPLE_THREADS_OFFSET(2); \
1124 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/pt-sigsuspend.c glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/pt-sigsuspend.c
1125 --- glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/pt-sigsuspend.c 1969-12-31 19:00:00.000000000 -0500
1126 +++ glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/pt-sigsuspend.c 2003-04-01 19:10:44.000000000 -0500
1128 +/* Internal sigsuspend system call for LinuxThreads. Generic Linux version.
1129 + Copyright (C) 2003 Free Software Foundation, Inc.
1130 + This file is part of the GNU C Library.
1132 + The GNU C Library is free software; you can redistribute it and/or
1133 + modify it under the terms of the GNU Lesser General Public
1134 + License as published by the Free Software Foundation; either
1135 + version 2.1 of the License, or (at your option) any later version.
1137 + The GNU C Library is distributed in the hope that it will be useful,
1138 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1139 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1140 + Lesser General Public License for more details.
1142 + You should have received a copy of the GNU Lesser General Public
1143 + License along with the GNU C Library; if not, write to the Free
1144 + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1145 + 02111-1307 USA. */
1148 +#include <signal.h>
1149 +#include <unistd.h>
1151 +#include <sysdep.h>
1152 +#include <sys/syscall.h>
1153 +#include <linuxthreads/internals.h>
1155 +#include "kernel-features.h"
1158 +__pthread_sigsuspend (const sigset_t *set)
1160 + INTERNAL_SYSCALL_DECL (err);
1161 +#if !__ASSUME_REALTIME_SIGNALS
1162 + static int __pthread_missing_rt_sigs;
1164 +# ifdef __NR_rt_sigsuspend
1165 + /* First try the RT signals. */
1166 + if (!__pthread_missing_rt_sigs)
1168 + /* XXX The size argument hopefully will have to be changed to the
1169 + real size of the user-level sigset_t. */
1171 + r = INTERNAL_SYSCALL (rt_sigsuspend, err, 2, set, _NSIG / 8);
1172 + if (INTERNAL_SYSCALL_ERRNO (r, err) != ENOSYS)
1175 + __pthread_missing_rt_sigs = 1;
1179 + INTERNAL_SYSCALL (sigsuspend, err, 3, 0, 0, set->__val[0]);
1181 + INTERNAL_SYSCALL (rt_sigsuspend, err, 2, set, _NSIG / 8);
1184 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/s390/s390-64/pt-sigsuspend.c glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/pt-sigsuspend.c
1185 --- glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/s390/s390-64/pt-sigsuspend.c 1969-12-31 19:00:00.000000000 -0500
1186 +++ glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/s390/s390-64/pt-sigsuspend.c 2003-04-01 19:10:45.000000000 -0500
1188 +#include "../../ia64/pt-sigsuspend.c"
1189 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
1190 --- glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h 2003-02-07 21:29:53.000000000 -0500
1191 +++ glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h 2003-03-02 06:44:19.000000000 -0500
1193 # ifndef __ASSEMBLER__
1194 # if defined FLOATING_STACKS && USE___THREAD && defined PIC
1195 # define SINGLE_THREAD_P \
1196 - __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
1197 - p_header.data.multiple_threads) == 0, 1)
1198 + __builtin_expect (THREAD_GETMEM (THREAD_SELF, p_multiple_threads) == 0, 1)
1200 extern int __local_multiple_threads attribute_hidden;
1201 # define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
1202 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
1203 --- glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h 1969-12-31 19:00:00.000000000 -0500
1204 +++ glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h 2003-03-25 17:02:20.000000000 -0500
1206 +/* bits/typesizes.h -- underlying types for *_t. Linux/SPARC version.
1207 + Copyright (C) 2002 Free Software Foundation, Inc.
1208 + This file is part of the GNU C Library.
1210 + The GNU C Library is free software; you can redistribute it and/or
1211 + modify it under the terms of the GNU Lesser General Public
1212 + License as published by the Free Software Foundation; either
1213 + version 2.1 of the License, or (at your option) any later version.
1215 + The GNU C Library is distributed in the hope that it will be useful,
1216 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1217 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1218 + Lesser General Public License for more details.
1220 + You should have received a copy of the GNU Lesser General Public
1221 + License along with the GNU C Library; if not, write to the Free
1222 + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1223 + 02111-1307 USA. */
1225 +#ifndef _BITS_TYPES_H
1226 +# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
1229 +#ifndef _BITS_TYPESIZES_H
1230 +#define _BITS_TYPESIZES_H 1
1232 +/* See <bits/types.h> for the meaning of these macros. This file exists so
1233 + that <bits/types.h> need not vary across different GNU platforms. */
1235 +#define __DEV_T_TYPE __UQUAD_TYPE
1236 +#define __UID_T_TYPE __U32_TYPE
1237 +#define __GID_T_TYPE __U32_TYPE
1238 +#define __INO_T_TYPE __ULONGWORD_TYPE
1239 +#define __INO64_T_TYPE __UQUAD_TYPE
1240 +#define __MODE_T_TYPE __U32_TYPE
1241 +#define __NLINK_T_TYPE __U32_TYPE
1242 +#define __OFF_T_TYPE __SLONGWORD_TYPE
1243 +#define __OFF64_T_TYPE __SQUAD_TYPE
1244 +#define __PID_T_TYPE __S32_TYPE
1245 +#define __RLIM_T_TYPE __ULONGWORD_TYPE
1246 +#define __RLIM64_T_TYPE __UQUAD_TYPE
1247 +#define __BLKCNT_T_TYPE __SLONGWORD_TYPE
1248 +#define __BLKCNT64_T_TYPE __SQUAD_TYPE
1249 +#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE
1250 +#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
1251 +#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
1252 +#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
1253 +#define __ID_T_TYPE __U32_TYPE
1254 +#define __CLOCK_T_TYPE __SLONGWORD_TYPE
1255 +#define __TIME_T_TYPE __SLONGWORD_TYPE
1256 +#define __USECONDS_T_TYPE __U32_TYPE
1257 +#define __SUSECONDS_T_TYPE __S32_TYPE
1258 +#define __DADDR_T_TYPE __S32_TYPE
1259 +#define __SWBLK_T_TYPE __SLONGWORD_TYPE
1260 +#define __KEY_T_TYPE __S32_TYPE
1261 +#define __CLOCKID_T_TYPE __S32_TYPE
1262 +#define __TIMER_T_TYPE __S32_TYPE
1263 +#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE
1264 +#define __FSID_T_TYPE struct { int __val[2]; }
1266 +/* Number of descriptors that can fit in an `fd_set'. */
1267 +#define __FD_SETSIZE 1024
1270 +#endif /* bits/typesizes.h */
1271 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/sparc/Makefile glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/sparc/Makefile
1272 --- glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/sparc/Makefile 2003-02-21 13:55:30.000000000 -0500
1273 +++ glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/sparc/Makefile 2003-03-14 18:36:52.000000000 -0500
1277 $(CC) $(CFLAGS) $(CPPFLAGS) -dumpspecs \
1278 - | sed 's,\(/usr/lib\(\|64\)/\|^\|\([^/a-z]\)\)\(crt[in]\.o\),\3./\4,g' > $@.new
1279 + | sed 's~\(/usr/lib\(\|64\)/\|^\|\([^/a-z]\)\)\(crt[in]\.o\)~\3'$(objpfx)'\4~g' > $@.new
1282 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/sparc/sparc64/Makefile glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/Makefile
1283 --- glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/sparc/sparc64/Makefile 1969-12-31 19:00:00.000000000 -0500
1284 +++ glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/Makefile 2003-03-14 18:36:52.000000000 -0500
1286 +# glibc makefile fragment for linuxthreads on sparc/sparc64.
1288 +ifeq ($(subdir),linuxthreads)
1289 +libpthread-routines += ptw-sigprocmask
1291 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c
1292 --- glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c 1969-12-31 19:00:00.000000000 -0500
1293 +++ glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc64/pt-sigsuspend.c 2003-04-01 19:10:44.000000000 -0500
1295 +#include "../../ia64/pt-sigsuspend.c"
1296 diff -Nur glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/x86_64/pt-sigsuspend.c glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/x86_64/pt-sigsuspend.c
1297 --- glibc-2.3.2/linuxthreads.old/sysdeps/unix/sysv/linux/x86_64/pt-sigsuspend.c 1969-12-31 19:00:00.000000000 -0500
1298 +++ glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/x86_64/pt-sigsuspend.c 2003-04-01 19:10:45.000000000 -0500
1300 +#include "../ia64/pt-sigsuspend.c"
1301 diff -Nur glibc-2.3.2/linuxthreads.old/tst-cancel4.c glibc-2.3.2/linuxthreads/tst-cancel4.c
1302 --- glibc-2.3.2/linuxthreads.old/tst-cancel4.c 2002-12-28 02:49:20.000000000 -0500
1303 +++ glibc-2.3.2/linuxthreads/tst-cancel4.c 2003-03-06 16:39:15.000000000 -0500
1305 -/* Copyright (C) 2002 Free Software Foundation, Inc.
1306 +/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
1307 This file is part of the GNU C Library.
1308 Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
1317 printf ("%s: sleep returns\n", __FUNCTION__);
1319 diff -Nur glibc-2.3.2/linuxthreads.old/tst-cancel7.c glibc-2.3.2/linuxthreads/tst-cancel7.c
1320 --- glibc-2.3.2/linuxthreads.old/tst-cancel7.c 1969-12-31 19:00:00.000000000 -0500
1321 +++ glibc-2.3.2/linuxthreads/tst-cancel7.c 2003-04-01 19:10:44.000000000 -0500
1323 +/* Test for pthread cancellation of mutex blocks.
1324 + Copyright (C) 2003 Free Software Foundation, Inc.
1325 + This file is part of the GNU C Library.
1326 + Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
1328 + The GNU C Library is free software; you can redistribute it and/or
1329 + modify it under the terms of the GNU Lesser General Public
1330 + License as published by the Free Software Foundation; either
1331 + version 2.1 of the License, or (at your option) any later version.
1333 + The GNU C Library is distributed in the hope that it will be useful,
1334 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1335 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1336 + Lesser General Public License for more details.
1338 + You should have received a copy of the GNU Lesser General Public
1339 + License along with the GNU C Library; if not, write to the Free
1340 + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1341 + 02111-1307 USA. */
1343 +#include <pthread.h>
1345 +#include <stdlib.h>
1346 +#include <unistd.h>
1348 +pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
1349 +pthread_barrier_t b;
1355 + int r = pthread_barrier_wait (&b);
1356 + if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
1358 + printf ("%s: barrier_wait failed\n", __FUNCTION__);
1362 + pthread_mutex_lock (&lock);
1364 + pthread_testcancel ();
1366 + pthread_mutex_unlock (&lock);
1374 + pthread_mutex_lock (&lock);
1376 + if (pthread_barrier_init (&b, NULL, 2) != 0)
1378 + puts ("barrier init failed");
1383 + if (pthread_create (&th, NULL, tf, NULL) != 0)
1385 + puts ("pthread_create failed");
1389 + int r = pthread_barrier_wait (&b);
1390 + if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
1392 + printf ("%s: barrier_wait failed\n", __FUNCTION__);
1396 + if (pthread_cancel (th) != 0)
1398 + puts ("pthread_cancel failed");
1402 + pthread_mutex_unlock (&lock);
1405 + if (pthread_join (th, &status) != 0)
1407 + puts ("join failed");
1411 + if (status != PTHREAD_CANCELED)
1413 + puts ("thread not canceled");
1419 + puts ("thread cancelled in the pthread_mutex_lock call");
1425 + puts ("thread not cancelled in pthread_testcancel call");
1432 +#define TEST_FUNCTION do_test ()
1433 +#include "../test-skeleton.c"
1434 diff -Nur glibc-2.3.2/linuxthreads.old/Versions glibc-2.3.2/linuxthreads/Versions
1435 --- glibc-2.3.2/linuxthreads.old/Versions 2003-01-02 17:33:45.000000000 -0500
1436 +++ glibc-2.3.2/linuxthreads/Versions 2003-03-18 22:34:41.000000000 -0500
1440 # Protected names for functions used in other shared objects.
1441 - __pthread_atfork; __pthread_initialize; __pthread_getspecific;
1442 + __pthread_atfork; __pthread_getspecific;
1443 __pthread_key_create; __pthread_mutex_destroy; __pthread_mutex_init;
1444 __pthread_mutex_lock; __pthread_mutex_trylock; __pthread_mutex_unlock;
1445 __pthread_mutexattr_destroy; __pthread_mutexattr_init;
1447 pthread_getcpuclockid;
1448 pthread_barrier_destroy; pthread_barrier_init; pthread_barrier_wait;
1449 pthread_barrierattr_destroy; pthread_barrierattr_init;
1450 - pthread_barrierattr_getpshared; pthread_barrierattr_setpshared;
1451 + pthread_barrierattr_setpshared;
1452 pthread_mutex_timedlock;
1453 pthread_rwlock_timedrdlock; pthread_rwlock_timedwrlock;
1458 # Internal libc interface to libpthread
1459 + __pthread_initialize;
1460 __pthread_kill_other_threads_np;