* sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
[glibc/pb-stable.git] / nptl / ChangeLog
blobc7af57c8cadda0471e77e5598f4f4987fdf87bb9
1 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
3         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
4         a typo.
6 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
8         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
9         (__pthread_cond_signal): Remove incorrect second addition for
10         cond_lock!=0.
12 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
14         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
15         (__pthread_cond_signal): Use correct futex pointer in
16         __lll_mutex_lock_wait call.
18         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
19         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
21 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
23         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
24         cancelable.
25         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
26         Likewise.
28         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
29         hand-written CFI generation code.  Since ENTRY/END also initiated
30         CFI frames this caused two CFI sets to be generated.
32 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
34         * cleanup_routine.c: New file.
35         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
36         * sysdeps/pthread/pthread.h: Add support for fully exception-based
37         cleanup handling.
38         * Makefile (libpthread-routines): Add cleanup_routine.
39         Add more CFLAGS variables to compile with exceptions.  Add comments
40         why which file needs unwind tables.
41         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
42         tests.
43         * tst-cancelx1.c: New file.
44         * tst-cancelx2.c: New file.
45         * tst-cancelx3.c: New file.
46         * tst-cancelx4.c: New file.
47         * tst-cancelx5.c: New file.
48         * tst-cancelx6.c: New file.
49         * tst-cancelx7.c: New file.
50         * tst-cancelx8.c: New file.
51         * tst-cancelx9.c: New file.
52         * tst-cancelx10.c: New file.
53         * tst-cancelx11.c: New file.
54         * tst-cancelx12.c: New file.
55         * tst-cancelx13.c: New file.
56         * tst-cancelx14.c: New file.
57         * tst-cancelx15.c: New file.
58         * tst-cleanupx0.c: New file.
59         * tst-cleanupx0.expect: New file.
60         * tst-cleanupx1.c: New file.
61         * tst-cleanupx2.c: New file.
62         * tst-cleanupx3.c: New file.
64         * tst-cleanup0.c: Make standard compliant.
65         * tst-cleanup1.c: Likewise.
67         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
68         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
69         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
70         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
71         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
72         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
73         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
74         CLEANUP_JMP_BUF.
75         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
76         * tst-cancel12.c: New file.
77         * tst-cancel13.c: New file.
78         * tst-cancel14.c: New file.
79         * tst-cancel15.c: New file.
80         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
81         and tst-cancel15.
83         * tst-cancel1.c: Add some comments.
85         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
86         timeout correctly.
88 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
90         * Makefile (CFLAGS-pthread_cancel.c): Define.
92 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
94         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
95         Change type of __writer element to int.
96         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
97         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
98         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
99         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
100         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
101         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
102         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
103         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
104         Compare with TID to determine deadlocks.
105         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
106         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
107         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
108         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
109         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
110         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
111         Likewise.
112         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
113         Likewise.
114         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
115         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
116         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
117         Likewise.
118         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
119         Likewise.
120         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
121         * Makefile (tests): Add tst-rwlock12.
122         * tst-rwlock12.c: New file.
124 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
126         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
127         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
128         Remove bogus hidden_proto.
129         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
130         Likewise.
131         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
132         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
133         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
134         ___lll_mutex_timedlock): Likewise.
136 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
138         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
139         (__pthread_cond_signal): Add some code to eventually handle
140         cond_lock!=0.
142 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
144         * Makefile (tests): Add tst-exec4.
145         (tst-exec4-ARGS): Define.
146         * tst-exec4.c: New file.
148 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
150         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
151         Also fail if tv_nsec < 0.
152         (__lll_timedwait_tid): Likewise.
153         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
154         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
155         Likewise.
156         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
157         Likewise.
158         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
159         Likewise.
160         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
161         Likewise.
162         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
163         Likewise.
164         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
165         Likewise.
167         * Makefile (tests): Add tst-sem8 and tst-sem9.
168         * tst-sem8.c: New file.
169         * tst-sem9.c: New file.
170         * sem_open.c: Fix creation of in_use record if the file exists but
171         no internal record.
173         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
174         definitions.
176         * sysdeps/pthread/timer_create.c (timer_create): In case
177         evp==NULL, assign timer ID to sival_ptr.
179         * descr.h (struct pthread_unwind_buf): Change type of prev element to
180         struct pthread_unwind_buf *.
181         (struct pthread): Likewise for cleanup_jmp_buf element.
183         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
184         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
185         * unwind.c (__pthread_unwind_next): Likewise.
187 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
189         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
190         (lll_futex_timed_wait): Use int for futex value parameter.
191         (lll_futex_wake): Likewise.
192         (lll_futex_requeue): Likewise.
194         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
195         Replace one memory operation with one register operation.
197         * tst-join4.c (do_test): Fix error message.
199         * tst-rwlock6.c (do_test): Use correct format specifier.
201         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
202         (__lll_mutex_lock_wait): Replace one memory operation with one
203         register operation.
204         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
205         (__lll_mutex_lock_wait): Likewise.
207         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
208         (__lll_mutex_cond_lock): Add one to value parameter of
209         __lll_lock_wait to reflect reality in the futex syscall.
210         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
211         (lll_mutex_cond_lock): Likewise.
213 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
215         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
216         New function.
217         (lll_mutex_cond_lock): Define.
219 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
221         * Makefile (tests): Add tst-signal6.
222         * tst-signal6.c: New file.
224         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
225         (__lll_mutex_unlock_force): New function
226         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
228         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
229         (__lll_mutex_unlock_force): New function.
230         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
232         * tst-rwlock7.c (do_test): Use correct format specifier.
234         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
235         Find break parameter in correct asm argument.
237 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
239         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
240         Remove out4.
241         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
242         error occured.
243         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
244         Add __mutex.
245         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
246         lll_futex_requeue, lll_mutex_unlock_force): Define.
248 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
250         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
251         (pthread_cond_t): Add __mutex.
252         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
253         lll_futex_requeue, lll_mutex_unlock_force): Define.
255 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
257         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
258         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
259         Add __mutex field.
260         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
261         Define.
262         (lll_futex_wait, lll_futex_wake): Define.
263         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
264         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
265         FUTEX_REQUEUE instead of FUTEX_WAIT.
266         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
267         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
268         mutex which was used in condvar structure.  Call
269         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
270         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
272         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
273         include tcb-offsets.h.  Read wakeup value in locked region.
274         Use the value of gbr register as THREAD_ID.
275         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
276         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
277         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
279         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
280         macros.
282 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
284         * sysdeps/pthread/pthread_cond_broadcast.c
285         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
287 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
289         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
290         typo in register name.
291         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
292         correctly.  Actually use requeue.  Little optimization.
293         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
294         mutex address early.  Handle cancellation state as 32-bit value.
295         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
296         Remove unnecessary label.
298 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
300         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
301         instead of FUTEX_WAIT.
302         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
303         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
304         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
305         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
306         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
307         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
308         used in condvar structure.  Call __pthread_mutex_cond_lock instead
309         of __pthread_mutex_lock_internal.
310         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
311         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
312         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
313         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
314         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
315         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
316         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
317         Add pthread_mutex_cond_lock.
318         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
319         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
320         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
321         lll_mutex_cond_lock.
322         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
323         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
324         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
325         Add __mutex field.
326         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
327         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
329         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
330         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
332         * pthreadP.h: Declare __pthread_mutex_cond_lock.
333         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
334         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
335         macro don't define aliases.
337         * cancellation.c: Remove __pthread_enable_asynccancel_2.
338         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
339         * sysdeps/pthread/pthread_cond_timedwait.c: Use
340         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
341         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
342         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
343         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
344         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
345         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
347 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
349         * sem_open.c: Fix one endless loop.  Implement correct semantics
350         wrt opening the same semaphore more then once.
351         * sem_close.c: Adjust for sem_open change.
352         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
353         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
354         * Makefile (tests): Add tst-sem7.
355         * tst-sem7.c: New file.
357 2003-05-16  Roland McGrath  <roland@redhat.com>
359         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
360         uninitialized variable braino.
362 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
364         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
365         test for syscall availability.
367         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
368         __no_posix_timers to -1 if the syscalls don't exist.
370         * pthread_join.c (pthread_join): Set tid field of the joined
371         thread to -1.  This isn't necessary but helps to recognize some
372         error conditions with almost no cost.
374         * allocatestack.c (FREE_P): Also negative values indicate an
375         unused stack.
377         * unwind.c: Include <unistd.h>.
379 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
381         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
383 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
385         * Makefile (crti-objs, crtn-objs): New variables.
386         (omit-deps, extra-objs): Add crtn.
387         ($(objpfx)libpthread.so): Depend on both crti and crtn
388         and links to them in multidir.
389         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
391 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
393         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
394         (lll_mutex_unlock): Use atomic_exchange_rel.
396 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
398         * cond-perf.c (cons): Add missing locking around setting of alldone.
400 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
402         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
403         related macros.
404         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
406 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
408         * tst-sem6.c: New file.
409         * Makefile (tests): Add tst-sem6.
411         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
412         Use atomic_exchange_rel instead of atomic_exchange.
413         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
414         Likewise.
416         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
417         code for lll_futex_wait and lll_futex_wake in static apps.  Use
418         vsyscall is possible.
420         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
421         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
422         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
423         pthread_setaffinity_np.
424         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
425         and pthread_setaffinity_np.
426         * Makefile (libpthread-routines): Add pthread_getaffinity and
427         pthread_setaffinity.
429         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
430         use it in case mmap to allocate the stack fails.
431         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
432         ARCH_MAP_FLAGS here.
433         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
434         ARCH_RETRY_MMAP.
436 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
438         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
439         handler implementation.  It is now lockless in fork().
440         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
441         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
442         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
443         declare the __fork_*_lists.
444         (struct fork_handler): Include pointers to all three functions.
445         Add next, refcntr and need_signal elements.
446         (__fork_handlers): New declaration.
447         (__register_atfork_malloc): Remove declaration.
448         (HAVE_register_atfork_malloc): Remove definition.
449         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
450         __pthread_child_handler variable.
451         (__libc_pthread_init): Use __register_atfork instead of explicitly
452         adding to the list.
453         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
454         and lll_futex_wake.
455         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
457         * unwind.c (unwind_cleanup): Print error message and then abort.  This
458         function must never be reached.
460         * cond-perf.c: New file.
462 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
464         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
466 2003-05-04  Roland McGrath  <roland@redhat.com>
468         * Makefile ($(objpfx)../libc.so): New target.
470 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
472         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
473         (pthread_condattr_t): Size is only an int, don't use long for
474         alignment.
475         (pthread_mutexattr_t): Likewise.
476         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
477         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
478         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
480 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
482         * sysdeps/i386/tls.h: Define THREAD_ID.
483         * sysdeps/ia64/tls.h: Likewise.
484         * sysdeps/powerpc/tls.h: Likewise.
485         * sysdeps/s390/tls.h: Likewise.
486         * sysdeps/sh/tls.h: Likewise.
487         * sysdeps/x86_64/tls.h: Likewise.
488         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
489         record ownership.
490         * pthread_mutex_timedlock.c: Likewise.
491         * pthread_mutex_trylock.c: Likewise.
492         * pthread_mutex_unlock.c: Likewise.
493         * pthread_rwlock_trywrlock.c: Likewise.
494         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
495         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
496         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
497         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
499         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
500         flag.
502 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
504         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
505         (__SIZEOF_PTHREAD_COND_T): Define to 48.
506         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
507         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
508         Make __align long long instead of long.
509         (pthread_rwlock_t): Formatting.
510         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
511         (pthread_rwlock_t): Formatting.
512         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
513         (pthread_cond_t): Make __align long long instead of long.
514         (pthread_rwlock_t): Move __flags field to the same position as in
515         linuxthreads.
517 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
519         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
520         * tst-rwlock7.c (do_test): Likewise.
522 2003-04-26  Roland McGrath  <roland@redhat.com>
524         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
526 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
528         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
529         sizeof (struct pthread).
530         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
531         1 struct pthread.
532         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
533         to 0.
534         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
535         struct pthread.
536         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
537         to 32-bit bytes.
538         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
539         tcbp.
540         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
541         unneccessarily.
542         (NO_TLS_OFFSET): Define.
543         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
544         add TLS_TCB_SIZE unnecessarily.
546 2003-04-22  Roland McGrath  <roland@redhat.com>
548         * Makeconfig (shared-thread-library): Reverse link order to work
549         around linker bug.
551 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
553         * semaphore.h: Fix typo in comment.
555 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
557         * sysdeps/pthread/sigfillset.c: New file.
559         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
560         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
561         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
562         * sysdeps/pthread/sigaction.c: Likewise.
563         * sysdeps/pthread/sigprocmask.c: New file.
564         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
565         __SIGRTMIN+1.
566         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
567         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
568         in this case.
570 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
572         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
573         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
575         * sysdeps/unix/sysv/linux/unregister-atfork.c
576         (__unregister_atfork): Don't free memory not allocated dynamically.
578         * semaphore.h: Remove __THROW marker from cancellation points.
579         * nptl/sysdeps/pthread/pthread.h: Likewise.
581 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
583         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
584         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
585         __THROW.
587 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
589         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
591 2003-04-15  Roland McGrath  <roland@redhat.com>
593         * forward.c (__pthread_unwind): Tweak to avoid warning.
595 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
597         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
599 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
601         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
602         overflow CFA advance instructions.
603         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
605 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
607         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
608         * sysdeps/i386/pthread_spin_lock.c: Likewise.
609         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
610         defined.
612         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
613         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
614         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
615         DW_CFA_advance_loc for .Laddl-.Lsubl.
617 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
619         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
620         position-independent unwind data for static libraries.
621         Add missing unwind info.  Add comments.
623         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
624         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
625         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
626         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
628 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
630         * Makefile: Make sure all cancellation points are compiled with
631         exception and asynchronous unwind tables.
633         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
634         which mishandles loading of global object addresses in PIC.
635         (THREAD_SETMEM_NC): Likewise.
637 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
639         * pthread.h: Define new data structure for cleanup buffer.  Declare
640         new cleanup handler interfaces.
641         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
642         (struct pthread): Add cleanup_jmp_buf pointer.  Define
643         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
644         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
645         it.  Declare old cleanup handler installation functions.
646         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
647         handling.
648         * cleanup_defer.c: Likewise.
649         * cleanup_compat.c: New file.  Old cleanup code.
650         * cleanup_def_compat.c: New file.  Old cleanup code.
651         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
652         if own thread descriptor.
653         * unwind.c: New file.
654         * forward.c: Add __pthread_unwind.
655         * init.c (pthread_functions): Add __pthread_unwind.
656         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
657         Add ptr___pthread_unwind.
658         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
659         and unwind function.
660         * Makefile (libpthread-routines): Add cleanup_compat,
661         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
662         table generation if necessary.
663         * version.c: Record whether unwind support is compiled in.
664         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
665         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
666         handler interfaces.
667         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
668         complication to generate unwind information for syscall wrappers.
669         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
670         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
671         __cleanup_fct_attribute.
673         * Makefile: Add rules to build and run tst-cleanup0.
674         * tst-cleanup0.c: New file.
675         * tst-cleanup0.expect: New file.
677         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
678         caller.  Optimize to avoid often unecessary local variable.
680 2003-04-11  Roland McGrath  <roland@redhat.com>
682         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
683         sets variable `multidir'; include that.
684         (generated): Add it.
685         ($(objpfx)$(multidir)/crti.o): New target.
686         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
688 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
690         * tst-attr2.c (do_test): Add cast to avoid warning.
691         * tst-mutex4.c (do_test): Likewise.
693 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
695         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
696         in child.
698 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
700         * Makefile (tests): Add tst-detach1.
701         * tst-detach1.c: New file.
703 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
705         * sysdeps/pthread/pthread.h: Remove duplicate
706         pthread_cleanup_{push,pop} definitions.
708         * tst-barrier2.c: Eliminate warnings.
709         * tst-cancel4.c: Likewise.
710         * tst-cond4.c: Likewise.
711         * tst-cond6.c: Likewise.
712         * tst-detach1.c: Likewise.
713         * tst-rwlock4.c: Likewise.
714         * tst-rwlock6.c: Likewise.
715         * tst-rwlock7.c: Likewise.
716         * tst-sem3.c: Likewise.
717         * tst-spin2.c: Likewise.
718         * tst-umask1.c: Likewise.
720 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
722         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
724 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
726         * descr.h (struct pthread): Move cancelhandling member to the front.
728 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
730         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
731         malloc_parent, and malloc_child statically.
732         (__register_atfork_malloc): New function.
733         (free_mem): Don't free any of the malloc_* variables on the list.
734         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
735         Define HAVE_register_atfork_malloc.
737 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
739         * sysdeps/pthread/createthread.c (create_thread): Add some more
740         comments explaining when to set multiple_threads and when not.
742         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
743         THREAD_ATOMIC_BIT_SET if not already defined.
744         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
745         THREAD_ATOMIC_BIT_SET:
746         * sysdeps/x86_64/tls.h: Likewise.
747         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
748         THREAD_ATOMIC_CMPXCHG_VAL.
749         (_pthread_cleanup_pop_restore): Likewise.
750         * cancellation.c (__pthread_enable_asynccancel): Likewise.
751         (__pthread_enable_asynccancel_2): Likewise.
752         (__pthread_disable_asynccancel): Likewise.
753         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
754         (__libc_disable_asynccancel): Likewise.
755         * init.c (sigcancel_handler): Likewise.
756         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
757         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
759 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
761         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
762         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
763         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
764         * Makefile (tests): Add tst-cancel11.
765         * tst-cancel11.c: New file.
767 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
769         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
770         round, not the first.  Use specific_used flag instead of local
771         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
772         (__free_tcb): Don't call deallocate_tsd here.
773         (start_thread): Call deallocate_tsd here.
774         * pthread_setspecific.c: Set specific_used flag really only when
775         needed.
776         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
777         * tst-tsd3.c: New file.
778         * tst-tsd4.c: New file.
780 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
782         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
783         Use atomic_exchange_and_add instead of __lll_add.
784         (__lll_mutex_timedlock): Likewise.
785         Patch by Ian Wienand.
787 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
789         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
790         (SINGLE_THREAD_P): Fix typo.
791         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
793 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
795         * Makefile (tests): Add tst-align.
796         * tst-align.c: New file.
797         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
799         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
800         function correctly.
802         * tst-tsd2.c: Add casts to avoid warnings.
804 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
806         * descr.h (struct pthread): Move most often used elements to the front.
808 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
810         * Makefile (libpthread-routines): Add pthread_atfork.
811         (libpthread-static-only-routines): Add pthread_atfork.
813 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
815         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
816         of TLS_DTV_AT_TP.
817         (INSTALL_DTV): Add parens.
818         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
819         Use passed descr instead of THREAD_SELF.
820         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
821         (__lll_mutex_timedlock_wait): Correct expected value after
822         spurious wakeup.
823         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
824         Release lock before waking up the waiters.
825         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
826         criteria.  Reorderstruct passed to cleanup handler.  Fix
827         handling of cancellation and failung pthread_mutex_unlock call.
828         Use __pthread_enable_asynccancel_2 instead of
829         __pthread_enable_asynccancel.
830         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
831         Return result of lock re-get if it fails.
832         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
833         for __pthread_cleanup_push.
834         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
835         completely broken rwlock implementation.
836         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
837         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
838         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
839         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
840         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
841         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
842         versioned_symbol macro.
843         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
844         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
846 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
848         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
849         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
850         and __helper_tid.
851         (struct timer): Remove th and bar field.
852         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
853         debugging code.  Create only one helper thread.
854         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
855         helper thread.
856         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
857         Renamed.  Define statically.  Use thread info from siginfo.
858         (__helper_once): New variable.
859         (__helper_tid): New variable.
860         (__reset_helper_control): New function.
861         (__start_helper_thread): New function.
863         * pthread_create.c (start_thread): Don't use setjmp inside
864         __builtin_expect to work around gcc bug.
866         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
867         timer_delete syscall fails, but not with ENOSYS, set
868         __no_posix_timers.
870         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
871         (timer_settime): Fix typo.
872         * sysdeps/unix/sysv/linux/timer_getoverr.c
873         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
875 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
877         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
878         offset of cleanupbuf.__prev.
880 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
882         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
883         of included file.
885 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
887         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
888         NULL provide default definition to syscall.
890 2003-03-25  Roland McGrath  <roland@redhat.com>
892         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
893         (timer_id2ptr): Fix typo.
895 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
897         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
898         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
899         * sysdeps/ia64/pthreaddef.h: Likewise.
900         * sysdeps/powerpc/pthreaddef.h: Likewise.
901         * sysdeps/s390/pthreaddef.h: Likewise.
902         * sysdeps/sh/pthreaddef.h: Likewise.
903         * sysdeps/x86_64/pthreaddef.h: Likewise.
904         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
905         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
906         being changed.
907         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
908         SIGTIMER is not unblocked.
909         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
910         RT signal taken.
911         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
912         be send.
913         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
914         pass pointer through as ID.
915         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
916         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
917         * sysdeps/unix/sysv/linux/timer_create.c: New file.
918         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
919         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
920         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
921         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
922         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
923         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
924         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
925         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
926         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
927         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
928         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
929         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
930         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
931         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
932         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
933         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
934         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
935         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
936         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
937         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
938         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
939         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
940         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
941         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
942         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
943         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
944         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
945         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
946         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
947         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
949         * pthreadP.h: Remove FRAME_LEFT definition.
950         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
951         already left frame.  Programs which have this problem are not POSIX
952         compliant.
953         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
955 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
957         * sysdeps/pthread/tst-timer.c: Check return values of the
958         functions we test.
960 2003-03-23  Roland McGrath  <roland@redhat.com>
962         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
963         * tst-tls3mod.c: Likewise.
964         * tst-tls1.c: Likewise.
965         * tst-tls2.c: Likewise.
967         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
968         undefined behavior.
970         * tst-join5.c (tf1, tf2): Add a cast.
972         * Makeconfig (includes): Append -I$(..)nptl to this variable.
974         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
975         Don't test anything.
976         * tst-cond4.c: Likewise.
977         * tst-cond6.c: Likewise.
978         * tst-flock2.c: Likewise.
979         * tst-mutex4.c: Likewise.
980         * tst-rwlock4.c: Likewise.
981         * tst-signal1.c: Likewise.
982         * tst-spin2.c: Likewise.
983         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
985         * tst-mutex4.c: Use test-skeleton.c.
986         * tst-spin2.c: Likewise.
987         * tst-sysconf.c: Likewise.
988         * tst-barrier2.c: Likewise.
989         * tst-cond4.c: Likewise.
990         * tst-cond6.c: Likewise.
991         * tst-rwlock4.c: Likewise.
992         * tst-unload.c: Likewise.
993         * tst-flock2.c (do_test): Use return instead of exit.
995 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
997         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
999 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
1001         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
1002         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
1003         instead of __lll_compare_and_swap.
1004         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
1005         Likewise.
1006         Removed definition if __lll_compare_and_swap.
1008         * cancellation.c: Adjust for new form of compare&exchange macros.
1009         * cleanup_defer.c: Likewise.
1010         * init.c: Likewise.
1011         * libc-cancellation.c: Likewise.
1012         * old_pthread_cond_broadcast.c: Likewise.
1013         * old_pthread_cond_signal.c: Likewise.
1014         * old_pthread_cond_timedwait.c: Likewise.
1015         * old_pthread_cond_wait.c: Likewise.
1016         * pthread_cancel.c: Likewise.
1017         * pthread_create.c: Likewise.
1018         * pthread_detach.c: Likewise.
1019         * pthread_join.c: Likewise.
1020         * pthread_key_delete.c: Likewise.
1021         * pthread_setcancelstate.c: Likewise.
1022         * pthread_setcanceltype.c: Likewise.
1023         * pthread_timedjoin.c: Likewise.
1024         * pthread_tryjoin.c: Likewise.
1025         * sysdeps/pthread/createthread.c: Likewise.
1027 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
1029         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
1030         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
1031         definitions.  Replace uses with calls to atomic_* functions.
1032         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1033         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
1034         __lll_test_and_set calls with atomic_exchange_and_add and
1035         atomic_exchange calls respectively.
1036         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
1037         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1038         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
1039         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
1040         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
1041         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
1042         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
1044         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
1045         returns the old value.
1047 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
1049         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
1050         int for variable OLDVAL and correct inline assembler contraint.
1051         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
1052         type int for variable OLD.
1054         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
1055         only for s390-32.
1056         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
1057         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
1058         instead of multiple_threads field in the TCB.
1060 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
1062         * sysdeps/i386/i686/bits/atomic.h: Removed.
1063         * sysdeps/i386/i586/bits/atomic.h: Removed.
1064         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
1065         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
1066         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
1067         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
1068         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
1069         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
1070         * atomic.h: Removed.  Moved to glibc.
1072         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
1073         support for clock selection.
1075         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
1076         signalling waiters.
1078 2003-03-18  Roland McGrath  <roland@redhat.com>
1080         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
1081         Add __lll_rel_instr first.  Add memory clobber.
1082         (lll_mutex_unlock): Use __lll_test_and_set.
1083         From Paul Mackerras <paulus@samba.org>.
1085         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
1086         unconditionally.
1087         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
1088         (SINGLE_THREAD_P):  Add `header.' prefix.
1089         From Paul Mackerras <paulus@samba.org>.
1091         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
1092         pthread_timedjoin_np to ...
1093         (libpthread: GLIBC_2.3.3): ... here.
1094         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
1096         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1097         Avoid shadowing VAL variable.
1099         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
1100         New macro.
1102 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
1104         * Makefile (tests): Add tst-cond11.
1105         * tst-cond11.c: New file.
1107         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
1108         struct passed to cleanup handler to eliminate one more
1109         instruction.
1110         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1112         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
1113         (pthrad_cond_t): Replace __unused field with __clock.
1115         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
1116         waken all waiters in cleanup handler.
1117         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1118         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1120         * pthread_condattr_getclock.c: New file.
1121         * pthread_condattr_setclock.c: New file.
1122         * sysdeps/pthread/pthread.h: Declare these new functions.
1123         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
1124         * Makefile (libpthread-routines): Add the new functions.
1125         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
1126         Renamed field to value.  Document use of the bits.
1127         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
1128         change.
1129         * pthread_condattr_setpshared.c: Likewise.
1130         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
1131         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
1132         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
1133         Add __clock field.
1134         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1135         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1136         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1137         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1138         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
1139         Implement clock selection.
1140         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
1141         * pthread-errnos.sym: Add ENOSYS.
1142         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
1143         _POSIX_CLOCK_SELECTION.
1144         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1146         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
1147         invalid .size directive.
1149 2003-03-17  Roland McGrath  <roland@redhat.com>
1151         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
1152         Formatting tweaks.
1154 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
1156         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
1157         Use __lll_add instead of spelling it out.  Use protected symbol names.
1158         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
1159         Use __lll_add.
1160         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
1161         Renamed from lll_compare_and_swap.  Use new name where necessary.
1162         (__lll_add): Defined.
1163         (__lll_dec_if_positive): Defined.
1164         (__lll_test_and_set): Defined.
1165         * sysdeps/ia64/pthread_spin_init.c: Removed.
1166         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
1167         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
1168         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
1169         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
1170         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
1171         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
1172         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
1173         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
1174         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
1175         __sync_lock_release_si.
1176         Patch by Jakub Jelinek.
1178         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
1179         Fix timeout handling.
1180         (__lll_timedwait_tid): Likewise.
1181         (lll_unlock_wake_cb): Wake up other waiters if necessary.
1182         Patch by Jakub Jelinek.
1184         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
1186 2003-03-17  Roland McGrath  <roland@redhat.com>
1188         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
1189         * sysdeps/pthread/pthread_spin_init.c: New file.
1190         * sysdeps/pthread/pthread_spin_unlock.c: New file.
1191         * sysdeps/powerpc/Makefile: New file.
1192         * sysdeps/powerpc/pthread_spin_lock.c: New file.
1193         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
1194         * sysdeps/powerpc/pthreaddef.h: New file.
1195         * sysdeps/powerpc/tcb-offsets.sym: New file.
1196         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
1197         * sysdeps/powerpc/tls.h: New file.
1198         * sysdeps/powerpc/bits/atomic.h: New file.
1199         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
1200         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
1201         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
1203         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
1204         * sysdeps/unix/sysv/linux/sem_post.c: New file.
1205         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
1206         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
1207         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
1208         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
1209         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
1210         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
1211         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
1212         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
1213         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
1214         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
1215         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
1216         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
1217         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
1219         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
1220         not gettimeofday.
1221         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
1222         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
1223         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
1224         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
1225         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
1227 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
1229         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
1230         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
1231         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1232         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1233         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
1235 2003-03-16  Roland McGrath  <roland@redhat.com>
1237         * tst-fork4.c: Include <string.h>.
1238         * tst-signal2.c: Likewise.
1239         * tst-mutex5.c (do_test): exit -> return.
1240         * tst-mutex2.c: Include <stdlib.h>.
1242 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
1244         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
1245         (__lll_mutex_timedlock_wait): Correct expected value after
1246         spurious wakeup.  Otherwise we would never wait again.
1248         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
1249         zone versus inline asm stupidity.  Use correct instructions.
1251         * tst-rwlock6.c: Add some more status output.
1253 2003-03-15  Roland McGrath  <roland@redhat.com>
1255         * sysdeps/pthread/configure.in: New file.
1256         * sysdeps/pthread/configure: New file (generated).
1258 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
1260         * allocatestack.c (allocate_stack): Store the exact stack size of
1261         user allocated stacks.
1263 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
1265         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
1266         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
1267         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
1268         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
1269         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
1270         Use `header.' prefix.
1271         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
1273 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
1275         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
1276         __builtin_frame_address, use stack pointer.
1278         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
1279         instead of __builtin_frame_pointer.
1281 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
1283         * tst-basic1.c (do_test): Add cast to avoid warning.
1284         * tst-basic2.c (do_test): Likewise.
1286         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
1287         amount of stack correction.
1289         * tst-fork4.c: Use test-skeleton.c.
1291 2003-03-14  Roland McGrath  <roland@redhat.com>
1293         * init.c: Fix typo "#eli" for "#else".
1295 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
1297         * allocatestack.c (__stack_user): Use hidden_data_def.
1298         * pthread_create.c (__pthread_keys): Likewise.
1300         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
1302 2003-03-14  Roland McGrath  <roland@redhat.com>
1304         * tst-fork4.c: New file.
1305         * Makefile (tests): Add it.
1307         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
1308         we always define the padding space.
1309         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
1310         stopped supporting its own extensions fully.
1311         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
1312         struct also called `header', so `header.multiple_threads' is the field
1313         name to use on all machines.
1314         * allocatestack.c (allocate_stack): Use `header.' prefix.
1315         * sysdeps/pthread/createthread.c (create_thread): Likewise.
1316         * pthread_create.c (__pthread_create_2_1): Likewise.
1317         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
1318         (THREAD_SELF): Likewise.
1319         * sysdeps/x86_64/tls.h: Likewise.
1320         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
1321         (SINGLE_THREAD_P): Likewise.
1322         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
1323         (SINGLE_THREAD_P): Likewise.
1324         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
1325         (SINGLE_THREAD_P): Likewise.
1327         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
1328         value directly.
1330 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
1332         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
1333         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
1335         * pthread_create.c (start_thread): setjmp is expected to return 0.
1337         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
1338         (THREAD_GETMEM_NC): Likewise.
1340 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
1342         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
1343         and the size of the stack which must be allocated is a multiple,
1344         allocate one more page.
1345         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
1346         MULTI_PAGE_ALIASING.
1348 2003-03-13  Roland McGrath  <roland@redhat.com>
1350         * pthread_create.c (start_thread): Set EXITING_BIT after the
1351         event-reporting (and destructors), not before.
1353 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
1355         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
1356         lll_futex_wake): Declare register variables as long int instead of
1357         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
1358         Make syscall arguments clobbered by the syscall.
1359         (lll_futex_wait): Define using lll_futex_timed_wait.
1361         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
1362         to void *.
1364         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
1365         PPID if [! NDEBUG].
1367         * allocatestack.c (nptl_ncreated): Only declare if
1368         COLORING_INCREMENT != 0.
1370         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
1371         (__libc_enable_asynccancel_2): Remove prototype.
1373         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
1374         ctid to match kernel.
1376 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
1378         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
1379         libc_multiple_threads.
1380         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
1381         __libc_multiple_threads to...
1382         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
1384         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
1385         versioning.
1386         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
1387         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1389         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
1390         (__pthread_once_internal): Define.
1392         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
1393         macros instead of .symver directly.
1394         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
1395         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1397         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
1398         * sysdeps/x86_64/tcb-offsets.sym: New file.
1399         * sysdeps/x86_64/Makefile: New file.
1401         * sysdeps/i386/tcb-offsets.sym: Add SELF.
1402         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
1403         to access own pthread_t in TCB.
1404         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1405         Likewise.
1406         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1407         Likewise.
1408         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1410 2003-03-12  Roland McGrath  <roland@redhat.com>
1412         * pthread-errnos.sym: New file.
1413         * Makefile (gen-as-const-headers): New variable, list that file.
1414         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
1415         header <pthread-errnos.h> instead of defining errno values here.
1416         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
1417         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1418         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
1419         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1420         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1421         Likewise.
1422         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1423         Likewise.
1424         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1425         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1426         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
1427         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1428         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1429         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
1430         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1431         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1432         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1433         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
1434         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1435         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
1436         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
1437         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
1438         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
1439         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1440         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1441         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1442         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1443         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
1444         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
1445         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
1446         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
1447         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
1448         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
1449         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1450         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1452         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
1453         CLONE_CHILD_SETTID worked.
1455 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
1457         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
1458         file.
1459         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
1460         file.
1462         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
1463         (pthread_cond_t): Add padding.
1465         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
1466         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
1467         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
1469         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
1470         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
1471         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
1472         (__pthread_rwlock_timedrdlock): Likewise.
1473         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
1474         (__pthread_rwlock_wrlock): Likewise.
1475         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
1476         (__pthread_rwlock_rdlock): Likewise.
1478         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
1480         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
1481         result of lock re-get if it fails.
1483 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
1485         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
1486         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1487         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
1488         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
1489         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1490         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
1491         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1492         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1493         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
1494         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1496         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
1497         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
1499         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
1500         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
1501         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
1502         (create_thread): Likewise.
1503         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
1504         * init.c (__pthread_initialize_minimal_internal): Initialize
1505         __libc_multiple_threads_ptr if necessary.
1506         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
1507         __pthread_multiple_threads and __libc_multiple_threads_ptr.
1508         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
1509         __libc_multiple_threads.
1510         (__libc_pthread_init): Return pointer to __libc_pthread_init if
1511         necessary.
1513         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
1514         (THREAD_SETMEM_NC): Likewise.
1516         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
1517         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
1518         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
1519         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
1521         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
1522         Eliminate one entire instruction.
1524         * cancellation.c (__pthread_enable_asynccancel_2): New function.
1525         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
1526         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1527         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
1528         instead of __pthread_enable_asynccancel.
1529         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
1530         (__pthread_cond_wait): Likewise.
1531         * sysdeps/pthread/pthread_cond_timedwait.c
1532         (__pthread_cond_timedwait): Likewise.
1533         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
1535         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
1536         (__condvar_cleanup): Wake up all waiters in case we got signaled
1537         after being woken up but before disabling asynchronous
1538         cancellation.
1539         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
1540         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
1541         (__condvar_cleanup): Likewise.
1543         * init.c (__NR_set_tid_address): If already defined, don't redefine.
1544         Make it an error if architecture has no #if case.  Add x86-64.
1546         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
1547         pt-initfini.s generation.
1549         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
1550         (TLS_INIT_TP): Fix typo.
1552 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
1554         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
1555         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
1557         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
1558         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
1559         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
1560         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
1561         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
1562         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
1563         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
1564         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
1566 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
1568         * sysdeps/pthread/pthread_cond_timedwait.c
1569         (__pthread_cond_timedwait): Return the result of the final
1570         locking.  If it succeeds, the regular function return value.
1572         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
1573         Return result of the final locking.
1574         * version.c (__nptl_main): Work around problems with the strange
1575         INTERNAL_SYSCALL macro on ppc32.
1576         * init.c (__pthread_initialize_minimal_internal): Unblock
1577         SIGCANCEL in case the parent blocked it.
1578         Reported by Paul Mackerras <paulus@samba.org>.
1580         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
1581         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
1582         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
1584 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
1586         * sysdeps/pthread/pthread_cond_timedwait.c
1587         (__pthread_cond_timedwait): Unlock and fail if
1588         __pthread_mutex_unlock_internal failed.
1590         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
1591         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
1592         Use ARCH_CLONE.
1593         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
1594         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
1595         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
1596         ALLOCATE_STACK): New macros.
1597         (TLS_TPADJ): New macro.
1598         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
1599         (allocate_stack): Handle TLS_DTV_AT_TP and
1600         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
1601         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
1602         Don't set PD->self.
1603         * init.c [__ia64__] (__NR_set_tid_address): Define.
1605         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
1606         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
1607         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
1608         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
1609         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
1610         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
1611         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
1612         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
1613         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
1614         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
1615         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
1616         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
1617         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
1618         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
1619         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
1620         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
1621         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
1622         * sysdeps/ia64/bits/atomic.h: New file.
1623         * sysdeps/ia64/Makefile: New file.
1624         * sysdeps/ia64/pthread_spin_init.c: New file.
1625         * sysdeps/ia64/pthread_spin_lock.c: New file.
1626         * sysdeps/ia64/pthread_spin_trylock.c: New file.
1627         * sysdeps/ia64/pthread_spin_unlock.c: New file.
1628         * sysdeps/ia64/pthreaddef.h: New file.
1629         * sysdeps/ia64/tcb-offsets.sym: New file.
1630         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
1631         * sysdeps/ia64/tls.h: New file.
1633         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
1634         to syscall instead of no arguments.
1636 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
1638         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
1639         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
1640         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
1641         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
1643         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
1644         unused code.
1646         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
1648         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
1649         lowlevelbarrier.sym.
1650         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
1651         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
1652         Include lowlevelbarrier.h and don't define offsets locally.
1653         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
1655         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1656         (__lll_mutex_lock_wait): Reverse order of first two parameters.
1657         (__lll_mutex_timedlock_wait): Likewise.
1658         (lll_mutex_lock): Adjust asm for that.
1659         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
1660         (lll_lock): Adjust asm for operand order change.
1661         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
1662         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
1664         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
1665         Reverse order of parameters.
1666         (__lll_timedwait_tid): Remove regparms attribute.
1667         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
1668         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
1670         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1671         (__lll_timedwait_tid): Remove one unnecessary instruction.
1673         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
1674         __lll_mutex_timedlock_wait only for NOT_IN_libc.
1675         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
1676         lowlevelmutex.S.
1678         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
1679         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
1680         for NOT_IN_libc.
1681         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
1682         lowlevellock.S.
1684         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
1685         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
1686         for libc.so.
1687         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
1688         define LOCK here (if UP is not defined).  The actual code is in
1689         lowlevelmutex.S.
1691         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
1692         LOCK is already defined.  Don't define lll_unlock_wake_cb and
1693         __lll_timedwait_tid for libc.so.
1694         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
1695         define LOCK here (if UP is not defined).  The actual code is in
1696         lowlevellock.S.
1698         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
1699         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
1700         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
1701         instead of lowlevelsem.h.
1702         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
1703         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
1704         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
1706         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
1707         lowlevelrwlock.sym.
1708         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
1709         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
1710         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
1712         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
1713         register loading.
1714         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
1715         last changed.  D'oh.
1717         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
1719         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
1720         of __libc_locking_needed.
1721         (lll_trylock): Initialize %eax to zero.
1723         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
1724         pthread_cond_t definition.
1726 2003-03-10  Roland McGrath  <roland@redhat.com>
1728         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
1729         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
1730         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
1731         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
1732         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
1734         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
1735         Instead of setting PD->multiple_threads, set globals
1736         __pthread_multiple_threads and __libc_multiple_threads.
1737         * sysdeps/pthread/createthread.c (create_thread): Likewise.
1738         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
1739         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
1741         * descr.h (struct pthread): Conditionalize first member on
1742         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
1743         containing an anonymous tcbhead_t.  Move `list' member out.
1744         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
1745         * allocatestack.c: Remove use of `header.data.' prefix.
1746         * pthread_create.c: Likewise.
1747         * init.c (__pthread_initialize_minimal_internal): Likewise.
1748         * sysdeps/pthread/createthread.c (create_thread): Likewise.
1749         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
1750         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
1751         * sysdeps/x86_64/tls.h: Likewise.
1752         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
1753         (SINGLE_THREAD_P): Likewise.
1754         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
1755         (SINGLE_THREAD_P): Likewise.
1756         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
1757         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
1759 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
1761         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
1763         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
1764         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
1766         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
1767         leftovers from the ia32 code.
1769         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
1770         memory load.
1771         (clear_once_control): Don't load %esi.
1773         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
1774         handling.
1776         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
1778         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
1779         * sysdeps/unix/sysv/linux/createthread.c: ...here.
1781         * Makefile (tests): Add tst-cond10.
1782         * tst-cond10.c: New file.
1784 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
1786         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
1787         * tst-signal3.c (do_test): Likewise.
1788         * tst-sem5.c (do_test): Likewise.
1789         * tst-kill6.c (do_test): Likewise.
1790         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
1792         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
1793         of inc/dec.
1794         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
1795         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
1796         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1797         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
1798         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1799         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1800         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1801         Likewise.
1802         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1803         Likewise.
1804         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1805         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1806         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1807         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
1808         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
1809         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
1810         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
1811         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1813         * allocatestack.c (allocate_stack): If mprotect() fails free the
1814         TLS memory.
1816 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
1818         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
1820         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
1821         lll_wake_tid.  This was used only to work around kernel limits in
1822         the early days.
1823         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1824         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
1825         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
1826         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
1828         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
1829         (__pthread_initialize_minimal_internal): Change initialization of
1830         __static_tls_align_m1 appropriately.
1831         * pthreadP.h (__static_tls_align_m1): Renamed from
1832         __static_tls_align.
1833         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
1834         instead of __static_tls_align-1.
1836 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
1838         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
1840         * pthread_create.c: Define __pthread_keys using nocommon
1841         attribute, not by placing it explicitly in bss.
1842         Remove DEFINE_DEALLOC definition.  Not needed anymore.
1844         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
1845         Use it in mmap call to allocate stacks.
1847         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
1849         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
1850         result of the thread function.
1852 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
1854         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
1855         version is just fine.
1857         * sysdeps/unix/sysv/linux/libc_pthread_init.c
1858         (__pthread_child_handler): Renamed from pthread_child_handler,
1859         exported, and marked hidden.  Change all users.
1860         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
1861         free __pthread_child_handler from child list.
1863 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1865         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
1867         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1868         Fix handling of cancellation and failing pthread_mutex_unlock call.
1869         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
1870         (__pthread_cond_wait): Likewise.
1872         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
1873         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
1874         lll_futex_timed_wait call.
1875         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
1876         (pthread_rwlock_timedwrlock): Likewise.
1878         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
1879         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
1880         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
1882         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
1883         check of lll_futex_wake return value.
1885 2003-03-03  Roland McGrath  <roland@redhat.com>
1887         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
1889         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1890         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
1891         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
1893 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
1895         * sysdeps/pthread/timer_create.c (timer_create): Return correct
1896         error for CPU clocks.
1898         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
1899         _POSIX_MONOTONIC_CLOCK.
1900         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
1902         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
1903         recent kernels.
1905 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
1907         * descr.h (struct pthread): Move cleanup field to the front.
1909 2003-03-01  Roland McGrath  <roland@redhat.com>
1911         * sem_open.c (sem_open): Braino fix.
1913 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
1915         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
1916         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
1917         __pthread_cleanup_pop functionality.
1918         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1920         * descr.h (struct pthread): Move tid field to the front now that
1921         it is often used.
1923         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
1924         (__lll_mutex_timedlock_wait): Remove.
1925         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
1926         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
1927         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
1928         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1929         (lll_unlock_wake_cb): Don't save and restore %esi.
1930         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
1931         %esi.
1932         (__lll_timedwait_tid): Add alignment.
1933         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
1934         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
1935         %esi.
1936         (__lll_timedwait_tid): Removed.
1937         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
1938         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
1939         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
1940         (pthread_barrier_wait): Don't save, load, and restore %esi for
1941         last thread.
1942         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
1943         (__pthread_cond_signal): Don't save, load, and restore %esi.
1944         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
1945         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
1946         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
1947         Don't save, load, and restore %esi.
1949 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
1951         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
1952         Release lock before waking up the waiters.
1954         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
1956         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
1957         (reader_thread): Likewise.
1959         * sysdeps/pthread/pthread_rwlock_unlock.c
1960         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
1961         to wake up readers if there are none.
1963         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
1964         Release internal lock before wake threads.
1966 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
1968         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
1969         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
1970         predefined.
1971         * tst-rwlock9.c: Likewise.
1972         * tst-rwlock10.c: New file.
1973         * tst-rwlock11.c: New file.
1975         * Makefile (tests): Add tst-dlsym1.
1976         * tst-dlsym1.c: New file.
1978         * init.c (__pthread_initialize_minimal_internal): Set
1979         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
1980         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
1982 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
1984         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
1986         * tst-cond2.c: Fix sychronization with child.
1988         * tst-rwlock8.c (reader_thread): Remove unused variable.
1990         * Makefile: Add rules to build and run tst-tls3.
1991         * tst-tls3.c: New file.
1992         * tst-tls3mod.c: New file.
1994         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
1995         * tst-rwlock8.c: New file.
1996         * tst-rwlock9.c: New file.
1997         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
1998         complete broken rwlock implementation.
1999         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2000         Likewise.
2001         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2002         Likewise.
2003         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
2004         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2005         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
2006         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
2007         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
2008         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
2009         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
2011 2003-02-23  Roland McGrath  <roland@redhat.com>
2013         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
2015 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
2017         * Makefile (tests): Add tst-context1.
2018         * tst-context1.c: New file.
2020         * Makefile (tests): Add tst-tls1 and tst-tls2.
2021         * tst-tls1.c: New file.
2022         * tst-tls2.c: New file.
2024         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
2025         for failed cmpxchg.
2027         * pthread_create.c (start_thread): Set EXITING_BIT early.
2029         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
2030         (THREAD_GETMEM_NC): Likewise.
2032 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
2034         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
2035         off 3 more bytes by using offset-less instructions when possible.
2037         * Makefile: Add dependency for $(objpfx)version.d.
2039         * eintr.c (eintr_source): Add unnecessary return but the compiler
2040         insists.
2042         * tst-kill3.c: Include <unistd.h>.
2044 2003-02-21  Roland McGrath  <roland@redhat.com>
2046         * pthread_create.c (start_thread): Call __libc_thread_freeres.
2048 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
2050         * Makefile (tests): Add tst-eintr1.
2051         (distribute): Add eintr.c.
2052         * tst-eintr1.c: New file.
2053         * eintr.c: New file.
2055         * pthread_cancel.c (pthread_cancel): Use tkill directly.
2057         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
2058         Disallow sending SIGCANCEL.
2060         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
2061         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
2062         * tst-kill1.c: New file.
2063         * tst-kill2.c: New file.
2064         * tst-kill3.c: New file.
2065         * tst-kill5.c: New file.
2066         * tst-kill6.c: New file.
2067         * tst-basic7.c: Renamed to...
2068         * tst-kill4.c: ...this.
2070 2003-02-21  Roland McGrath  <roland@redhat.com>
2072         * Makefile (install-lib-ldscripts): New variable.
2074 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
2076         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
2077         * pthread_cancel.c: Use INVALID_TD_P.
2078         * pthread_detach.c: Likewise.
2079         * pthread_getschedparam.c: Likewise.
2080         * pthread_setschedparam.c: Likewise.
2081         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
2082         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
2083         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
2084         * pthread_timedjoin.c: Likewise.
2086         * tst-basic7.c: Include <signal.h>.
2088         * pthread_join.c (pthread_join): Limited checking for invalid
2089         descriptors.
2090         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
2092 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
2094         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
2095         beginning of the loop.  Clear the entire first block of TSD.
2096         * Makefile (tests): Add tst-key4.
2097         * tst-key4.c: New file.
2099 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
2101         * Makefile (tests): Add tst-basic7.
2102         * tst-basic7.c: New file.
2104         * pthread_create.c (deallocate_tsd): Mark as internal_function.
2105         Add some more __builtin_expect.
2107         * pthreadP.h: Define dummy version of DEBUGGING_P.
2109 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
2111         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
2112         _POSIX_THREAD_PRIORITY_SCHEDULING.
2113         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
2114         _XOPEN_REALTIME_THREADS.
2115         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
2117         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
2118         kernel returns EINVAL for PID <= 0, work around it.
2120         * Makefile (tests): Add tst-signal5.
2121         * tst-signal5.c: New file.
2123         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
2124         and LOGIN_NAME_MAX.
2126         * tst-cancel1.c (tf): Block all signals.
2128         * Makefile (tests): Add tst-basic6.
2129         * tst-basic6.c: New file.
2131         * tst-basic1.c: Add test for process ID.
2133         * Makefile (tests): Add tst-cancel10.
2134         * tst-cancel10.c: New file.
2136         * Makefile (tests): Add tst-signal4.
2137         * tst-signal4.c: New file.
2139         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
2140         __sigismember instead of sigismember.  Add __builtin_expect.
2142 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
2144         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
2145         pthread_setcancelstate, and pthread_rwlock_setpshared.
2147         * tst-cancel7.c (do_test): Make sure the pid file exists before
2148         canceling the thread.
2150         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
2151         pthread_rwlock_timedrdlock tests.
2152         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
2153         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2154         Check for invalid tv_nsec field.
2155         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2156         Likewise.
2158         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
2159         recursive mutex of overflow.
2161         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
2163         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
2164         going into an endless loop.
2165         * Makefile (tests): Add tst-cancel9.
2166         * tst-cancel9.c: New file.
2168         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
2170 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
2172         * tst-mutex5.c (do_test): Add more timedlock tests.
2174         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
2175         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
2177         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
2178         use INLINE_SYSCALL.  Error number is returned, not -1.
2180         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
2181         and __deallocate_stack with internal_function.
2182         * pthread_create.c: Adjust definitions appropriately.
2183         * allocatestack.c: Likewise.
2185         * pthread_join.c: Add one more __builtin_expect.
2186         * pthread_timedjoin.c: Likewise.
2188         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
2189         not data of sequence number does not match.
2190         Add one __builtin_expect.
2192         * Makefile (tests): Add tst-clock1.
2193         * tst-clock1.c: New file.
2195         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
2196         negative arguments.
2197         * Makefile (tests): Add tst-basic5.
2198         * tst-basic5.c: New file.
2200 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
2202         * Makefile (tests): Add tst-basic4.
2203         * tst-basic4.c: New file.
2205         * pthreadP.h: Add declaraction for __nptl_nthreads.
2206         * pthread_create.c: Define __nptl_nthreads
2207         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
2208         after thread is done.  If then zero, call exit(0).
2209         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2210         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
2211         * init.c (pthread_functions): Initialize ptr_nthreads.
2212         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
2213         (__reclaim_stacks): Decrement __nptl_nthreads.
2214         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
2215         Define.
2216         * Makefile (tests): Add tst-basic3.
2217         * tst-basic3.c: New file.
2219         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
2220         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
2221         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
2222         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
2223         if asynchronous canceling is enabled.
2224         * pthread_join.c (pthread_join): When recognizing circular joins,
2225         take into account the other thread might be already canceled.
2226         * Makefile (tests): Add tst-join5.
2227         * tst-join5.c: New file.
2229         * Makefile (tests): Add tst-join4.
2230         * tst-join4.c: New file.
2232 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
2234         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
2236 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2238         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
2239         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
2240         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
2241         warning.
2242         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
2243         to avoid warning.
2244         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
2245         error if lll_futex_wake failed.
2247 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
2249         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
2250         handling of cancellation and failung pthread_mutex_unlock call.
2251         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2252         * Makefile (tests): Add tst-cond8 and tst-cond9.
2253         * tst-cond8.c: New file.
2254         * tst-cond9.c: New file.
2256         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
2258         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
2259         non-standard initializers with __USE_GNU.
2261         * Makefile (tests): Add tst-cleanup3.
2262         * tst-cleanup3.c: New file.
2264 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
2266         * Makefile (tests): Add tst-attr1 and tst-attr2.
2267         * tst-attr1.c: New file.
2268         * tst-attr2.c: New file.
2270         * Makefile: Add rules to build and run tst-atfork2 test.
2271         * tst-atfork2.c: New file.
2272         * tst-atfork2mod.c: New file.
2274         * sysdeps/unix/sysv/linux/unregister-atfork.c
2275         (__unregister_atfork): Free the memory allocated for the handlers
2276         after removing them from the lists.
2278         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
2279         cleanup function.
2281         * tst-atfork1.c (do_test): Wait for the child we forked.
2282         Report error in child.
2284         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
2286         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
2288 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
2290         * Makefile (tests): Add tst-cancel8.
2291         * tst-cancel8.c: New file.
2293         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
2294         clearing of control variable.
2295         * Makefile (tests): Add tst-once3 and tst-once4.
2296         * tst-once3.c: New file.
2297         * tst-once4.c: New file.
2299 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
2301         * sysdeps/sh/Makefile: New file.
2302         * sysdeps/sh/bits/atomic.h: New file.
2303         * sysdeps/sh/pthread_spin_init.c: New file.
2304         * sysdeps/sh/pthread_spin_lock.c: New file.
2305         * sysdeps/sh/pthread_spin_trylock.S: New file.
2306         * sysdeps/sh/pthread_spin_unlock.S: New file.
2307         * sysdeps/sh/pthreaddef.h: New file.
2308         * sysdeps/sh/tcb-offsets.sym: New file.
2309         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
2310         * sysdeps/sh/tls.h: New file.
2311         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
2312         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
2313         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
2314         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
2315         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
2316         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
2317         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
2318         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
2319         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
2320         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
2321         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
2322         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
2323         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
2324         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
2325         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
2326         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
2327         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
2328         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
2329         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
2330         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
2331         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
2332         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
2333         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
2334         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
2335         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
2336         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
2337         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
2338         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
2339         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
2340         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
2342 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
2344         * tst-cond2.c: Rearrange code to not rely on behavior undefined
2345         according to POSIX.
2347         * tst-basic2.c (do_test): Lock mutex before creating the thread.
2349 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
2351         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
2352         (TLS_GET_FS): New #define.
2353         (TLS_SET_FS): New #define.
2354         Correct value of __NR_set_thread_area.
2356         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
2358 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
2360         * Makefile (tests): Add tst-popen1.
2361         * tst-popen1.c: New file.
2363         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
2364         but inactive generalization.
2365         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2366         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
2367         Minor optimization, remove one instruction.
2368         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
2370 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2372         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
2374 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2376         * init.c (__NR_set_tid_address): Add #ifdef for s390.
2377         * sysdeps/pthread/pthread_barrier_wait.c: New file.
2378         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
2379         * sysdeps/pthread/pthread_cond_signal.c: New file.
2380         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
2381         * sysdeps/pthread/pthread_cond_wait.c: New file.
2382         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
2383         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
2384         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
2385         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
2386         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
2387         * sysdeps/s390/Makefile: New file.
2388         * sysdeps/s390/bits/atomic.h: New file.
2389         * sysdeps/s390/pthread_spin_init.c: New file.
2390         * sysdeps/s390/pthread_spin_lock.c: New file.
2391         * sysdeps/s390/pthread_spin_trylock.c: New file.
2392         * sysdeps/s390/pthread_spin_unlock.c: New file.
2393         * sysdeps/s390/pthreaddef.h: New file.
2394         * sysdeps/s390/tcb-offsets.sym: New file.
2395         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
2396         * sysdeps/s390/tls.h: New file.
2397         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
2398         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
2399         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
2400         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
2401         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
2402         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
2403         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
2404         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
2405         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
2406         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
2407         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
2408         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
2409         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
2410         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
2411         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
2412         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
2413         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
2414         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
2415         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
2416         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
2417         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
2418         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
2419         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
2421 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
2423         * atomic.h: Add a couple more default implementations.
2424         (atomic_compare_and_exchange_acq): Use
2425         __arch_compare_and_exchange_32_acq in return value definition.  It
2426         always exists.
2427         (atomic_bit_set): Renamed from atomic_set_bit.
2428         Add missing atomic_ prefixes.
2430         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
2431         thread library is available, use correct value to mark initialized
2432         once variable.
2434 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
2436         * allocatestack.c (allocate_stack): Use __getpagesize instead of
2437         __sysconf to determine pagesize.
2439         * pthread_create.c: Include <atomic.h>.
2440         * allocatestack.c (allocate_stack): Implement coloring of the
2441         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
2442         size minus one.  Adjust users.
2443         * sysdeps/i386/i686/Makefile: New file.
2445 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
2447         * allocatestack.c: Improve comment throughout the file.
2449         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2450         (__lll_lock_wait): Add branch prediction.
2451         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
2452         (__lll_lock_wait): Likewise.
2453         (lll_unlock_wake_cb): Removed.
2455 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
2457         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
2458         _POSIX_THREAD_PRIORITY_SCHEDULING.
2460 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
2462         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2463         Fix return type of ptr___pthread_getspecific.
2465 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
2467         * Makefile (tests): Add tst-umask1.
2468         (tst-umask1-ARGS): Define.
2469         * tst-umask1.c: New file.
2471 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
2473         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
2474         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
2475         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
2476         pthread_rwlock_unlock.
2477         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
2478         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
2479         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
2480         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
2481         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2482         New file.
2483         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
2484         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2485         New file.
2486         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
2487         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
2488         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
2489         New file.
2490         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
2491         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
2492         New file.
2493         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
2494         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
2495         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
2496         New file.
2497         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
2498         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
2499         New file.
2500         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
2502         * Makefile (libpthread-routines): Remove lowlevelcond and
2503         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
2504         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
2505         and pthread_cond_broadcast.
2506         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
2507         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
2508         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
2509         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
2510         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
2511         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
2512         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
2513         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
2514         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
2515         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
2516         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
2517         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
2518         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
2519         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
2520         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
2521         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
2522         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
2523         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
2524         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
2525         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
2526         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
2527         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
2528         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
2529         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
2530         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
2531         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
2532         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
2533         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
2534         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
2535         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
2536         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
2538         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
2539         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
2540         of the code is moved to ...
2541         * sysdeps/pthread/createthread.c: ...here.  New file.
2543 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
2545         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
2546         (__new_sem_post): Clear %eax before returning.
2547         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
2549         * Makefile (tests): Add tst-cleanup2.
2550         * tst-cleanup2.c: New file.
2552         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
2553         Interpret first parameter correctly.
2555 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
2557         * Makefile (headers): Add bits/semaphore.h.
2559 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
2561         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
2562         if not SHARED.
2564 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
2566         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
2567         must be used and mapping failed.
2568         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
2570         * Makefile (CFLAGS-pthread_self.os): Define this, not
2571         CFLAGS-pthread_self.c.
2573 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
2575         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
2576         lll_unlock_wake_cb.
2578         * Makefile (libpthread-routines): Add version.  Add rules to build
2579         version.os and banner.h.
2580         * version.c: New file.
2582 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
2584         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
2585         the alias unconditional.
2586         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
2588 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
2590         * Makefile (CFLAGS-pthread_self.c): New definition.
2592 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
2594         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
2595         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
2596         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
2597         * init.c (__pthread_initialize_minimal_internal): Likewise.
2599 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
2601         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
2603         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
2604         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
2605         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
2606         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
2607         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
2608         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
2610 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
2612         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
2613         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
2614         * tst-cancel-wrappers.sh: Remove all exceptions.
2616 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
2618         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
2619         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
2621         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
2622         Use __libc_pthread_functions array if SHARED.
2624         * pthreadP.h: Move pthread_cond_2_0_t definition to...
2625         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
2627         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
2628         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
2629         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
2630         __libc_ptf_call instead of __libc_maybe_call.
2631         (PTF): New #define.
2632         (__libc_cleanup_region_start): Wrap function name with PTF call.
2633         (__libc_cleanup_region_end): Likewise.
2634         (__libc_cleanup_end): Likewise.
2636         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
2637         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
2638         * pthread_key_create.c: Add __pthread_key_create_internal alias.
2639         * pthreadP.h: Add prototypes.
2641         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
2642         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
2643         __pthread_rwlock_unlock aliases.
2644         * pthreadP.h: Add prototypes for new aliases.
2646         * pthreadP.h (struct pthead_functions): Moved to...
2647         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
2648         * init.c (pthread_functions): Add initializers for new elements.
2650         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
2651         __pthread_cleanup_pop_restore aliases.
2652         * pthreadP.h: Add prototypes.
2654         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
2655         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
2656         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
2657         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
2658         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
2659         * pthreadP.h: Adjust prototypes and callers.
2661 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
2663         * Makefile (tests): Add tst-cancel7.
2664         (tst-cancel7-ARGS): New variable.
2665         * tst-cancel7.c: New file.
2667         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
2668         around gcc defficiencies.
2669         * old_pthread_cond_signal.c: Likewise.
2670         * old_pthread_cond_timedwait.c: Likewise.
2671         * old_pthread_cond_wait.c: Likewise.
2673         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
2675 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
2677         * Makefile (tests): Add tst-cond7.
2678         * tst-cond7.c: New file.
2680         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
2681         (condvar_cleanup): Get condvar address from the right place.
2683         * atomic.h: Correct definitions of atomic_full_barrier,
2684         atomic_read_barrier, atomic_write_barrier.
2686         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
2687         race-free.
2688         * old_pthread_cond_signal.c: Likewise.
2689         * old_pthread_cond_timedwait.c: Likewise.
2690         * old_pthread_cond_wait.c: Likewise.
2692 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
2694         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
2696 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
2698         * pthreadP.h (pthread_cond_2_0_t): New type.
2699         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
2700         Use new type for the 2.0 condvar function prototypes.
2701         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
2702         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
2703         parameter.
2704         * old_pthread_cond_destroy.c: Likewise.
2705         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
2706         * old_pthread_cond_signal.c: Likewise.
2707         * old_pthread_cond_timedwait.c: Likewise.
2708         * old_pthread_cond_wait.c: Likewise.
2710         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
2711         (__pthread_cond_wait): Don't save cancellation mode and seq value
2712         in same location.
2714         * herrno.c (__h_errno_location): Don't define as weak.
2716 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
2718         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
2719         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
2720         and pthread_cond_wait.
2721         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
2722         Renamed to...
2723         (__pthread_cond_broadcast_2_0): ... this.
2724         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
2725         Renamed to...
2726         (__pthread_cond_destroy_2_0): ... this.
2727         * old_pthread_cond_init.c (__old_pthread_cond_init):
2728         Renamed to...
2729         (__pthread_cond_init_2_0): ... this.
2730         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
2731         Renamed to...
2732         (__pthread_cond_signal_2_0): ... this.
2733         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
2734         Renamed to...
2735         (__pthread_cond_wait_2_0): ... this.
2736         * pthread_cond_destroy.c: Include shlib-compat.h.
2737         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
2738         * pthread_cond_init.c: Include shlib-compat.h.
2739         (pthread_cond_init): Change strong_alias into versioned_symbol.
2740         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
2741         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
2742         fields.
2743         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
2744         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
2745         __pthread_cond_wait_2_0): New prototypes.
2746         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
2747         __old_pthread_cond_init, __old_pthread_cond_signal,
2748         __old_pthread_cond_wait): Removed.
2749         * init.c: Include shlib-compat.h.
2750         (pthread_functions): Guard ptr___pthread_attr_init_2_0
2751         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
2752         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
2753         ptr___pthread_cond_*_2_0 fields.
2754         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
2755         pthread_cond_*@GLIBC_2.0 compatibility symbols.
2757         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
2758         LIBC_SIGACTION was not yet defined.
2759         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
2760         [!defined LIBC_SIGACTION] (__sigaction): New function and
2761         libc_hidden_weak.
2762         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
2763         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
2765 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
2767         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
2769 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
2771         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
2772         New, larger type definition.
2773         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
2774         implementation.
2775         * Versions [libpthread]: Add definitions for new pthread_cond_*
2776         interfaces for version GLIBC_2.3.2.
2777         * pthread_cond_init.c: Update initialization for new type definition.
2778         * Makefile (libpthread-routines): Remove pthread_cond_wait,
2779         pthread_cond_timedwait, pthread_cond_signal, and
2780         pthread_cond_broadcast.  Add old_pthread_cond_init,
2781         old_pthread_cond_destroy, old_pthread_cond_wait,
2782         old_pthread_cond_timedwait, old_pthread_cond_signal, and
2783         old_pthread_cond_broadcast.
2784         * old_pthread_cond_broadcast.c: New file.
2785         * old_pthread_cond_destroy.c: New file.
2786         * old_pthread_cond_init.c: New file.
2787         * old_pthread_cond_signal.c: New file.
2788         * old_pthread_cond_timedwait.c: New file.
2789         * old_pthread_cond_wait.c: New file.
2790         * pthreadP.h: Add prototypes for the compatibility interfaces.
2792         * pthread_cond_destroy.c: Don't include <errno.h>.
2794 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
2796         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
2797         unnecessary zero offset when addressing MUTEX.
2799 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
2801         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
2802         __register_atfork.
2803         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
2804         for __register_atfork.
2806 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
2808         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
2809         instead of ASSEMBLER test macro.
2811         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
2812         __libc_current_sigrtmax): Add libc_hidden_def.
2814         * sysdeps/pthread/list.h: Remove assert.h include.
2816 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
2818         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
2819         __pthread_initialize_minimal_internal not
2820         __pthread_initialize_minimal.
2822 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
2824         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
2825         __pthread_initialize_minimal as hidden.
2827         * init.c (__pthread_initialize_minimal_internal): Don't mark as
2828         constructor.
2830 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
2832         * Makefile ($(inst_libdir)/libpthread.so): Depend on
2833         $(common-objpfx)format.lds, include that into the output script.
2834         Fix comment.
2835         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
2837 2002-12-28  Andreas Jaeger  <aj@suse.de>
2839         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
2840         nsec resolution changes.
2841         (xstat64_conv): Likewise.
2842         (xstat32_conv): Likewise.
2843         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
2844         struct kernel_stat.
2845         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
2846         structs stat and stat64.
2847         * time/time.h (__timespec_defined): Define for __USE_MISC.
2848         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
2850 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
2852         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
2853         argument.
2854         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
2855         (pthread_exit): Use strong_alias to avoid warnings.
2856         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
2857         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
2858         ptr___pthread_attr_init_2_*.
2859         * init.c (pthread_functions): Adjust.
2861 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
2863         * forward.c: Make all functions available by default again.  It
2864         caused too much trouble.
2866         * pt-siglongjmp.c: Removed.
2868 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
2870         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
2871         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
2872         * sysdeps/i386/Makefile: New file.
2873         * sysdeps/i386/tcb-offsets.sym: New file.
2874         * sysdeps/pthread/tcb-offsets.h: New file.
2875         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
2876         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
2878         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
2879         __register_atfork...
2880         (GLIBC_2.3.2): ...here.
2882 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
2884         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
2885         pthread_attr_setstackaddr with __attribute_deprecated__.
2887 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
2889         * pt-system.c (system): Remove cancellation handling.
2890         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
2891         cancellation routines.
2893 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
2895         * descr.h: Include <dl-sysdep.h>.
2896         (struct pthread): Move header.data.list to the back of the struct.
2897         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
2898         (MULTIPLE_THREADS_OFFSET): Adjust offset.
2899         (SYSINFO_OFFSEET): Likewise.
2901 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
2903         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
2904         Define.
2905         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
2906         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
2907         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
2908         (USE_DL_SYSINFO): Undef.
2910 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
2912         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
2913         $(common-objpfx)libc.so.
2914         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
2915         it is bigger than pipe buffer size even on arches with bigger
2916         page size.
2917         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
2919 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
2921         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
2922         correct errno access for case that USE___THREAD is not defined.
2924 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
2926         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
2927         Patch by Marijn Ros <marijn@mad.scientist.com>.
2929 2002-12-22  Roland McGrath  <roland@redhat.com>
2931         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
2933 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
2935         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
2937 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
2939         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
2940         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
2941         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
2943         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
2944         of int $0x80.
2945         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
2946         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
2947         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
2948         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2949         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
2950         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
2951         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
2952         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
2954         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
2955         sysenter.
2956         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
2958         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
2960         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
2961         in new TCB.
2962         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
2963         that sysinfo is properly initialized.
2964         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
2965         to 1 only for ld.so.
2967         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
2968         RTLD_CORRECT_DYNAMIC_WEAK.
2970 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
2972         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
2973         Use return 0 as 6th argument to FORWARD4.
2974         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
2976 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
2978         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
2979         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
2980         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
2981         (INIT_SYSINFO): New #define.
2982         (TLS_TP_INIT): Use INIT_SYSINFO.
2983         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
2984         At test to make sure SYSINFO_OFFSET value is correct.
2985         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
2987 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
2989         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
2990         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
2991         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
2992         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
2993         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
2994         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
2995         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
2997 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
2999         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
3000         macro instead of using int $0x80 directly.
3002         * sysdeps/pthread/bits/stdio-lock.h: New file.
3003         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
3004         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
3005         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
3006         * Makefile (routines): Add libc-lowlevelmutex.
3008         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
3009         __i686.get_pc_thunk.dx.
3011 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
3013         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
3014         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
3015         ($(objpfx)tst-cancel-wrappers.out): New rule.
3016         * tst-cancel-wrappers.sh: New test.
3017         * tst-locale1.c: Include signal.h.
3018         (uselocale): Test static linking of __libc_current_sigrt*.
3020 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
3022         * Makefile (tests): Add tst-cancel6.
3023         * tst-cancel6.c: New file
3025 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
3027         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
3028         Define meaningfully for assembler as well.
3029         * pthreadP.h (struct pthread_functions): Remove
3030         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
3031         and ptr_pthread_attr_init_2_1 fields.
3032         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
3033         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
3034         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
3035         (FORWARD3): Define using FORWARD4.
3036         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
3037         versions.
3038         * pt-system.c: Remove duplicate stdlib.h include.
3040 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
3042         * sem_init.c: Define sem_init@GLIBC_2.0.
3043         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
3044         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
3046         * flockfile.c: Moved to...
3047         * sysdeps/pthread/flockfile.c: ...here.  New file.
3048         * funlockfile.c: Moved to...
3049         * sysdeps/pthread/funlockfile.c: ...here.  New file.
3050         * ftrylockfile.c: Moved to...
3051         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
3053 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
3055         * libc-cancellation.c: Guard both function with
3056         #if !defined NOT_IN_libc.
3057         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
3058         automatically provided pthread wrappers.
3059         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
3060         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
3061         nor in libpthread.
3062         * pt-open.c: Removed.
3063         * pt-fcntl.c: Removed.
3064         * pt-fsync.c: Removed.
3065         * pt-lseek.c: Removed.
3066         * pt-msgrcv.c: Removed.
3067         * pt-msgsnd.c: Removed.
3068         * pt-msync.c: Removed.
3069         * pt-nanosleep.c: Removed.
3070         * pt-open64.c: Removed.
3071         * pt-pause.c: Removed.
3072         * pt-pread.c: Removed.
3073         * pt-pread64.c: Removed.
3074         * pt-pwrite.c: Removed.
3075         * pt-pwrite64.c: Removed.
3076         * pt-read.c: Removed.
3077         * pt-recv.c: Removed.
3078         * pt-recvfrom.c: Removed.
3079         * pt-recvmsg.c: Removed.
3080         * pt-send.c: Removed.
3081         * pt-sendto.c: Removed.
3082         * pt-sigtimedwait.c: Removed.
3083         * pt-sigwait.c: Removed.
3084         * pt-wait.c: Removed.
3085         * pt-waitpid.c: Removed.
3086         * pt-write.c: Removed.
3087         * pt-accept.c: Removed.
3088         * pt-close.c: Removed.
3089         * pt-connect.c: Removed.
3090         * pt-lseek64.c: Removed.
3091         * pt-sendmsg.c: Removed.
3092         * pt-tcdrain.c: Removed.
3094 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
3096         * init.c (__pthread_initialize_minimal_internal): Renamed from
3097         __pthread_initialize_minimal.  Make old name an alias.  This
3098         converts a normal relocation into a relative relocation.
3100         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
3102         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
3103         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
3104         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
3105         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
3106         pt-sigwaitinfo, pt-waitid, and pt-writev.
3107         * pt-creat.c: Removed.
3108         * pt-poll.c: Removed.
3109         * pt-pselect.c: Removed.
3110         * pt-readv.c: Removed.
3111         * pt-select.c: Removed.
3112         * pt-sigpause.c: Removed.
3113         * pt-sigsuspend.c: Removed.
3114         * pt-sigwaitinfo.c: Removed.
3115         * pt-waitid.c: Removed.
3116         * pt-writev.c: Removed.
3118         * init.c (pthread_functions): New variable.
3119         (__pthread_initialize_minimal): Pass pointer to pthread_functions
3120         (or NULL) to __libc_pthread_init.
3121         * forward.c: Rewrite to use __libc:pthread_functions array to get
3122         function addresses.
3123         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
3124         prototype.
3125         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
3126         Take new parameter.  Copy content of variable pointed to by it
3127         to __libc_pthread_init.
3129         * pthreadP.h (struct pthread_functions): New type.
3130         (__libc_pthread_init): Declare.
3132         * pthread_attr_destroy.c: Add namespace protected alias.
3133         * pthread_attr_getdetachstate.c: Likewise.
3134         * pthread_attr_getinheritsched.c: Likewise.
3135         * pthread_attr_getschedparam.c: Likewise.
3136         * pthread_attr_getschedpolicy.c: Likewise.
3137         * pthread_attr_getscope.c: Likewise.
3138         * pthread_attr_setdetachstate.c: Likewise.
3139         * pthread_attr_setinheritsched.c: Likewise.
3140         * pthread_attr_setschedparam.c: Likewise.
3141         * pthread_attr_setschedpolicy.c: Likewise.
3142         * pthread_attr_setscope.c: Likewise.
3143         * pthread_cond_broadcast.c: Likewise.
3144         * pthread_cond_destroy.c: Likewise.
3145         * pthread_cond_init.c: Likewise.
3146         * pthread_cond_signal.c: Likewise.
3147         * pthread_cond_wait.c: Likewise.
3148         * pthread_condattr_destroy.c: Likewise.
3149         * pthread_condattr_init.c: Likewise.
3150         * pthread_equal.c: Likewise.
3151         * pthread_exit.c: Likewise.
3152         * pthread_getschedparam.c: Likewise.
3153         * pthread_self.c: Likewise.
3154         * pthread_setcancelstate.c: Likewise.
3155         * pthread_setschedparam.c: Likewise.
3156         * pthread_mutex_destroy.c: Likewise.
3157         * pthread_mutex_init.c: Likewise.
3158         * pthreadP.h: Add prototypes for the aliases.
3160         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
3161         multiple_threads member in correct TCB to 1.
3163         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
3164         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
3165         member of thread decriptor, otherwise return unconditionally 1.
3167 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
3169         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
3170         regular Linux version.  Remove file.
3171         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
3172         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
3173         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
3174         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
3175         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
3176         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
3177         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
3178         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
3179         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
3180         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
3181         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
3182         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
3183         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
3184         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
3185         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
3186         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
3187         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
3188         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
3189         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
3190         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
3191         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
3192         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
3193         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
3194         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
3195         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
3196         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
3197         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
3198         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
3199         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
3200         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
3202 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
3204         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
3205         * sysdeps/unix/sysv/linux/open.c: Removed.
3206         * sysdeps/unix/sysv/linux/fsync.c: Removed.
3207         * sysdeps/unix/sysv/linux/lseek.c: Removed.
3208         * sysdeps/unix/sysv/linux/msync.c: Removed.
3209         * sysdeps/unix/sysv/linux/read.c: Removed.
3210         * sysdeps/unix/sysv/linux/close.c: Removed.
3211         * sysdeps/unix/sysv/linux/creat.c: Removed.
3212         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
3213         * sysdeps/unix/sysv/linux/pause.c: Removed.
3214         * sysdeps/unix/sysv/linux/select.c: Removed.
3215         * sysdeps/unix/sysv/linux/write.c: Removed.
3217 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
3219         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
3220         element in TCB to see whether locking is needed.
3222         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
3223         MULTIPLE_THREADS_OFFSET value is correct.
3225         * sysdeps/unix/sysv/linux/close.c: New file.
3226         * sysdeps/unix/sysv/linux/connect.S: New file.
3227         * sysdeps/unix/sysv/linux/creat.c: New file.
3228         * sysdeps/unix/sysv/linux/fsync.c: New file.
3229         * sysdeps/unix/sysv/linux/llseek.c: New file.
3230         * sysdeps/unix/sysv/linux/lseek.c: New file.
3231         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
3232         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
3233         * sysdeps/unix/sysv/linux/msync.c: New file.
3234         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
3235         * sysdeps/unix/sysv/linux/open.c: New file.
3236         * sysdeps/unix/sysv/linux/open64.c: New file.
3237         * sysdeps/unix/sysv/linux/pause.c: New file.
3238         * sysdeps/unix/sysv/linux/poll.c: New file.
3239         * sysdeps/unix/sysv/linux/pread.c: New file.
3240         * sysdeps/unix/sysv/linux/pread64.c: New file.
3241         * sysdeps/unix/sysv/linux/pselect.c: New file.
3242         * sysdeps/unix/sysv/linux/pwrite.c: New file.
3243         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
3244         * sysdeps/unix/sysv/linux/readv.c: New file.
3245         * sysdeps/unix/sysv/linux/recv.S: New file.
3246         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
3247         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
3248         * sysdeps/unix/sysv/linux/select.c: New file.
3249         * sysdeps/unix/sysv/linux/send.S: New file.
3250         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
3251         * sysdeps/unix/sysv/linux/sendto.S: New file.
3252         * sysdeps/unix/sysv/linux/sigpause.c: New file.
3253         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
3254         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
3255         * sysdeps/unix/sysv/linux/sigwait.c: New file.
3256         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
3257         * sysdeps/unix/sysv/linux/system.c: New file.
3258         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
3259         * sysdeps/unix/sysv/linux/wait.c: New file.
3260         * sysdeps/unix/sysv/linux/waitid.c: New file.
3261         * sysdeps/unix/sysv/linux/waitpid.c: New file.
3262         * sysdeps/unix/sysv/linux/writev.c: New file.
3263         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
3265         * pt-readv.c: Fix comment.
3267 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
3269         * tst-cleanup1.c: Include stdlib.h.
3271         * tst-cancel5.c: New test.
3272         * Makefile (tests): Add tst-cancel5.
3273         (tst-cancel5): Link against libc.so libpthread.so in that order.
3275 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
3277         * forward.c (test_loaded): Prevent recursive calls.
3279         * Makefile (routines): Add libc-cancellation.
3280         * libc-cancellation.c: New file.
3281         * descr.h (struct pthread): Add multiple_threads field.
3282         * allocatestack.c (allocate_stack): Initialize multiple_header field of
3283         new thread descriptor to 1.
3284         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
3285         Initialize multiple_thread field after successful thread creation.
3286         * cancellation.c (__do_cancel): Move to pthreadP.h.
3287         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
3288         (__pthread_disable_asynccancel): Add internal_function attribute.
3289         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
3290         * pthread_setcancelstate.c: Likewise.
3291         * pthread_setcanceltype.c: Likewise.
3292         * pthread_exit.c: Likewise.
3293         * pthreadP.h (CANCELLATION_P): Likewise.
3294         (__do_cancel): Define as static inline.
3295         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
3296         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
3297         declarations.
3298         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
3299         fields.  Define MULTIPLE_THREADS_OFFSET.
3300         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
3301         declaration.
3302         * sysdeps/unix/sysv/linux/accept.S: New file.
3303         * sysdeps/unix/sysv/linux/read.c: New file.
3304         * sysdeps/unix/sysv/linux/write.c: New file.
3305         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
3306         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
3307         initialization of __libc_locking_needed.
3308         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
3309         __libc_locking_needed, use multiple_threads field in TCB.
3310         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
3312 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
3314         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
3315         version.
3316         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
3318         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
3319         access to __libc_locking_needed for PIC.
3321 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
3323         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
3324         declare for libc.so.
3325         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
3326         expression.
3327         (__libc_lock_lock): Put into statement expression.
3328         (__libc_lock_unlock): Remove trailing semicolon.
3329         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
3331 2002-12-12  Roland McGrath  <roland@redhat.com>
3333         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
3334         "m" constraint to refer to __libc_locking_needed.  Declare it here.
3336 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
3338         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
3339         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
3340         Initialize __libc_locking_needed.
3341         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
3342         instead of __register_pthread_fork_handler.
3343         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
3344         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
3345         fork-gen with libc_pthread_init.
3346         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
3347         of __register_pthread_fork_handler.
3348         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
3349         of __register_pthread_fork_handler.
3350         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
3351         __libc_locking_needed to determine whether lock prefix can be avoided.
3352         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
3354 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
3356         * Makefile (tests): Add tst-cleanup1.
3357         * tst-cleanup1.c: New file.
3358         * cancellation.c (__cleanup_thread): Removed.
3359         (__do_cancel): Remove call to __cleanup_thread.
3360         * pthreadP.h: Remove __cleanup_thread prorotype.
3362         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
3363         Remember function and argument even if cancellation handler
3364         function is not available.
3365         (__libc_cleanup_region_end): Execute registered function directly if
3366         pthread functions are not available.
3367         (__libc_cleanup_end): Likewise.
3369         * init.c (__pthread_initialize_minimal): Fix initialization in
3370         static lib by preventing gcc from being too clever.
3372 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
3374         * init.c (__pthread_initialize_minimal): Remove unneccesary
3375         sigaddset call.
3377         * Makefile (tests): We can run tst-locale2 now.
3379 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
3381         * Versions: Remove duplicated sigwait entry.
3383 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
3385         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
3386         inside libpthread.
3388         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
3390         * pthreadP.h: Declare __pthread_enable_asynccancel and
3391         __pthread_disable_asynccancel.
3392         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
3393         (CANCEL_RESET): Use __pthread_disable_asynccancel.
3394         * cancellation.c (__pthread_enable_asynccancel): New function.
3395         (__pthread_disable_asynccancel): New function.
3396         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
3397         * pt-close.c: Likewise.
3398         * pt-connect.c: Likewise.
3399         * pt-creat.c: Likewise.
3400         * pt-fcntl.c: Likewise.
3401         * pt-fsync.c: Likewise.
3402         * pt-lseek.c: Likewise.
3403         * pt-lseek64.c: Likewise.
3404         * pt-msgrcv.c: Likewise.
3405         * pt-msgsnd.c: Likewise.
3406         * pt-msync.c: Likewise.
3407         * pt-nanosleep.c: Likewise.
3408         * pt-open.c: Likewise.
3409         * pt-open64.c: Likewise.
3410         * pt-pause.c: Likewise.
3411         * pt-poll.c: Likewise.
3412         * pt-pread.c: Likewise.
3413         * pt-pread64.c: Likewise.
3414         * pt-pselect.c: Likewise.
3415         * pt-pwrite.c: Likewise.
3416         * pt-pwrite64.c: Likewise.
3417         * pt-read.c: Likewise.
3418         * pt-readv.c: Likewise.
3419         * pt-recv.c: Likewise.
3420         * pt-recvfrom.c: Likewise.
3421         * pt-recvmsg.c: Likewise.
3422         * pt-select.c: Likewise.
3423         * pt-send.c: Likewise.
3424         * pt-sendmsg.c: Likewise.
3425         * pt-sendto.c: Likewise.
3426         * pt-sigpause.c: Likewise.
3427         * pt-sigsuspend.c: Likewise.
3428         * pt-sigtimedwait.c: Likewise.
3429         * pt-sigwait.c: Likewise.
3430         * pt-sigwaitinfo.c: Likewise.
3431         * pt-system.c: Likewise.
3432         * pt-tcdrain.c: Likewise.
3433         * pt-wait.c: Likewise.
3434         * pt-waitid.c: Likewise.
3435         * pt-waitpid.c: Likewise.
3436         * pt-write.c: Likewise.
3437         * pt-writev.c: Likewise.
3438         * pthread_join.c: Likewise.
3439         * pthread_timedjoin.c: Likewise.
3441         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
3442         (__xpg_sigpause): New function.
3443         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
3445 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
3447         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
3449         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
3450         _GI_pthread_cleanup_pop to pthreadP.h.
3452         * ftrylockfile.c: Use _IO_lock_trylock instead of
3453         pthread_mutex_trylock.
3455         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
3456         (CANCEL_RESET): Likewise.
3457         (__pthread_setcanceltype_): Declare.
3458         (__pthread_mutex_lock_internal): Declare.
3459         (__pthread_mutex_unlock_internal): Declare.
3460         (__pthread_once_internal): Declare.
3461         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
3462         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
3464         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
3465         and pthread_mutex_unlock.
3466         * pthread_cond_wait.c: Likewise.
3467         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
3468         * pthread_mutex_unlock.c: Likewise.
3470         * pthread_setcanceltype.c: Add additional alias
3471         __pthread_setcanceltype.
3473         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
3474         * sem_open.c (sem_open): Likewise.
3475         Use __libc_open, __libc_write, and __libc_close instead of
3476         open, write, and close respectively.
3478         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
3479         Rewrite as statement expression since it must return a value.
3481         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
3482         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
3483         __pthread_kill.
3485         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
3486         alias __pthread_once_internal.
3488         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
3490 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
3492         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
3493         * tst-stdio1.c: New file.
3494         * tst-stdio2.c: New file.
3496         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
3498         * Makefile (tests): Comment out tst-locale2 for now.
3499         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
3501         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
3502         -D_IO_MTSAFE_IO.
3503         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
3504         Use _IO_lock_init instead of explicit assignment.
3506         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
3507         Define __libc_lock_* and __libc_lock_recursive macros with
3508         lowlevellock macros, not pthread mutexes.
3510         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
3511         of pthread_mutex_lock.
3512         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
3513         instead of pthread_mutex_unlock.
3515 2002-12-06  Roland McGrath  <roland@redhat.com>
3517         * allocatestack.c (__stack_user): Use uninitialized defn.
3518         * init.c (__pthread_initialize_minimal): Initialize it here.
3520 2002-12-05  Roland McGrath  <roland@redhat.com>
3522         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
3523         string.
3524         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
3526         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
3527         missing & here too.
3529 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
3531         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
3532         lowlevellock.
3533         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
3534         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
3535         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
3536         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
3537         for __libc_lock_* macros.
3538         * Makefile (routines): Add libc-lowlevellock.
3540 2002-10-09  Roland McGrath  <roland@redhat.com>
3542         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
3543         Under [__PIC__], call the function via the pointer fetched for
3544         comparison rather than a call by name that uses the PLT.
3545         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
3546         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
3547         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
3548         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
3549         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
3551 2002-12-04  Roland McGrath  <roland@redhat.com>
3553         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
3555         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
3556         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
3558         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
3560 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
3562         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
3563         a completely opaque, non-integer type.
3564         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3566 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
3568         * sysdeps/i386/tls.h: Include stdlib.h.
3569         * sysdeps/x86_64/tls.h: Likewise.
3571 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
3573         * Makefile (tests): Add tst-locale2.
3574         (tests-static): Likewise.
3575         * tst-locale2.c: New file.
3577         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
3578         volatile and add memory clobbers to lock operations.
3580 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
3582         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
3583         * sysdeps/i386/i486/bits/atomic.h: New file.
3584         * sysdeps/i386/i586/bits/atomic.h: New file.
3585         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
3586         include i486 version.
3587         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
3588         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
3589         Patch by Marijn Ros <marijn@mad.scientist.com>.
3591         * allocatestack.c (get_cached_stack): Don't crash if we first
3592         found a stack with a larger size then needed.
3593         Reported by Hui Huang <hui.huang@sun.com>.
3595         * Makefile (tests): Add tst-sysconf.
3596         * tst-sysconf.c: New file.
3598         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
3599         PTHREAD_THREADS_MAX.
3601 2002-12-02  Roland McGrath  <roland@redhat.com>
3603         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
3604         Declare using hidden_proto instead of attribute_hidden, so there are
3605         non-.hidden static symbols for gdb to find.
3606         (__pthread_keys): Likewise.
3607         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
3608         * allocatestack.c (__stack_user): Likewise.
3609         * pthread_create.c (__pthread_keys): Likewise.
3610         (__nptl_threads_events, __nptl_last_event): Make these static instead
3611         of hidden.
3612         * pthread_key_create.c (__pthread_pthread_keys_max,
3613         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
3615 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
3617         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
3618         statically.
3619         * tst-locale1.c: New file.
3621         * pthread_cond_timedwait.c: Include <stdlib.h>.
3623         * Makefile (tests): Add tst-fork2 and tst-fork3.
3624         * tst-fork2.c: New file.
3625         * tst-fork3.c: New file.
3627 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
3629         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
3631         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
3632         require it to 200112L.
3634         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
3635         instruction only if HAVE_CMOV is defined.
3636         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
3638         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
3640         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
3642         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
3644         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
3646 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
3648         * sysdeps/x86_64/bits/atomic.h: New file.
3650         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
3651         16-bit operations.
3653         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
3654         possible since gettid cannot fail.
3656         * sysdeps/x86_64/pthreaddef.h: New file.
3658         * sysdeps/i386/pthreaddef.h (gettid): Removed.
3660         * sysdeps/x86_64/pthread_spin_init.c: New file.
3661         * sysdeps/x86_64/pthread_spin_lock.c: New file.
3662         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
3663         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
3665         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
3666         Add missing lock prefix.  Minute optimization.
3668         * tst-spin2.c (main): Also check successful trylock call.
3670         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
3671         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
3673         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
3674         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
3676         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
3677         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
3678         value in case of an error.  Add support for INTERNAL_SYSCALL.
3680         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
3681         value in case of an error.
3683         * sysdeps/x86_64/tls.h: New file.
3685 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
3687         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
3688         takes the array member name and the index as parameters.
3689         (THREAD_SETMEM_NC): Likewise.
3690         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
3691         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
3692         interfaces.
3694         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
3695         to decide which code to use.
3696         (THREAD_SETMEM_NC): Likewise.
3698         * allocatestack.c (queue_stack): Don't remove stack from list here.
3699         Do it in the caller.  Correct condition to prematurely terminate
3700         loop to free stacks.
3701         (__deallocate_stack): Remove stack from list here.
3703 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
3705         * Makefile (tests): Add tst-stack1.
3706         * tst-stack1.c: New file.
3708         * allocatestack.c (allocate_stack): Initialize the TCB on a user
3709         provided stack.
3711         * pthread_attr_getstack.c: Return bottom of the thread area.
3713 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
3715         * Makefile (libpthread-routines): Add pt-allocrtsig and
3716         pthread_kill_other_threads.
3717         * pt-allocrtsig.c: New file.
3718         * pthread_kill_other_threads.c: New file.
3719         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
3720         all three functions.
3721         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
3722         allocrtsig.
3723         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
3724         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
3725         and __libc_allocate_rtsig_private.
3726         * Versions (libpthread): Export pthread_kill_other_threads_np,
3727         __libc_current_sigrtmin, and __libc_current_sigrtmax.
3729 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
3731         * allocatestack.c (allocate_stack): stackaddr in attribute points to
3732         the end of the stack.  Adjust computations.
3733         When mprotect call fails dequeue stack and free it.
3734         * pthread_attr_setstack.c: Store top of the stack in stackaddr
3735         attribute.
3736         * pthread_getattr_np.c: Likewise.
3738         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
3739         surprises.
3741 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
3743         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
3744         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
3746 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
3748         * pthread_getspecific.c: Optimize access to first 2nd-level array.
3749         * pthread_setspecific.c: Likewise.
3751 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
3753         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
3754         definitions.  Get them from the official place.
3755         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
3757         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
3758         Use new CLONE_ flags in clone() calls.
3760         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
3761         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
3763         * Versions: Add pthread_* functions for libc.
3764         * forward.c: New file.
3766         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
3767         errno-loc.
3768         * herrno.c: New file.
3769         * res.c: New file.
3771         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
3772         sem_trywait, and sem_timedwait.  Add herrno and res.
3773         * sem_init.c: Don't initialize lock and waiters members.
3774         * sem_open.c: Likewise.
3775         * sem_post.c: Removed.
3776         * sem_wait.c: Removed.
3777         * sem_trywait.c: Removed.
3778         * sem_timedwait.c: Removed.
3779         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
3780         Includes full implementations of sem_post, sem_wait, sem_trywait,
3781         and sem_timedwait.
3782         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
3783         for new implementation.
3784         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
3785         and waiters fields.
3787         * tst-sem3.c: Improve error message.
3788         * tst-signal3.c: Likewise.
3790         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
3791         to tell the kernel about the termination futex and to initialize tid
3792         member.  Don't initialize main_thread.
3793         * descr.h (struct pthread): Remove main_thread member.
3794         * cancelllation.c (__do_cancel): Remove code handling main thread.
3795         The main thread is not special anymore.
3797         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
3798         size of the stacks to stack_cache_actsize.
3800         * pt-readv.c: Add missing "defined".
3801         * pt-sigwait.c: Likewise.
3802         * pt-writev.c: Likewise.
3804 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
3806         * Versions: Export __connect from libpthread.
3807         Patch by Luca Barbieri <ldb@ldb.ods.org>.
3809         * Makefile (libpthread-routines): Add pt-raise.
3810         * sysdeps/unix/sysv/linux/raise.c: New file.
3811         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
3812         * sysdeps/generic/pt-raise.c: New file.
3814         * pthread_cond_init.c: Initialize all data elements of the condvar
3815         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
3817         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
3818         * pthread_create.c: Likewise.
3820         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
3821         * tst-key1.c: New file.
3822         * tst-key2.c: New file.
3823         * tst-key3.c: New file.
3825         * Versions: Export pthread_detach for version GLIBC_2.0.
3826         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
3828 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
3830         * pthread_key_create.c: Terminate search after an unused key was found.
3831         Patch by Luca Barbieri <ldb@ldb.ods.org>.
3833         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
3834         Patch by Luca Barbieri <ldb@ldb.ods.org>.
3836 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
3838         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
3839         dynamic lookup for errno in PIC.
3841         * allocatestack.c (get_cached_stack): Rearrange code slightly to
3842         release the stack lock as soon as possible.
3843         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
3844         the static TLS block.
3845         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
3847         * cancellation.c: Renamed from cancelation.c.
3848         * Makefile: Adjust accordingly.
3849         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
3850         * cleanup_defer.c: Use CANCELLATION_P.
3851         * pthread_testcancel.c: Likewise.
3852         * descr.h: Fix spelling in comments.
3853         * init.c: Likewise.
3854         * pthread_getattr_np.c: Likewise.
3855         * pthread_getschedparam.c: Likewise.
3856         * pthread_setschedparam.c: Likewise.
3857         * Versions: Likewise.
3859         * pt-pselect.c: New file.
3860         * Makefile (libpthread-routines): Add pt-pselect.
3861         * Versions: Add pselect.
3863         * tst-cancel4.c: New file.
3864         * Makefile (tests): Add tst-cancel4.
3866 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
3868         * pthread_mutex_lock.c: Always record lock ownership.
3869         * pthread_mutex_timedlock.c: Likewise.
3870         * pthread_mutex_trylock.c: Likewise.
3872         * pt-readv.c: New file.
3873         * pt-writev.c: New file.
3874         * pt-creat.c: New file.
3875         * pt-msgrcv.c: New file.
3876         * pt-msgsnd.c: New file.
3877         * pt-poll.c: New file.
3878         * pt-select.c: New file.
3879         * pt-sigpause.c: New file.
3880         * pt-sigsuspend.c: New file.
3881         * pt-sigwait.c: New file.
3882         * pt-sigwaitinfo.c: New file.
3883         * pt-waitid.c: New file.
3884         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
3885         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
3886         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
3887         * Versions: Add all the new functions.
3889         * tst-exit1.c: New file.
3890         * Makefile (tests): Add tst-exit1.
3892         * sem_timedwait.c: Minor optimization for more optimal fastpath.
3894 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
3896         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
3898         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
3899         call.  pthread_join is an official cancellation point.
3900         * pthread_timedjoin.c: Likewise.
3902         * pthread_cond_wait.c: Revert order in which internal lock are dropped
3903         and the condvar's mutex are retrieved.
3904         * pthread_cond_timedwait.c: Likewise.
3905         Reported by dice@saros.East.Sun.COM.
3907 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
3909         * pthreadP.h: Cut out all type definitions and move them...
3910         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
3911         * pthreadP.h: Include <internaltypes.h>.
3913         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
3914         performance tweaks.
3916         * sem_trywait.c: Shuffle #includes around to get right order.
3917         * sem_timedwait.c: Likewise.
3918         * sem_post.c: Likewise.
3919         * sem_wait.c: Likewise.
3921         * nptl 0.3 released.
3923         * Makefile (tests): Add tst-signal3.
3924         * tst-signal3.c: New file.
3926 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
3928         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
3929         the asms modify the sem object.
3930         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
3932         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
3933         the actual members.
3934         * pthreadP.h (struct sem): New type.  Actual semaphore type.
3935         * semaphoreP.h: Include pthreadP.h.
3936         * sem_getvalue.c: Adjust to sem_t change.
3937         * sem_init.c: Likewise.
3938         * sem_open.c: Likewise.
3939         * sem_post.c: Likewise.
3940         * sem_timedwait.c: Likewise.
3941         * sem_trywait.c: Likewise.
3942         * sem_wait.c: Likewise.
3944 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
3946         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
3947         * tst-basic2.c: New file.
3948         * tst-exec1.c: New file.
3949         * tst-exec2.c: New file.
3950         * tst-exec3.c: New file.
3952         * tst-fork1.c: Remove extra */.
3954         * nptl 0.2 released.  The API for IA-32 is complete.