]> git.pld-linux.org Git - packages/glibc.git/blame - glibc-linuxthreads.patch
- fix idn (Pawel Nogas <pnogas@amu.edu.pl>)
[packages/glibc.git] / glibc-linuxthreads.patch
CommitLineData
d69553a1 1diff -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
4@@ -1,5 +1,5 @@
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.
9
10 The GNU C Library is free software; you can redistribute it and/or
11@@ -20,6 +20,7 @@
12 #include <alloca.h>
13 #include <stdlib.h>
14 #include <sys/param.h>
15+#include "internals.h"
16 #include <sysdep-cancel.h>
17
18 int
19diff -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
22@@ -1,4 +1,127 @@
23-2003-02-27 Roland McGrath <roland@redhat.com>
24+2003-04-02 Jakub Jelinek <jakub@redhat.com>
25+
26+ * Makefile (libpthread-routines): Add pthread_atfork.
27+ (libpthread-static-only-routines): Add pthread_atfork.
28+
29+2003-04-01 Jakub Jelinek <jakub@redhat.com>
30+
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.
43+
44+2003-03-31 Alexandre Oliva <aoliva@redhat.com>
45+
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.
50+
51+2003-03-25 Ulrich Drepper <drepper@redhat.com>
52+
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.
56+
57+2003-03-24 Daniel Jacobowitz <drow@mvista.com>
58+
59+ * sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
60+ (DOARGS_5, DOARGS_6, DOARGS_7): Rewritten.
61+
62+2003-03-22 Jakub Jelinek <jakub@redhat.com>
63+
64+ * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
65+
66+2003-03-21 Daniel Jacobowitz <drow@mvista.com>
67+
68+ * sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
69+ (SINGLE_THREAD_P_PIC): Use "reg" instead of "lr".
70+
71+2003-03-21 Jakub Jelinek <jakub@redhat.com>
72+
73+ * sysdeps/i386/tls.h [__ASSUME_SET_THREAD_AREA_SYSCALL]
74+ (TLS_SETUP_GS_SEGMENT): Fix a typo.
75+
76+2003-03-19 Ulrich Drepper <drepper@redhat.com>
77+
78+ * sysdeps/pthread/Makefile: Fix cut&paste error.
79+
80+2003-03-18 Roland McGrath <roland@redhat.com>
81+
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.
86+
87+2003-03-14 Jakub Jelinek <jakub@redhat.com>
88+
89+ * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
90+ * sysdeps/unix/sysv/linux/sparc/Makefile ($(objpfx)specs): Use full
91+ path for crt[in].o.
92+
93+2003-03-14 Alexandre Oliva <aoliva@redhat.com>
94+
95+ * sysdeps/mips/pspinlock.c (__pthread_spin_lock): Don't .set
96+ mips2 on new abi.
97+ * sysdeps/mips/pt-machine.h (__compare_and_swap): Likewise.
98+ Handle 64-bit longs on n64.
99+
100+2003-03-07 Jakub Jelinek <jakub@redhat.com>
101+
102+ * sysdeps/ia64/pspinlock.c (__pthread_spin_lock,
103+ __pthread_spin_trylock): Rewritten.
104+
105+2003-03-06 Ulrich Drepper <drepper@redhat.com>
106+
107+ * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
108+ recent kernels.
109+
110+2003-03-02 Ulrich Drepper <drepper@redhat.com>
111+
112+ * sysdeps/pthread/timer_create.c (timer_create): Return correct
113+ error for CPU clocks.
114+
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.
118+
119+2003-03-01 Roland McGrath <roland@redhat.com>
120+
121+ * sysdeps/powerpc/powerpc64/pt-machine.h
122+ (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
123+ New macros.
124+ * sysdeps/powerpc/tls.h: Don't define those here.
125+
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.
132+
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.
148
149 * sysdeps/powerpc/tls.h [HAVE_TLS_SUPPORT]: Define USE_TLS and all
150 related macros.
151diff -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
154@@ -23,6 +23,7 @@
155 #include <stdint.h>
156 #include <sys/types.h>
157 #include <hp-timing.h>
158+#include <tls.h>
159
160 /* Fast thread-specific data internal to libc. */
161 enum __libc_tsd_key_t { _LIBC_TSD_KEY_MALLOC = 0,
162@@ -106,11 +107,14 @@
163
164 union dtv;
165
166-
167-struct _pthread_descr_struct {
168- /* XXX Remove this union for IA-64 style TLS module */
169- union {
170- struct {
171+struct _pthread_descr_struct
172+{
173+#if !defined USE_TLS || !TLS_DTV_AT_TP
174+ /* This overlaps tcbhead_t (see tls.h), as used for TLS without threads. */
175+ union
176+ {
177+ struct
178+ {
179 void *tcb; /* Pointer to the TCB. This is not always
180 the address of this thread descriptor. */
181 union dtv *dtvp;
182@@ -122,6 +126,11 @@
183 } data;
184 void *__padding[16];
185 } p_header;
186+# define p_multiple_threads p_header.data.multiple_threads
187+#elif TLS_MULTIPLE_THREADS_IN_TCB
188+ int p_multiple_threads;
189+#endif
190+
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 */
194diff -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
197@@ -377,6 +377,8 @@
198
199 extern void __pthread_wait_for_restart_signal(pthread_descr self);
200
201+extern void __pthread_sigsuspend (const sigset_t *mask) attribute_hidden;
202+
203 extern int __pthread_yield (void);
204
205 extern int __pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
206diff -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
209@@ -36,8 +36,8 @@
210 install-lib-ldscripts := libpthread.so
211
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 \
220@@ -47,11 +47,12 @@
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-%)
228
229 libpthread-shared-only-routines = pt-allocrtsig
230+libpthread-static-only-routines = pthread_atfork
231
232 libpthread-nonshared = pthread_atfork
233
234@@ -89,7 +90,7 @@
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
243diff -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;
252-#else
253+#if !defined USE_TLS || !TLS_DTV_AT_TP
254 new_thread->p_header.data.tcb = new_thread;
255-#endif
256 new_thread->p_header.data.self = new_thread;
257- new_thread->p_header.data.multiple_threads = 1;
258+#endif
259+#if TLS_MULTIPLE_THREADS_IN_TCB || !defined USE_TLS || !TLS_DTV_AT_TP
260+ new_thread->p_multiple_threads = 1;
261+#endif
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;
265diff -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
268@@ -566,8 +566,10 @@
269 #endif
270
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;
276+#endif
277+ *__libc_multiple_threads_ptr = 1;
278
279 #ifndef HAVE_Z_NODELETE
280 if (__builtin_expect (&__dso_handle != NULL, 1))
281@@ -611,9 +613,13 @@
282 __pthread_handles[1].h_descr = manager_thread = mgr;
283
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;
291+#endif
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);
298 do {
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);
303
304 READ_MEMORY_BARRIER(); /* See comment in __pthread_restart_new */
305diff -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
308@@ -171,7 +171,7 @@
309
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) \
317diff -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
320@@ -1,5 +1,5 @@
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>
326
327@@ -21,6 +21,7 @@
328 #include <errno.h>
329 #include <pthread.h>
330 #include "internals.h"
331+#include <ia64intrin.h>
332
333 /* This implementation is inspired by the implementation used in the
334 Linux kernel. */
335@@ -28,21 +29,15 @@
336 int
337 __pthread_spin_lock (pthread_spinlock_t *lock)
338 {
339- asm volatile
340- ("mov ar.ccv = r0\n\t"
341- "mov r3 = 1\n\t"
342- ";;\n"
343- "1:\n\t"
344- "ld4 r2 = %0\n\t"
345- ";;\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"
349- ";;\n\t"
350- "cmp4.eq p0, p7 = r0, r2\n\t"
351- "(p7) br.cond.spnt.few 1b\n\t"
352- ";;\n"
353- :: "m" (lock) : "r2", "r3", "p7", "memory");
354+ int *p = (int *) lock;
355+
356+ while (__builtin_expect (__sync_val_compare_and_swap_si (p, 0, 1), 0))
357+ {
358+ /* Spin without using the atomic instruction. */
359+ do
360+ __asm __volatile ("" : : : "memory");
361+ while (*p);
362+ }
363 return 0;
364 }
365 weak_alias (__pthread_spin_lock, pthread_spin_lock)
366@@ -51,16 +46,7 @@
367 int
368 __pthread_spin_trylock (pthread_spinlock_t *lock)
369 {
370- int oldval;
371-
372- asm volatile
373- ("mov ar.ccv = r0\n\t"
374- "mov r2 = 1\n\t"
375- ";;\n\t"
376- "cmpxchg4.acq %0 = %1, r2, ar.ccv\n\t"
377- ";;\n"
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;
381 }
382 weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
383
384diff -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
387@@ -3,7 +3,7 @@
388
389 --
390 #ifdef USE_TLS
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)
393 #else
394 MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads)
395 #endif
396diff -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
399@@ -98,6 +98,8 @@
400 # define INIT_THREAD_SELF(descr, nr) \
401 (__thread_self = (struct _pthread_descr_struct *)(descr) + 1)
402
403+# define TLS_MULTIPLE_THREADS_IN_TCB 1
404+
405 /* Get the thread descriptor definition. */
406 # include <linuxthreads/descr.h>
407
408diff -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
411@@ -1,5 +1,5 @@
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.
416
417 The GNU C Library is free software; you can redistribute it and/or
418@@ -32,7 +32,9 @@
419 ("\t\t\t# spin_lock\n"
420 "1:\n\t"
421 ".set push\n\t"
422+#if _MIPS_SIM == _MIPS_SIM_ABI32
423 ".set mips2\n\t"
424+#endif
425 "ll %1,%3\n\t"
426 "li %2,1\n\t"
427 "bnez %1,1b\n\t"
428diff -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
431@@ -1,6 +1,7 @@
432 /* Machine-dependent pthreads configuration and inline functions.
433
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>.
440@@ -60,12 +61,22 @@
441 ("/* Inline compare & swap */\n"
442 "1:\n\t"
443 ".set push\n\t"
444+#if _MIPS_SIM == _MIPS_SIM_ABI32
445 ".set mips2\n\t"
446+#endif
447+#if defined _ABI64 && _MIPS_SIM == _ABI64
448+ "lld %1,%5\n\t"
449+#else
450 "ll %1,%5\n\t"
451+#endif
452 "move %0,$0\n\t"
453 "bne %1,%3,2f\n\t"
454 "move %0,%4\n\t"
455+#if defined _ABI64 && _MIPS_SIM == _ABI64
456+ "scd %0,%2\n\t"
457+#else
458 "sc %0,%2\n\t"
459+#endif
460 ".set pop\n\t"
461 "beqz %0,1b\n"
462 "2:\n\t"
463diff -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
466@@ -1,6 +1,6 @@
467 /* Machine-dependent pthreads configuration and inline functions.
468 powerpc version.
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.
472
473 The GNU C Library is free software; you can redistribute it and/or
474@@ -57,6 +57,16 @@
475 /* Initialize the thread-unique value. */
476 #define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
477
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))
487+
488 /* Compare-and-swap for semaphores. */
489 /* note that test-and-set(x) is the same as !compare-and-swap(x, 0, 1) */
490
491diff -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
494@@ -1,4 +1,24 @@
495 #include <sysdep.h>
496 #include <tls.h>
497
498-MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads)
499+--
500+
501+-- This could go into powerpc32/ instead and conditionalize #include of it.
502+#ifndef __powerpc64__
503+
504+# ifdef USE_TLS
505+
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)
510+
511+# else
512+
513+# define thread_offsetof(mem) offsetof (tcbhead_t, mem)
514+
515+# endif
516+
517+MULTIPLE_THREADS_OFFSET thread_offsetof (multiple_threads)
518+
519+#endif
520diff -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
523@@ -32,15 +32,6 @@
524 void *pointer;
525 } dtv_t;
526
527-typedef struct
528-{
529- void *tcb; /* Pointer to the TCB. Not necessary the
530- thread descriptor used by libpthread. */
531- dtv_t *dtv;
532- void *self; /* Pointer to the thread descriptor. */
533- int multiple_threads;
534-} tcbhead_t;
535-
536 #else /* __ASSEMBLER__ */
537 # include <tcb-offsets.h>
538 #endif /* __ASSEMBLER__ */
539@@ -52,6 +43,14 @@
540
541 # ifndef __ASSEMBLER__
542
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. */
546+typedef struct
547+{
548+ dtv_t *dtv;
549+} tcbhead_t;
550+
551 /* This is the size of the initial TCB. */
552 # define TLS_INIT_TCB_SIZE sizeof (tcbhead_t)
553
554@@ -67,12 +66,12 @@
555 /* This is the size we need before TCB. */
556 # define TLS_PRE_TCB_SIZE sizeof (struct _pthread_descr_struct)
557
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
568
569 /* The DTV is allocated at the TP; the TCB is placed elsewhere. */
570@@ -99,7 +98,7 @@
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)
576
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))
582
583+/* Make sure we have the p_multiple_threads member in the thread structure.
584+ See below. */
585+# ifndef __powerpc64__
586+# define TLS_MULTIPLE_THREADS_IN_TCB 1
587+# endif
588+
589 /* Get the thread descriptor definition. */
590 # include <linuxthreads/descr.h>
591
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. */
595-
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))
600-
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))
604-
605 # endif /* __ASSEMBLER__ */
606
607-#else /* Not HAVE_TLS_SUPPORT. */
608+#elif !defined __ASSEMBLER__ && !defined __powerpc64__
609+
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. */
616+typedef struct
617+{
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. */
622+} tcbhead_t;
623
624 #define NONTLS_INIT_TP \
625 do { \
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; \
630 } while (0)
631
632diff -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
635@@ -1,59 +0,0 @@
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.
639-
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.
644-
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.
649-
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. */
654-
655-#ifndef _BITS_LIBC_TSD_H
656-#define _BITS_LIBC_TSD_H 1
657-
658-#include <linuxthreads/descr.h>
659-#include <tls.h>
660-
661-#if USE_TLS && HAVE___THREAD
662-
663-/* When __thread works, the generic definition is what we want. */
664-# include <sysdeps/generic/bits/libc-tsd.h>
665-
666-#else
667-
668-# include <bits/libc-lock.h>
669-
670-# ifndef SHARED
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 *);
674-
675-weak_extern (__pthread_internal_tsd_address)
676-weak_extern (__pthread_internal_tsd_get)
677-weak_extern (__pthread_internal_tsd_set)
678-# endif
679-
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))
691-
692-#endif
693-
694-#endif /* bits/libc-tsd.h */
695diff -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
698@@ -0,0 +1,65 @@
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.
702+
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.
707+
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.
712+
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
716+ 02111-1307 USA. */
717+
718+#ifndef _BITS_TYPES_H
719+# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
720+#endif
721+
722+#ifndef _BITS_TYPESIZES_H
723+#define _BITS_TYPESIZES_H 1
724+
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. */
727+
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]; }
758+
759+/* Number of descriptors that can fit in an `fd_set'. */
760+#define __FD_SETSIZE 1024
761+
762+
763+#endif /* bits/typesizes.h */
764diff -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
767@@ -1,6 +1,6 @@
768 /* MT support function to get address of `errno' variable, linuxthreads
769 version.
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.
773
774 The GNU C Library is free software; you can redistribute it and/or
775@@ -20,6 +20,7 @@
776
777 #include <errno.h>
778 #include <tls.h>
779+#include <linuxthreads/internals.h>
780 #include <sysdep-cancel.h>
781
782 #if ! USE___THREAD
783diff -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
786@@ -1,4 +1,4 @@
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.
790
791 The GNU C Library is free software; you can redistribute it and/or
792@@ -18,6 +18,7 @@
793
794 #include <netdb.h>
795 #include <tls.h>
796+#include <linuxthreads/internals.h>
797 #include <sysdep-cancel.h>
798
799 #if ! USE___THREAD
800diff -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
803@@ -9,5 +9,5 @@
804 endif
805
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)\""
809 endif
810diff -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
813@@ -1,4 +1,4 @@
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.
817
818 The GNU C Library is free software; you can redistribute it and/or
819@@ -18,6 +18,7 @@
820
821 #include <resolv.h>
822 #include <tls.h>
823+#include <linuxthreads/internals.h>
824 #include <sysdep-cancel.h>
825
826 #if ! USE___THREAD
827diff -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
830@@ -1,4 +1,4 @@
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>.
835
836@@ -37,15 +37,23 @@
837 struct timer_node *newtimer = NULL;
838 struct thread_node *thread = NULL;
839
840- if (clock_id != CLOCK_REALTIME
841+ if (0
842 #ifdef _POSIX_CPUTIME
843- && clock_id != CLOCK_PROCESS_CPUTIME_ID
844+ || clock_id == CLOCK_PROCESS_CPUTIME_ID
845 #endif
846 #ifdef _POSIX_THREAD_CPUTIME
847- && clock_id != CLOCK_THREAD_CPUTIME_ID
848+ || clock_id == CLOCK_THREAD_CPUTIME_ID
849 #endif
850 )
851 {
852+ /* We don't allow timers for CPU clocks. At least not in the
853+ moment. */
854+ __set_errno (ENOTSUP);
855+ return -1;
856+ }
857+
858+ if (clock_id != CLOCK_REALTIME)
859+ {
860 __set_errno (EINVAL);
861 return -1;
862 }
863diff -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
866@@ -3,7 +3,7 @@
867
868 --
869 #ifdef USE_TLS
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)
873 #else
874 MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads)
875diff -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
878@@ -112,6 +112,8 @@
879 __asm __volatile ("ldc %0,gbr" : : "r" (__self + 1)); \
880 0; })
881
882+# define TLS_MULTIPLE_THREADS_IN_TCB 1
883+
884 /* Get the thread descriptor definition. This must be after the
885 the definition of THREAD_SELF for TLS. */
886 # include <linuxthreads/descr.h>
887diff -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
890@@ -0,0 +1,65 @@
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.
894+
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.
899+
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.
904+
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
908+ 02111-1307 USA. */
909+
910+#ifndef _BITS_TYPES_H
911+# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
912+#endif
913+
914+#ifndef _BITS_TYPESIZES_H
915+#define _BITS_TYPESIZES_H 1
916+
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. */
919+
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]; }
950+
951+/* Number of descriptors that can fit in an `fd_set'. */
952+#define __FD_SETSIZE 1024
953+
954+
955+#endif /* bits/typesizes.h */
956diff -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
959@@ -0,0 +1,28 @@
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.
963+
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.
968+
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.
973+
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
977+ 02111-1307 USA. */
978+
979+#include <sysdep.h>
980+
981+#undef PSEUDO_PREPARE_ARGS
982+#define PSEUDO_PREPARE_ARGS ldq a0, 0(a0);
983+
984+ .hidden __pthread_sigsuspend
985+PSEUDO_NOERRNO(__pthread_sigsuspend, sigsuspend, 1)
986+ ret
987+PSEUDO_END_NOERRNO(__pthread_sigsuspend)
988diff -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
991@@ -24,6 +24,15 @@
992
993 #if !defined NOT_IN_libc || defined IS_IN_libpthread
994
995+/* We push lr onto the stack, so we have to use ldmib instead of ldmia
996+ to find the saved arguments. */
997+#undef DOARGS_5
998+#undef DOARGS_6
999+#undef DOARGS_7
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};
1003+
1004 # undef PSEUDO_RET
1005 # define PSEUDO_RET \
1006 ldrcc pc, [sp], $4; \
1007@@ -110,7 +119,7 @@
1008 ldr reg, 2b; \
1009 3: \
1010 add ip, pc, ip; \
1011- ldr ip, [ip, lr]; \
1012+ ldr ip, [ip, reg]; \
1013 teq ip, #0;
1014 # define SINGLE_THREAD_P_INT \
1015 str lr, [sp, $-4]!; \
1016diff -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
1019@@ -1,5 +1,5 @@
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.
1024
1025 The GNU C Library is free software; you can redistribute it and/or
1026@@ -132,4 +132,7 @@
1027 /* POSIX message queues are not yet supported. */
1028 #undef _POSIX_MESSAGE_PASSING
1029
1030+/* The monotonic clock might be available. */
1031+#define _POSIX_MONOTONIC_CLOCK 0
1032+
1033 #endif /* posix_opt.h */
1034diff -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
1037@@ -39,4 +39,5 @@
1038 return __libc_maybe_call2 (pthread_fork, (&__fork_block), ARCH_FORK ());
1039 }
1040 weak_alias (__libc_fork, __fork)
1041+libc_hidden_def (__fork)
1042 weak_alias (__libc_fork, fork)
1043diff -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
1046@@ -1,5 +1,5 @@
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.
1051
1052 The GNU C Library is free software; you can redistribute it and/or
1053@@ -138,4 +138,7 @@
1054 /* POSIX message queues are not yet supported. */
1055 #undef _POSIX_MESSAGE_PASSING
1056
1057+/* The monotonic clock might be available. */
1058+#define _POSIX_MONOTONIC_CLOCK 0
1059+
1060 #endif /* posix_opt.h */
1061diff -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
1064@@ -0,0 +1,33 @@
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.
1068+
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.
1073+
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.
1078+
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. */
1083+
1084+#include <errno.h>
1085+#include <signal.h>
1086+#include <unistd.h>
1087+
1088+#include <sysdep.h>
1089+#include <sys/syscall.h>
1090+#include <linuxthreads/internals.h>
1091+
1092+void
1093+__pthread_sigsuspend (const sigset_t *set)
1094+{
1095+ INTERNAL_SYSCALL_DECL (err);
1096+ INTERNAL_SYSCALL (rt_sigsuspend, err, 2, set, _NSIG / 8);
1097+}
1098diff -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
1101@@ -101,8 +101,7 @@
1102
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)
1108 # else
1109 # define SINGLE_THREAD_P \
1110 adds r14 = MULTIPLE_THREADS_OFFSET, r13 ;; ld4 r14 = [r14] ;; cmp4.ne p6, p7 = 0, r14
1111diff -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
1114@@ -85,8 +85,7 @@
1115
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)
1121 # else
1122 # define SINGLE_THREAD_P \
1123 lwz 10,MULTIPLE_THREADS_OFFSET(2); \
1124diff -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
1127@@ -0,0 +1,56 @@
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.
1131+
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.
1136+
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.
1141+
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. */
1146+
1147+#include <errno.h>
1148+#include <signal.h>
1149+#include <unistd.h>
1150+
1151+#include <sysdep.h>
1152+#include <sys/syscall.h>
1153+#include <linuxthreads/internals.h>
1154+
1155+#include "kernel-features.h"
1156+
1157+void
1158+__pthread_sigsuspend (const sigset_t *set)
1159+{
1160+ INTERNAL_SYSCALL_DECL (err);
1161+#if !__ASSUME_REALTIME_SIGNALS
1162+ static int __pthread_missing_rt_sigs;
1163+
1164+# ifdef __NR_rt_sigsuspend
1165+ /* First try the RT signals. */
1166+ if (!__pthread_missing_rt_sigs)
1167+ {
1168+ /* XXX The size argument hopefully will have to be changed to the
1169+ real size of the user-level sigset_t. */
1170+ int r;
1171+ r = INTERNAL_SYSCALL (rt_sigsuspend, err, 2, set, _NSIG / 8);
1172+ if (INTERNAL_SYSCALL_ERRNO (r, err) != ENOSYS)
1173+ return;
1174+
1175+ __pthread_missing_rt_sigs = 1;
1176+ }
1177+# endif
1178+
1179+ INTERNAL_SYSCALL (sigsuspend, err, 3, 0, 0, set->__val[0]);
1180+#else
1181+ INTERNAL_SYSCALL (rt_sigsuspend, err, 2, set, _NSIG / 8);
1182+#endif
1183+}
1184diff -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
1187@@ -0,0 +1 @@
1188+#include "../../ia64/pt-sigsuspend.c"
1189diff -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
1192@@ -121,8 +121,7 @@
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)
1199 # else
1200 extern int __local_multiple_threads attribute_hidden;
1201 # define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
1202diff -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
1205@@ -0,0 +1,65 @@
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.
1209+
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.
1214+
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.
1219+
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. */
1224+
1225+#ifndef _BITS_TYPES_H
1226+# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
1227+#endif
1228+
1229+#ifndef _BITS_TYPESIZES_H
1230+#define _BITS_TYPESIZES_H 1
1231+
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. */
1234+
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]; }
1265+
1266+/* Number of descriptors that can fit in an `fd_set'. */
1267+#define __FD_SETSIZE 1024
1268+
1269+
1270+#endif /* bits/typesizes.h */
1271diff -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
1274@@ -6,6 +6,6 @@
1275 generated += specs
1276 $(objpfx)specs:
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
1280 mv -f $@.new $@
1281 endif
1282diff -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
1285@@ -0,0 +1,5 @@
1286+# glibc makefile fragment for linuxthreads on sparc/sparc64.
1287+
1288+ifeq ($(subdir),linuxthreads)
1289+libpthread-routines += ptw-sigprocmask
1290+endif
1291diff -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
1294@@ -0,0 +1 @@
1295+#include "../../ia64/pt-sigsuspend.c"
1296diff -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
1299@@ -0,0 +1 @@
1300+#include "../ia64/pt-sigsuspend.c"
1301diff -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
1304@@ -1,4 +1,4 @@
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.
1309
1310@@ -154,7 +154,7 @@
1311 exit (1);
1312 }
1313
1314- sleep (10000000);
1315+ sleep (1000000);
1316
1317 printf ("%s: sleep returns\n", __FUNCTION__);
1318
1319diff -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
1322@@ -0,0 +1,111 @@
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.
1327+
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.
1332+
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.
1337+
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. */
1342+
1343+#include <pthread.h>
1344+#include <stdio.h>
1345+#include <stdlib.h>
1346+#include <unistd.h>
1347+
1348+pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
1349+pthread_barrier_t b;
1350+int value = 0;
1351+
1352+static void *
1353+tf (void *arg)
1354+{
1355+ int r = pthread_barrier_wait (&b);
1356+ if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
1357+ {
1358+ printf ("%s: barrier_wait failed\n", __FUNCTION__);
1359+ exit (1);
1360+ }
1361+
1362+ pthread_mutex_lock (&lock);
1363+ ++value;
1364+ pthread_testcancel ();
1365+ ++value;
1366+ pthread_mutex_unlock (&lock);
1367+ return NULL;
1368+}
1369+
1370+
1371+static int
1372+do_test (void)
1373+{
1374+ pthread_mutex_lock (&lock);
1375+
1376+ if (pthread_barrier_init (&b, NULL, 2) != 0)
1377+ {
1378+ puts ("barrier init failed");
1379+ return 1;
1380+ }
1381+
1382+ pthread_t th;
1383+ if (pthread_create (&th, NULL, tf, NULL) != 0)
1384+ {
1385+ puts ("pthread_create failed");
1386+ return 1;
1387+ }
1388+
1389+ int r = pthread_barrier_wait (&b);
1390+ if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
1391+ {
1392+ printf ("%s: barrier_wait failed\n", __FUNCTION__);
1393+ exit (1);
1394+ }
1395+
1396+ if (pthread_cancel (th) != 0)
1397+ {
1398+ puts ("pthread_cancel failed");
1399+ return 1;
1400+ }
1401+
1402+ pthread_mutex_unlock (&lock);
1403+
1404+ void *status;
1405+ if (pthread_join (th, &status) != 0)
1406+ {
1407+ puts ("join failed");
1408+ return 1;
1409+ }
1410+
1411+ if (status != PTHREAD_CANCELED)
1412+ {
1413+ puts ("thread not canceled");
1414+ return 1;
1415+ }
1416+
1417+ if (value == 0)
1418+ {
1419+ puts ("thread cancelled in the pthread_mutex_lock call");
1420+ return 1;
1421+ }
1422+
1423+ if (value != 1)
1424+ {
1425+ puts ("thread not cancelled in pthread_testcancel call");
1426+ return 1;
1427+ }
1428+
1429+ return 0;
1430+}
1431+
1432+#define TEST_FUNCTION do_test ()
1433+#include "../test-skeleton.c"
1434diff -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
1437@@ -80,7 +80,7 @@
1438 sigwait;
1439
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;
1446@@ -147,7 +147,7 @@
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;
1454
1455@@ -170,6 +170,7 @@
1456 }
1457 GLIBC_PRIVATE {
1458 # Internal libc interface to libpthread
1459+ __pthread_initialize;
1460 __pthread_kill_other_threads_np;
1461 }
1462 }
This page took 0.1671 seconds and 4 git commands to generate.