[__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
[glibc.git] / nptl / ChangeLog
blob422ae58937281906b070545d9b7837d12ebf0a01
1 2007-05-27  Ulrich Drepper  <drepper@redhat.com>
3         * init.c: Make it compile with older kernel headers.
5         * tst-initializers1.c: Show through exit code which test failed.
7         * pthread_rwlock_init.c: Also initialize __shared field.
8         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
9         element in rwlock structure into four byte elements.  One of them is
10         the new __shared element.
11         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
12         Likewise.
13         [__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
14         __shared, adjust names of other padding elements.
15         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
16         * sysdeps/pthread/pthread.h: Adjust rwlock initializers.
17         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
18         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
19         FUTEX_PRIVATE_FLAG.
20         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
21         futex to use private operations if possible.
22         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
23         Likewise.
24         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
25         Likewise.
26         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
27         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
28         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
29         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
30         Likewise.
31         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
32         Likewise.
33         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
34         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
36 2007-05-26  Ulrich Drepper  <drepper@redhat.com>
38         * pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
39         * pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
40         * pthread_rwlock_timedrdlock.c: Likewise.
41         * pthread_rwlock_tryrdlock.c: Likewise.
43         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
44         optimization.
46         * sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
47         * sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
48         duplication of __sem_wait_cleanup.
50         * allocatestack.c: Revert last change.
51         * init.c: Likewise.
52         * sysdeps/i386/tls.h: Likewise.
53         * sysdeps/x86_64/tls.h: Likewise.
54         * descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
55         header structure.
56         * sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
58         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
59         Add private field.
60         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
61         * pthread_barrier_init.c: Set private flag if pshared and private
62         futexes are supported.
63         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
64         private field in futex command setup.
65         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
67 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
69         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
70         support.
71         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
72         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
73         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
74         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
75         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
77         * semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
78         * sem_init.c (__new_sem_init): Rewrite to initialize all three
79         fields in the structure.
80         (__old_sem_init): New function.
81         * sem_open.c: Initialize all fields of the structure.
82         * sem_getvalue.c: Adjust for renamed element.
83         * sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
84         (gen-as-const-headers): Add structsem.sym.
85         * sysdeps/unix/sysv/linux/structsem.sym: New file.
86         * sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
87         struct new_sem.  Add struct old_sem.
88         * sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
89         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
90         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
91         * sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
92         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
93         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
94         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
95         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
96         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
97         * Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
98         * tst-sem10.c: New file.
99         * tst-sem11.c: New file.
100         * tst-sem12.c: New file.
101         * tst-typesizes.c: Test struct new_sem and struct old_sem instead
102         of struct sem.
104 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
105             Jakub Jelinek  <jakub@redhat.com>
107         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
108         Move __pthread_enable_asynccancel right before futex syscall.
109         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
110         Likewise.
112 2007-05-24  Jakub Jelinek  <jakub@redhat.com>
114         * sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
115         THREAD_COPY_PRIVATE_FUTEX): Define.
116         * sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
117         THREAD_COPY_PRIVATE_FUTEX): Define.
118         * allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
119         * init.c (__pthread_initialize_minimal_internal): Use
120         THREAD_SET_PRIVATE_FUTEX.
122         * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
123         (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
124         THREAD_GSCOPE_FLAG_WAIT): Define.
125         (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG,
126         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define.
127         * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use
128         PTR_DEMANGLE.
129         (THREAD_GSCOPE_GET_FLAG): Define.
130         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define.
131         * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
132         instead of ->header.gscope_flag directly.
134 2007-05-23  Ulrich Drepper  <drepper@redhat.com>
136         * init.c (__pthread_initialize_minimal_internal): Check whether
137         private futexes are available.
138         * allocatestack.c (allocate_stack): Copy private_futex field from
139         current thread into the new stack.
140         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
141         futexes if they are available.
142         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
143         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
144         in libc-lowlevellock.S allow using private futexes.
145         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
146         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
147         FUTEX_PRIVATE_FLAG.
148         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
149         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
150         if they are available.
151         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
152         * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
153         * sysdeps/i386/tcb-offsets.sym: Likewise.
154         * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
155         * sysdeps/i386/tls.h (tcbhead_t): Likewise.
157 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
159         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
160         Remove ptr_wait_lookup_done again.
161         * init.c (pthread_functions): Don't add .ptr_wait_lookup_done here.
162         (__pthread_initialize_minimal_internal): Initialize
163         _dl_wait_lookup_done pointer in _rtld_global directly.
164         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
165         Remove code to code _dl_wait_lookup_done.
166         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
167         encrypted for now.
169 2007-05-21  Jakub Jelinek  <jakub@redhat.com>
171         * tst-robust9.c (do_test): Don't fail if ENABLE_PI and
172         pthread_mutex_init failed with ENOTSUP.
174 2007-05-19  Ulrich Drepper  <drepper@redhat.com>
176         * allocatestack.c (__wait_lookup_done): New function.
177         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
178         Add ptr_wait_lookup_done.
179         * init.c (pthread_functions): Initialize .ptr_wait_lookup_done.
180         * pthreadP.h: Declare __wait_lookup_done.
181         * sysdeps/i386/tls.h (tcbhead_t): Add gscope_flag.
182         Define macros to implement reference handling of global scope.
183         * sysdeps/x86_64/tls.h: Likewise.
184         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
185         Initialize GL(dl_wait_lookup_done).
187 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
189         [BZ #4512]
190         * pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
191         is detected.
192         * pthread_mutex_timedlock.c: Likewise.
193         * pthread_mutex_trylock.c: Likewise.
194         Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
196         * Makefile (tests): Add tst-robust9 and tst-robustpi9.
197         * tst-robust9.c: New file.
198         * tst-robustpi9.c: New file.
200         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
201         unnecessary extra cancellation test.
203 2007-05-14  Ulrich Drepper  <drepper@redhat.com>
205         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
206         extra cancellation test.
207         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
209 2007-05-10  Ulrich Drepper  <drepper@redhat.com>
211         * descr.h (struct pthread): Rearrange members to fill hole in
212         64-bit layout.
214         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
215         (__pthread_setaffinity_new): If syscall was successful and
216         RESET_VGETCPU_CACHE is defined, use it before returning.
217         * sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
219 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
221         [BZ #4455]
222         * tst-align2.c: Include stackinfo.h.
223         * tst-getpid1.c: Likewise.
225 2007-05-02  Carlos O'Donell  <carlos@systemhalted.org>
227         [BZ #4455]
228         * tst-align2.c (do_test): Add _STACK_GROWS_UP case.
229         * tst-getpid1.c (do_test): Likewise.
231         [BZ #4456]
232         * allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
233         (allocate_stack): Likewise.
235 2007-05-07  Ulrich Drepper  <drepper@redhat.com>
237         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
238         (__lll_robust_lock_wait): Fix race caused by reloading of futex value.
239         (__lll_robust_timedlock_wait): Likewise.
240         Reported by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
242 2007-05-06  Mike Frysinger  <vapier@gentoo.org>
244         [BZ #4465]
245         * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
246         * tst-cancel4.c (tf_fdatasync): New test.
248 2007-04-27  Ulrich Drepper  <drepper@redhat.com>
250         [BZ #4392]
251         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Treat error
252         check mutexes like normal mutexes.
254         [BZ #4306]
255         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
256         Initialize the whole sigevent structure to appease valgrind.
258 2007-04-25  Ulrich Drepper  <drepper@redhat.com>
260         * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
261         * sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
263 2007-04-06  Ulrich Drepper  <drepper@redhat.com>
265         * tst-locale1.c: Avoid warnings.
266         * tst-locale2.c: Likewise.
268 2007-03-19  Steven Munroe  <sjmunroe@us.ibm.com>
270         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
271         (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
273 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
275         * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
276         __extern_always_inline where appropriate.
277         * sysdeps/pthread/pthread.h: Likewise.
279 2007-03-13  Richard Henderson  <rth@redhat.com>
281         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
282         separate cfi regions for the two subsections.
284 2007-02-25  Ulrich Drepper  <drepper@redhat.com>
286         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
287         new thread, don't just decrement it.
288         Patch by Suzuki K P <suzuki@in.ibm.com>.
290 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
292         * sysdeps/pthread/pthread-functions.h: Correct last patch, correct
293         PTHFCT_CALL definition.
295 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
297         * sysdeps/pthread/pthread-functions.h: If PTR_DEMANGLE is not
298         available, don't use it.
300 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
302         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
303         (__lll_mutex_timedlock_wait): Use correct pointer when we don't
304         call into the kernel to delay.
306 2007-01-18  Ulrich Drepper  <drepper@redhat.com>
308         * tst-initializers1.c: We want to test the initializers as seen
309         outside of libc, so undefined _LIBC.
311         * pthread_join.c (cleanup): Avoid warning.
313 2007-01-17  Ulrich Drepper  <drepper@redhat.com>
315         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
316         (__lll_timedwait_tid): Add unwind info.
318         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Don't just copy the
319         function table, mangle the pointers.
320         * sysdeps/pthread/pthread-functions.h: Define PTHFCT_CALL.
321         * forward.c: Use PTHFCT_CALL and __libc_pthread_functions_init.
322         * sysdeps/pthread/bits/libc-lock.h: When using __libc_pthread_functions
323         demangle pointers before use.
324         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Use PTHFCT_CALL to
325         demangle pointer.
326         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
327         * sysdeps/pthread/setxid.h: Likewise.
329 2007-01-12  Ulrich Drepper  <drepper@redhat.com>
331         * tst-rwlock7.c: Show some more information in case of correct
332         behavior.
334 2007-01-11  Ulrich Drepper  <drepper@redhat.com>
336         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
337         (lll_futex_timed_wait): Undo part of last change, don't negate
338         return value.
340 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
342         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups.  Define
343         FUTEX_CMP_REQUEUE and lll_futex_requeue.
345 2006-12-28  David S. Miller  <davem@davemloft.net>
347         * shlib-versions: Fix sparc64 linux target specification.
349 2007-01-10  Jakub Jelinek  <jakub@redhat.com>
351         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
352         Adjust include path for pthread_barrier_wait.c move.
354 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
356         * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
357         tid isn't reread from pd->tid in between ESRCH test and the syscall.
359 2006-12-06  Jakub Jelinek  <jakub@redhat.com>
361         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
362         6 argument cancellable syscalls.
363         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
364         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
365         6 argument cancellable syscalls.
366         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
368 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
370         * sysdeps/unix/sysv/linux/rtld-lowlevel.h
371         (__rtld_mrlock_initialize): Add missing closing parenthesis.
373 2006-10-30  Jakub Jelinek  <jakub@redhat.com>
375         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
376         __sync_lock_release instead of __sync_lock_release_si.
378 2006-10-29  Jakub Jelinek  <jakub@redhat.com>
380         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P):
381         Define.
382         (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld.
383         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
384         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
385         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
386         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
387         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
388         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
389         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
390         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
391         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
392         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
394 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
396         * sysdeps/pthread/pthread_barrier_wait.c: Move to...
397         * pthread_barrier_wait.c: ...here.
398         * sysdeps/pthread/pthread_cond_broadcast.c: Move to...
399         * pthread_cond_broadcast.c: ...here.
400         * sysdeps/pthread/pthread_cond_signal.c: Move to...
401         * pthread_cond_signal.c: ...here.
402         * sysdeps/pthread/pthread_cond_timedwait.c: Move to...
403         * pthread_cond_timedwait.c: ...here.
404         * sysdeps/pthread/pthread_cond_wait.c: Move to...
405         * pthread_cond_wait.c: ...here.
406         * sysdeps/pthread/pthread_once.c: Move to...
407         * pthread_once.c: ...here.
408         * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to...
409         * pthread_rwlock_rdlock.c: ...here.
410         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to...
411         * pthread_rwlock_timedrdlock.c: ...here.
412         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to...
413         * pthread_rwlock_timedwrlock.c: ...here.
414         * sysdeps/pthread/pthread_rwlock_unlock.c: Move to...
415         * pthread_rwlock_unlock.c: ...here.
416         * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to...
417         * pthread_rwlock_wrlock.c: ...here.
418         * sysdeps/pthread/pthread_spin_destroy.c: Move to...
419         * pthread_spin_destroy.c: ...here.
420         * sysdeps/pthread/pthread_spin_init.c: Move to...
421         * pthread_spin_init.c: ...here.
422         * sysdeps/pthread/pthread_spin_unlock.c: Move to...
423         * pthread_spin_unlock.c: ...here.
424         * sysdeps/pthread/pthread_getcpuclockid.c: Move to...
425         * pthread_getcpuclockid.c: ...here.
427         * init.c: USE_TLS support is now always enabled.
428         * tst-tls5.h: Likewise.
429         * sysdeps/alpha/tls.h: Likewise.
430         * sysdeps/i386/tls.h: Likewise.
431         * sysdeps/ia64/tls.h: Likewise.
432         * sysdeps/powerpc/tls.h: Likewise.
433         * sysdeps/s390/tls.h: Likewise.
434         * sysdeps/sh/tls.h: Likewise.
435         * sysdeps/sparc/tls.h: Likewise.
436         * sysdeps/x86_64/tls.h: Likewise.
438 2006-10-27  Jakub Jelinek  <jakub@redhat.com>
440         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
441         __rtld_mrlock_change): Update oldval if atomic compare and exchange
442         failed.
444         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
445         Define to THREAD_SELF->header.multiple_threads.
446         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
447         Likewise.
448         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
449         Likewise.
450         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
451         (SINGLE_THREAD_P): Likewise.
452         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
453         (SINGLE_THREAD_P): Likewise.
454         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
455         (SINGLE_THREAD_P): Likewise.
456         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
457         (SINGLE_THREAD_P): Likewise.
458         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P):
459         Likewise.
460         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
461         (SINGLE_THREAD_P): Likewise.
462         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
463         (SINGLE_THREAD_P): Likewise.
464         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P):
465         Likewise.
467 2006-10-26  Jakub Jelinek  <jakub@redhat.com>
469         * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3
470         by default rather than 2_3_3.
472 2006-10-17  Jakub Jelinek  <jakub@redhat.com>
474         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
475         __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
476         atomic_* instead of catomic_* macros.
478 2006-10-12  Ulrich Drepper  <drepper@redhat.com>
480         [BZ #3285]
481         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX.
482         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
483         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
484         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
485         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
486         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX.
487         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
488         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
489         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
490         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise.
491         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
492         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
493         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
495 2006-10-11  Ulrich Drepper  <drepper@redhat.com>
497         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for
498         cancelable syscalls with six parameters.
500         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
501         operations instead of atomic_*.
503 2006-10-09  Ulrich Drepper  <drepper@redhat.com>
505         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
507 2006-10-07  Ulrich Drepper  <drepper@redhat.com>
509         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file.
510         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file.
511         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c:
512         New file.
513         * pthread_attr_setstack.c: Allow overwriting the version number of the
514         new symbol.
515         * pthread_attr_setstacksize.c: Likewise.
516         (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use
517         it.
518         * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add
519         pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6.
521 2006-09-24  Ulrich Drepper  <drepper@redhat.com>
523         [BZ #3251]
524         * descr.h (ENQUEUE_MUTEX_BOTH): Add cast to avoid warning.
525         Patch by Petr Baudis.
527 2006-09-18  Jakub Jelinek  <jakub@redhat.com>
529         * tst-kill4.c (do_test): Explicitly set tf thread's stack size.
531         * tst-cancel2.c (tf): Loop as long as something was written.
533 2006-09-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
535         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: For PI
536         mutexes wake all mutexes.
537         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Don't increment
538         WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
539         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
541 2006-09-12  Ulrich Drepper  <drepper@redhat.com>
543         * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use
544         to guarantee the thread is always canceled.
546 2006-09-08  Jakub Jelinek  <jakub@redhat.com>
548         * tst-cond22.c: Include pthread.h instead of pthreadP.h.
549         Include stdlib.h.
550         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Only
551         increase FUTEX if increasing WAKEUP_SEQ.  Fix comment typo.
552         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
553         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
554         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
556 2006-09-08  Ulrich Drepper  <drepper@redhat.com>
558         [BZ #3123]
559         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Don't
560         increment WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
561         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
562         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
563         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
564         * Makefile (tests): Add tst-cond22.
565         * tst-cond22.c: New file.
567 2006-09-05  Ulrich Drepper  <drepper@redhat.com>
569         [BZ #3124]
570         * descr.h (struct pthread): Add parent_cancelhandling.
571         * sysdeps/pthread/createthread.c (create_thread): Pass parent
572         cancelhandling value to child.
573         * pthread_create.c (start_thread): If parent thread was canceled
574         reset the SIGCANCEL mask.
575         * Makefile (tests): Add tst-cancel25.
576         * tst-cancel25.c: New file.
578 2006-09-05  Jakub Jelinek  <jakub@redhat.com>
579             Ulrich Drepper  <drepper@redhat.com>
581         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
582         counterp if it is already zero.
583         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
585 2006-03-04  Jakub Jelinek  <jakub@redhat.com>
586             Roland McGrath  <roland@redhat.com>
588         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
589         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
590         LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
591         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
592         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
593         lll_robust_mutex_timedlock, lll_mutex_unlock,
594         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
595         Add _L_*_ symbols around the subsection.
596         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
597         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
599 2006-03-03  Jakub Jelinek  <jakub@redhat.com>
600             Roland McGrath  <roland@redhat.com>
602         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
603         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
604         LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
605         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
606         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
607         lll_robust_mutex_timedlock, lll_mutex_unlock,
608         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
609         Add _L_*_ symbols around the subsection.
610         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
611         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
613 2006-08-31  Ulrich Drepper  <drepper@redhat.com>
615         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Undo last
616         change because it can disturb too much existing code.  If real hard
617         reader preference is needed we'll introduce another type.
618         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
619         (pthread_rwlock_timedwrlock): Likewise.
620         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
621         Likewise.
623 2006-08-30  Ulrich Drepper  <drepper@redhat.com>
625         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Respect
626         reader preference.
627         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
628         (pthread_rwlock_timedwrlock): Likewise.
629         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
630         Likewise.
632 2006-08-25  Jakub Jelinek  <jakub@redhat.com>
634         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
635         Only define ifdef SHARED.
637 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
639         * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
640         (free_stacks): ...here.
641         (__free_stack_cache): New function.
642         * pthreadP.h: Declare __free_stack_cache.
643         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
644         ptr_freeres.
645         * init.c (pthread_functions): Initialize ptr_freeres.
646         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
647         New freeres function.
649 2006-07-30  Joseph S. Myers  <joseph@codesourcery.com>
651         [BZ #3018]
652         * Makefile (extra-objs): Add modules to extra-test-objs instead.
654 2006-08-20  Ulrich Drepper  <drepper@redhat.com>
656         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
657         _XOPEN_REALTIME_THREADS.
659 2006-08-15  Jakub Jelinek  <jakub@redhat.com>
661         * sysdeps/unix/sysv/linux/clock_settime.c (INTERNAL_VSYSCALL): Use
662         HAVE_CLOCK_GETRES_VSYSCALL as guard macro rather than
663         HAVE_CLOCK_GETTIME_VSYSCALL.
664         (maybe_syscall_settime_cpu): Use plain INTERNAL_VSYSCALL here.
666 2006-08-14  Jakub Jelinek  <jakub@redhat.com>
668         * sysdeps/unix/sysv/linux/bits/posix_opt.h
669         (_POSIX_THREAD_PRIO_PROTECT): Define to 200112L.
670         * descr.h (struct priority_protection_data): New type.
671         (struct pthread): Add tpp field.
672         * pthreadP.h (PTHREAD_MUTEX_PP_NORMAL_NP,
673         PTHREAD_MUTEX_PP_RECURSIVE_NP, PTHREAD_MUTEX_PP_ERRORCHECK_NP,
674         PTHREAD_MUTEX_PP_ADAPTIVE_NP): New enum values.
675         * pthread_mutex_init.c (__pthread_mutex_init): Handle non-robust
676         TPP mutexes.
677         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle TPP mutexes.
678         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
679         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
680         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
681         * tpp.c: New file.
682         * pthread_setschedparam.c (__pthread_setschedparam): Handle priority
683         boosted by TPP.
684         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
685         * pthread_mutexattr_getprioceiling.c
686         (pthread_mutexattr_getprioceiling): If ceiling is 0, ensure it is
687         in the SCHED_FIFO priority range.
688         * pthread_mutexattr_setprioceiling.c
689         (pthread_mutexattr_setprioceiling): Fix prioceiling validation.
690         * pthread_mutex_getprioceiling.c (pthread_mutex_getprioceiling): Fail
691         if mutex is not TPP.  Ceiling is now in __data.__lock.
692         * pthread_mutex_setprioceiling.c: Include stdbool.h.
693         (pthread_mutex_setprioceiling): Fix prioceiling validation.  Ceiling
694         is now in __data.__lock.  Add locking.
695         * pthread_create.c (__free_tcb): Free pd->tpp structure.
696         * Makefile (libpthread-routines): Add tpp.
697         (xtests): Add tst-mutexpp1, tst-mutexpp6 and tst-mutexpp10.
698         * tst-tpp.h: New file.
699         * tst-mutexpp1.c: New file.
700         * tst-mutexpp6.c: New file.
701         * tst-mutexpp10.c: New file.
702         * tst-mutex1.c (TEST_FUNCTION): Don't redefine if already defined.
703         * tst-mutex6.c (TEST_FUNCTION): Likewise.
705 2006-08-12  Ulrich Drepper  <drepper@redhat.com>
707         [BZ #2843]
708         * pthread_join.c (pthread_join): Account for self being canceled
709         when checking for deadlocks.
710         * tst-join5.c: Cleanups.  Allow to be used in tst-join6.
711         (tf1): Don't print anything after pthread_join returns, this would be
712         another cancellation point.
713         (tf2): Likewise.
714         * tst-join6.c: New file.
715         * Makefile (tests): Add tst-join6.
717 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
719         [BZ #2892]
720         * pthread_setspecific.c (__pthread_setspecific): Check
721         out-of-range index before checking for unused key.
723         * sysdeps/pthread/gai_misc.h: New file.
725 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
727         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
728         file.  Don't use sysctl.
729         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
730         overwrite the file if this is likely not true.
732 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
734         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
735         * Makefile (tests): Add tst-getpid3.
736         * tst-getpid3.c: New file.
738 2006-07-30  Roland McGrath  <roland@redhat.com>
740         * Makefile (libpthread-routines): Add ptw-sigsuspend.
742         * sysdeps/unix/sysv/linux/i386/not-cancel.h
743         (pause_not_cancel): New macro.
744         (nanosleep_not_cancel): New macro.
745         (sigsuspend_not_cancel): New macro.
746         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
747         nanosleep_not_cancel macro from <not-cancel.h>.
748         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
749         macro from <not-cancel.h>.
751 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
752             Jakub Jelinek  <jakub@redhat.com>
754         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
755         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
756         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
757         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
758         * pthread_mutex_init.c: Add support for priority inheritance mutex.
759         * pthread_mutex_lock.c: Likewise.
760         * pthread_mutex_timedlock.c: Likewise.
761         * pthread_mutex_trylock.c: Likewise.
762         * pthread_mutex_unlock.c: Likewise.
763         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
764         all mutexes.
765         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
766         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
767         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
768         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
769         pthread-pi-defines.sym.
770         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
771         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
772         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
773         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
774         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
775         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
776         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
777         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
778         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
779         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
780         _POSIX_THREAD_PRIO_INHERIT to 200112L.
781         * tst-mutex1.c: Adjust to allow use in PI mutex test.
782         * tst-mutex2.c: Likewise.
783         * tst-mutex3.c: Likewise.
784         * tst-mutex4.c: Likewise.
785         * tst-mutex5.c: Likewise.
786         * tst-mutex6.c: Likewise.
787         * tst-mutex7.c: Likewise.
788         * tst-mutex7a.c: Likewise.
789         * tst-mutex8.c: Likewise.
790         * tst-mutex9.c: Likewise.
791         * tst-robust1.c: Likewise.
792         * tst-robust7.c: Likewise.
793         * tst-robust8.c: Likewise.
794         * tst-mutexpi1.c: New file.
795         * tst-mutexpi2.c: New file.
796         * tst-mutexpi3.c: New file.
797         * tst-mutexpi4.c: New file.
798         * tst-mutexpi5.c: New file.
799         * tst-mutexpi6.c: New file.
800         * tst-mutexpi7.c: New file.
801         * tst-mutexpi7a.c: New file.
802         * tst-mutexpi8.c: New file.
803         * tst-mutexpi9.c: New file.
804         * tst-robust1.c: New file.
805         * tst-robust2.c: New file.
806         * tst-robust3.c: New file.
807         * tst-robust4.c: New file.
808         * tst-robust5.c: New file.
809         * tst-robust6.c: New file.
810         * tst-robust7.c: New file.
811         * tst-robust8.c: New file.
812         * Makefile (tests): Add the new tests.
814         * pthread_create.c (start_thread): Add some casts to avoid warnings.
815         * pthread_mutex_destroy.c: Remove unneeded label.
817 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
819         * pthread_mutex_init.c (__pthread_mutex_init): Move some
820         computations to compile time.
822 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
824         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
826 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
828         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
830 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
832         * pthread_key_create.c (__pthread_key_create): Do away with
833         __pthread_keys_lock.
835         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
836         (__kernel_cpumask_size): Mark as hidden.
837         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
839         * sem_open.c (__sem_mappings_lock): Mark as hidden.
840         * semaphoreP.h (__sem_mappings_lock): Likewise.
842 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
844         * pthread_atfork.c: Mark __dso_handle as hidden.
846 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
848         [BZ #2644]
849         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
850         the reload problem.  Change the one path in pthread_cancel_init
851         which causes the problem.  Force gcc to reload.  Simplify callers.
852         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
853         (_Unwind_GetBSP): Undo last patch.
855 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
857         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
858         function pointer is reloaded after pthread_cancel_init calls.
860         [BZ #2644]
861         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
862         pointers are reloaded after pthread_cancel_init calls.
864 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
866         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
867         __always_inline.
869 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
871         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
872         Allocate new object which is passed to timer_sigev_thread so that
873         the timer can be deleted before the new thread is scheduled.
875 2006-04-26  Roland McGrath  <roland@redhat.com>
877         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
879 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
881         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
882         suffix for conditional jumps.
883         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
884         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
885         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
886         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
887         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
888         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
890         * init.c (sigcancel_handler): Compare with correct PID even if the
891         thread is in the middle of a fork call.
892         (sighandler_setxid): Likewise.
893         Reported by Suzuki K P <suzuki@in.ibm.com> .
895 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
897         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
899 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
901         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
902         fails [Coverity CID 105].
904 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
906         * sysdeps/pthread/pthread.h: Add nonnull attributes.
908 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
910         [BZ #2505]
911         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
912         Define __lll_rel_instr using lwsync.
914 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
916         * allocatestack.c (allocate_stack): Always initialize robust_head.
917         * descr.h: Define struct robust_list_head.
918         (struct pthread): Use robust_list_head in robust mutex list definition.
919         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
920         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
921         (__pthread_initialize_minimal_internal): Register robust_list with
922         the kernel.
923         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
924         Declare __set_robust_list_avail.
925         * pthread_create.c (start_thread): Register robust_list of new thread.
926         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
927         waiters.
928         * pthread_mutex_destroy.c: For robust mutexes don't look at the
929         number of users, it's unreliable.
930         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
931         set_robust_list syscall is available.
932         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
933         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
934         Set robust_head.list_op_pending before trying to lock a robust mutex.
935         * pthread_mutex_timedlock.c: Likewise.
936         * pthread_mutex_trylock.c: Likewise.
937         * pthread_mutex_unlock.c: Likewise for unlocking.
938         * Makefile (tests): Add tst-robust8.
939         * tst-robust8.c: New file.
941 2006-03-08  Andreas Schwab  <schwab@suse.de>
943         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
944         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
946 2006-03-05  Roland McGrath  <roland@redhat.com>
948         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
949         and $config_os doesn't match *linux*.
951 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
953         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
954         Use __syscall_error.
955         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
956         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
957         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
958         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
959         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
960         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
962 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
964         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
966 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
968         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
969         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
970         mutex.
971         (__lll_robust_timedlock_wait): Likewise.
972         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
973         (__lll_robust_lock_wait): Likewise.
974         (__lll_robust_timedlock_wait): Likewise.
975         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
976         (__lll_robust_lock_wait): Likewise.
977         (__lll_robust_timedlock_wait): Likewise.
979 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
981         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
982         lll_robust_mutex_trylock, lll_robust_mutex_lock,
983         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
984         lll_robust_mutex_unlock): Define.
985         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
987 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
989         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
990         instead of <clone.S>.
992 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
994         * Makefile (libpthread-routines): Add
995         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
996         and pthread_mutex_[sg]etprioceiling.
997         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
998         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
999         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
1000         pthread_mutex_setprioceiling.
1001         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
1002         PTHREAD_PRIO_PROTECT): New enum values.
1003         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
1004         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
1005         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
1006         prototypes.
1007         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
1008         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
1009         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
1010         Define.
1011         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
1012         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
1013         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
1014         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
1015         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
1016         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
1017         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
1018         protocol mutexes.
1019         * pthread_mutex_getprioceiling.c: New file.
1020         * pthread_mutex_setprioceiling.c: New file.
1021         * pthread_mutexattr_getprioceiling.c: New file.
1022         * pthread_mutexattr_setprioceiling.c: New file.
1023         * pthread_mutexattr_getprotocol.c: New file.
1024         * pthread_mutexattr_setprotocol.c: New file.
1026 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
1028         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
1030 2006-02-27  Roland McGrath  <roland@redhat.com>
1032         * sysdeps/pthread/Subdirs: List nptl here too.
1033         * configure (libc_add_on_canonical): New variable.
1035         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
1037         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
1038         self to get main source tree's file.
1039         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
1040         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
1041         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
1042         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
1043         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
1044         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
1045         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
1046         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
1047         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
1048         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
1049         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
1050         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
1051         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
1053         * Makefile: Use $(sysdirs) in vpath directive.
1055         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
1056         (CPPFLAGS-timer_routines.c): Likewise.
1058         * Makeconfig (includes): Variable removed.
1060 2006-02-26  Roland McGrath  <roland@redhat.com>
1062         * sysdeps/generic/pt-raise.c: Moved to ...
1063         * pt-raise.c: ... here.
1064         * sysdeps/generic/lowlevellock.h: Moved to ...
1065         * lowlevellock.h: ... here.
1067 2006-02-23  Roland McGrath  <roland@redhat.com>
1069         * descr.h (struct pthread): Add final member `end_padding'.
1070         (PTHREAD_STRUCT_END_PADDING): Use it.
1072 2006-02-20  Roland McGrath  <roland@redhat.com>
1074         * sysdeps/mips: Directory removed, saved in ports repository.
1075         * sysdeps/unix/sysv/linux/mips: Likewise.
1077 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
1079         * tst-robust1.c: Add second mutex to check that the mutex list is
1080         handled correctly.
1082 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
1084         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
1085         lll_robust_mutex_trylock, lll_robust_mutex_lock,
1086         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
1087         lll_robust_mutex_unlock): New macros.
1088         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
1089         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1090         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1091         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1092         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
1094 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1096         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
1097         definitions.
1098         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
1100 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
1102         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1103         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
1104         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
1105         (lll_robust_mutex_unlock): Likewise.
1107 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
1109         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
1110         Set robust_list.__next rather than robust_list.
1111         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
1112         (__pthread_list_t): New typedef.
1113         (pthread_mutex_t): Replace __next and __prev fields with __list.
1114         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
1115         (__pthread_list_t): New typedef.
1116         (pthread_mutex_t): Replace __next and __prev fields with __list.
1117         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
1118         (__pthread_list_t, __pthread_slist_t): New typedefs.
1119         (pthread_mutex_t): Replace __next and __prev fields with __list.
1120         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
1121         (__pthread_list_t, __pthread_slist_t): New typedefs.
1122         (pthread_mutex_t): Replace __next and __prev fields with __list.
1123         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
1124         (__pthread_list_t, __pthread_slist_t): New typedefs.
1125         (pthread_mutex_t): Replace __next and __prev fields with __list.
1126         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
1127         (__pthread_slist_t): New typedef.
1128         (pthread_mutex_t): Replace __next field with __list.
1130 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
1132         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
1133         PTHREAD_MUTEX_OWNERDEAD.
1134         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
1135         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
1136         * Makefile (libpthread-routines): Add lowlevelrobustlock.
1137         * pthread_create.c (start_thread): Very much simplify robust_list loop.
1138         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
1139         to PTHREAD_MUTEX_INCONSISTENT.
1140         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
1141         * pthread_mutex_lock.c: Reimplement robust mutex handling.
1142         * pthread_mutex_trylock.c: Likewise.
1143         * pthread_mutex_timedlock.c: Likewise.
1144         * pthread_mutex_unlock.c: Likewise.
1145         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
1146         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
1147         lowlevelrobustlock.sym.
1148         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
1149         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
1150         definitions.
1151         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1152         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
1153         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
1154         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
1155         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
1157 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
1159         * allocatestack.c (allocate_stack): Initialize robust_list.
1160         * init.c (__pthread_initialize_minimal_internal): Likewise.
1161         * descr.h (struct xid_command): Pretty printing.
1162         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
1163         robust_list.  Adjust macros.
1164         * pthread_create.c (start_thread): Adjust robust_list handling.
1165         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
1166         but the owner for all robust mutex types.
1167         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
1168         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
1169         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1170         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
1172         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
1173         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
1175 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
1177         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
1178         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
1180 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1182         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
1183         Return status.
1184         (lll_futex_timed_wait): Define.
1186 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
1188         * tst-cancel4.c: Test ppoll.
1190 2006-01-18  Andreas Jaeger  <aj@suse.de>
1192         [BZ #2167]
1193         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
1194         (pthread_mutex_t): Follow changes for other archs.  Based on patch
1195         by Jim Gifford <patches@jg555.com>.
1197 2006-01-13  Richard Henderson  <rth@redhat.com>
1199         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
1201 2006-01-10  Roland McGrath  <roland@redhat.com>
1203         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
1204         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
1205         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
1206         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
1207         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
1208         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
1209         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
1210         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
1211         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
1212         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
1214 2006-01-09  Roland McGrath  <roland@redhat.com>
1216         * tst-initializers1-c89.c: New file.
1217         * tst-initializers1-c99.c: New file.
1218         * tst-initializers1-gnu89.c: New file.
1219         * tst-initializers1-gnu99.c: New file.
1220         * Makefile (tests): Add them.
1221         (CFLAGS-tst-initializers1-c89.c): New variable.
1222         (CFLAGS-tst-initializers1-c99.c): New variable.
1223         (CFLAGS-tst-initializers1-gnu89.c): New variable.
1224         (CFLAGS-tst-initializers1-gnu99.c): New variable.
1226         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
1227         Use __extension__ on anonymous union definition.
1228         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1229         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1230         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1231         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1232         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1234 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
1236         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
1237         Don't give the union a name because it changes the mangled name.
1238         Instead name the struct for __data.
1239         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
1240         Likewise.
1241         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
1242         Likewise.
1244 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
1246         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
1247         stack bias to mc_ftp field.
1249 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
1251         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
1252         being too clever and reloading the futex value where it shouldn't.
1254 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
1256         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
1257         correct type.
1259 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
1261         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
1262         Add cfi directives.
1264 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
1266         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
1267         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
1268         rename in tcbhead_t.
1270         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
1271         Don't give the union a name because it changes the mangled name.
1272         Instead name the struct for __data.
1273         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1274         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1275         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1276         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1277         * pthread_create.c (start_thread): Adjust robust mutex free loop.
1278         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
1280 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
1282         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
1283         Return status.
1284         (lll_futex_timed_wait): Define.
1285         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1286         * sysdeps/pthread/aio_misc.h: New file.
1288 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
1290         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
1292 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
1294         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
1295         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
1296         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
1298 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
1300         * tst-cancel24.cc: Use C headers instead of C++ headers.
1302 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
1304         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
1305         sparc-linux configured glibc.
1306         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
1307         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
1308         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
1309         atomic_compare_and_exchange_val_24_acq instead of
1310         atomic_compare_and_exchange_val_acq.
1311         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
1312         instead of atomic_exchange_rel.
1313         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
1314         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
1315         file.
1316         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
1317         file.
1318         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
1319         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
1320         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
1321         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
1322         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
1323         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
1324         New file.
1325         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1326         New file.
1327         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
1328         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
1329         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
1330         file.
1331         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
1332         file.
1333         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
1335 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
1337         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
1338         mutex initializers.
1340 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
1342         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
1343         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
1344         THREAD_COPY_POINTER_GUARD): Define.
1345         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
1346         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
1348 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
1350         * version.c: Update copyright year.
1352 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1354         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
1355         .eh_frame section, use cfi_* directives.
1356         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
1358 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
1360         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
1361         now.
1363 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
1365         * sysdeps/pthread/sigaction.c: Removed.
1366         * sigaction.c: New file.
1367         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
1369 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
1371         * Makefile (tests): Add tst-signal7.
1372         * tst-signal7.c: New file.
1374 2005-12-27  Roland McGrath  <roland@redhat.com>
1376         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
1377         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
1378         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
1379         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
1380         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
1381         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
1382         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
1383         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
1384         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
1385         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
1386         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
1388 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
1390         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
1391         and __prev field to pthread_mutex_t.
1392         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1393         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1394         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1395         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1396         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
1397         to pthread_mutex_t.
1399 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
1401         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
1402         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
1403         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
1404         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
1405         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
1406         and PTHREAD_MUTEXATTR_FLAG_BITS.
1407         * descr.h (struct pthread): Add robust_list field and define
1408         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
1409         * pthread_mutexattr_getrobust.c: New file.
1410         * pthread_mutexattr_setrobust.c: New file.
1411         * pthread_mutex_consistent.c: New file.
1412         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
1413         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
1414         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
1415         Adjust pthread_mutex_t initializers.
1416         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
1417         field to pthread_mutex_t.
1418         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
1419         and __prev field to pthread_mutex_t.
1420         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
1421         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
1422         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
1423         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
1424         * pthread_mutexattr_gettype.c: Likewise.
1425         * pthread_mutexattr_setpshared.c: Likewise.
1426         * pthread_mutexattr_settype.c: Likewise.
1427         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
1428         Initialize mutex kind according to robust flag.
1429         * pthread_mutex_lock.c: Implement local robust mutex.
1430         * pthread_mutex_timedlock.c: Likewise.
1431         * pthread_mutex_trylock.c: Likewise.
1432         * pthread_mutex_unlock.c: Likewise.
1433         * pthread_create.c (start_thread): Mark robust mutexes which remained
1434         locked as dead.
1435         * tst-robust1.c: New file.
1436         * tst-robust2.c: New file.
1437         * tst-robust3.c: New file.
1438         * tst-robust4.c: New file.
1439         * tst-robust5.c: New file.
1440         * tst-robust6.c: New file.
1441         * tst-robust7.c: New file.
1442         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
1443         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
1444         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
1445         tst-robust5, tst-robust6, and tst-robust7.
1447         * tst-typesizes.c: New file.
1448         * Makefile (tests): Add tst-typesizes.
1450         * tst-once3.c: More debug output.
1452 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
1454         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
1455         missing after last change.
1457         * version.c: Update copyright year.
1459 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
1461         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
1462         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
1463         * pthread_mutex_trylock.c: Likewise.
1464         * pthread_mutex_timedlock.c: Likewise.
1465         * pthread_mutex_unlock.c: Likewise.
1467 2005-12-22  Roland McGrath  <roland@redhat.com>
1469         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
1470         so that #include_next's search location is not reset to the -I..
1471         directory where <nptl/...> can be found.
1473 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
1475         [BZ #1913]
1476         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
1477         Fix unwind info.  Remove useless branch prediction prefix.
1478         * tst-cancel24.cc: New file.
1479         * Makefile: Add rules to build and run tst-cancel24.
1481 2005-12-21  Roland McGrath  <roland@redhat.com>
1483         * libc-cancellation.c: Use <> rather than "" #includes.
1484         * pt-cleanup.c: Likewise.
1485         * pthread_create.c: Likewise.
1486         * pthread_join.c: Likewise.
1487         * pthread_timedjoin.c: Likewise.
1488         * pthread_tryjoin.c: Likewise.
1489         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
1490         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
1491         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
1492         * unwind.c: Likewise.
1494 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1496         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
1497         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
1498         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
1499         THREAD_COPY_POINTER_GUARD): Define.
1501 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
1503         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
1504         rather than one.
1505         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
1506         THREAD_COPY_POINTER_GUARD): Define.
1507         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
1508         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
1509         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
1510         THREAD_COPY_POINTER_GUARD): Define.
1511         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
1512         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
1513         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
1514         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
1515         Use PTR_DEMANGLE for B0 if defined.
1517 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
1519         * pthread_create.c (__pthread_create_2_1): Use
1520         THREAD_COPY_POINTER_GUARD if available.
1521         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
1522         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
1523         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
1524         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
1525         * sysdeps/x86_64/tls.h: Likewise.
1527 2005-12-15  Roland McGrath  <roland@redhat.com>
1529         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
1531 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
1533         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
1534         sysdeps/generic.
1535         * errno-loc.c: New file.
1537 2005-12-12  Roland McGrath  <roland@redhat.com>
1539         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
1540         adjustments before choosing stack size.  Update minimum stack size
1541         calculation to match allocate_stack change.
1543 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
1545         * allocatestack.c (allocate_stack): Don't demand that there is an
1546         additional full page available on the stack beside guard, TLS, the
1547         minimum stack.
1549 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
1551         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
1552         (__cleanup_fct_attribute): Use __regparm__ not regparm.
1554         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
1555         compiling 32-bit code we must define __cleanup_fct_attribute.
1557 005-11-24  Jakub Jelinek  <jakub@redhat.com>
1559         [BZ #1920]
1560         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
1561         __attribute__ instead of __attribute.
1562         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
1563         (__cleanup_fct_attribute): Likewise.
1565 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
1567         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
1568         a write barrier before writing libgcc_s_getcfa.
1570 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
1572         * sysdeps/unix/sysv/linux/configure: Removed.
1574 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
1576         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
1577         optional init_array/fini_array support.
1579 2005-10-24  Roland McGrath  <roland@redhat.com>
1581         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
1582         versioned_symbol use.
1584 2005-10-16  Roland McGrath  <roland@redhat.com>
1586         * init.c (__pthread_initialize_minimal_internal): Even when using a
1587         compile-time default stack size, apply the minimum that allocate_stack
1588         will require, and round up to page size.
1590 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
1592         * Makefile ($(test-modules)): Remove static pattern rule.
1594 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
1595             Ulrich Drepper  <drepper@redhat.com>
1597         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
1598         alignment in callback function.
1599         * Makefile: Add rules to build and run tst-align3.
1600         * tst-align3.c: New file.
1602 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
1604         * allocatestack.c (setxid_signal_thread): Add
1605         INTERNAL_SYSCALL_DECL (err).
1607 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
1609         * allocatestack.c (setxid_signal_thread): Need to use
1610         atomic_compare_and_exchange_bool_acq.
1612 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
1613             Jakub Jelinek  <jakub@redhat.com>
1615         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
1616         CANCEL_RESTMASK.
1617         (struct pthread): Move specific_used field to avoid padding.
1618         Add setxid_futex field.
1619         * init.c (sighandler_setxid): Reset setxid flag and release the
1620         setxid futex.
1621         * allocatestack.c (setxid_signal_thread): New function.  Broken
1622         out of the bodies of the two loops in __nptl_setxid.  For undetached
1623         threads check whether they are exiting and if yes, don't send a signal.
1624         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
1625         * pthread_create.c (start_thread): For undetached threads, check
1626         whether setxid bit is set.  If yes, wait until signal has been
1627         processed.
1629         * allocatestack.c (STACK_VARIABLES): Initialize them.
1630         * pthread_create.c (__pthread_create_2_1): Initialize pd.
1632 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
1634         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
1635         waiters, awake all waiters on the associated mutex.
1637 2005-09-22  Roland McGrath  <roland@redhat.com>
1639         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
1640         ../sysdeps/x86_64/hp-timing.h).
1642 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
1644         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
1645         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
1646         (lll_futex_wake_unlock): Define.
1647         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
1648         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
1649         (lll_futex_wake_unlock): Define.
1650         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
1651         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
1652         (lll_futex_wake_unlock): Define.
1653         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
1654         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
1655         (lll_futex_wake_unlock): Define.
1656         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
1657         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
1658         (lll_futex_wake_unlock): Define.
1659         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
1660         lll_futex_wake_unlock.
1661         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
1662         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
1663         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
1664         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1665         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
1666         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
1668 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1670         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
1671         Fix typo in register name.
1673 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
1675         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
1676         Use __sigfillset.  Document that sigfillset does the right thing wrt
1677         to SIGSETXID.
1679 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
1681         [BZ #1102]
1682         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
1683         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
1684         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
1685         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
1686         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
1687         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
1688         in the structure.
1689         * Makefile (tests): Add tst-initializers1.
1690         (CFLAGS-tst-initializers1.c): Set.
1691         * tst-initializers1.c: New test.
1693 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
1695         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
1696         Make sure __flags are located at offset 48 from the start of the
1697         structure.
1699 2005-07-02  Roland McGrath  <roland@redhat.com>
1701         * Makeconfig: Comment fix.
1703 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
1705         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
1706         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
1707         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
1708         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
1709         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
1710         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
1711         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
1712         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
1713         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
1714         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
1716 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
1718         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
1719         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
1720         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
1721         fields.
1722         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
1723         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
1724         field.  Put in sysinfo field unconditionally.
1725         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
1726         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
1727         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
1728         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
1729         fields.
1730         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
1731         * pthread_create.c (__pthread_create_2_1): Use
1732         THREAD_COPY_STACK_GUARD macro.
1733         * Makefile: Add rules to build and run tst-stackguard1{,-static}
1734         tests.
1735         * tst-stackguard1.c: New file.
1736         * tst-stackguard1-static.c: New file.
1738 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
1740         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
1741         Invoke CGOTSETUP and CGOTRESTORE.
1742         (CGOTSETUP, CGOTRESTORE): Define.
1744 2005-05-29  Richard Henderson  <rth@redhat.com>
1746         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
1747         (tf_write, tf_writev): Use it.
1748         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
1749         the system minimum.
1751 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
1753         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
1754         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
1755         __librt_*_asynccancel@local.
1757 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
1759         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
1760         all occurrences of JUMPTARGET.  Instead append @local to labels.
1762 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
1764         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
1765         size/alignment of struct pthread rather than tcbhead_t.
1766         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
1767         Likewise.
1768         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
1769         Likewise.
1770         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
1771         Likewise.
1773 2005-05-19  Richard Henderson  <rth@redhat.com>
1775         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
1776         __sync_val_compare_and_swap, not explicit _si variant.
1777         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
1779 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
1781         [BZ #915]
1782         * sysdeps/pthread/pthread.h: Avoid empty initializers.
1784 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
1786         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
1787         .eh_frame section, use cfi_* directives.
1789 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
1791         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
1792         of "" includes.
1794 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
1796         [BZ #1075]
1797         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
1798         aio_write blocks.
1800 2005-04-27  Roland McGrath  <roland@redhat.com>
1802         * Makefile (tests): Remove tst-clock2.
1804         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
1805         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
1806         translating to the kernel clockid_t for our own process/thread clock.
1808         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
1810 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
1812         * old_pthread_cond_init.c: Include <errno.h>.
1813         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
1814         process shared or uses clock other than CLOCK_REALTIME.
1815         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
1817 2005-04-13  David S. Miller  <davem@davemloft.net>
1819         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
1820         * sysdeps/sparc/sparc64/clone.S: New file.
1822 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
1824         [BZ #1102]
1825         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
1826         __inline instead of inline.
1827         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
1829 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
1831         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
1832         functionally equivalent, but shorter instructions.
1833         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
1834         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
1835         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1836         Likewise.
1837         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
1838         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1839         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1840         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1841         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1842         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
1843         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1844         Likewise.
1845         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
1846         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1847         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1848         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1849         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1851 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
1853         * sysdeps/mips/Makefile: New file.
1854         * sysdeps/mips/nptl-sysdep.S: New file.
1855         * sysdeps/mips/tcb-offsets.sym: New file.
1856         * sysdeps/mips/pthread_spin_lock.S: New file.
1857         * sysdeps/mips/pthread_spin_trylock.S: New file.
1858         * sysdeps/mips/pthreaddef.h: New file.
1859         * sysdeps/mips/tls.h: New file.
1860         * sysdeps/mips/jmpbuf-unwind.h: New file.
1861         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
1862         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
1863         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
1864         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
1865         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
1866         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
1867         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
1868         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
1869         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
1870         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
1872 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
1874         [BZ #1112]
1875         * pthread_create.c (__pthread_create_2_1): Rename syscall error
1876         variable to scerr.
1878 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
1880         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
1882 2005-02-25  Roland McGrath  <roland@redhat.com>
1884         * alloca_cutoff.c: Correct license text.
1885         * tst-unload.c: Likewise.
1886         * sysdeps/pthread/allocalim.h: Likewise.
1887         * sysdeps/pthread/pt-initfini.c: Likewise.
1888         * sysdeps/pthread/bits/libc-lock.h: Likewise.
1889         * sysdeps/pthread/bits/sigthread.h: Likewise.
1890         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
1891         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
1893 2005-02-16  Roland McGrath  <roland@redhat.com>
1895         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1896         Use unsigned int * for ptr_nthreads.
1898 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
1900         [BZ #721]
1901         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
1902         gcc4.
1904 2005-02-07  Richard Henderson  <rth@redhat.com>
1906         [BZ #787]
1907         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
1908         argument.
1910 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
1912         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
1913         order of arguments in invocation of atomic_add_zero.
1915 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
1917         [BZ #737]
1918         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
1919         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
1920         at least gotntpoff relocation and addition.
1921         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
1922         Likewise.
1923         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
1924         Likewise.
1925         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
1926         Likewise.
1928 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
1930         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
1931         entry for static tls deallocation fix.
1932         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
1933         also contains information whether the memory pointed to is static
1934         TLS or not.
1935         * sysdeps/i386/tls.h: Likewise.
1936         * sysdeps/ia64/tls.h: Likewise.
1937         * sysdeps/powerpc/tls.h: Likewise.
1938         * sysdeps/s390/tls.h: Likewise.
1939         * sysdeps/sh/tls.h: Likewise.
1940         * sysdeps/sparc/tls.h: Likewise.
1941         * sysdeps/x86_64/tls.h: Likewise.
1943 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
1945         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
1947 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
1949         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
1950         %esp.
1951         * Makefile (tests): Add tst-align2.
1952         * tst-align2.c: New test.
1953         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
1954         -mpreferred-stack-boundary=4.
1956 2004-12-18  Roland McGrath  <roland@redhat.com>
1958         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
1959         New file removed withdrawn for the moment.
1961 2004-12-17  Richard Henderson  <rth@redhat.com>
1963         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
1964         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
1966 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
1968         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
1969         Increased PTHREAD_STACK_MIN.
1971         * tst-context1.c (stacks): Use bigger stack size.
1973 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
1975         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
1976         * sysdeps/sparc/tcb-offsets.sym: Add TID.
1978 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
1980         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
1981         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
1982         * sysdeps/s390/tcb-offsets.sym (TID): Add.
1984 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
1986         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
1988 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
1990         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
1991         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
1993         * tst-getpid1.c: If child crashes, report this first.  Print which
1994         signal.
1996 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
1998         * init.c (__pthread_initialize_minimal_internal): Also unblock
1999         SIGSETXID.
2001 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
2003         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
2004         _POSIX_THREAD_CPUTIME): Define to 0.
2005         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
2006         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
2007         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
2008         __timer_signal_thread_tclk): Remove.
2009         (init_module): Remove their initialization.
2010         (thread_cleanup): Remove their cleanup assertions.
2011         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
2012         __timer_signal_thread_tclk): Remove.
2013         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
2014         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
2015         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
2017 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
2019         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
2020         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
2022         * Makefile (tests): Add tst-getpid2.
2023         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
2024         (do_test): Use it.  Use __clone2 instead of clone on ia64.
2025         * tst-getpid2.c: New test.
2027 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2029         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
2031 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
2033         * Makefile (tests): Add tst-getpid1.
2034         * tst-getpid1.c: New file.
2035         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
2036         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
2038 2004-12-02  Roland McGrath  <roland@redhat.com>
2040         * Makefile (libpthread-nonshared): Variable removed.
2041         ($(objpfx)libpthread_nonshared.a): Target removed.
2042         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
2043         These are now handled by generic magic from
2044         libpthread-static-only-routines being set.
2046 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
2048         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
2049         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
2050         _POSIX_THREAD_PRIO_PROTECT): Define.
2051         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2052         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
2053         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
2055 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
2057         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
2058         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
2059         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
2060         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
2061         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2062         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
2063         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
2065 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
2067         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
2069         * Makefile (libpthread-routines): Add pthread_setschedprio.
2070         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
2071         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
2072         * pthread_setschedprio.c: New file.
2074 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
2076         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
2077         * pthread_cancel.c (pthread_create): Likewise.
2079         * Makefile (libpthread-routines): Add vars.
2080         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
2081         * init.c (__default_stacksize, __is_smp): Remove.
2082         * vars.c: New file.
2083         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
2084         and define a wrapper macro.
2085         (PTHREAD_STATIC_FN_REQUIRE): Define.
2086         * allocatestack.c (__find_thread_by_id): Undefine.
2087         * pthread_create (__pthread_keys): Remove.
2088         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
2089         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
2090         PTHREAD_STATIC_FN_REQUIRE.
2092 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2094         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
2095         parameter to REGISTER macro.
2097 2004-11-17  Roland McGrath  <roland@redhat.com>
2099         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
2100         Make sure SIGCANCEL is blocked as well.
2102 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
2104         * sysdeps/pthread/setxid.h: New file.
2105         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
2106         (struct xid_command): Add forward decl.
2107         (struct pthread_functions): Change return type of __nptl_setxid hook
2108         to int.
2109         * pthreadP.h (__nptl_setxid): Change return type to int.
2110         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
2111         calling thread, return its return value and set errno on failure.
2112         * descr.h (struct xid_command): Change id type to long array.
2114         * Makefile: Add rules to build and test tst-setuid1 and
2115         tst-setuid1-static.
2116         * tst-setuid1.c: New test.
2117         * tst-setuid1-static.c: New test.
2119 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
2121         * Makefile (tests): Add tst-exit3.
2122         * tst-exit3.c: New test.
2124 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
2126         * Makefile (tests): Add tst-exit2.
2127         * tst-exit2.c: New file.
2129 2004-11-09  Roland McGrath  <roland@redhat.com>
2131         [BZ #530]
2132         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
2133         here, before calling clone.
2134         * pthread_create.c (start_thread): Don't do it here.
2136 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
2138         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
2140 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
2142         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
2143         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
2144         assembler warning.
2146 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
2148         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
2149         if sched_priority is not between minprio and maxprio.
2151 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2153         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
2154         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
2156         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
2157         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
2159 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
2161         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
2162         not-cancelable I/O functions.
2164 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2166         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
2167         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
2168         make sure 2 is stored in the futex and we looked at the old value.
2169         Fix a few other problems to return the correct value.
2171 2004-10-14  Richard Henderson  <rth@redhat.com>
2173         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
2174         make gcc4 happy.
2176 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
2178         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
2179         of pthread-functions.h and pthreaddef.h.
2180         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
2182         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
2183         Change __data.__nwaiters from int to unsigned int.
2185         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
2186         sysconf (_SC_THREAD_CPUTIME) returns negative value.
2188         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
2189         before return type.
2191         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
2192         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
2194 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
2196         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
2197         test fails, remove message queue.
2198         (tf_msgsnd): Likewise.
2200 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
2202         * tst-clock1.c: Change #ifdef to #if defined.
2203         * tst-clock2.c: Likewise.
2204         * tst-cond11.c: Likewise.
2206         * sysdeps/pthread/timer_create.c (timer_create): Use
2207         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
2208         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
2209         THREAD_CPUTIME.
2211 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
2213         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
2214         _POSIX_THREAD_CPUTIME): Define to 0.
2216 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
2218         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
2219         and _POSIX_THREAD_CPUTIME to zero.
2220         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
2221         * tst-barrier2.c: Fix testing for POSIX feature.
2222         * tst-clock1.c: Likewise.
2223         * tst-clock2.c: Likewise.
2224         * tst-cond11.c: Likewise.
2225         * tst-cond4.c: Likewise.
2226         * tst-cond6.c: Likewise.
2227         * tst-flock2.c: Likewise.
2228         * tst-mutex4.c: Likewise.
2229         * tst-mutex9.c: Likewise.
2230         * tst-rwlock12.c: Likewise.
2231         * tst-rwlock4.c: Likewise.
2232         * tst-signal1.c: Likewise.
2233         * tst-spin2.c: Likewise.
2234         * sysdeps/pthread/posix-timer.h: Likewise.
2235         * sysdeps/pthread/timer_create.c: Likewise.
2236         * sysdeps/pthread/timer_routines.c: Likewise.
2238 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
2240         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2241         (__lll_mutex_timedlock_wait): Address futex correctly.
2243         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2244         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
2245         make sure 2 is stored in the futex and we looked at the old value.
2246         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2247         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
2248         which might very well made the code not working at all before.
2249         [BZ #417]
2251 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
2253         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
2254         allow SIGSETXID to be sent.
2255         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
2256         for SIGSETXID to be defined.
2257         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
2258         SIGSETXID cannot be blocked.
2260         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
2261         Add __extension__ to long long types.
2262         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2263         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2264         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2265         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2266         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
2267         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
2268         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2270 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
2272         * descr.h (struct pthread): Add stopped_start field.
2273         * sysdeps/pthread/createthread.c (create_thread): Set
2274         start_stopped flag in descriptor for new thread appropriately.
2275         * pthread_create.c (start_thread): Only take lock to be stopped on
2276         startup if stopped_start flag says so.
2278 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
2280         * pthread_create.c (__pthread_create_2_1): Remember whether thread
2281         is created detached and if yes, do not try to free the stack in case
2282         the thread creation failed.
2283         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
2284         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
2285         case there has been no error.  [BZ #405]
2287         * pthread_create.c (start_thread): Don't wait for scheduler data
2288         etc to be set at the beginning of the function.  The cancellation
2289         infrastructure must have been set up.  And enable async
2290         cancellation before potentially going to sleep.  [BZ #401]
2292 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
2294         * Versions: Remove exports for pthread_set*id_np functions.
2295         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
2296         for now.
2297         * Makefile: Don't build pthread_set*id code for now.
2299 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
2301         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
2302         internal use.
2303         * allocatestack.c (__nptl_setxid): New function.
2304         * descr.h (struct xid_command): Define type.
2305         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
2306         (sighandler_setxid): New function.
2307         (__pthread_initialize_minimal): Register sighandler_setxid for
2308         SIGCANCEL.
2309         * pt-allocrtsig.c: Update comment.
2310         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
2311         Declare __nptl_setxid.
2312         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
2313         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
2314         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
2315         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
2316         and pthread_setresuid_np.
2317         * pthread_setgid_np.c: New file.
2318         * pthread_setuid_np.c: New file.
2319         * pthread_setegid_np.c: New file.
2320         * pthread_seteuid_np.c: New file.
2321         * pthread_setregid_np.c: New file.
2322         * pthread_setreuid_np.c: New file.
2323         * pthread_setresgid_np.c: New file.
2324         * pthread_setresuid_np.c: New file.
2325         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
2326         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
2327         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
2328         and pthread_setresuid_np.
2329         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
2330         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
2331         pthread_setregid, and pthread_setresgid.
2333 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
2335         * allocatestack.c (allocate_stack): Return EAGAIN instead of
2336         ENOMEM when out of memory.
2338 2004-09-10  Roland McGrath  <roland@redhat.com>
2340         [BZ #379]
2341         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
2342         code, since we don't try to use the broken CLONE_STOPPED any more.
2343         * pthread_create.c (start_thread): Likewise.
2345 2004-09-15  Richard Henderson  <rth@redhat.com>
2347         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
2349 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
2351         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
2352         (__libc_unwind_longjmp): Delete macro and declare as function.
2353         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
2354         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
2355         nptl directory.
2356         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
2357         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
2358         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
2360 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
2362         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
2363         for __USE_XOPEN2K.
2364         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
2365         types also for __USE_XOPEN2K.
2366         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
2367         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2368         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2369         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2370         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2371         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2372         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2373         [BZ #320]
2375 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
2377         * sysdeps/pthread/pthread.h
2378         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
2379         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
2380         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
2381         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
2382         [BZ #375]
2384 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
2386         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
2387         PSEUDO to be used with . prefix.
2389         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
2390         Use atomic_increment instead of atomic_exchange_and_add.
2391         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
2392         Likewise.
2393         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
2394         Likewise.
2395         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
2396         Likewise.
2398         * allocatestack.c (allocate_stack): Use atomic_increment_val
2399         instead of atomic_exchange_and_add.
2400         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
2401         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
2402         Likewise.
2403         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
2404         Likewise.
2406         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
2407         the initialization function might throw.
2409 2005-09-05  Richard Henderson  <rth@redhat.com>
2411         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
2412         Move definition inside libpthread, libc, librt check.  Provide
2413         definition for rtld.
2415 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
2417         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
2418         * sysdeps/i386/jmpbuf-unwind.h: Likewise
2419         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
2420         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
2421         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
2422         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
2423         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
2424         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
2425         * unwind.c: Use it.
2427         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
2428         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
2429         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
2430         Likewise.
2431         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
2432         Decrement __nwaiters.  If pthread_cond_destroy has been called and
2433         this is the last waiter, signal pthread_cond_destroy caller and
2434         avoid using the pthread_cond_t structure after unlock.
2435         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2436         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2437         Read clock type from the least significant bits of __nwaiters instead
2438         of __clock.
2439         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2440         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
2442 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
2444         [BZ #342]
2445         * Makefile (tests): Add tst-cond20 and tst-cond21.
2446         * tst-cond20.c: New test.
2447         * tst-cond21.c: New test.
2448         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
2449         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
2450         it unsigned int.
2451         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
2452         Likewise.
2453         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2454         (pthread_cond_t): Likewise.
2455         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
2456         Likewise.
2457         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
2458         Likewise.
2459         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
2460         Likewise.
2461         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
2462         (cond_nwaiters): New.
2463         (clock_bits): New.
2464         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
2465         if there are waiters not signalled yet.
2466         Wait until all already signalled waiters wake up.
2467         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
2468         __nwaiters.  If pthread_cond_destroy has been called and this is the
2469         last waiter, signal pthread_cond_destroy caller and avoid using
2470         the pthread_cond_t structure after unlock.
2471         (__pthread_cond_wait): Increment __nwaiters in the beginning,
2472         decrement it when leaving.  If pthread_cond_destroy has been called
2473         and this is the last waiter, signal pthread_cond_destroy caller.
2474         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
2475         Likewise.  Read clock type from the least significant bits of
2476         __nwaiters instead of __clock.
2477         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
2478         whether clock ID can be encoded in COND_CLOCK_BITS bits.
2479         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
2480         clock type just from the last COND_CLOCK_BITS bits of value.
2481         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
2482         instead of __clock, just from second bit of condattr's value.
2484 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
2486         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
2487         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
2488         != 64.
2489         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
2491 2004-08-15  Roland McGrath  <roland@frob.com>
2493         * pthread_atfork.c: Update copyright terms including special exception
2494         for these trivial files, which are statically linked into executables
2495         that use dynamic linking for the significant library code.
2497 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
2499         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
2500         pthread_rwlock_rdlock.
2501         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
2502         Decrease __nr_readers_queued after reacquiring lock.
2503         * sysdeps/pthread/pthread_rwlock_timedrdlock
2504         (pthread_rwlock_timedrdlock): Likewise.
2505         Reported by Bob Cook <bobcook47@hotmail.com>.
2507 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
2509         * tst-rwlock14.c (tf): Read main thread handle from *ARG
2510         before pthread_barrier_wait.
2512 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
2514         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
2515         Remove unnecessary exception handling data.
2517 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
2519         [BZ #284]
2520         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
2521         instead of clockid_t.
2523 2004-07-21  Roland McGrath  <roland@redhat.com>
2525         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
2527 2004-07-19  Roland McGrath  <roland@redhat.com>
2529         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
2531 2004-07-02  Roland McGrath  <roland@redhat.com>
2533         * configure: Don't exit.
2535 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2537         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
2538         (__pthread_cond_timedwait): Check for invalid nanosecond in
2539         timeout value.
2541 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
2543         * Makefile: Add rules to build and run tst-fini1.
2544         * tst-fini1.c: New file.
2545         * tst-fini1mod.c: New file.
2547 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
2549         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
2550         if no cancellation support is needed.
2551         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
2552         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
2553         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
2554         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
2555         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2556         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
2557         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
2558         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2559         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2561         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
2562         only if not already defined.
2564 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
2566         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
2567         constraint "m" instead of "0" for futex.
2569         * shlib-versions: Add powerpc64-.*-linux.*.
2571 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
2573         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
2574         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
2575         for valid tv_nsec.
2576         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
2577         1 billion and 64-bit tv_nsec which is valid when truncated to 32
2578         bits.
2580 2004-06-29  Roland McGrath  <roland@redhat.com>
2582         * Banner: NPTL no longer has its own version number.
2583         * Makefile (nptl-version): Variable removed.
2584         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
2585         using $(version), the glibc version number.
2587 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2589         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
2590         Fix branch offset for a PLT entry.
2591         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
2592         Likewise.
2593         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
2594         Likewise.
2595         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
2596         Likewise.
2597         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
2598         Likewise.
2600 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
2602         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
2603         unconditionally.
2605 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
2607         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2608         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
2609         instead of tv_sec.
2610         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
2611         (pthread_rwlock_timedrdlock): Likewise.
2613 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
2615         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
2616         Set __r7 to val, not mutex.
2618 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
2620         * Makefile: Add rules to build tst-rwlock14.
2621         * tst-rwlock14.c: New file.
2623 2004-06-24  Boris Hu  <boris.hu@intel.com>
2625         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
2626         check.
2627         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
2629 2004-06-19  Andreas Jaeger  <aj@suse.de>
2631         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
2632         assembler in last patch.
2634 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
2636         * sysdeps/pthread/pthread_cond_timedwait.c
2637         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
2638         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2639         (__pthread_cond_timedwait): Check for invalid nanosecond in
2640         timeout value.
2641         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2642         * tst-cond19.c: New file.
2643         * Makefile: Add rules to build and run tst-cond19.
2645 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
2647         * tst-context1.c (GUARD_PATTERN): Defined.
2648         (tst_context_t): Define struct containing ucontext_t & guard words.
2649         (ctx): Declare as an array of tst_context_t.
2650         (fct): Verify uc_link & guard words are still valid.
2651         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
2653 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2655         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
2656         Add __data.__futex field, reshuffle __data.__clock.
2657         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
2658         (__pthread_cond_signal): Increment __futex at the same time as
2659         __wakeup_seq or __total_seq.  Pass address of __futex instead of
2660         address of low 32-bits of __wakeup_seq to futex syscall.
2661         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
2662         (__pthread_cond_wait): Likewise.  Pass __futex value from before
2663         releasing internal lock to FUTEX_WAIT.
2664         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
2665         (__pthread_cond_timedwait): Likewise.
2666         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
2667         (FUTEX_CMP_REQUEUE): Define.
2668         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
2669         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
2670         Pass __futex value from before the unlock and __futex address instead
2671         of address of low 32-bits of __wakeup_seq to futex syscall.
2672         Fallback to FUTEX_WAKE all on any errors.
2674 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
2676         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
2677         comment typo.
2678         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
2679         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
2680         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
2681         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
2682         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
2684 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2686         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
2687         Add memory clobber to inline assembly.
2688         (__lll_mutex_trylock): Likewise.
2689         (__lll_mutex_cond_trylock): Likewise.
2691 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
2693         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
2694         Pass val argument as 6th system call argument in %r7.
2696 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
2698         * Makefile (tests): Add tst-cond16.
2699         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
2700         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
2701         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
2702         Add __data.__futex field, reshuffle __data.__clock.
2703         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
2704         (__pthread_cond_signal): Increment __futex at the same time as
2705         __wakeup_seq or __total_seq.  Pass address of __futex instead of
2706         address of low 32-bits of __wakeup_seq to futex syscall.
2707         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
2708         (__pthread_cond_wait): Likewise.  Pass __futex value from before
2709         releasing internal lock to FUTEX_WAIT.
2710         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
2711         (__pthread_cond_timedwait): Likewise.
2712         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
2713         (FUTEX_CMP_REQUEUE): Define.
2714         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
2715         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
2716         Pass __futex value from before the unlock and __futex address instead
2717         of address of low 32-bits of __wakeup_seq to futex syscall.
2718         Fallback to FUTEX_WAKE all on any errors.
2719         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
2720         Define.
2721         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
2722         internally.  Return non-zero if error, zero if success.
2723         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
2724         Add __data.__futex field, reshuffle __data.__clock.
2725         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
2726         Define.
2727         (lll_futex_requeue): Add val argument, return 1 unconditionally
2728         for the time being.
2729         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
2730         Add __data.__futex field, reshuffle __data.__clock.
2731         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
2732         Define.
2733         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
2734         internally.  Return non-zero if error, zero if success.
2735         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2736         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
2737         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
2738         Define.
2739         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
2740         internally.  Return non-zero if error, zero if success.
2741         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
2742         Add __data.__futex field, reshuffle __data.__clock.
2743         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
2744         Define.
2745         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
2746         internally.  Return non-zero if error, zero if success.
2747         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
2748         Add __data.__futex field, reshuffle __data.__clock.
2749         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
2750         Add __data.__futex field, reshuffle __data.__clock.
2751         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
2752         Increment __futex at the same time as __wakeup_seq or __total_seq.
2753         Pass address of __futex instead of address of low 32-bits of
2754         __wakeup_seq to futex syscall.
2755         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
2756         Pass __futex value from before releasing internal lock
2757         to FUTEX_WAIT.
2758         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
2759         Likewise.  Avoid unnecessary shadowing of variables.
2760         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
2761         Set __futex to 2 * __total_seq.  Pass __futex value from before the
2762         unlock and __futex address instead of address of low 32-bits of
2763         __wakeup_seq to futex_requeue macro, adjust for new return value
2764         meaning.
2765         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
2766         (__pthread_cond_signal): Increment __futex at the same time as
2767         __wakeup_seq or __total_seq.  Pass address of __futex instead of
2768         address of low 32-bits of __wakeup_seq to futex syscall.
2769         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
2770         (__pthread_cond_wait): Likewise.  Pass __futex value from before
2771         releasing internal lock to FUTEX_WAIT.
2772         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
2773         (__pthread_cond_timedwait): Likewise.
2774         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
2775         (FUTEX_CMP_REQUEUE): Define.
2776         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
2777         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
2778         Pass __futex value from before the unlock and __futex address instead
2779         of address of low 32-bits of __wakeup_seq to futex syscall.
2780         Fallback to FUTEX_WAKE all on any errors.
2782 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2784         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
2785         Add nop to align the end of critical section.
2786         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
2788 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2790         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
2791         Add __broadcast_seq field.
2792         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
2793         all waiters as woken with woken_seq and bump broadcast counter.
2794         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
2795         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
2796         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2797         Comment typo fixes.  Avoid returning -ETIMEDOUT.
2799 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
2801         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2802         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
2803         Reported by Kaz Kojima.
2805 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
2807         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
2809 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
2811         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
2812         __broadcast_seq with bc_seq after acquiring internal lock instead of
2813         before it.
2815 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
2817         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
2818         compilation.
2819         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2820         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
2821         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
2822         (pthread_cond_t): Add __data.__broadcast_seq field.
2823         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
2824         (FRAME_SIZE): Define.
2825         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
2826         Comment typo fixes.
2827         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
2828         Define.
2829         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
2830         typo fixes.
2831         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
2832         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
2833         fixes.
2835 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
2837         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
2838         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
2839         Add __broadcast_seq field.
2840         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2841         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2842         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2843         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
2844         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2845         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
2846         all waiters as woken with woken_seq and bump broadcast counter.
2847         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
2848         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
2849         __broadcast_seq field.
2850         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2851         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
2852         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
2853         * pthread_cond_init.c: Initialize __broadcast_seq field.
2854         * Makefile (tests): Add tst-cond17 and tst-cond18.
2855         Add .NOTPARALLEL goal.
2856         * tst-cond16.c: New file.  From Jakub.
2857         * tst-cond17.c: New file.  From Jakub.
2858         * tst-cond18.c: New file.  From Jakub.
2860 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
2862         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
2863         unwind info.
2865         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
2866         Parametrize frame size.  Correct some unwind info.
2867         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2869 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
2871         * tst-stack3.c: Note testing functionality beyond POSIX.
2873 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
2875         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
2876         Change conditional from ifdef to if.
2878 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
2880         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
2881         SYSDEP_CANCEL_ERROR): Define.
2882         (PSEUDO): Use it.
2884 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
2886         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
2888 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
2890         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
2892 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2894         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
2895         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
2896         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
2897         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
2899 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
2901         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
2902         thread has all signals blocked.
2904 2004-04-18  Andreas Jaeger  <aj@suse.de>
2906         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
2907         (SEM_VALUE_MAX): Add missing brace.
2909 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
2911         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
2912         in rt subdir.
2913         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
2914         * sysdeps/pthread/tst-mqueue8x.c: New test.
2915         * tst-cancel4.c: Update comment about message queues.
2917         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
2918         return it_value { 0, 0 }.
2919         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
2920         like SIGEV_SIGNAL.
2921         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
2922         assertion for SIGEV_NONE.
2923         (thread_attr_compare): Compare all attributes, not just a partial
2924         subset.
2926 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
2928         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
2930 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
2932         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
2933         Just use a plain number.
2934         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
2935         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
2936         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
2937         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
2938         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
2939         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
2940         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
2942 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2944         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
2945         frame info.
2946         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2948 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
2950         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
2951         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
2952         of calling sigwaitinfo.
2954 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
2956         * allocatestack.c (allocate_stack): Set reported_guardsize
2957         unconditionally.
2958         * pthread_getattr_np.c (pthread_getattr_np): Use
2959         reported_guardsize instead of guardsize.
2960         * descr.h (struct pthread): Add reported_guardsize field.
2962 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
2964         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
2966 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
2968         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
2970 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
2972         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
2973         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
2974         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
2975         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
2976         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
2977         Define.
2978         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
2979         (_POSIX_MESSAGE_PASSING): Define.
2980         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
2981         (_POSIX_MESSAGE_PASSING): Define.
2982         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
2983         (_POSIX_MESSAGE_PASSING): Define.
2985 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
2987         * tst-context1.c (fct): Check whether correct stack is used.
2989 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
2991         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
2992         matching constraints for asm mem parameters.
2994         * tst-clock2.c (tf): Don't define unless needed.
2996 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
2998         * Makefile (link-libc-static): Use $(static-gnulib) instead of
2999         $(gnulib).
3001 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
3003         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
3004         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
3005         * pthreadP.h: Declare __nptl_deallocate_tsd.
3006         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
3007         Adjust caller.
3009         * Makefile (tests): Add tst-tsd5.
3010         * tst-tsd5.c: New file.
3012 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
3014         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
3015         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
3016         is SHLIB_COMPAT check.
3017         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
3018         (__pthread_attr_getaffinity_old): Likewise.
3019         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
3020         (__pthread_getaffinity_old): Likewise.
3021         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
3022         (__pthread_setaffinity_old): Likewise.
3024 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
3026         * allocatestack.c (_make_stacks_executable): Call
3027         _dl_make_stack_executable first.
3029 2004-03-24  Roland McGrath  <roland@redhat.com>
3031         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
3032         constraint instead of "0".
3034 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
3036         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
3037         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
3039         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
3040         code to avoid warning.
3042 2004-03-24  Andreas Jaeger  <aj@suse.de>
3044         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
3045         (__pthread_attr_setaffinity_old): Remove const.
3047 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
3049         * sysdeps/unix/sysv/linux/smp.h: New file.
3050         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
3051         * init.c: Define __is_smp.
3052         (__pthread_initialize_minimal_internal): Call is_smp_system to
3053         initialize __is_smp.
3054         * pthreadP.h: Declare __is_smp.
3055         Define MAX_ADAPTIVE_COUNT is necessary.
3056         * pthread_mutex_init.c: Add comment regarding __spins field.
3057         * pthread_mutex_lock.c: Implement adaptive mutex type.
3058         * pthread_mutex_timedlock.c: Likewise.
3059         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
3060         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
3061         Add __spins field.
3062         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3063         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3064         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3065         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3066         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3067         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3068         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3069         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
3070         lll_mutex_cond_trylock.
3071         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3072         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3073         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3074         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3075         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3076         Define BUSY_WAIT_NOP.
3077         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3078         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3080         * tst-mutex5.c: Add support for testing adaptive mutexes.
3081         * tst-mutex7.c: Likewise.
3082         * tst-mutex5a.c: New file.
3083         * tst-mutex7a.c: New file.
3084         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
3086         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3087         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
3088         vgettimeofday call might destroy the content.
3090         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
3091         @pause in the loop.
3093         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
3094         No need to restrict type of ret.  Make it int.  Add comment.
3096         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
3097         Remove unnecessary setne instruction.
3099 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
3101         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
3102         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
3103         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
3104         If realloc fails, break out of the loop.
3106 2004-03-20  Andreas Jaeger  <aj@suse.de>
3108         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
3109         (__pthread_setaffinity_old): Fix interface.
3110         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
3111         (__pthread_getaffinity_old): Likewise.
3113         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
3114         (__pthread_setaffinity_new): Remove duplicate declaration.
3116 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3118         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
3119         the return value to a safe register.
3120         (CDISABLE): Set the function argument correctly.
3122 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3124         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
3125         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
3126         Rewrite so that only one locked memory operation per round is needed.
3127         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
3128         (pthread_barrier_wait): After wakeup, release lock only when the
3129         last thread stopped using the barrier object.
3130         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
3131         (__pthread_cond_wait): Don't store mutex address if the current
3132         value is ~0l.  Add correct cleanup support and unwind info.
3133         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
3134         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
3135         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
3136         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
3137         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
3138         Add correct cleanup support and unwind info.
3139         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
3140         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
3141         information for syscall wrappers.
3143 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
3145         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
3146         cpusetsize field, remove next.
3147         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
3148         parameter for size of the CPU set.
3149         (pthread_setaffinity_np): Likewise.
3150         (pthread_attr_getaffinity_np): Likewise.
3151         (pthread_attr_setaffinity_np): Likewise.
3152         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
3153         interface change, keep compatibility code.
3154         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
3155         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
3156         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
3157         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
3158         __pthread_getaffinity_np.
3159         * Versions: Add version for changed interfaces.
3160         * tst-attr3.c: Adjust test for interface change.
3161         * pthread_getattr_np.c: Query the kernel about the affinity mask with
3162         increasing buffer sizes.
3163         * pthread_attr_destroy.c: Remove unused list handling.
3164         * pthread_attr_init.c: Likewise.
3166 2004-03-17  Roland McGrath  <roland@redhat.com>
3168         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
3169         first argument to clock_getres so we ever enable kernel timers.
3171 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
3173         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
3175 2004-03-12  Richard Henderson  <rth@redhat.com>
3177         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
3178         oldvalue from CENABLE to CDISABLE.
3180 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
3182         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
3183         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
3184         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
3185         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
3187 2004-03-11  Richard Henderson  <rth@redhat.com>
3189         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
3190         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
3191         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
3193 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
3195         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
3196         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
3197         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
3199 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
3201         * forward.c (__pthread_cond_broadcast_2_0,
3202         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
3203         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
3204         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
3206 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3208         * sysdeps/sh/tcb-offsets.sym: Add PID.
3209         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
3210         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
3212 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
3214         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
3215         include <sysdep-cancel.h>, vfork is no cancellation point.
3216         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
3217         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
3218         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
3220 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
3222         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
3223         libc_hidden_def.
3224         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
3225         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
3226         Likewise.
3227         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
3228         Likewise.
3229         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
3230         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
3231         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
3232         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
3233         of DO_CALL_VIA_BREAK.  Work around a gas problem.
3235         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
3236         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
3237         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
3238         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
3239         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
3240         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
3242         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
3243         a local register for saving old PID.  Negate PID in parent upon exit.
3245         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
3246         tcb-offsets.h.
3247         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
3248         before syscall, set to the old value in the parent afterwards.
3249         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
3250         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
3251         tcb-offsets.h.
3252         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
3253         before syscall, set to the old value in the parent afterwards.
3254         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
3255         * sysdeps/s390/tcb-offsets.sym: Add PID.
3257         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
3258         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
3259         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
3260         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
3261         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
3262         * sysdeps/sparc/tcb-offsets.sym: Add PID.
3264 2004-03-10  Andreas Schwab  <schwab@suse.de>
3266         * sysdeps/ia64/tcb-offsets.sym: Add PID.
3267         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
3268         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
3270 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
3272         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
3273         * tst-cancel21.c (do_one_test): Likewise.
3274         Reported by Gordon Jin <gordon.jin@intel.com>.
3276 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
3278         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
3279         if non-zero and set to INT_MIN if zero.
3280         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
3281         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
3282         (SAVE_PID, RESTORE_PID): Define.
3283         (__vfork): Use it.
3284         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
3285         Use relative path to avoid including NPTL i386/vfork.S.
3286         (SAVE_PID, RESTORE_PID): Define.
3287         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
3288         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
3289         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
3290         tst-vfork2x.
3291         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
3292         * tst-vfork1.c: New test.
3293         * tst-vfork2.c: New test.
3294         * tst-vfork1x.c: New test.
3295         * tst-vfork2x.c: New test.
3297 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
3299         * sysdeps/i386/tcb-offsets.sym: Add PID.
3300         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3301         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
3302         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
3304 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
3306         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
3308 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
3310         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
3311         _rtld_global_ro.
3313 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
3315         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
3316         _rtld_global_ro.
3318         * tst-once4.c: Remove unnecessary macro definition.
3320         * tst-mutex7.c (do_test): Limit thread stack size.
3321         * tst-once2.c (do_test): Likewise.
3322         * tst-tls3.c (do_test): Likewise.
3323         * tst-tls1.c (do_test): Likewise.
3324         * tst-signal3.c (do_test): Likewise.
3325         * tst-kill6.c (do_test): Likewise.
3326         * tst-key4.c (do_test): Likewise.
3327         * tst-join4.c (do_test): Likewise.
3328         * tst-fork1.c (do_test): Likewise.
3329         * tst-context1.c (do_test): Likewise.
3330         * tst-cond2.c (do_test): Likewise.
3331         * tst-cond10.c (do_test): Likewise.
3332         * tst-clock2.c (do_test): Likewise.
3333         * tst-cancel10.c (do_test): Likewise.
3334         * tst-basic2.c (do_test): Likewise.
3335         * tst-barrier4.c (do_test): Likewise.
3337 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
3339         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
3341 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
3343         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
3344         (__pthread_cond_timedwait): Optimize wakeup test.
3345         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
3346         (__pthread_cond_wait): Likewise.
3347         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
3348         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
3349         Likewise.
3351 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
3353         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
3354         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
3355         the atomic instruction needed.
3356         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3357         (__lll_mutex_lock_wait): Likewise.
3359 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
3361         * Makefile (tests): Add tst-cond14 and tst-cond15.
3362         * tst-cond14.c: New file.
3363         * tst-cond15.c: New file.
3365 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
3367         * sysdeps/pthread/createthread.c (create_thread): Remove use of
3368         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
3369         needs to be implemented differently to be useful.
3371 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
3373         * pthread_attr_setschedparam.c: Don't test priority against limits
3374         here.  Set ATTR_FLAG_SCHED_SET flag.
3375         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
3376         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
3377         from parent thread to child.  If attribute is used and scheduling
3378         parameters are not inherited, copy parameters from attribute or
3379         compute them.  Check priority value.
3380         * pthread_getschedparam.c: If the parameters aren't known yet get
3381         them from the kernel.
3382         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
3383         ATTR_FLAG_POLICY_SET flag for thread.
3384         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
3385         and ATTR_FLAG_POLICY_SET.
3387         * sysdeps/pthread/createthread.c: Use tgkill if possible.
3389         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
3390         fail if stack address hasn't been set.  Just return 0.
3392 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
3394         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
3395         libpthread for the files in this list.
3396         (CFLAGS-tst-unload): Removed.
3397         * tst-unload.c (do_test): Don't use complete path for
3398         LIBPHREAD_SO.
3400         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
3401         tst-_res1mod2.
3403 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
3405         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
3406         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
3407         operation per round is needed.
3408         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3409         (__lll_mutex_lock_wait): Likewise.
3411 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
3413         * tst-cancel9.c (cleanup): Don't print to stderr.
3415 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3417         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
3419 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
3421         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
3422         (__syscall_error_handler2): Call CDISABLE.
3423         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
3424         (__syscall_error_handler2): Call CDISABLE.
3426         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
3427         Release lock before the loop, don't reacquire it.
3429         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
3431 2004-02-19  Andreas Schwab  <schwab@suse.de>
3433         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
3434         Fix last change.
3436 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
3438         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
3439         (pthread_barrier_wait): After wakeup, release lock only when the
3440         last thread stopped using the barrier object.
3441         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
3442         (pthread_barrier_wait): Likewise.
3443         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
3444         Likewise.
3445         * Makefile (tests): Add tst-barrier4.
3446         * tst-barrier4.c: New file.
3448         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
3449         (__pthread_cond_timedwait): Perform timeout test while holding
3450         internal lock to prevent wakeup race.
3451         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
3452         * sysdeps/pthread/pthread_cond_timedwait.c
3453         (__pthread_cond_timedwait): Likewise.
3454         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
3455         (__pthread_cond_timedwait): Likewise.
3457 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
3459         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
3460         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
3461         * Makefile (tests): Add tst-rwlock13.
3462         * tst-rwlock13.c: New test.
3464 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
3466         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
3467         (__condvar_tw_cleanup): Little optimization.
3468         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
3470 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
3472         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
3473         libpthread as "lib" parameter to SHLIB_COMPAT.
3474         (__novmx_siglongjmp): Fix typo in function name.
3475         (__novmx_longjmp): Fix typo in function name.
3477 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
3479         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
3480         __builtin_expect.
3482         * sysdeps/generic/pt-longjmp.c: Moved to...
3483         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
3485 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
3487         * Makefile (libpthread-routines): Add pt-cleanup.
3488         * pt-longjmp.c: Removed.
3489         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
3490         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
3491         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
3492         Version longjmp, siglongjmp for GLIBC_2.3.4.
3493         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
3495 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
3497         * sysdeps/pthread/pthread_cond_timedwait.c
3498         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
3499         Reuse code.  Add __builtin_expects.
3501         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
3502         (__pthread_cond_timedwait): Get internal lock in case timeout has
3503         passed before the futex syscall.
3504         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3506 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
3508         * allocatestack.c: Pretty printing.
3510         * sysdeps/pthread/createthread.c (create_thread): Don't add
3511         CLONE_DETACHED bit if it is not necessary.
3513 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
3515         * pthread_getattr_np.c: Include ldsodefs.h.
3517 2004-01-16  Richard Henderson  <rth@redhat.com>
3519         * allocatestack.c: Don't declare __libc_stack_end.
3520         * init.c (__pthread_initialize_minimal_internal): Likewise.
3521         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
3523 2004-01-15  Richard Henderson  <rth@redhat.com>
3525         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
3526         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
3527         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
3528         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
3529         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
3530         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
3531         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
3532         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
3534 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
3536         * init.c (pthread_functions): Make array const.
3538 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
3540         * allocatestack.c (__make_stacks_executable): Change interface.
3541         Check parameters.  Pass parameter on to libc counterpart.
3542         * pthreadP.h: Change declaration.
3544 2004-01-13  Richard Henderson  <rth@redhat.com>
3546         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
3547         prototype form.
3548         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
3549         Likewise.
3551         * sysdeps/alpha/Makefile: New file.
3552         * sysdeps/alpha/tcb-offsets.sym: New file.
3553         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
3554         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
3556         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
3557         on powerpc version.
3559 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
3561         * Makefile (tests): Add tst-backtrace1.
3562         * tst-backtrace1.c: New test.
3564 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
3566         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
3567         register as second parameter to the REGISTER macro.
3568         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
3569         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
3570         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
3571         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
3572         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
3573         of thread register as second parameter to REGISTER macro in 64 case.
3575 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
3577         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
3578         (CFLAGS-getpid.o): Defined.
3579         (CFLAGS-getpid.os): Defined.
3581 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
3583         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
3584         returned for main thread does not overlap with any other VMA.
3585         Patch by Jakub Jelinek.
3587 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
3589         * tst-raise1.c: Include stdio.h.
3591 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
3593         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
3594         setting with __ASSUME_TGKILL || defined __NR_tgkill.
3595         If pid is 0, set it to selftid.
3596         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
3597         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
3598         != 0, return self->tid without doing a syscall.
3599         * descr.h (struct pthread): Move pid field after tid.
3601         * Makefile (tests): Add tst-raise1.
3602         * tst-raise1.c: New file.
3604 2003-12-23  Roland McGrath  <roland@redhat.com>
3606         * tst-oddstacklimit.c: New file.
3607         * Makefile (tests): Add it.
3608         (tst-oddstacklimit-ENV): New variable.
3610         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
3611         value up to page size for __default_stacksize.
3613 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
3615         * Makefile (tests): Add tst-eintr5.
3616         * tst-eintr5.c: New file.
3618         * eintr.c (eintr_source): Prevent sending signal to self.
3620         * tst-eintr2.c (tf1): Improve error message.
3622 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
3624         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
3625         * sysdeps/unix/sysv/linux/getpid.c: New file.
3626         * pthread_cancel.c: Add comment explaining use of PID field.
3627         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
3628         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
3629         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
3630         temporarily to signal the field must not be relied on and updated
3631         by getpid().
3632         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
3633         temporarily negative.
3634         * sysdeps/unix/sysv/linux/raise.c: Likewise.
3636 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
3638         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
3639         (eintr_source): If ARG != NULL, use pthread_kill.
3640         * tst-eintr1.c: Adjust for this change.
3641         * tst-eintr2.c: Likewise.
3642         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
3643         * tst-eintr3.c: New file.
3644         * tst-eintr4.c: New file.
3646 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
3648         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
3649         if CANCELSTATE_BITMASK is set.
3650         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
3651         Likewise.
3653         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
3654         (tests-reverse): Add tst-cancel23.
3655         * tst-cancel22.c: New test.
3656         * tst-cancel23.c: New test.
3658 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
3660         * tst-eintr1.c: Better error messages.
3662         * Makefile (tests): Add tst-eintr2.
3663         * tst-eintr2.c: New file.
3665 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
3667         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
3668         (CFLAGS-tst-cancelx21.c): Set.
3669         * tst-cancel21.c: New test.
3670         * tst-cancelx21.c: New test.
3672         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
3673         comparison operand.
3674         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
3675         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
3676         * pt-longjmp.c: Include jmpbuf-unwind.h.
3677         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
3678         _JMPBUF_UNWINDS.  Adjust compared pointers.
3679         * init.c (__pthread_initialize_minimal_internal): Initialize
3680         pd->stackblock_size.
3681         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
3682         * sysdeps/alpha/jmpbuf-unwind.h: New file.
3683         * sysdeps/i386/jmpbuf-unwind.h: New file.
3684         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
3685         * sysdeps/s390/jmpbuf-unwind.h: New file.
3686         * sysdeps/sh/jmpbuf-unwind.h: New file.
3687         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
3688         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
3689         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
3690         (_JMPBUF_CFA_UNWINDS): Remove.
3691         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
3693 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
3695         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
3696         (CFLAGS-tst-cancelx20.c): Set.
3697         * tst-cancel20.c: New test.
3698         * tst-cancelx20.c: New test.
3700 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
3702         * init.c (__pthread_initialize_minimal_internal): Don't treat
3703         architectures with separate register stack special here when
3704         computing default stack size.
3706 2003-12-17  Roland McGrath  <roland@redhat.com>
3708         * Makefile (tst-cancelx7-ARGS): New variable.
3709         Reportd by Greg Schafer <gschafer@zip.com.au>.
3711 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
3713         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
3714         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
3715         (tst-stack3-ENV): Set.
3716         ($(objpfx)tst-stack3-mem): New.
3717         * tst-stack3.c: New test.
3719 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
3721         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
3722         Add unwind directives.  Drop unused .regstk directive.
3723         (_fini_EPILOG_BEGINS): Add unwind directives.
3725 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
3727         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
3728         Assume parameter is a pointer.
3729         (lll_futex_wake): Likewise.
3730         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
3731         Likewise.
3732         (lll_futex_wake): Likewise.
3733         Reported by Boris Hu.
3734         * sysdeps/unix/sysv/linux/unregister-atfork.c
3735         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
3737         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
3739 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
3741         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
3742         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
3743         __rtld_lock_initialize for ld.so lock.
3744         Patch in part by Adam Li <adam.li@intel.com>.
3746 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
3748         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
3749         in $(gnulib).  Also, remove stale comment.
3751 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
3753         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
3754         advantage of new syscall stub and optimize accordingly.
3756         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
3757         from SYS_futex, to match expectations of
3758         sysdep.h:DO_INLINE_SYSCALL.
3759         (lll_futex_clobbers): Remove.
3760         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
3761         (lll_futex_wake): Likewise.
3762         (lll_futex_requeue): Likewise.
3763         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
3764         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
3765         Jelinek).
3766         (__lll_mutex_lock): Likewise.
3767         (__lll_mutex_cond_lock): Likewise.
3768         (__lll_mutex_timed_lock): Likewise.
3769         (__lll_mutex_unlock): Likewise.
3770         (__lll_mutex_unlock_force): Likewise.
3772         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
3773         comes before the include of <sysdep.h>.
3774         (THREAD_SELF_SYSINFO): New macro.
3775         (THREAD_SYSINFO): Likewise.
3776         (INIT_SYSINFO): New macro.
3777         (TLS_INIT_TP): Call INIT_SYSINFO.
3779         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
3781         * sysdeps/pthread/createthread.c (create_thread): Use
3782         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
3783         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
3784         THREAD_SELF_SYSINFO instead of open code.
3785         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
3786         (THREAD_SYSINFO): Likewise.
3788         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
3790         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
3792 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
3794         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
3795         instead of .init.  Patch by David Mosberger.
3797 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
3799         * sysdeps/pthread/configure.in: Remove broken declaration in C
3800         cleanup handling check.
3802 2003-11-30  Andreas Jaeger  <aj@suse.de>
3804         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
3805         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
3806         Likewise.
3808 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
3810         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
3811         * pthread_attr_destroy.c: Include shlib-compat.h.
3812         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
3813         is set in iattr->flags.
3814         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
3816 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
3818         * Makefile (distribute): Add tst-cleanup4aux.c.
3820         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
3821         include.
3823 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
3825         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
3826         pthread_cond_signal.
3828         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
3829         store mutex address if the current value is ~0l.
3830         * sysdeps/pthread/pthread_cond_timedwait.c
3831         (__pthread_cond_timedwait): Likewise.
3832         * sysdeps/pthread/pthread_cond_broadcast.c
3833         (__pthread_cond_broadcast): Don't use requeue for pshared
3834         condvars.
3836         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
3837         (__pthread_cond_wait): Don't store mutex address if the current
3838         value is ~0l.
3839         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
3840         (__pthread_cond_timedwait): Likewise.
3841         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
3842         (__pthread_cond_broadcast): Don't use requeue for pshared
3843         condvars.
3845         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
3846         element with ~0l for pshared condvars, with NULL otherwise.
3848         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
3849         (__pthread_cond_wait): Don't store mutex address if the current
3850         value is ~0l.
3851         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
3852         (__pthread_cond_timedwait): Likewise.
3853         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
3854         (__pthread_cond_broadcast): Don't use requeue for pshared
3855         condvars.
3857         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
3858         * tst-cond12.c: New file.
3859         * tst-cond13.c: New file.
3861 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
3863         * sysdeps/pthread/configure.in: Make missing forced unwind support
3864         fatal.
3866 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
3868         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
3870 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
3872         * Makefile: Add magic to clean up correctly.
3874 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
3876         * unwind.c (FRAME_LEFT): Define.
3877         (unwind_stop): Handle old style cleanups here.
3878         (__pthread_unwind): Handle old style cleanups only if
3879         !HAVE_FORCED_UNWIND.
3880         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
3881         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
3882         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
3883         ($(objpfx)tst-cleanupx4): Likewise.
3884         * tst-cleanup4.c: New test.
3885         * tst-cleanup4aux.c: New.
3886         * tst-cleanupx4.c: New test.
3888 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
3890         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
3891         lll_mutex_*lock macros to skip atomic operations on some archs.
3893 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
3895         * sysdeps/pthread/tst-timer.c (main): Initialize
3896         sigev2.sigev_value as well.
3898 2003-10-15  Roland McGrath  <roland@redhat.com>
3900         * sysdeps/pthread/configure.in: Barf if visibility attribute support
3901         is missing.
3902         * sysdeps/pthread/configure: Regenerated.
3904 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3906         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
3907         locking macros.  No distinction between normal and mutex locking
3908         anymore.
3909         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
3910         Merge bits from lowlevelmutex.S we still need.
3911         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
3912         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
3913         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
3914         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
3915         new mutex implementation.
3916         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
3917         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
3918         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
3919         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
3920         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
3921         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
3922         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
3923         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
3924         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3925         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
3926         symbol for entry point to avoid cancellation.
3928 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
3930         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
3931         changes.
3932         (SAVE_OLDTYPE_0): Fix a typo.
3934 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
3936         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
3937         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
3939 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
3941         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
3942         correct offset.
3944 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
3946         * Makefile (tests): Add tst-cancel19.
3947         * tst-cancel19.c: New test.
3949 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
3951         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
3952         restoring of the old cancellation type.
3954 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
3956         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
3958 2003-09-27  Wolfram Gloger  <wg@malloc.de>
3960         * sysdeps/pthread/malloc-machine.h: New file
3962 2003-09-24  Roland McGrath  <roland@redhat.com>
3964         * allocatestack.c (__make_stacks_executable): Don't ignore return
3965         value from _dl_make_stack_executable.
3967 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
3969         * allocatestack.c (__make_stacks_executable): Also change
3970         permission of the currently unused stacks.
3972         * allocatestack.c (change_stack_perm): Split out from
3973         __make_stacks_executable.
3974         (allocate_stack): If the required permission changed between the time
3975         we started preparing the stack and queueing it, change the permission.
3976         (__make_stacks_executable): Call change_stack_perm.
3978         * Makefile: Build tst-execstack-mod locally.
3979         * tst-execstack-mod.c: New file.
3981 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
3983         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
3985 2003-09-23  Roland McGrath  <roland@redhat.com>
3987         * tst-execstack.c: New file.
3988         * Makefile (tests): Add it.
3989         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
3990         (LDFLAGS-tst-execstack): New variable.
3992         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
3993         whether to use PROT_EXEC for stack mmap.
3994         (__make_stacks_executable): New function.
3995         * pthreadP.h: Declare it.
3996         * init.c (__pthread_initialize_minimal_internal): Set
3997         GL(dl_make_stack_executable_hook) to that.
3999 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
4001         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
4002         recommendation from AMD re avoidance of lock prefix.
4004 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
4006         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
4007         lll_futex_timed_wait instead of lll_futex_wait.
4008         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
4009         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
4010         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
4011         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
4012         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
4013         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
4014         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
4015         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
4016         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
4017         Completely revamp the locking macros.  No distinction between
4018         normal and mutex locking anymore.
4019         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
4020         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
4021         __lll_lock_timedwait): Fix prototypes.
4022         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
4023         __lll_lock_timedwait): Likewise.
4024         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
4025         macros, add __builtin_expect.
4026         (lll_mutex_timedlock): Likewise.  Fix return value.
4027         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
4028         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
4029         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
4030         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
4031         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
4032         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
4033         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
4034         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
4036 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
4038         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4039         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
4040         operation if possible.
4042         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
4043         like jumping over the lock prefix.
4045 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
4047         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
4048         locking macros.  No distinction between normal and mutex locking
4049         anymore.
4050         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
4051         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
4052         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
4053         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
4054         locking.  Merge bits from lowlevelmutex.S we still need.
4055         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
4056         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
4057         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
4058         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
4059         * Makefile (routines): Remove libc-lowlevelmutex.
4060         (libpthread-rountines): Remove lowlevelmutex.
4061         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
4062         for new mutex implementation.
4063         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
4064         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4065         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4066         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
4067         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4068         Likewise.
4069         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4070         Likewise.
4071         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
4072         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4073         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
4074         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
4075         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4076         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4077         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
4078         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
4079         Likewise.
4080         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
4081         Likewise.
4082         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
4083         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
4084         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
4085         Don't use requeue.
4086         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
4087         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
4089 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
4091         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
4092         in parameters of asm with output parameters.
4094         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
4095         type of DECR parameter to int.
4096         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
4098 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
4100         * tst-attr3.c (tf, do_test): Print stack start/end/size and
4101         guardsize for each thread.
4103 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
4105         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
4106         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4107         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
4109         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
4110         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
4111         NULL.
4112         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
4113         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
4114         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4115         (pthread_getaffinity_np): Add hidden_def.
4117         * Makefile (tests): Add tst-attr3.
4118         * tst-attr3.c: New test.
4120         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
4122 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
4124         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
4125         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
4127 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
4129         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
4130         * tst-align.c: Include tst-stack-align.h.
4131         (tf, do_test): Use TEST_STACK_ALIGN macro.
4133 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
4135         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
4136         variable.
4138 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
4140         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
4141         stack-related values for the initial thread.
4143 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
4145         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
4147 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
4149         * pthread_mutex_lock.c: Minor code rearrangements.
4151 2003-09-05  Roland McGrath  <roland@redhat.com>
4153         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
4154         Instead, include ../nptl_db/db_info.c to do its magic.
4155         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
4156         (__pthread_pthread_key_2ndlevel_size): Likewise.
4157         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
4158         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
4159         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
4160         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
4161         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
4162         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
4163         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
4164         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
4165         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
4166         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
4167         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
4168         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
4169         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
4170         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
4171         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
4172         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
4173         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
4175 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
4177         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
4178         of pthread_t to be compatible with LT.
4179         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4180         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4181         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4182         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4183         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
4184         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4185         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4187 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
4189         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
4191 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
4193         * unwind-forcedunwind.c: Move to...
4194         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
4195         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
4196         * sysdeps/pthread/jmpbuf-unwind.h: New file.
4197         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
4198         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
4199         * unwind.c: Include jmpbuf-unwind.h.
4200         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
4202 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
4204         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
4205         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
4206         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
4207         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
4208         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
4209         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
4210         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
4211         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
4212         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
4213         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
4214         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
4215         function.
4216         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
4217         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
4218         * Makefile (tests): Add tst-stack2.
4219         * tst-stack2.c: New test.
4220         * tst-stack1.c: Include limits.h and sys/param.h.
4221         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
4223         * pthread_condattr_setpshared.c: Include errno.h.
4224         (pthread_condattr_setpshared): Return EINVAL if pshared
4225         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
4227         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
4228         defined symbol for entry point to avoid cancellation.
4229         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
4230         Likewise.
4231         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
4232         Likewise.
4233         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
4234         Likewise.
4235         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
4236         Likewise.
4237         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
4238         Likewise.
4239         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
4240         __close_nocancel, __read_nocancel, __write_nocancel,
4241         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
4242         libpthread.so or librt.so, define to corresponding function
4243         without _nocancel suffix.
4244         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
4245         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
4246         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
4248         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
4250 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
4252         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
4253         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
4255         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
4256         in subsections has a symbol associated with it.
4258         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
4259         defined symbol for entry point to avoid cancellation.
4260         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
4262 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
4264         * Makefile (tests): Add tst-tls5.
4265         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
4266         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
4267         ($(objpfx)tst-tls5): New.
4268         ($(objpfx)tst-tls6.out): Likewise.
4269         (tests): Depend on $(objpfx)tst-tls6.out.
4270         * tst-tls3.c: Include stdint.h and pthreaddef.h.
4271         (do_test): Check pthread_self () return value alignment.
4272         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
4273         (tf): Check pthread_self () return value alignment.
4274         * tst-tls5.c: New test.
4275         * tst-tls5.h: New.
4276         * tst-tls5mod.c: New.
4277         * tst-tls5moda.c: New.
4278         * tst-tls5modb.c: New.
4279         * tst-tls5modc.c: New.
4280         * tst-tls5modd.c: New.
4281         * tst-tls5mode.c: New.
4282         * tst-tls5modf.c: New.
4283         * tst-tls6.sh: New test.
4285         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
4286         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
4287         * init.c (pthread_functions): Initialize them.
4288         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
4289         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
4290         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
4291         pthread_cond_timedwait@@GLIBC_2.3.2.
4293 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
4295         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
4296         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
4297         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
4298         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
4299         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
4300         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
4302         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
4304         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
4305         _POSIX_THREAD_PRIORITY_SCHEDULING.
4306         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
4308 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
4310         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
4311         nested function, use static inline function from libio.h.
4312         Code by Richard Henderson.
4314         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
4315         weak.
4317 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
4319         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
4320         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
4321         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
4322         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
4323         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
4324         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
4325         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
4326         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
4327         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
4328         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
4329         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
4330         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
4331         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
4332         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
4333         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
4334         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
4335         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
4336         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
4337         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
4338         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
4339         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
4340         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
4341         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
4342         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
4343         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
4344         * sysdeps/sparc/tls.h: New file.
4345         * sysdeps/sparc/tcb-offsets.sym: New file.
4346         * sysdeps/sparc/Makefile: New file.
4347         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
4348         * init.c [__sparc__] (__NR_set_tid_address): Define.
4350 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
4352         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
4353         _IO_release_lock): Define.
4355 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
4357         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
4358         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
4360 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
4362         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
4363         (__pthread_cleanup_class): Add missing return types of member
4364         functions.
4366 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
4368         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4369         (lll_mutex_unlock_force): Add memory barrier between store and futex
4370         syscall.
4372 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
4374         * tst-cancel4.c (do_test): Also unlink tempfname and remove
4375         tempmsg in first loop.
4377 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
4379         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
4380         _POSIX_THREAD_PRIORITY_SCHEDULING.
4381         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4383 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
4385         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
4386         (__rtld_lock_default_lock_recursive,
4387         __rtld_lock_default_unlock_recursive): Define.
4388         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
4389         __rtld_lock_unlock_recursive): Define using
4390         GL(_dl_rtld_*lock_recursive).
4391         * init.c (__pthread_initialize_minimal_internal): Initialize
4392         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
4393         Lock GL(_dl_load_lock) the same number of times as
4394         GL(_dl_load_lock) using non-mt implementation was nested.
4396         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
4397         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
4399 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
4401         * tst-cancel17.c (do_test): Make len2 maximum of page size and
4402         PIPE_BUF.
4404 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
4406         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
4408 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
4410         * sysdeps/pthread/createthread.c (do_clone): Move error handling
4411         to first syscall error check.  Move syscall error check for tkill
4412         into __ASSUME_CLONE_STOPPED #ifdef.
4414 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
4416         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
4417         is not defined, do explicit synchronization.
4418         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
4419         is not defined also unlock pd->lock for non-debugging case in case
4420         it is necessary.
4421         * pthread_create.c (start_thread): Always get and release pd->lock
4422         if __ASSUME_CLONE_STOPPED is not defined.
4423         (start_thread_debug): Removed.  Adjust users.
4424         * allocatestack.c (allocate_stack): Always initialize lock if
4425         __ASSUME_CLONE_STOPPED is not defined.
4426         * Makefile (tests): Add tst-sched1.
4427         * tst-sched1.c: New file.
4429         * sysdeps/pthread/createthread.c (do_clone): Only use
4430         sched_setschduler and pass correct parameters.
4432 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
4434         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
4435         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
4436         PTHREAD_STACK_MIN in comments.
4438 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
4440         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4441         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
4442         argument.
4443         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
4444         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
4445         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
4446         (__pthread_cleanup_upto): Fix prototype.
4447         (_longjmp_unwind): Adjust caller.
4448         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
4449         Change second argument to const struct pointer.
4450         * tst-sem8.c (main): Remove unused s2 and s3 variables.
4451         * tst-sem9.c (main): Likewise.
4452         * unwind.c: Include string.h for strlen prototype.
4454 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
4456         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4457         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
4458         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
4459         Define HAVE_CMOV.
4460         Patch by Nicholas Miell <nmiell@attbi.com>.
4462 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
4464         * init.c (__pthread_initialize_minimal_internal): Initialize
4465         GL(dl_init_static_tls).
4466         * pthreadP.h (__pthread_init_static_tls): New prototype.
4467         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
4468         New functions.
4469         * Makefile (tests): Add tst-tls4.
4470         (modules-names): Add tst-tls4moda and tst-tls4modb.
4471         ($(objpfx)tst-tls4): Link against libdl and libpthread.
4472         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
4473         tst-tls4modb.so.
4474         * tst-tls4.c: New file.
4475         * tst-tls4moda.c: New file.
4476         * tst-tls4modb.c: New file.
4478 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
4480         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
4481         before __timer_dealloc.
4482         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
4483         Don't call list_unlink.
4485 2003-07-29  Roland McGrath  <roland@redhat.com>
4487         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
4489 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
4491         * tst-cancel17.c (do_test): Check if aio_cancel failed.
4492         Don't reuse struct aiocb A if it failed.
4493         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
4494         not just one byte, as that does not block.
4496 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
4498         * sysdeps/pthread/unwind-resume.c: New file.
4499         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
4500         unwind-resume in csu subdir.
4501         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
4502         exceptions.
4503         (librt-sysdep_routines, librt-shared-only-routines): Add
4504         rt-unwind-resume.
4505         * sysdeps/pthread/rt-unwind-resume.c: New file.
4506         * unwind-forcedunwind.c: New file.
4507         * Makefile (libpthread-routines): Add unwind-forcedunwind.
4508         (libpthread-shared-only-routines): Likewise.
4509         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
4510         * pthreadP.h (pthread_cancel_init): New prototype.
4511         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
4513         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
4514         attr argument const struct pthread_attr *.
4516         * res.c (__res_state): Return __resp.
4517         * descr.h: Include resolv.h.
4518         (struct pthread): Add res field.
4519         * pthread_create.c: Include resolv.h.
4520         (start_thread): Initialize __resp.
4521         * Makefile (tests): Add tst-_res1.
4522         (module-names): Add tst-_res1mod1, tst-_res1mod2.
4523         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
4524         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
4525         libpthread.
4526         * tst-_res1.c: New file.
4527         * tst-_res1mod1.c: New file.
4528         * tst-_res1mod2.c: New file.
4530 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
4532         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
4534         * Makefile: Define various *-no-z-defs variables for test DSOs
4535         which has undefined symbols.
4537 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
4539         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
4540         Retry if the stwcx fails to store once_control.
4542 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
4544         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
4545         pthread_attr_setaffinity.
4546         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
4547         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
4548         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
4549         * pthread_attr_destroy.c: Free cpuset element if allocated.
4550         * pthread_create.c: Pass iattr as additional parameter to
4551         create_thread.
4552         * sysdeps/pthread/createthread.c: If attribute is provided and
4553         a new thread is created with affinity set or scheduling parameters,
4554         start thread with CLONE_STOPPED.
4555         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
4556         pthread_attr_setaffinity.
4557         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
4558         cpuset element.
4560 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
4562         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
4564 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
4566         * sysdeps/pthread/configure.in: Require CFI directives also for
4567         ppc and s390.
4569 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
4571         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
4572         Add cfi directives.
4574 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4576         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
4577         CLEANUP_JMP_BUF.
4578         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
4579         registers as variables.  Call __pthread_mutex_unlock_usercnt.
4580         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4581         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
4582         not self pointer in __writer.  Compare with TID to determine
4583         deadlocks.
4584         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4585         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
4586         Likewise.
4587         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
4588         Likewise.
4589         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
4590         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
4591         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
4592         macros also when compiling librt.
4594 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
4596         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
4597         -fasynchronous-unwind-tables.
4598         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
4599         (PSEUDO): Add cfi directives.
4600         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
4601         Likewise.
4602         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
4603         Likewise.
4605 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
4607         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
4608         __pthread_unregister_cancel): Add prototypes and hidden_proto.
4609         * unwind.c (__pthread_unwind_next): Add hidden_def.
4610         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
4611         Likewise.
4612         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
4613         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4614         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
4615         Likewise.
4616         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
4617         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
4618         Likewise.
4619         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
4620         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
4621         __pthread_unregister_cancel and __pthread_unwind_next.
4623 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
4625         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
4626         different symbol for the cancellation syscall wrapper and
4627         non-cancellation syscall wrapper.
4628         (PSEUDO_END): Define.
4630 2003-07-05  Richard Henderson  <rth@redhat.com>
4632         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
4633         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
4634         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
4635         return actual return value from the syscall, not 0.
4637 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
4639         * descr.h (struct pthread): Add pid field.
4640         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
4641         (__reclaim_stacks): Likewise.
4642         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
4643         also check for PID of the signal source.
4644         (__pthread_initialize_minimal_internal): Also initialize pid field
4645         of initial thread's descriptor.
4646         * pthread_cancel.c: Use tgkill instead of tkill if possible.
4647         * sysdeps/unix/sysv/linux/fork.c: Likewise.
4648         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
4649         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
4650         * sysdeps/unix/sysv/linux/raise.c: Likewise.
4652 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
4654         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
4655         Fix use of parameter.
4656         (__libc_cleanup_pop): Likewise.
4658 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
4660         * init.c (sigcancel_handler): Change parameters to match handler
4661         for SA_SIGACTION.  Check signal number and code to recognize
4662         invalid invocations.
4664 2003-07-03  Roland McGrath  <roland@redhat.com>
4666         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
4667         Apply sizeof (struct pthread) bias to r13 value.
4669 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
4671         * sysdeps/pthread/configure.in: Require CFI directives.
4673         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
4674         definition.
4675         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
4676         libpthread compilation.
4677         * unwind.c (__pthread_unwind): Add hidden_def.
4678         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
4680 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
4682         * libc-cancellation.c (__libc_cleanup_routine): Define.
4683         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
4684         (__pthread_cleanup_pop): Define.
4686 2003-07-01  Richard Henderson  <rth@redhat.com>
4688         * sysdeps/alpha/elf/pt-initfini.c: New file.
4689         * sysdeps/alpha/pthread_spin_lock.S: New file.
4690         * sysdeps/alpha/pthread_spin_trylock.S: New file.
4691         * sysdeps/alpha/pthreaddef.h: New file.
4692         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
4693         * sysdeps/alpha/tls.h: New file.
4694         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
4695         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
4696         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
4697         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
4698         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
4699         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
4700         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
4701         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
4702         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
4703         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
4705 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
4707         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
4708         cleanup support and unwind info.
4710 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
4712         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
4713         Use correct cleanup handler registration.  Add unwind info.
4714         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
4715         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
4716         * tst-once3.c: Add cleanup handler and check it is called.
4717         * tst-once4.c: Likewise.
4718         * tst-oncex3.c: New file.
4719         * tst-oncex4.c: New file.
4720         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
4722 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
4724         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
4726 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
4728         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
4729         (tf_msgsnd): Likewise.
4731         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
4732         premature returns a bit more.
4734 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
4736         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
4737         definition to the front.
4739         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
4740         the cleanup functions to make the names unique.  Fix dwarf opcode
4741         un unwind table.
4742         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
4743         functions to make the names unique.  Fix CFA offset for two blocks.
4745 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
4747         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
4748         missing closing braces.
4749         Patch by Christophe Saout <christophe@saout.de>.
4751 2003-06-24  Roland McGrath  <roland@redhat.com>
4753         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
4755 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
4757         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
4758         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
4760         * pthreadP.h: Declare __find_thread_by_id.
4761         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
4762         * pthread_clock_gettime.c: Allow using other thread's clock.
4763         * pthread_clock_settime.c: Likewise.
4764         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
4765         * Makefile: Add rules to build and run tst-clock2.
4766         * tst-clock2.c: New file.
4768 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
4770         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
4771         to use exception-based cleanup handler.
4772         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4774         * tst-cond8.c (ch): Announce that we are done.
4776         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
4778         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
4779         Also test aio_suspend with timeout value.
4781 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
4783         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
4784         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
4785         attribute_hidden.
4787         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
4788         (__pthread_mutex_lock_internal): Likewise.
4789         (__pthread_mutex_unlock_internal): Likewise.
4790         (__pthread_mutex_unlock_usercnt): Declare.
4791         * pthread_mutex_destroy.c: Always fail if used in any way.
4792         * pthread_mutex_init.c: Update comment.
4793         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
4794         * pthread_mutex_timedlock.c: Adjust __nusers.
4795         * pthread_mutex_trylock.c: Adjust __nusers.
4796         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
4797         and public interfaces are wrapper with pass additional parameter.
4798         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
4799         parameter zero.
4800         * tst-mutex8.c: New file.
4801         * Makefile (tests): Add tst-mutex8.
4802         * sysdeps/pthread/pthread_cond_timedwait.c: Call
4803         __pthread_mutex_unlock_usercnt.
4804         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4805         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4806         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4807         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4808         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4809         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
4810         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
4811         Add __nusers.
4812         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4813         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4814         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4815         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4816         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4818         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
4819         * pthread_mutex_timedlock.c: Likewise.
4820         * pthread_mutex_trylock.c: Adjust __nusers.
4821         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
4822         * tst-mutex9.c: New file.
4823         * Makefile (tests): Add tst-mutex9.
4824         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
4825         * sysdeps/ia64/tls.h: Likewise.
4826         * sysdeps/powerpc/tls.h: Likewise.
4827         * sysdeps/s390/tls.h: Likewise.
4828         * sysdeps/sh/tls.h: Likewise.
4829         * sysdeps/x86_64/tls.h: Likewise.
4830         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
4831         Change type of __owner.
4832         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4833         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4834         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4835         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4836         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4838 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
4840         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
4841         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
4843         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
4844         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
4845         instead of nr to lll_futex_wake.  Only set errno and return -1
4846         if err < 0.
4848         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
4849         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
4850         return actual return value from the syscall, not 0.
4852 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
4854         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
4855         find a random value.
4856         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
4857         errno==EIDRM.
4859         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
4860         compat_timer_settime.
4861         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
4862         compat_timer_gettime.
4863         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
4864         compat_timer_getoverrun.
4865         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
4866         compat_timer_delete.
4868         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
4869         error-checking mutex detect busy mutexes.
4871 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
4873         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
4874         Add ax to clobber list.
4875         (lll_mutex_cond_lock): Likewise.
4876         (lll_mutex_unlock): Likewise.
4877         (lll_lock): Likewise.
4878         (lll_unlock): Likewise.
4880         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
4881         * tst-cancel18.c: New file.
4882         * tst-cancelx18.c: New file.
4884         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
4885         and tcdrain.
4887         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
4888         * tst-cancel17.c: New file.
4889         * tst-cancelx17.c: New file.
4891         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
4892         * sysdeps/unix/sysv/linux/sigwait.c: New file.
4893         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
4895         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
4897 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
4899         * sysdeps/pthread/createthread.c (create_thread): Set
4900         header.multiple_threads unconditionally.
4901         * allocatestack.c (allocate_stack): Likewise.
4902         * descr.h (struct pthread): Add header.multiple_threads
4903         unconditionally.
4904         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
4905         Define for librt.  #error if neither libpthread, libc nor librt.
4906         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
4907         Likewise.
4908         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
4909         CDISABLE): Likewise.
4910         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
4911         CDISABLE): Likewise.
4912         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
4913         CDISABLE): Likewise.
4914         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
4915         CDISABLE): Likewise.  Access header.multiple_threads outside of
4916         libc and libpthread.
4917         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
4918         Likewise.
4919         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
4920         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
4922 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
4924         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
4925         Also test early cancellation before the thread reaches the cancellation
4926         point.
4928         * Makefile: Compile forward.c with exceptions.
4930         * sysdeps/unix/sysv/linux/sleep.c: New file.
4932 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
4934         * Makefile: Add CFLAGS definition to compile function wrappers
4935         duplicated from libc with exceptions.
4936         * tst-cancel4.c: Also check cancellation handlers.
4938         * Makefile: Add rules to build and run tst-cancel16 and
4939         tst-cancelx16.  Add missing CFLAGS definitions.
4940         * tst-cancel16.c: New file.
4941         * tst-cancelx16.c: New file.
4943 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
4945         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
4946         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
4947         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
4948         (DL_SYSINFO_IMPLEMENTATION): Likewise.
4950         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
4951         (LIBC_CANCEL_RESET): Likewise.
4952         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
4953         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
4954         librt-cancellation.
4955         (CFLAGS-libcrt-cancellation.c): Define.
4956         * sysdeps/pthread/librt-cancellation.c: New file.
4957         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
4958         macros also when compiling librt.
4959         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
4960         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
4961         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
4962         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
4963         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
4964         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
4965         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4967         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
4968         compat_timer_create.
4970 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
4972         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
4974         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
4975         __register_atfork.
4976         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
4977         Add libc_hidden_def.
4979 2003-06-13  Roland McGrath  <roland@redhat.com>
4981         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
4982         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
4984 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
4986         * allocatestack.c (queue_stack): Always inline.
4987         * ptreadhP.h (__do_cancel): Likewise.
4989 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
4991         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
4992         a typo.
4994 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
4996         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
4997         (__pthread_cond_signal): Remove incorrect second addition for
4998         cond_lock!=0.
5000 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
5002         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
5003         (__pthread_cond_signal): Use correct futex pointer in
5004         __lll_mutex_lock_wait call.
5006         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
5007         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
5009 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
5011         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
5012         cancelable.
5013         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
5014         Likewise.
5016         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
5017         hand-written CFI generation code.  Since ENTRY/END also initiated
5018         CFI frames this caused two CFI sets to be generated.
5020 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
5022         * cleanup_routine.c: New file.
5023         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
5024         * sysdeps/pthread/pthread.h: Add support for fully exception-based
5025         cleanup handling.
5026         * Makefile (libpthread-routines): Add cleanup_routine.
5027         Add more CFLAGS variables to compile with exceptions.  Add comments
5028         why which file needs unwind tables.
5029         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
5030         tests.
5031         * tst-cancelx1.c: New file.
5032         * tst-cancelx2.c: New file.
5033         * tst-cancelx3.c: New file.
5034         * tst-cancelx4.c: New file.
5035         * tst-cancelx5.c: New file.
5036         * tst-cancelx6.c: New file.
5037         * tst-cancelx7.c: New file.
5038         * tst-cancelx8.c: New file.
5039         * tst-cancelx9.c: New file.
5040         * tst-cancelx10.c: New file.
5041         * tst-cancelx11.c: New file.
5042         * tst-cancelx12.c: New file.
5043         * tst-cancelx13.c: New file.
5044         * tst-cancelx14.c: New file.
5045         * tst-cancelx15.c: New file.
5046         * tst-cleanupx0.c: New file.
5047         * tst-cleanupx0.expect: New file.
5048         * tst-cleanupx1.c: New file.
5049         * tst-cleanupx2.c: New file.
5050         * tst-cleanupx3.c: New file.
5052         * tst-cleanup0.c: Make standard compliant.
5053         * tst-cleanup1.c: Likewise.
5055         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
5056         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
5057         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
5058         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
5059         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
5060         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
5061         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
5062         CLEANUP_JMP_BUF.
5063         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
5064         * tst-cancel12.c: New file.
5065         * tst-cancel13.c: New file.
5066         * tst-cancel14.c: New file.
5067         * tst-cancel15.c: New file.
5068         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
5069         and tst-cancel15.
5071         * tst-cancel1.c: Add some comments.
5073         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
5074         timeout correctly.
5076 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
5078         * Makefile (CFLAGS-pthread_cancel.c): Define.
5080 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
5082         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
5083         Change type of __writer element to int.
5084         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5085         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5086         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5087         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5088         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
5089         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
5090         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
5091         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
5092         Compare with TID to determine deadlocks.
5093         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
5094         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
5095         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
5096         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
5097         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5098         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5099         Likewise.
5100         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5101         Likewise.
5102         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5103         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
5104         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
5105         Likewise.
5106         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
5107         Likewise.
5108         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
5109         * Makefile (tests): Add tst-rwlock12.
5110         * tst-rwlock12.c: New file.
5112 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
5114         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
5115         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
5116         Remove bogus hidden_proto.
5117         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
5118         Likewise.
5119         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
5120         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
5121         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
5122         ___lll_mutex_timedlock): Likewise.
5124 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
5126         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
5127         (__pthread_cond_signal): Add some code to eventually handle
5128         cond_lock!=0.
5130 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
5132         * Makefile (tests): Add tst-exec4.
5133         (tst-exec4-ARGS): Define.
5134         * tst-exec4.c: New file.
5136 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
5138         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
5139         Also fail if tv_nsec < 0.
5140         (__lll_timedwait_tid): Likewise.
5141         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
5142         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
5143         Likewise.
5144         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
5145         Likewise.
5146         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
5147         Likewise.
5148         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
5149         Likewise.
5150         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
5151         Likewise.
5152         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
5153         Likewise.
5155         * Makefile (tests): Add tst-sem8 and tst-sem9.
5156         * tst-sem8.c: New file.
5157         * tst-sem9.c: New file.
5158         * sem_open.c: Fix creation of in_use record if the file exists but
5159         no internal record.
5161         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
5162         definitions.
5164         * sysdeps/pthread/timer_create.c (timer_create): In case
5165         evp==NULL, assign timer ID to sival_ptr.
5167         * descr.h (struct pthread_unwind_buf): Change type of prev element to
5168         struct pthread_unwind_buf *.
5169         (struct pthread): Likewise for cleanup_jmp_buf element.
5171         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
5172         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
5173         * unwind.c (__pthread_unwind_next): Likewise.
5175 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
5177         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
5178         (lll_futex_timed_wait): Use int for futex value parameter.
5179         (lll_futex_wake): Likewise.
5180         (lll_futex_requeue): Likewise.
5182         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
5183         Replace one memory operation with one register operation.
5185         * tst-join4.c (do_test): Fix error message.
5187         * tst-rwlock6.c (do_test): Use correct format specifier.
5189         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
5190         (__lll_mutex_lock_wait): Replace one memory operation with one
5191         register operation.
5192         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
5193         (__lll_mutex_lock_wait): Likewise.
5195         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
5196         (__lll_mutex_cond_lock): Add one to value parameter of
5197         __lll_lock_wait to reflect reality in the futex syscall.
5198         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
5199         (lll_mutex_cond_lock): Likewise.
5201 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
5203         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
5204         New function.
5205         (lll_mutex_cond_lock): Define.
5207 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
5209         * Makefile (tests): Add tst-signal6.
5210         * tst-signal6.c: New file.
5212         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
5213         (__lll_mutex_unlock_force): New function
5214         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
5216         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
5217         (__lll_mutex_unlock_force): New function.
5218         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
5220         * tst-rwlock7.c (do_test): Use correct format specifier.
5222         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
5223         Find break parameter in correct asm argument.
5225 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
5227         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
5228         Remove out4.
5229         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
5230         error occured.
5231         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
5232         Add __mutex.
5233         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
5234         lll_futex_requeue, lll_mutex_unlock_force): Define.
5236 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
5238         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
5239         (pthread_cond_t): Add __mutex.
5240         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
5241         lll_futex_requeue, lll_mutex_unlock_force): Define.
5243 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5245         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
5246         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
5247         Add __mutex field.
5248         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
5249         Define.
5250         (lll_futex_wait, lll_futex_wake): Define.
5251         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
5252         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
5253         FUTEX_REQUEUE instead of FUTEX_WAIT.
5254         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
5255         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
5256         mutex which was used in condvar structure.  Call
5257         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
5258         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
5260         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
5261         include tcb-offsets.h.  Read wakeup value in locked region.
5262         Use the value of gbr register as THREAD_ID.
5263         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5264         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
5265         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
5267         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
5268         macros.
5270 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
5272         * sysdeps/pthread/pthread_cond_broadcast.c
5273         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
5275 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
5277         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
5278         typo in register name.
5279         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
5280         correctly.  Actually use requeue.  Little optimization.
5281         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
5282         mutex address early.  Handle cancellation state as 32-bit value.
5283         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5284         Remove unnecessary label.
5286 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
5288         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
5289         instead of FUTEX_WAIT.
5290         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
5291         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5292         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5293         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
5294         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
5295         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
5296         used in condvar structure.  Call __pthread_mutex_cond_lock instead
5297         of __pthread_mutex_lock_internal.
5298         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5299         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5300         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
5301         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
5302         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5303         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5304         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
5305         Add pthread_mutex_cond_lock.
5306         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
5307         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
5308         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
5309         lll_mutex_cond_lock.
5310         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
5311         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
5312         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
5313         Add __mutex field.
5314         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5315         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
5317         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
5318         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
5320         * pthreadP.h: Declare __pthread_mutex_cond_lock.
5321         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
5322         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
5323         macro don't define aliases.
5325         * cancellation.c: Remove __pthread_enable_asynccancel_2.
5326         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
5327         * sysdeps/pthread/pthread_cond_timedwait.c: Use
5328         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
5329         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5330         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5331         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
5332         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5333         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5335 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
5337         * sem_open.c: Fix one endless loop.  Implement correct semantics
5338         wrt opening the same semaphore more then once.
5339         * sem_close.c: Adjust for sem_open change.
5340         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
5341         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
5342         * Makefile (tests): Add tst-sem7.
5343         * tst-sem7.c: New file.
5345 2003-05-16  Roland McGrath  <roland@redhat.com>
5347         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
5348         uninitialized variable braino.
5350 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
5352         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
5353         test for syscall availability.
5355         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
5356         __no_posix_timers to -1 if the syscalls don't exist.
5358         * pthread_join.c (pthread_join): Set tid field of the joined
5359         thread to -1.  This isn't necessary but helps to recognize some
5360         error conditions with almost no cost.
5362         * allocatestack.c (FREE_P): Also negative values indicate an
5363         unused stack.
5365         * unwind.c: Include <unistd.h>.
5367 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
5369         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
5371 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
5373         * Makefile (crti-objs, crtn-objs): New variables.
5374         (omit-deps, extra-objs): Add crtn.
5375         ($(objpfx)libpthread.so): Depend on both crti and crtn
5376         and links to them in multidir.
5377         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
5379 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
5381         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
5382         (lll_mutex_unlock): Use atomic_exchange_rel.
5384 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
5386         * cond-perf.c (cons): Add missing locking around setting of alldone.
5388 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
5390         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
5391         related macros.
5392         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
5394 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
5396         * tst-sem6.c: New file.
5397         * Makefile (tests): Add tst-sem6.
5399         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
5400         Use atomic_exchange_rel instead of atomic_exchange.
5401         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
5402         Likewise.
5404         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
5405         code for lll_futex_wait and lll_futex_wake in static apps.  Use
5406         vsyscall is possible.
5408         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
5409         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
5410         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
5411         pthread_setaffinity_np.
5412         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
5413         and pthread_setaffinity_np.
5414         * Makefile (libpthread-routines): Add pthread_getaffinity and
5415         pthread_setaffinity.
5417         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
5418         use it in case mmap to allocate the stack fails.
5419         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
5420         ARCH_MAP_FLAGS here.
5421         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
5422         ARCH_RETRY_MMAP.
5424 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
5426         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
5427         handler implementation.  It is now lockless in fork().
5428         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
5429         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
5430         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
5431         declare the __fork_*_lists.
5432         (struct fork_handler): Include pointers to all three functions.
5433         Add next, refcntr and need_signal elements.
5434         (__fork_handlers): New declaration.
5435         (__register_atfork_malloc): Remove declaration.
5436         (HAVE_register_atfork_malloc): Remove definition.
5437         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
5438         __pthread_child_handler variable.
5439         (__libc_pthread_init): Use __register_atfork instead of explicitly
5440         adding to the list.
5441         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
5442         and lll_futex_wake.
5443         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
5445         * unwind.c (unwind_cleanup): Print error message and then abort.  This
5446         function must never be reached.
5448         * cond-perf.c: New file.
5450 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
5452         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
5454 2003-05-04  Roland McGrath  <roland@redhat.com>
5456         * Makefile ($(objpfx)../libc.so): New target.
5458 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
5460         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
5461         (pthread_condattr_t): Size is only an int, don't use long for
5462         alignment.
5463         (pthread_mutexattr_t): Likewise.
5464         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5465         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
5466         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5468 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
5470         * sysdeps/i386/tls.h: Define THREAD_ID.
5471         * sysdeps/ia64/tls.h: Likewise.
5472         * sysdeps/powerpc/tls.h: Likewise.
5473         * sysdeps/s390/tls.h: Likewise.
5474         * sysdeps/sh/tls.h: Likewise.
5475         * sysdeps/x86_64/tls.h: Likewise.
5476         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
5477         record ownership.
5478         * pthread_mutex_timedlock.c: Likewise.
5479         * pthread_mutex_trylock.c: Likewise.
5480         * pthread_mutex_unlock.c: Likewise.
5481         * pthread_rwlock_trywrlock.c: Likewise.
5482         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
5483         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
5484         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
5485         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
5487         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
5488         flag.
5490 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
5492         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
5493         (__SIZEOF_PTHREAD_COND_T): Define to 48.
5494         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
5495         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
5496         Make __align long long instead of long.
5497         (pthread_rwlock_t): Formatting.
5498         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
5499         (pthread_rwlock_t): Formatting.
5500         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
5501         (pthread_cond_t): Make __align long long instead of long.
5502         (pthread_rwlock_t): Move __flags field to the same position as in
5503         linuxthreads.
5505 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
5507         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
5508         * tst-rwlock7.c (do_test): Likewise.
5510 2003-04-26  Roland McGrath  <roland@redhat.com>
5512         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
5514 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
5516         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
5517         sizeof (struct pthread).
5518         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
5519         1 struct pthread.
5520         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
5521         to 0.
5522         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
5523         struct pthread.
5524         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
5525         to 32-bit bytes.
5526         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
5527         tcbp.
5528         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
5529         unneccessarily.
5530         (NO_TLS_OFFSET): Define.
5531         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
5532         add TLS_TCB_SIZE unnecessarily.
5534 2003-04-22  Roland McGrath  <roland@redhat.com>
5536         * Makeconfig (shared-thread-library): Reverse link order to work
5537         around linker bug.
5539 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
5541         * semaphore.h: Fix typo in comment.
5543 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
5545         * sysdeps/pthread/sigfillset.c: New file.
5547         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
5548         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
5549         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
5550         * sysdeps/pthread/sigaction.c: Likewise.
5551         * sysdeps/pthread/sigprocmask.c: New file.
5552         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
5553         __SIGRTMIN+1.
5554         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
5555         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
5556         in this case.
5558 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
5560         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
5561         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
5563         * sysdeps/unix/sysv/linux/unregister-atfork.c
5564         (__unregister_atfork): Don't free memory not allocated dynamically.
5566         * semaphore.h: Remove __THROW marker from cancellation points.
5567         * nptl/sysdeps/pthread/pthread.h: Likewise.
5569 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
5571         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
5572         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
5573         __THROW.
5575 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
5577         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
5579 2003-04-15  Roland McGrath  <roland@redhat.com>
5581         * forward.c (__pthread_unwind): Tweak to avoid warning.
5583 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
5585         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
5587 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
5589         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
5590         overflow CFA advance instructions.
5591         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5593 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
5595         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
5596         * sysdeps/i386/pthread_spin_lock.c: Likewise.
5597         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
5598         defined.
5600         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
5601         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
5602         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
5603         DW_CFA_advance_loc for .Laddl-.Lsubl.
5605 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
5607         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
5608         position-independent unwind data for static libraries.
5609         Add missing unwind info.  Add comments.
5611         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
5612         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5613         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5614         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5616 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
5618         * Makefile: Make sure all cancellation points are compiled with
5619         exception and asynchronous unwind tables.
5621         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
5622         which mishandles loading of global object addresses in PIC.
5623         (THREAD_SETMEM_NC): Likewise.
5625 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
5627         * pthread.h: Define new data structure for cleanup buffer.  Declare
5628         new cleanup handler interfaces.
5629         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
5630         (struct pthread): Add cleanup_jmp_buf pointer.  Define
5631         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
5632         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
5633         it.  Declare old cleanup handler installation functions.
5634         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
5635         handling.
5636         * cleanup_defer.c: Likewise.
5637         * cleanup_compat.c: New file.  Old cleanup code.
5638         * cleanup_def_compat.c: New file.  Old cleanup code.
5639         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
5640         if own thread descriptor.
5641         * unwind.c: New file.
5642         * forward.c: Add __pthread_unwind.
5643         * init.c (pthread_functions): Add __pthread_unwind.
5644         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
5645         Add ptr___pthread_unwind.
5646         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
5647         and unwind function.
5648         * Makefile (libpthread-routines): Add cleanup_compat,
5649         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
5650         table generation if necessary.
5651         * version.c: Record whether unwind support is compiled in.
5652         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
5653         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
5654         handler interfaces.
5655         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
5656         complication to generate unwind information for syscall wrappers.
5657         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
5658         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
5659         __cleanup_fct_attribute.
5661         * Makefile: Add rules to build and run tst-cleanup0.
5662         * tst-cleanup0.c: New file.
5663         * tst-cleanup0.expect: New file.
5665         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
5666         caller.  Optimize to avoid often unecessary local variable.
5668 2003-04-11  Roland McGrath  <roland@redhat.com>
5670         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
5671         sets variable `multidir'; include that.
5672         (generated): Add it.
5673         ($(objpfx)$(multidir)/crti.o): New target.
5674         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
5676 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
5678         * tst-attr2.c (do_test): Add cast to avoid warning.
5679         * tst-mutex4.c (do_test): Likewise.
5681 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
5683         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
5684         in child.
5686 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
5688         * Makefile (tests): Add tst-detach1.
5689         * tst-detach1.c: New file.
5691 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
5693         * sysdeps/pthread/pthread.h: Remove duplicate
5694         pthread_cleanup_{push,pop} definitions.
5696         * tst-barrier2.c: Eliminate warnings.
5697         * tst-cancel4.c: Likewise.
5698         * tst-cond4.c: Likewise.
5699         * tst-cond6.c: Likewise.
5700         * tst-detach1.c: Likewise.
5701         * tst-rwlock4.c: Likewise.
5702         * tst-rwlock6.c: Likewise.
5703         * tst-rwlock7.c: Likewise.
5704         * tst-sem3.c: Likewise.
5705         * tst-spin2.c: Likewise.
5706         * tst-umask1.c: Likewise.
5708 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
5710         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
5712 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
5714         * descr.h (struct pthread): Move cancelhandling member to the front.
5716 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
5718         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
5719         malloc_parent, and malloc_child statically.
5720         (__register_atfork_malloc): New function.
5721         (free_mem): Don't free any of the malloc_* variables on the list.
5722         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
5723         Define HAVE_register_atfork_malloc.
5725 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
5727         * sysdeps/pthread/createthread.c (create_thread): Add some more
5728         comments explaining when to set multiple_threads and when not.
5730         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
5731         THREAD_ATOMIC_BIT_SET if not already defined.
5732         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
5733         THREAD_ATOMIC_BIT_SET:
5734         * sysdeps/x86_64/tls.h: Likewise.
5735         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
5736         THREAD_ATOMIC_CMPXCHG_VAL.
5737         (_pthread_cleanup_pop_restore): Likewise.
5738         * cancellation.c (__pthread_enable_asynccancel): Likewise.
5739         (__pthread_enable_asynccancel_2): Likewise.
5740         (__pthread_disable_asynccancel): Likewise.
5741         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
5742         (__libc_disable_asynccancel): Likewise.
5743         * init.c (sigcancel_handler): Likewise.
5744         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
5745         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
5747 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
5749         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
5750         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
5751         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
5752         * Makefile (tests): Add tst-cancel11.
5753         * tst-cancel11.c: New file.
5755 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
5757         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
5758         round, not the first.  Use specific_used flag instead of local
5759         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
5760         (__free_tcb): Don't call deallocate_tsd here.
5761         (start_thread): Call deallocate_tsd here.
5762         * pthread_setspecific.c: Set specific_used flag really only when
5763         needed.
5764         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
5765         * tst-tsd3.c: New file.
5766         * tst-tsd4.c: New file.
5768 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
5770         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
5771         Use atomic_exchange_and_add instead of __lll_add.
5772         (__lll_mutex_timedlock): Likewise.
5773         Patch by Ian Wienand.
5775 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
5777         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
5778         (SINGLE_THREAD_P): Fix typo.
5779         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
5781 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
5783         * Makefile (tests): Add tst-align.
5784         * tst-align.c: New file.
5785         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
5787         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
5788         function correctly.
5790         * tst-tsd2.c: Add casts to avoid warnings.
5792 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
5794         * descr.h (struct pthread): Move most often used elements to the front.
5796 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
5798         * Makefile (libpthread-routines): Add pthread_atfork.
5799         (libpthread-static-only-routines): Add pthread_atfork.
5801 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5803         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
5804         of TLS_DTV_AT_TP.
5805         (INSTALL_DTV): Add parens.
5806         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
5807         Use passed descr instead of THREAD_SELF.
5808         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
5809         (__lll_mutex_timedlock_wait): Correct expected value after
5810         spurious wakeup.
5811         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
5812         Release lock before waking up the waiters.
5813         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
5814         criteria.  Reorderstruct passed to cleanup handler.  Fix
5815         handling of cancellation and failung pthread_mutex_unlock call.
5816         Use __pthread_enable_asynccancel_2 instead of
5817         __pthread_enable_asynccancel.
5818         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5819         Return result of lock re-get if it fails.
5820         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
5821         for __pthread_cleanup_push.
5822         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
5823         completely broken rwlock implementation.
5824         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5825         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
5826         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
5827         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
5828         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5829         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
5830         versioned_symbol macro.
5831         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
5832         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
5834 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
5836         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
5837         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
5838         and __helper_tid.
5839         (struct timer): Remove th and bar field.
5840         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
5841         debugging code.  Create only one helper thread.
5842         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
5843         helper thread.
5844         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
5845         Renamed.  Define statically.  Use thread info from siginfo.
5846         (__helper_once): New variable.
5847         (__helper_tid): New variable.
5848         (__reset_helper_control): New function.
5849         (__start_helper_thread): New function.
5851         * pthread_create.c (start_thread): Don't use setjmp inside
5852         __builtin_expect to work around gcc bug.
5854         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
5855         timer_delete syscall fails, but not with ENOSYS, set
5856         __no_posix_timers.
5858         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
5859         (timer_settime): Fix typo.
5860         * sysdeps/unix/sysv/linux/timer_getoverr.c
5861         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
5863 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
5865         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
5866         offset of cleanupbuf.__prev.
5868 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
5870         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
5871         of included file.
5873 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
5875         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
5876         NULL provide default definition to syscall.
5878 2003-03-25  Roland McGrath  <roland@redhat.com>
5880         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
5881         (timer_id2ptr): Fix typo.
5883 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
5885         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
5886         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
5887         * sysdeps/ia64/pthreaddef.h: Likewise.
5888         * sysdeps/powerpc/pthreaddef.h: Likewise.
5889         * sysdeps/s390/pthreaddef.h: Likewise.
5890         * sysdeps/sh/pthreaddef.h: Likewise.
5891         * sysdeps/x86_64/pthreaddef.h: Likewise.
5892         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
5893         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
5894         being changed.
5895         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
5896         SIGTIMER is not unblocked.
5897         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
5898         RT signal taken.
5899         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
5900         be send.
5901         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
5902         pass pointer through as ID.
5903         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
5904         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
5905         * sysdeps/unix/sysv/linux/timer_create.c: New file.
5906         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
5907         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
5908         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
5909         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
5910         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
5911         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
5912         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
5913         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
5914         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
5915         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
5916         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
5917         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
5918         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
5919         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
5920         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
5921         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
5922         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
5923         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
5924         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
5925         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
5926         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
5927         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
5928         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
5929         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
5930         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
5931         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
5932         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
5933         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
5934         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
5935         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
5937         * pthreadP.h: Remove FRAME_LEFT definition.
5938         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
5939         already left frame.  Programs which have this problem are not POSIX
5940         compliant.
5941         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
5943 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
5945         * sysdeps/pthread/tst-timer.c: Check return values of the
5946         functions we test.
5948 2003-03-23  Roland McGrath  <roland@redhat.com>
5950         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
5951         * tst-tls3mod.c: Likewise.
5952         * tst-tls1.c: Likewise.
5953         * tst-tls2.c: Likewise.
5955         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
5956         undefined behavior.
5958         * tst-join5.c (tf1, tf2): Add a cast.
5960         * Makeconfig (includes): Append -I$(..)nptl to this variable.
5962         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
5963         Don't test anything.
5964         * tst-cond4.c: Likewise.
5965         * tst-cond6.c: Likewise.
5966         * tst-flock2.c: Likewise.
5967         * tst-mutex4.c: Likewise.
5968         * tst-rwlock4.c: Likewise.
5969         * tst-signal1.c: Likewise.
5970         * tst-spin2.c: Likewise.
5971         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
5973         * tst-mutex4.c: Use test-skeleton.c.
5974         * tst-spin2.c: Likewise.
5975         * tst-sysconf.c: Likewise.
5976         * tst-barrier2.c: Likewise.
5977         * tst-cond4.c: Likewise.
5978         * tst-cond6.c: Likewise.
5979         * tst-rwlock4.c: Likewise.
5980         * tst-unload.c: Likewise.
5981         * tst-flock2.c (do_test): Use return instead of exit.
5983 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
5985         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
5987 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
5989         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
5990         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
5991         instead of __lll_compare_and_swap.
5992         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
5993         Likewise.
5994         Removed definition if __lll_compare_and_swap.
5996         * cancellation.c: Adjust for new form of compare&exchange macros.
5997         * cleanup_defer.c: Likewise.
5998         * init.c: Likewise.
5999         * libc-cancellation.c: Likewise.
6000         * old_pthread_cond_broadcast.c: Likewise.
6001         * old_pthread_cond_signal.c: Likewise.
6002         * old_pthread_cond_timedwait.c: Likewise.
6003         * old_pthread_cond_wait.c: Likewise.
6004         * pthread_cancel.c: Likewise.
6005         * pthread_create.c: Likewise.
6006         * pthread_detach.c: Likewise.
6007         * pthread_join.c: Likewise.
6008         * pthread_key_delete.c: Likewise.
6009         * pthread_setcancelstate.c: Likewise.
6010         * pthread_setcanceltype.c: Likewise.
6011         * pthread_timedjoin.c: Likewise.
6012         * pthread_tryjoin.c: Likewise.
6013         * sysdeps/pthread/createthread.c: Likewise.
6015 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
6017         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
6018         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
6019         definitions.  Replace uses with calls to atomic_* functions.
6020         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
6021         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
6022         __lll_test_and_set calls with atomic_exchange_and_add and
6023         atomic_exchange calls respectively.
6024         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
6025         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
6026         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
6027         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
6028         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
6029         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
6030         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
6032         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
6033         returns the old value.
6035 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
6037         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
6038         int for variable OLDVAL and correct inline assembler contraint.
6039         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
6040         type int for variable OLD.
6042         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
6043         only for s390-32.
6044         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
6045         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
6046         instead of multiple_threads field in the TCB.
6048 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
6050         * sysdeps/i386/i686/bits/atomic.h: Removed.
6051         * sysdeps/i386/i586/bits/atomic.h: Removed.
6052         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
6053         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
6054         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
6055         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
6056         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
6057         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
6058         * atomic.h: Removed.  Moved to glibc.
6060         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
6061         support for clock selection.
6063         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
6064         signalling waiters.
6066 2003-03-18  Roland McGrath  <roland@redhat.com>
6068         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
6069         Add __lll_rel_instr first.  Add memory clobber.
6070         (lll_mutex_unlock): Use __lll_test_and_set.
6071         From Paul Mackerras <paulus@samba.org>.
6073         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
6074         unconditionally.
6075         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
6076         (SINGLE_THREAD_P):  Add `header.' prefix.
6077         From Paul Mackerras <paulus@samba.org>.
6079         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
6080         pthread_timedjoin_np to ...
6081         (libpthread: GLIBC_2.3.3): ... here.
6082         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
6084         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
6085         Avoid shadowing VAL variable.
6087         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
6088         New macro.
6090 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
6092         * Makefile (tests): Add tst-cond11.
6093         * tst-cond11.c: New file.
6095         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
6096         struct passed to cleanup handler to eliminate one more
6097         instruction.
6098         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6100         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
6101         (pthrad_cond_t): Replace __unused field with __clock.
6103         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
6104         waken all waiters in cleanup handler.
6105         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6106         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6108         * pthread_condattr_getclock.c: New file.
6109         * pthread_condattr_setclock.c: New file.
6110         * sysdeps/pthread/pthread.h: Declare these new functions.
6111         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
6112         * Makefile (libpthread-routines): Add the new functions.
6113         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
6114         Renamed field to value.  Document use of the bits.
6115         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
6116         change.
6117         * pthread_condattr_setpshared.c: Likewise.
6118         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
6119         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
6120         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
6121         Add __clock field.
6122         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6123         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6124         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6125         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6126         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
6127         Implement clock selection.
6128         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
6129         * pthread-errnos.sym: Add ENOSYS.
6130         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
6131         _POSIX_CLOCK_SELECTION.
6132         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
6134         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
6135         invalid .size directive.
6137 2003-03-17  Roland McGrath  <roland@redhat.com>
6139         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
6140         Formatting tweaks.
6142 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
6144         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
6145         Use __lll_add instead of spelling it out.  Use protected symbol names.
6146         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
6147         Use __lll_add.
6148         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
6149         Renamed from lll_compare_and_swap.  Use new name where necessary.
6150         (__lll_add): Defined.
6151         (__lll_dec_if_positive): Defined.
6152         (__lll_test_and_set): Defined.
6153         * sysdeps/ia64/pthread_spin_init.c: Removed.
6154         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
6155         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
6156         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
6157         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
6158         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
6159         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
6160         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
6161         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
6162         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
6163         __sync_lock_release_si.
6164         Patch by Jakub Jelinek.
6166         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
6167         Fix timeout handling.
6168         (__lll_timedwait_tid): Likewise.
6169         (lll_unlock_wake_cb): Wake up other waiters if necessary.
6170         Patch by Jakub Jelinek.
6172         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
6174 2003-03-17  Roland McGrath  <roland@redhat.com>
6176         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
6177         * sysdeps/pthread/pthread_spin_init.c: New file.
6178         * sysdeps/pthread/pthread_spin_unlock.c: New file.
6179         * sysdeps/powerpc/Makefile: New file.
6180         * sysdeps/powerpc/pthread_spin_lock.c: New file.
6181         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
6182         * sysdeps/powerpc/pthreaddef.h: New file.
6183         * sysdeps/powerpc/tcb-offsets.sym: New file.
6184         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
6185         * sysdeps/powerpc/tls.h: New file.
6186         * sysdeps/powerpc/bits/atomic.h: New file.
6187         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
6188         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
6189         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
6191         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
6192         * sysdeps/unix/sysv/linux/sem_post.c: New file.
6193         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
6194         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
6195         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
6196         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
6197         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
6198         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
6199         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
6200         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
6201         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
6202         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
6203         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
6204         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
6205         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
6207         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
6208         not gettimeofday.
6209         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
6210         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
6211         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
6212         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
6213         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
6215 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
6217         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
6218         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
6219         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6220         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6221         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
6223 2003-03-16  Roland McGrath  <roland@redhat.com>
6225         * tst-fork4.c: Include <string.h>.
6226         * tst-signal2.c: Likewise.
6227         * tst-mutex5.c (do_test): exit -> return.
6228         * tst-mutex2.c: Include <stdlib.h>.
6230 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
6232         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
6233         (__lll_mutex_timedlock_wait): Correct expected value after
6234         spurious wakeup.  Otherwise we would never wait again.
6236         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
6237         zone versus inline asm stupidity.  Use correct instructions.
6239         * tst-rwlock6.c: Add some more status output.
6241 2003-03-15  Roland McGrath  <roland@redhat.com>
6243         * sysdeps/pthread/configure.in: New file.
6244         * sysdeps/pthread/configure: New file (generated).
6246 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
6248         * allocatestack.c (allocate_stack): Store the exact stack size of
6249         user allocated stacks.
6251 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
6253         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
6254         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
6255         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
6256         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
6257         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
6258         Use `header.' prefix.
6259         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
6261 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
6263         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
6264         __builtin_frame_address, use stack pointer.
6266         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
6267         instead of __builtin_frame_pointer.
6269 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
6271         * tst-basic1.c (do_test): Add cast to avoid warning.
6272         * tst-basic2.c (do_test): Likewise.
6274         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
6275         amount of stack correction.
6277         * tst-fork4.c: Use test-skeleton.c.
6279 2003-03-14  Roland McGrath  <roland@redhat.com>
6281         * init.c: Fix typo "#eli" for "#else".
6283 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
6285         * allocatestack.c (__stack_user): Use hidden_data_def.
6286         * pthread_create.c (__pthread_keys): Likewise.
6288         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
6290 2003-03-14  Roland McGrath  <roland@redhat.com>
6292         * tst-fork4.c: New file.
6293         * Makefile (tests): Add it.
6295         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
6296         we always define the padding space.
6297         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
6298         stopped supporting its own extensions fully.
6299         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
6300         struct also called `header', so `header.multiple_threads' is the field
6301         name to use on all machines.
6302         * allocatestack.c (allocate_stack): Use `header.' prefix.
6303         * sysdeps/pthread/createthread.c (create_thread): Likewise.
6304         * pthread_create.c (__pthread_create_2_1): Likewise.
6305         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
6306         (THREAD_SELF): Likewise.
6307         * sysdeps/x86_64/tls.h: Likewise.
6308         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
6309         (SINGLE_THREAD_P): Likewise.
6310         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
6311         (SINGLE_THREAD_P): Likewise.
6312         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
6313         (SINGLE_THREAD_P): Likewise.
6315         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
6316         value directly.
6318 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
6320         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
6321         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
6323         * pthread_create.c (start_thread): setjmp is expected to return 0.
6325         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
6326         (THREAD_GETMEM_NC): Likewise.
6328 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
6330         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
6331         and the size of the stack which must be allocated is a multiple,
6332         allocate one more page.
6333         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
6334         MULTI_PAGE_ALIASING.
6336 2003-03-13  Roland McGrath  <roland@redhat.com>
6338         * pthread_create.c (start_thread): Set EXITING_BIT after the
6339         event-reporting (and destructors), not before.
6341 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
6343         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
6344         lll_futex_wake): Declare register variables as long int instead of
6345         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
6346         Make syscall arguments clobbered by the syscall.
6347         (lll_futex_wait): Define using lll_futex_timed_wait.
6349         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
6350         to void *.
6352         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
6353         PPID if [! NDEBUG].
6355         * allocatestack.c (nptl_ncreated): Only declare if
6356         COLORING_INCREMENT != 0.
6358         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
6359         (__libc_enable_asynccancel_2): Remove prototype.
6361         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
6362         ctid to match kernel.
6364 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
6366         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
6367         libc_multiple_threads.
6368         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
6369         __libc_multiple_threads to...
6370         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
6372         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
6373         versioning.
6374         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
6375         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
6377         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
6378         (__pthread_once_internal): Define.
6380         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
6381         macros instead of .symver directly.
6382         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
6383         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
6385         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
6386         * sysdeps/x86_64/tcb-offsets.sym: New file.
6387         * sysdeps/x86_64/Makefile: New file.
6389         * sysdeps/i386/tcb-offsets.sym: Add SELF.
6390         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
6391         to access own pthread_t in TCB.
6392         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6393         Likewise.
6394         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6395         Likewise.
6396         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6398 2003-03-12  Roland McGrath  <roland@redhat.com>
6400         * pthread-errnos.sym: New file.
6401         * Makefile (gen-as-const-headers): New variable, list that file.
6402         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
6403         header <pthread-errnos.h> instead of defining errno values here.
6404         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
6405         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
6406         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
6407         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6408         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6409         Likewise.
6410         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6411         Likewise.
6412         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6413         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6414         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
6415         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
6416         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
6417         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
6418         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
6419         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
6420         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6421         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
6422         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
6423         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
6424         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
6425         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
6426         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
6427         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6428         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
6429         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
6430         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6431         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
6432         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
6433         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
6434         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
6435         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
6436         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
6437         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
6438         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
6440         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
6441         CLONE_CHILD_SETTID worked.
6443 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
6445         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
6446         file.
6447         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
6448         file.
6450         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
6451         (pthread_cond_t): Add padding.
6453         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
6454         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
6455         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
6457         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
6458         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
6459         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
6460         (__pthread_rwlock_timedrdlock): Likewise.
6461         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
6462         (__pthread_rwlock_wrlock): Likewise.
6463         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
6464         (__pthread_rwlock_rdlock): Likewise.
6466         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
6468         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
6469         result of lock re-get if it fails.
6471 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
6473         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
6474         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6475         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
6476         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
6477         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6478         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
6479         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
6480         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
6481         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
6482         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
6484         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
6485         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
6487         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
6488         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
6489         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
6490         (create_thread): Likewise.
6491         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
6492         * init.c (__pthread_initialize_minimal_internal): Initialize
6493         __libc_multiple_threads_ptr if necessary.
6494         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
6495         __pthread_multiple_threads and __libc_multiple_threads_ptr.
6496         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
6497         __libc_multiple_threads.
6498         (__libc_pthread_init): Return pointer to __libc_pthread_init if
6499         necessary.
6501         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
6502         (THREAD_SETMEM_NC): Likewise.
6504         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
6505         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
6506         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
6507         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
6509         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
6510         Eliminate one entire instruction.
6512         * cancellation.c (__pthread_enable_asynccancel_2): New function.
6513         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
6514         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6515         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
6516         instead of __pthread_enable_asynccancel.
6517         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
6518         (__pthread_cond_wait): Likewise.
6519         * sysdeps/pthread/pthread_cond_timedwait.c
6520         (__pthread_cond_timedwait): Likewise.
6521         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
6523         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
6524         (__condvar_cleanup): Wake up all waiters in case we got signaled
6525         after being woken up but before disabling asynchronous
6526         cancellation.
6527         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
6528         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
6529         (__condvar_cleanup): Likewise.
6531         * init.c (__NR_set_tid_address): If already defined, don't redefine.
6532         Make it an error if architecture has no #if case.  Add x86-64.
6534         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
6535         pt-initfini.s generation.
6537         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
6538         (TLS_INIT_TP): Fix typo.
6540 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
6542         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
6543         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
6545         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
6546         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
6547         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
6548         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
6549         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
6550         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
6551         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
6552         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
6554 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
6556         * sysdeps/pthread/pthread_cond_timedwait.c
6557         (__pthread_cond_timedwait): Return the result of the final
6558         locking.  If it succeeds, the regular function return value.
6560         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
6561         Return result of the final locking.
6562         * version.c (__nptl_main): Work around problems with the strange
6563         INTERNAL_SYSCALL macro on ppc32.
6564         * init.c (__pthread_initialize_minimal_internal): Unblock
6565         SIGCANCEL in case the parent blocked it.
6566         Reported by Paul Mackerras <paulus@samba.org>.
6568         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
6569         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
6570         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
6572 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
6574         * sysdeps/pthread/pthread_cond_timedwait.c
6575         (__pthread_cond_timedwait): Unlock and fail if
6576         __pthread_mutex_unlock_internal failed.
6578         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
6579         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
6580         Use ARCH_CLONE.
6581         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
6582         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
6583         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
6584         ALLOCATE_STACK): New macros.
6585         (TLS_TPADJ): New macro.
6586         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
6587         (allocate_stack): Handle TLS_DTV_AT_TP and
6588         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
6589         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
6590         Don't set PD->self.
6591         * init.c [__ia64__] (__NR_set_tid_address): Define.
6593         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
6594         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
6595         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
6596         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
6597         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
6598         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
6599         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
6600         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
6601         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
6602         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
6603         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
6604         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
6605         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
6606         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
6607         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
6608         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
6609         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
6610         * sysdeps/ia64/bits/atomic.h: New file.
6611         * sysdeps/ia64/Makefile: New file.
6612         * sysdeps/ia64/pthread_spin_init.c: New file.
6613         * sysdeps/ia64/pthread_spin_lock.c: New file.
6614         * sysdeps/ia64/pthread_spin_trylock.c: New file.
6615         * sysdeps/ia64/pthread_spin_unlock.c: New file.
6616         * sysdeps/ia64/pthreaddef.h: New file.
6617         * sysdeps/ia64/tcb-offsets.sym: New file.
6618         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
6619         * sysdeps/ia64/tls.h: New file.
6621         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
6622         to syscall instead of no arguments.
6624 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
6626         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
6627         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
6628         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
6629         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
6631         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
6632         unused code.
6634         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
6636         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
6637         lowlevelbarrier.sym.
6638         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
6639         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
6640         Include lowlevelbarrier.h and don't define offsets locally.
6641         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
6643         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
6644         (__lll_mutex_lock_wait): Reverse order of first two parameters.
6645         (__lll_mutex_timedlock_wait): Likewise.
6646         (lll_mutex_lock): Adjust asm for that.
6647         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
6648         (lll_lock): Adjust asm for operand order change.
6649         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
6650         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
6652         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
6653         Reverse order of parameters.
6654         (__lll_timedwait_tid): Remove regparms attribute.
6655         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
6656         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
6658         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
6659         (__lll_timedwait_tid): Remove one unnecessary instruction.
6661         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
6662         __lll_mutex_timedlock_wait only for NOT_IN_libc.
6663         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
6664         lowlevelmutex.S.
6666         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
6667         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
6668         for NOT_IN_libc.
6669         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
6670         lowlevellock.S.
6672         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
6673         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
6674         for libc.so.
6675         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
6676         define LOCK here (if UP is not defined).  The actual code is in
6677         lowlevelmutex.S.
6679         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
6680         LOCK is already defined.  Don't define lll_unlock_wake_cb and
6681         __lll_timedwait_tid for libc.so.
6682         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
6683         define LOCK here (if UP is not defined).  The actual code is in
6684         lowlevellock.S.
6686         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
6687         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
6688         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
6689         instead of lowlevelsem.h.
6690         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
6691         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
6692         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
6694         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
6695         lowlevelrwlock.sym.
6696         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
6697         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
6698         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
6700         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
6701         register loading.
6702         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
6703         last changed.  D'oh.
6705         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
6707         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
6708         of __libc_locking_needed.
6709         (lll_trylock): Initialize %eax to zero.
6711         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
6712         pthread_cond_t definition.
6714 2003-03-10  Roland McGrath  <roland@redhat.com>
6716         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
6717         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
6718         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
6719         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
6720         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
6722         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
6723         Instead of setting PD->multiple_threads, set globals
6724         __pthread_multiple_threads and __libc_multiple_threads.
6725         * sysdeps/pthread/createthread.c (create_thread): Likewise.
6726         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
6727         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
6729         * descr.h (struct pthread): Conditionalize first member on
6730         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
6731         containing an anonymous tcbhead_t.  Move `list' member out.
6732         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
6733         * allocatestack.c: Remove use of `header.data.' prefix.
6734         * pthread_create.c: Likewise.
6735         * init.c (__pthread_initialize_minimal_internal): Likewise.
6736         * sysdeps/pthread/createthread.c (create_thread): Likewise.
6737         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
6738         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
6739         * sysdeps/x86_64/tls.h: Likewise.
6740         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
6741         (SINGLE_THREAD_P): Likewise.
6742         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
6743         (SINGLE_THREAD_P): Likewise.
6744         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
6745         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
6747 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
6749         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
6751         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
6752         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
6754         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
6755         leftovers from the ia32 code.
6757         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
6758         memory load.
6759         (clear_once_control): Don't load %esi.
6761         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
6762         handling.
6764         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
6766         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
6767         * sysdeps/unix/sysv/linux/createthread.c: ...here.
6769         * Makefile (tests): Add tst-cond10.
6770         * tst-cond10.c: New file.
6772 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
6774         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
6775         * tst-signal3.c (do_test): Likewise.
6776         * tst-sem5.c (do_test): Likewise.
6777         * tst-kill6.c (do_test): Likewise.
6778         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
6780         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
6781         of inc/dec.
6782         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
6783         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
6784         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
6785         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
6786         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6787         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
6788         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6789         Likewise.
6790         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6791         Likewise.
6792         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6793         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6794         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6795         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6796         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6797         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
6798         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
6799         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
6801         * allocatestack.c (allocate_stack): If mprotect() fails free the
6802         TLS memory.
6804 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
6806         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
6808         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
6809         lll_wake_tid.  This was used only to work around kernel limits in
6810         the early days.
6811         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
6812         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
6813         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
6814         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
6816         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
6817         (__pthread_initialize_minimal_internal): Change initialization of
6818         __static_tls_align_m1 appropriately.
6819         * pthreadP.h (__static_tls_align_m1): Renamed from
6820         __static_tls_align.
6821         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
6822         instead of __static_tls_align-1.
6824 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
6826         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
6828         * pthread_create.c: Define __pthread_keys using nocommon
6829         attribute, not by placing it explicitly in bss.
6830         Remove DEFINE_DEALLOC definition.  Not needed anymore.
6832         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
6833         Use it in mmap call to allocate stacks.
6835         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
6837         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
6838         result of the thread function.
6840 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
6842         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
6843         version is just fine.
6845         * sysdeps/unix/sysv/linux/libc_pthread_init.c
6846         (__pthread_child_handler): Renamed from pthread_child_handler,
6847         exported, and marked hidden.  Change all users.
6848         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
6849         free __pthread_child_handler from child list.
6851 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
6853         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
6855         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
6856         Fix handling of cancellation and failing pthread_mutex_unlock call.
6857         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
6858         (__pthread_cond_wait): Likewise.
6860         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
6861         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
6862         lll_futex_timed_wait call.
6863         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
6864         (pthread_rwlock_timedwrlock): Likewise.
6866         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
6867         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
6868         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
6870         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
6871         check of lll_futex_wake return value.
6873 2003-03-03  Roland McGrath  <roland@redhat.com>
6875         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
6877         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
6878         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
6879         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
6881 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
6883         * sysdeps/pthread/timer_create.c (timer_create): Return correct
6884         error for CPU clocks.
6886         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
6887         _POSIX_MONOTONIC_CLOCK.
6888         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
6890         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
6891         recent kernels.
6893 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
6895         * descr.h (struct pthread): Move cleanup field to the front.
6897 2003-03-01  Roland McGrath  <roland@redhat.com>
6899         * sem_open.c (sem_open): Braino fix.
6901 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
6903         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
6904         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
6905         __pthread_cleanup_pop functionality.
6906         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6908         * descr.h (struct pthread): Move tid field to the front now that
6909         it is often used.
6911         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
6912         (__lll_mutex_timedlock_wait): Remove.
6913         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
6914         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
6915         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
6916         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
6917         (lll_unlock_wake_cb): Don't save and restore %esi.
6918         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
6919         %esi.
6920         (__lll_timedwait_tid): Add alignment.
6921         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
6922         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
6923         %esi.
6924         (__lll_timedwait_tid): Removed.
6925         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
6926         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
6927         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
6928         (pthread_barrier_wait): Don't save, load, and restore %esi for
6929         last thread.
6930         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6931         (__pthread_cond_signal): Don't save, load, and restore %esi.
6932         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
6933         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
6934         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
6935         Don't save, load, and restore %esi.
6937 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
6939         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
6940         Release lock before waking up the waiters.
6942         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
6944         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
6945         (reader_thread): Likewise.
6947         * sysdeps/pthread/pthread_rwlock_unlock.c
6948         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
6949         to wake up readers if there are none.
6951         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
6952         Release internal lock before wake threads.
6954 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
6956         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
6957         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
6958         predefined.
6959         * tst-rwlock9.c: Likewise.
6960         * tst-rwlock10.c: New file.
6961         * tst-rwlock11.c: New file.
6963         * Makefile (tests): Add tst-dlsym1.
6964         * tst-dlsym1.c: New file.
6966         * init.c (__pthread_initialize_minimal_internal): Set
6967         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
6968         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
6970 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
6972         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
6974         * tst-cond2.c: Fix sychronization with child.
6976         * tst-rwlock8.c (reader_thread): Remove unused variable.
6978         * Makefile: Add rules to build and run tst-tls3.
6979         * tst-tls3.c: New file.
6980         * tst-tls3mod.c: New file.
6982         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
6983         * tst-rwlock8.c: New file.
6984         * tst-rwlock9.c: New file.
6985         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
6986         complete broken rwlock implementation.
6987         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6988         Likewise.
6989         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6990         Likewise.
6991         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
6992         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6993         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
6994         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6995         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
6996         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
6997         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6999 2003-02-23  Roland McGrath  <roland@redhat.com>
7001         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
7003 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
7005         * Makefile (tests): Add tst-context1.
7006         * tst-context1.c: New file.
7008         * Makefile (tests): Add tst-tls1 and tst-tls2.
7009         * tst-tls1.c: New file.
7010         * tst-tls2.c: New file.
7012         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
7013         for failed cmpxchg.
7015         * pthread_create.c (start_thread): Set EXITING_BIT early.
7017         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
7018         (THREAD_GETMEM_NC): Likewise.
7020 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
7022         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
7023         off 3 more bytes by using offset-less instructions when possible.
7025         * Makefile: Add dependency for $(objpfx)version.d.
7027         * eintr.c (eintr_source): Add unnecessary return but the compiler
7028         insists.
7030         * tst-kill3.c: Include <unistd.h>.
7032 2003-02-21  Roland McGrath  <roland@redhat.com>
7034         * pthread_create.c (start_thread): Call __libc_thread_freeres.
7036 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
7038         * Makefile (tests): Add tst-eintr1.
7039         (distribute): Add eintr.c.
7040         * tst-eintr1.c: New file.
7041         * eintr.c: New file.
7043         * pthread_cancel.c (pthread_cancel): Use tkill directly.
7045         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
7046         Disallow sending SIGCANCEL.
7048         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
7049         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
7050         * tst-kill1.c: New file.
7051         * tst-kill2.c: New file.
7052         * tst-kill3.c: New file.
7053         * tst-kill5.c: New file.
7054         * tst-kill6.c: New file.
7055         * tst-basic7.c: Renamed to...
7056         * tst-kill4.c: ...this.
7058 2003-02-21  Roland McGrath  <roland@redhat.com>
7060         * Makefile (install-lib-ldscripts): New variable.
7062 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
7064         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
7065         * pthread_cancel.c: Use INVALID_TD_P.
7066         * pthread_detach.c: Likewise.
7067         * pthread_getschedparam.c: Likewise.
7068         * pthread_setschedparam.c: Likewise.
7069         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
7070         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
7071         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
7072         * pthread_timedjoin.c: Likewise.
7074         * tst-basic7.c: Include <signal.h>.
7076         * pthread_join.c (pthread_join): Limited checking for invalid
7077         descriptors.
7078         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
7080 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
7082         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
7083         beginning of the loop.  Clear the entire first block of TSD.
7084         * Makefile (tests): Add tst-key4.
7085         * tst-key4.c: New file.
7087 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
7089         * Makefile (tests): Add tst-basic7.
7090         * tst-basic7.c: New file.
7092         * pthread_create.c (deallocate_tsd): Mark as internal_function.
7093         Add some more __builtin_expect.
7095         * pthreadP.h: Define dummy version of DEBUGGING_P.
7097 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
7099         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
7100         _POSIX_THREAD_PRIORITY_SCHEDULING.
7101         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
7102         _XOPEN_REALTIME_THREADS.
7103         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
7105         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
7106         kernel returns EINVAL for PID <= 0, work around it.
7108         * Makefile (tests): Add tst-signal5.
7109         * tst-signal5.c: New file.
7111         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
7112         and LOGIN_NAME_MAX.
7114         * tst-cancel1.c (tf): Block all signals.
7116         * Makefile (tests): Add tst-basic6.
7117         * tst-basic6.c: New file.
7119         * tst-basic1.c: Add test for process ID.
7121         * Makefile (tests): Add tst-cancel10.
7122         * tst-cancel10.c: New file.
7124         * Makefile (tests): Add tst-signal4.
7125         * tst-signal4.c: New file.
7127         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
7128         __sigismember instead of sigismember.  Add __builtin_expect.
7130 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
7132         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
7133         pthread_setcancelstate, and pthread_rwlock_setpshared.
7135         * tst-cancel7.c (do_test): Make sure the pid file exists before
7136         canceling the thread.
7138         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
7139         pthread_rwlock_timedrdlock tests.
7140         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
7141         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7142         Check for invalid tv_nsec field.
7143         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7144         Likewise.
7146         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
7147         recursive mutex of overflow.
7149         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
7151         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
7152         going into an endless loop.
7153         * Makefile (tests): Add tst-cancel9.
7154         * tst-cancel9.c: New file.
7156         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
7158 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
7160         * tst-mutex5.c (do_test): Add more timedlock tests.
7162         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
7163         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
7165         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
7166         use INLINE_SYSCALL.  Error number is returned, not -1.
7168         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
7169         and __deallocate_stack with internal_function.
7170         * pthread_create.c: Adjust definitions appropriately.
7171         * allocatestack.c: Likewise.
7173         * pthread_join.c: Add one more __builtin_expect.
7174         * pthread_timedjoin.c: Likewise.
7176         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
7177         not data of sequence number does not match.
7178         Add one __builtin_expect.
7180         * Makefile (tests): Add tst-clock1.
7181         * tst-clock1.c: New file.
7183         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
7184         negative arguments.
7185         * Makefile (tests): Add tst-basic5.
7186         * tst-basic5.c: New file.
7188 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
7190         * Makefile (tests): Add tst-basic4.
7191         * tst-basic4.c: New file.
7193         * pthreadP.h: Add declaraction for __nptl_nthreads.
7194         * pthread_create.c: Define __nptl_nthreads
7195         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
7196         after thread is done.  If then zero, call exit(0).
7197         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
7198         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
7199         * init.c (pthread_functions): Initialize ptr_nthreads.
7200         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
7201         (__reclaim_stacks): Decrement __nptl_nthreads.
7202         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
7203         Define.
7204         * Makefile (tests): Add tst-basic3.
7205         * tst-basic3.c: New file.
7207         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
7208         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
7209         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
7210         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
7211         if asynchronous canceling is enabled.
7212         * pthread_join.c (pthread_join): When recognizing circular joins,
7213         take into account the other thread might be already canceled.
7214         * Makefile (tests): Add tst-join5.
7215         * tst-join5.c: New file.
7217         * Makefile (tests): Add tst-join4.
7218         * tst-join4.c: New file.
7220 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
7222         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
7224 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
7226         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
7227         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
7228         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
7229         warning.
7230         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
7231         to avoid warning.
7232         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
7233         error if lll_futex_wake failed.
7235 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
7237         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
7238         handling of cancellation and failung pthread_mutex_unlock call.
7239         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7240         * Makefile (tests): Add tst-cond8 and tst-cond9.
7241         * tst-cond8.c: New file.
7242         * tst-cond9.c: New file.
7244         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
7246         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
7247         non-standard initializers with __USE_GNU.
7249         * Makefile (tests): Add tst-cleanup3.
7250         * tst-cleanup3.c: New file.
7252 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
7254         * Makefile (tests): Add tst-attr1 and tst-attr2.
7255         * tst-attr1.c: New file.
7256         * tst-attr2.c: New file.
7258         * Makefile: Add rules to build and run tst-atfork2 test.
7259         * tst-atfork2.c: New file.
7260         * tst-atfork2mod.c: New file.
7262         * sysdeps/unix/sysv/linux/unregister-atfork.c
7263         (__unregister_atfork): Free the memory allocated for the handlers
7264         after removing them from the lists.
7266         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
7267         cleanup function.
7269         * tst-atfork1.c (do_test): Wait for the child we forked.
7270         Report error in child.
7272         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
7274         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
7276 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
7278         * Makefile (tests): Add tst-cancel8.
7279         * tst-cancel8.c: New file.
7281         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
7282         clearing of control variable.
7283         * Makefile (tests): Add tst-once3 and tst-once4.
7284         * tst-once3.c: New file.
7285         * tst-once4.c: New file.
7287 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
7289         * sysdeps/sh/Makefile: New file.
7290         * sysdeps/sh/bits/atomic.h: New file.
7291         * sysdeps/sh/pthread_spin_init.c: New file.
7292         * sysdeps/sh/pthread_spin_lock.c: New file.
7293         * sysdeps/sh/pthread_spin_trylock.S: New file.
7294         * sysdeps/sh/pthread_spin_unlock.S: New file.
7295         * sysdeps/sh/pthreaddef.h: New file.
7296         * sysdeps/sh/tcb-offsets.sym: New file.
7297         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
7298         * sysdeps/sh/tls.h: New file.
7299         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
7300         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
7301         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
7302         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
7303         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
7304         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
7305         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
7306         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
7307         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
7308         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
7309         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
7310         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
7311         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
7312         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
7313         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
7314         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
7315         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
7316         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
7317         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
7318         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
7319         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
7320         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
7321         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
7322         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
7323         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
7324         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
7325         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
7326         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
7327         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
7328         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
7330 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
7332         * tst-cond2.c: Rearrange code to not rely on behavior undefined
7333         according to POSIX.
7335         * tst-basic2.c (do_test): Lock mutex before creating the thread.
7337 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
7339         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
7340         (TLS_GET_FS): New #define.
7341         (TLS_SET_FS): New #define.
7342         Correct value of __NR_set_thread_area.
7344         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
7346 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
7348         * Makefile (tests): Add tst-popen1.
7349         * tst-popen1.c: New file.
7351         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
7352         but inactive generalization.
7353         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7354         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
7355         Minor optimization, remove one instruction.
7356         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
7358 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
7360         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
7362 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
7364         * init.c (__NR_set_tid_address): Add #ifdef for s390.
7365         * sysdeps/pthread/pthread_barrier_wait.c: New file.
7366         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
7367         * sysdeps/pthread/pthread_cond_signal.c: New file.
7368         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
7369         * sysdeps/pthread/pthread_cond_wait.c: New file.
7370         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
7371         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
7372         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
7373         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
7374         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
7375         * sysdeps/s390/Makefile: New file.
7376         * sysdeps/s390/bits/atomic.h: New file.
7377         * sysdeps/s390/pthread_spin_init.c: New file.
7378         * sysdeps/s390/pthread_spin_lock.c: New file.
7379         * sysdeps/s390/pthread_spin_trylock.c: New file.
7380         * sysdeps/s390/pthread_spin_unlock.c: New file.
7381         * sysdeps/s390/pthreaddef.h: New file.
7382         * sysdeps/s390/tcb-offsets.sym: New file.
7383         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
7384         * sysdeps/s390/tls.h: New file.
7385         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
7386         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
7387         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
7388         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
7389         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
7390         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
7391         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
7392         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
7393         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
7394         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
7395         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
7396         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
7397         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
7398         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
7399         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
7400         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
7401         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
7402         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
7403         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
7404         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
7405         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
7406         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
7407         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
7409 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
7411         * atomic.h: Add a couple more default implementations.
7412         (atomic_compare_and_exchange_acq): Use
7413         __arch_compare_and_exchange_32_acq in return value definition.  It
7414         always exists.
7415         (atomic_bit_set): Renamed from atomic_set_bit.
7416         Add missing atomic_ prefixes.
7418         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
7419         thread library is available, use correct value to mark initialized
7420         once variable.
7422 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
7424         * allocatestack.c (allocate_stack): Use __getpagesize instead of
7425         __sysconf to determine pagesize.
7427         * pthread_create.c: Include <atomic.h>.
7428         * allocatestack.c (allocate_stack): Implement coloring of the
7429         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
7430         size minus one.  Adjust users.
7431         * sysdeps/i386/i686/Makefile: New file.
7433 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
7435         * allocatestack.c: Improve comment throughout the file.
7437         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
7438         (__lll_lock_wait): Add branch prediction.
7439         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
7440         (__lll_lock_wait): Likewise.
7441         (lll_unlock_wake_cb): Removed.
7443 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
7445         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
7446         _POSIX_THREAD_PRIORITY_SCHEDULING.
7448 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
7450         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
7451         Fix return type of ptr___pthread_getspecific.
7453 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
7455         * Makefile (tests): Add tst-umask1.
7456         (tst-umask1-ARGS): Define.
7457         * tst-umask1.c: New file.
7459 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
7461         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
7462         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
7463         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
7464         pthread_rwlock_unlock.
7465         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
7466         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
7467         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
7468         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
7469         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7470         New file.
7471         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
7472         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7473         New file.
7474         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
7475         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
7476         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
7477         New file.
7478         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
7479         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
7480         New file.
7481         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
7482         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
7483         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
7484         New file.
7485         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
7486         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
7487         New file.
7488         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
7490         * Makefile (libpthread-routines): Remove lowlevelcond and
7491         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
7492         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
7493         and pthread_cond_broadcast.
7494         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
7495         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
7496         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
7497         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
7498         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
7499         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
7500         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
7501         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
7502         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
7503         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
7504         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
7505         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
7506         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
7507         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
7508         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
7509         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
7510         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
7511         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
7512         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
7513         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
7514         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
7515         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
7516         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
7517         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
7518         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
7519         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
7520         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
7521         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
7522         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
7523         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
7524         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
7526         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
7527         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
7528         of the code is moved to ...
7529         * sysdeps/pthread/createthread.c: ...here.  New file.
7531 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
7533         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
7534         (__new_sem_post): Clear %eax before returning.
7535         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
7537         * Makefile (tests): Add tst-cleanup2.
7538         * tst-cleanup2.c: New file.
7540         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
7541         Interpret first parameter correctly.
7543 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
7545         * Makefile (headers): Add bits/semaphore.h.
7547 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
7549         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
7550         if not SHARED.
7552 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
7554         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
7555         must be used and mapping failed.
7556         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
7558         * Makefile (CFLAGS-pthread_self.os): Define this, not
7559         CFLAGS-pthread_self.c.
7561 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
7563         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
7564         lll_unlock_wake_cb.
7566         * Makefile (libpthread-routines): Add version.  Add rules to build
7567         version.os and banner.h.
7568         * version.c: New file.
7570 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
7572         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
7573         the alias unconditional.
7574         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
7576 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
7578         * Makefile (CFLAGS-pthread_self.c): New definition.
7580 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
7582         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
7583         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
7584         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
7585         * init.c (__pthread_initialize_minimal_internal): Likewise.
7587 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
7589         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
7591         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
7592         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
7593         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
7594         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
7595         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
7596         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
7598 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
7600         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
7601         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
7602         * tst-cancel-wrappers.sh: Remove all exceptions.
7604 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
7606         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
7607         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
7609         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
7610         Use __libc_pthread_functions array if SHARED.
7612         * pthreadP.h: Move pthread_cond_2_0_t definition to...
7613         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
7615         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
7616         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
7617         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
7618         __libc_ptf_call instead of __libc_maybe_call.
7619         (PTF): New #define.
7620         (__libc_cleanup_region_start): Wrap function name with PTF call.
7621         (__libc_cleanup_region_end): Likewise.
7622         (__libc_cleanup_end): Likewise.
7624         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
7625         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
7626         * pthread_key_create.c: Add __pthread_key_create_internal alias.
7627         * pthreadP.h: Add prototypes.
7629         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
7630         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
7631         __pthread_rwlock_unlock aliases.
7632         * pthreadP.h: Add prototypes for new aliases.
7634         * pthreadP.h (struct pthead_functions): Moved to...
7635         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
7636         * init.c (pthread_functions): Add initializers for new elements.
7638         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
7639         __pthread_cleanup_pop_restore aliases.
7640         * pthreadP.h: Add prototypes.
7642         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
7643         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
7644         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
7645         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
7646         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
7647         * pthreadP.h: Adjust prototypes and callers.
7649 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
7651         * Makefile (tests): Add tst-cancel7.
7652         (tst-cancel7-ARGS): New variable.
7653         * tst-cancel7.c: New file.
7655         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
7656         around gcc defficiencies.
7657         * old_pthread_cond_signal.c: Likewise.
7658         * old_pthread_cond_timedwait.c: Likewise.
7659         * old_pthread_cond_wait.c: Likewise.
7661         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
7663 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
7665         * Makefile (tests): Add tst-cond7.
7666         * tst-cond7.c: New file.
7668         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
7669         (condvar_cleanup): Get condvar address from the right place.
7671         * atomic.h: Correct definitions of atomic_full_barrier,
7672         atomic_read_barrier, atomic_write_barrier.
7674         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
7675         race-free.
7676         * old_pthread_cond_signal.c: Likewise.
7677         * old_pthread_cond_timedwait.c: Likewise.
7678         * old_pthread_cond_wait.c: Likewise.
7680 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
7682         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
7684 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
7686         * pthreadP.h (pthread_cond_2_0_t): New type.
7687         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
7688         Use new type for the 2.0 condvar function prototypes.
7689         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
7690         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
7691         parameter.
7692         * old_pthread_cond_destroy.c: Likewise.
7693         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
7694         * old_pthread_cond_signal.c: Likewise.
7695         * old_pthread_cond_timedwait.c: Likewise.
7696         * old_pthread_cond_wait.c: Likewise.
7698         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
7699         (__pthread_cond_wait): Don't save cancellation mode and seq value
7700         in same location.
7702         * herrno.c (__h_errno_location): Don't define as weak.
7704 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
7706         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
7707         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
7708         and pthread_cond_wait.
7709         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
7710         Renamed to...
7711         (__pthread_cond_broadcast_2_0): ... this.
7712         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
7713         Renamed to...
7714         (__pthread_cond_destroy_2_0): ... this.
7715         * old_pthread_cond_init.c (__old_pthread_cond_init):
7716         Renamed to...
7717         (__pthread_cond_init_2_0): ... this.
7718         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
7719         Renamed to...
7720         (__pthread_cond_signal_2_0): ... this.
7721         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
7722         Renamed to...
7723         (__pthread_cond_wait_2_0): ... this.
7724         * pthread_cond_destroy.c: Include shlib-compat.h.
7725         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
7726         * pthread_cond_init.c: Include shlib-compat.h.
7727         (pthread_cond_init): Change strong_alias into versioned_symbol.
7728         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
7729         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
7730         fields.
7731         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
7732         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
7733         __pthread_cond_wait_2_0): New prototypes.
7734         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
7735         __old_pthread_cond_init, __old_pthread_cond_signal,
7736         __old_pthread_cond_wait): Removed.
7737         * init.c: Include shlib-compat.h.
7738         (pthread_functions): Guard ptr___pthread_attr_init_2_0
7739         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
7740         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
7741         ptr___pthread_cond_*_2_0 fields.
7742         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
7743         pthread_cond_*@GLIBC_2.0 compatibility symbols.
7745         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
7746         LIBC_SIGACTION was not yet defined.
7747         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
7748         [!defined LIBC_SIGACTION] (__sigaction): New function and
7749         libc_hidden_weak.
7750         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
7751         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
7753 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
7755         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
7757 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
7759         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
7760         New, larger type definition.
7761         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
7762         implementation.
7763         * Versions [libpthread]: Add definitions for new pthread_cond_*
7764         interfaces for version GLIBC_2.3.2.
7765         * pthread_cond_init.c: Update initialization for new type definition.
7766         * Makefile (libpthread-routines): Remove pthread_cond_wait,
7767         pthread_cond_timedwait, pthread_cond_signal, and
7768         pthread_cond_broadcast.  Add old_pthread_cond_init,
7769         old_pthread_cond_destroy, old_pthread_cond_wait,
7770         old_pthread_cond_timedwait, old_pthread_cond_signal, and
7771         old_pthread_cond_broadcast.
7772         * old_pthread_cond_broadcast.c: New file.
7773         * old_pthread_cond_destroy.c: New file.
7774         * old_pthread_cond_init.c: New file.
7775         * old_pthread_cond_signal.c: New file.
7776         * old_pthread_cond_timedwait.c: New file.
7777         * old_pthread_cond_wait.c: New file.
7778         * pthreadP.h: Add prototypes for the compatibility interfaces.
7780         * pthread_cond_destroy.c: Don't include <errno.h>.
7782 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
7784         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
7785         unnecessary zero offset when addressing MUTEX.
7787 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
7789         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
7790         __register_atfork.
7791         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
7792         for __register_atfork.
7794 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
7796         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
7797         instead of ASSEMBLER test macro.
7799         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
7800         __libc_current_sigrtmax): Add libc_hidden_def.
7802         * sysdeps/pthread/list.h: Remove assert.h include.
7804 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
7806         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
7807         __pthread_initialize_minimal_internal not
7808         __pthread_initialize_minimal.
7810 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
7812         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
7813         __pthread_initialize_minimal as hidden.
7815         * init.c (__pthread_initialize_minimal_internal): Don't mark as
7816         constructor.
7818 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
7820         * Makefile ($(inst_libdir)/libpthread.so): Depend on
7821         $(common-objpfx)format.lds, include that into the output script.
7822         Fix comment.
7823         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
7825 2002-12-28  Andreas Jaeger  <aj@suse.de>
7827         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
7828         nsec resolution changes.
7829         (xstat64_conv): Likewise.
7830         (xstat32_conv): Likewise.
7831         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
7832         struct kernel_stat.
7833         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
7834         structs stat and stat64.
7835         * time/time.h (__timespec_defined): Define for __USE_MISC.
7836         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
7838 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
7840         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
7841         argument.
7842         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
7843         (pthread_exit): Use strong_alias to avoid warnings.
7844         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
7845         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
7846         ptr___pthread_attr_init_2_*.
7847         * init.c (pthread_functions): Adjust.
7849 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
7851         * forward.c: Make all functions available by default again.  It
7852         caused too much trouble.
7854         * pt-siglongjmp.c: Removed.
7856 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
7858         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
7859         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
7860         * sysdeps/i386/Makefile: New file.
7861         * sysdeps/i386/tcb-offsets.sym: New file.
7862         * sysdeps/pthread/tcb-offsets.h: New file.
7863         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
7864         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
7866         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
7867         __register_atfork...
7868         (GLIBC_2.3.2): ...here.
7870 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
7872         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
7873         pthread_attr_setstackaddr with __attribute_deprecated__.
7875 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
7877         * pt-system.c (system): Remove cancellation handling.
7878         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
7879         cancellation routines.
7881 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
7883         * descr.h: Include <dl-sysdep.h>.
7884         (struct pthread): Move header.data.list to the back of the struct.
7885         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
7886         (MULTIPLE_THREADS_OFFSET): Adjust offset.
7887         (SYSINFO_OFFSEET): Likewise.
7889 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
7891         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
7892         Define.
7893         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
7894         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
7895         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
7896         (USE_DL_SYSINFO): Undef.
7898 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
7900         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
7901         $(common-objpfx)libc.so.
7902         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
7903         it is bigger than pipe buffer size even on arches with bigger
7904         page size.
7905         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
7907 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
7909         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
7910         correct errno access for case that USE___THREAD is not defined.
7912 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
7914         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
7915         Patch by Marijn Ros <marijn@mad.scientist.com>.
7917 2002-12-22  Roland McGrath  <roland@redhat.com>
7919         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
7921 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
7923         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
7925 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
7927         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
7928         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
7929         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
7931         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
7932         of int $0x80.
7933         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
7934         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
7935         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
7936         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
7937         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
7938         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
7939         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
7940         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
7942         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
7943         sysenter.
7944         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
7946         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
7948         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
7949         in new TCB.
7950         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
7951         that sysinfo is properly initialized.
7952         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
7953         to 1 only for ld.so.
7955         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
7956         RTLD_CORRECT_DYNAMIC_WEAK.
7958 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
7960         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
7961         Use return 0 as 6th argument to FORWARD4.
7962         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
7964 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
7966         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
7967         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
7968         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
7969         (INIT_SYSINFO): New #define.
7970         (TLS_TP_INIT): Use INIT_SYSINFO.
7971         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
7972         At test to make sure SYSINFO_OFFSET value is correct.
7973         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
7975 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
7977         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
7978         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
7979         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
7980         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
7981         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
7982         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
7983         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
7985 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
7987         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
7988         macro instead of using int $0x80 directly.
7990         * sysdeps/pthread/bits/stdio-lock.h: New file.
7991         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
7992         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
7993         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
7994         * Makefile (routines): Add libc-lowlevelmutex.
7996         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
7997         __i686.get_pc_thunk.dx.
7999 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
8001         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
8002         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
8003         ($(objpfx)tst-cancel-wrappers.out): New rule.
8004         * tst-cancel-wrappers.sh: New test.
8005         * tst-locale1.c: Include signal.h.
8006         (uselocale): Test static linking of __libc_current_sigrt*.
8008 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
8010         * Makefile (tests): Add tst-cancel6.
8011         * tst-cancel6.c: New file
8013 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
8015         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
8016         Define meaningfully for assembler as well.
8017         * pthreadP.h (struct pthread_functions): Remove
8018         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
8019         and ptr_pthread_attr_init_2_1 fields.
8020         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
8021         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
8022         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
8023         (FORWARD3): Define using FORWARD4.
8024         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
8025         versions.
8026         * pt-system.c: Remove duplicate stdlib.h include.
8028 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
8030         * sem_init.c: Define sem_init@GLIBC_2.0.
8031         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
8032         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
8034         * flockfile.c: Moved to...
8035         * sysdeps/pthread/flockfile.c: ...here.  New file.
8036         * funlockfile.c: Moved to...
8037         * sysdeps/pthread/funlockfile.c: ...here.  New file.
8038         * ftrylockfile.c: Moved to...
8039         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
8041 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
8043         * libc-cancellation.c: Guard both function with
8044         #if !defined NOT_IN_libc.
8045         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
8046         automatically provided pthread wrappers.
8047         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
8048         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
8049         nor in libpthread.
8050         * pt-open.c: Removed.
8051         * pt-fcntl.c: Removed.
8052         * pt-fsync.c: Removed.
8053         * pt-lseek.c: Removed.
8054         * pt-msgrcv.c: Removed.
8055         * pt-msgsnd.c: Removed.
8056         * pt-msync.c: Removed.
8057         * pt-nanosleep.c: Removed.
8058         * pt-open64.c: Removed.
8059         * pt-pause.c: Removed.
8060         * pt-pread.c: Removed.
8061         * pt-pread64.c: Removed.
8062         * pt-pwrite.c: Removed.
8063         * pt-pwrite64.c: Removed.
8064         * pt-read.c: Removed.
8065         * pt-recv.c: Removed.
8066         * pt-recvfrom.c: Removed.
8067         * pt-recvmsg.c: Removed.
8068         * pt-send.c: Removed.
8069         * pt-sendto.c: Removed.
8070         * pt-sigtimedwait.c: Removed.
8071         * pt-sigwait.c: Removed.
8072         * pt-wait.c: Removed.
8073         * pt-waitpid.c: Removed.
8074         * pt-write.c: Removed.
8075         * pt-accept.c: Removed.
8076         * pt-close.c: Removed.
8077         * pt-connect.c: Removed.
8078         * pt-lseek64.c: Removed.
8079         * pt-sendmsg.c: Removed.
8080         * pt-tcdrain.c: Removed.
8082 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
8084         * init.c (__pthread_initialize_minimal_internal): Renamed from
8085         __pthread_initialize_minimal.  Make old name an alias.  This
8086         converts a normal relocation into a relative relocation.
8088         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
8090         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
8091         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
8092         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
8093         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
8094         pt-sigwaitinfo, pt-waitid, and pt-writev.
8095         * pt-creat.c: Removed.
8096         * pt-poll.c: Removed.
8097         * pt-pselect.c: Removed.
8098         * pt-readv.c: Removed.
8099         * pt-select.c: Removed.
8100         * pt-sigpause.c: Removed.
8101         * pt-sigsuspend.c: Removed.
8102         * pt-sigwaitinfo.c: Removed.
8103         * pt-waitid.c: Removed.
8104         * pt-writev.c: Removed.
8106         * init.c (pthread_functions): New variable.
8107         (__pthread_initialize_minimal): Pass pointer to pthread_functions
8108         (or NULL) to __libc_pthread_init.
8109         * forward.c: Rewrite to use __libc:pthread_functions array to get
8110         function addresses.
8111         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
8112         prototype.
8113         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
8114         Take new parameter.  Copy content of variable pointed to by it
8115         to __libc_pthread_init.
8117         * pthreadP.h (struct pthread_functions): New type.
8118         (__libc_pthread_init): Declare.
8120         * pthread_attr_destroy.c: Add namespace protected alias.
8121         * pthread_attr_getdetachstate.c: Likewise.
8122         * pthread_attr_getinheritsched.c: Likewise.
8123         * pthread_attr_getschedparam.c: Likewise.
8124         * pthread_attr_getschedpolicy.c: Likewise.
8125         * pthread_attr_getscope.c: Likewise.
8126         * pthread_attr_setdetachstate.c: Likewise.
8127         * pthread_attr_setinheritsched.c: Likewise.
8128         * pthread_attr_setschedparam.c: Likewise.
8129         * pthread_attr_setschedpolicy.c: Likewise.
8130         * pthread_attr_setscope.c: Likewise.
8131         * pthread_cond_broadcast.c: Likewise.
8132         * pthread_cond_destroy.c: Likewise.
8133         * pthread_cond_init.c: Likewise.
8134         * pthread_cond_signal.c: Likewise.
8135         * pthread_cond_wait.c: Likewise.
8136         * pthread_condattr_destroy.c: Likewise.
8137         * pthread_condattr_init.c: Likewise.
8138         * pthread_equal.c: Likewise.
8139         * pthread_exit.c: Likewise.
8140         * pthread_getschedparam.c: Likewise.
8141         * pthread_self.c: Likewise.
8142         * pthread_setcancelstate.c: Likewise.
8143         * pthread_setschedparam.c: Likewise.
8144         * pthread_mutex_destroy.c: Likewise.
8145         * pthread_mutex_init.c: Likewise.
8146         * pthreadP.h: Add prototypes for the aliases.
8148         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
8149         multiple_threads member in correct TCB to 1.
8151         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
8152         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
8153         member of thread decriptor, otherwise return unconditionally 1.
8155 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
8157         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
8158         regular Linux version.  Remove file.
8159         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
8160         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
8161         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
8162         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
8163         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
8164         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
8165         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
8166         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
8167         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
8168         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
8169         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
8170         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
8171         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
8172         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
8173         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
8174         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
8175         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
8176         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
8177         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
8178         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
8179         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
8180         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
8181         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
8182         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
8183         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
8184         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
8185         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
8186         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
8187         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
8188         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
8190 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
8192         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
8193         * sysdeps/unix/sysv/linux/open.c: Removed.
8194         * sysdeps/unix/sysv/linux/fsync.c: Removed.
8195         * sysdeps/unix/sysv/linux/lseek.c: Removed.
8196         * sysdeps/unix/sysv/linux/msync.c: Removed.
8197         * sysdeps/unix/sysv/linux/read.c: Removed.
8198         * sysdeps/unix/sysv/linux/close.c: Removed.
8199         * sysdeps/unix/sysv/linux/creat.c: Removed.
8200         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
8201         * sysdeps/unix/sysv/linux/pause.c: Removed.
8202         * sysdeps/unix/sysv/linux/select.c: Removed.
8203         * sysdeps/unix/sysv/linux/write.c: Removed.
8205 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
8207         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
8208         element in TCB to see whether locking is needed.
8210         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
8211         MULTIPLE_THREADS_OFFSET value is correct.
8213         * sysdeps/unix/sysv/linux/close.c: New file.
8214         * sysdeps/unix/sysv/linux/connect.S: New file.
8215         * sysdeps/unix/sysv/linux/creat.c: New file.
8216         * sysdeps/unix/sysv/linux/fsync.c: New file.
8217         * sysdeps/unix/sysv/linux/llseek.c: New file.
8218         * sysdeps/unix/sysv/linux/lseek.c: New file.
8219         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
8220         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
8221         * sysdeps/unix/sysv/linux/msync.c: New file.
8222         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
8223         * sysdeps/unix/sysv/linux/open.c: New file.
8224         * sysdeps/unix/sysv/linux/open64.c: New file.
8225         * sysdeps/unix/sysv/linux/pause.c: New file.
8226         * sysdeps/unix/sysv/linux/poll.c: New file.
8227         * sysdeps/unix/sysv/linux/pread.c: New file.
8228         * sysdeps/unix/sysv/linux/pread64.c: New file.
8229         * sysdeps/unix/sysv/linux/pselect.c: New file.
8230         * sysdeps/unix/sysv/linux/pwrite.c: New file.
8231         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
8232         * sysdeps/unix/sysv/linux/readv.c: New file.
8233         * sysdeps/unix/sysv/linux/recv.S: New file.
8234         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
8235         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
8236         * sysdeps/unix/sysv/linux/select.c: New file.
8237         * sysdeps/unix/sysv/linux/send.S: New file.
8238         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
8239         * sysdeps/unix/sysv/linux/sendto.S: New file.
8240         * sysdeps/unix/sysv/linux/sigpause.c: New file.
8241         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
8242         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
8243         * sysdeps/unix/sysv/linux/sigwait.c: New file.
8244         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
8245         * sysdeps/unix/sysv/linux/system.c: New file.
8246         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
8247         * sysdeps/unix/sysv/linux/wait.c: New file.
8248         * sysdeps/unix/sysv/linux/waitid.c: New file.
8249         * sysdeps/unix/sysv/linux/waitpid.c: New file.
8250         * sysdeps/unix/sysv/linux/writev.c: New file.
8251         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
8253         * pt-readv.c: Fix comment.
8255 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
8257         * tst-cleanup1.c: Include stdlib.h.
8259         * tst-cancel5.c: New test.
8260         * Makefile (tests): Add tst-cancel5.
8261         (tst-cancel5): Link against libc.so libpthread.so in that order.
8263 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
8265         * forward.c (test_loaded): Prevent recursive calls.
8267         * Makefile (routines): Add libc-cancellation.
8268         * libc-cancellation.c: New file.
8269         * descr.h (struct pthread): Add multiple_threads field.
8270         * allocatestack.c (allocate_stack): Initialize multiple_header field of
8271         new thread descriptor to 1.
8272         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
8273         Initialize multiple_thread field after successful thread creation.
8274         * cancellation.c (__do_cancel): Move to pthreadP.h.
8275         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
8276         (__pthread_disable_asynccancel): Add internal_function attribute.
8277         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
8278         * pthread_setcancelstate.c: Likewise.
8279         * pthread_setcanceltype.c: Likewise.
8280         * pthread_exit.c: Likewise.
8281         * pthreadP.h (CANCELLATION_P): Likewise.
8282         (__do_cancel): Define as static inline.
8283         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
8284         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
8285         declarations.
8286         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
8287         fields.  Define MULTIPLE_THREADS_OFFSET.
8288         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
8289         declaration.
8290         * sysdeps/unix/sysv/linux/accept.S: New file.
8291         * sysdeps/unix/sysv/linux/read.c: New file.
8292         * sysdeps/unix/sysv/linux/write.c: New file.
8293         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
8294         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
8295         initialization of __libc_locking_needed.
8296         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
8297         __libc_locking_needed, use multiple_threads field in TCB.
8298         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
8300 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
8302         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
8303         version.
8304         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
8306         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
8307         access to __libc_locking_needed for PIC.
8309 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
8311         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
8312         declare for libc.so.
8313         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
8314         expression.
8315         (__libc_lock_lock): Put into statement expression.
8316         (__libc_lock_unlock): Remove trailing semicolon.
8317         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
8319 2002-12-12  Roland McGrath  <roland@redhat.com>
8321         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
8322         "m" constraint to refer to __libc_locking_needed.  Declare it here.
8324 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
8326         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
8327         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
8328         Initialize __libc_locking_needed.
8329         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
8330         instead of __register_pthread_fork_handler.
8331         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
8332         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
8333         fork-gen with libc_pthread_init.
8334         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
8335         of __register_pthread_fork_handler.
8336         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
8337         of __register_pthread_fork_handler.
8338         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
8339         __libc_locking_needed to determine whether lock prefix can be avoided.
8340         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
8342 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
8344         * Makefile (tests): Add tst-cleanup1.
8345         * tst-cleanup1.c: New file.
8346         * cancellation.c (__cleanup_thread): Removed.
8347         (__do_cancel): Remove call to __cleanup_thread.
8348         * pthreadP.h: Remove __cleanup_thread prorotype.
8350         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
8351         Remember function and argument even if cancellation handler
8352         function is not available.
8353         (__libc_cleanup_region_end): Execute registered function directly if
8354         pthread functions are not available.
8355         (__libc_cleanup_end): Likewise.
8357         * init.c (__pthread_initialize_minimal): Fix initialization in
8358         static lib by preventing gcc from being too clever.
8360 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
8362         * init.c (__pthread_initialize_minimal): Remove unneccesary
8363         sigaddset call.
8365         * Makefile (tests): We can run tst-locale2 now.
8367 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
8369         * Versions: Remove duplicated sigwait entry.
8371 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
8373         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
8374         inside libpthread.
8376         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
8378         * pthreadP.h: Declare __pthread_enable_asynccancel and
8379         __pthread_disable_asynccancel.
8380         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
8381         (CANCEL_RESET): Use __pthread_disable_asynccancel.
8382         * cancellation.c (__pthread_enable_asynccancel): New function.
8383         (__pthread_disable_asynccancel): New function.
8384         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
8385         * pt-close.c: Likewise.
8386         * pt-connect.c: Likewise.
8387         * pt-creat.c: Likewise.
8388         * pt-fcntl.c: Likewise.
8389         * pt-fsync.c: Likewise.
8390         * pt-lseek.c: Likewise.
8391         * pt-lseek64.c: Likewise.
8392         * pt-msgrcv.c: Likewise.
8393         * pt-msgsnd.c: Likewise.
8394         * pt-msync.c: Likewise.
8395         * pt-nanosleep.c: Likewise.
8396         * pt-open.c: Likewise.
8397         * pt-open64.c: Likewise.
8398         * pt-pause.c: Likewise.
8399         * pt-poll.c: Likewise.
8400         * pt-pread.c: Likewise.
8401         * pt-pread64.c: Likewise.
8402         * pt-pselect.c: Likewise.
8403         * pt-pwrite.c: Likewise.
8404         * pt-pwrite64.c: Likewise.
8405         * pt-read.c: Likewise.
8406         * pt-readv.c: Likewise.
8407         * pt-recv.c: Likewise.
8408         * pt-recvfrom.c: Likewise.
8409         * pt-recvmsg.c: Likewise.
8410         * pt-select.c: Likewise.
8411         * pt-send.c: Likewise.
8412         * pt-sendmsg.c: Likewise.
8413         * pt-sendto.c: Likewise.
8414         * pt-sigpause.c: Likewise.
8415         * pt-sigsuspend.c: Likewise.
8416         * pt-sigtimedwait.c: Likewise.
8417         * pt-sigwait.c: Likewise.
8418         * pt-sigwaitinfo.c: Likewise.
8419         * pt-system.c: Likewise.
8420         * pt-tcdrain.c: Likewise.
8421         * pt-wait.c: Likewise.
8422         * pt-waitid.c: Likewise.
8423         * pt-waitpid.c: Likewise.
8424         * pt-write.c: Likewise.
8425         * pt-writev.c: Likewise.
8426         * pthread_join.c: Likewise.
8427         * pthread_timedjoin.c: Likewise.
8429         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
8430         (__xpg_sigpause): New function.
8431         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
8433 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
8435         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
8437         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
8438         _GI_pthread_cleanup_pop to pthreadP.h.
8440         * ftrylockfile.c: Use _IO_lock_trylock instead of
8441         pthread_mutex_trylock.
8443         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
8444         (CANCEL_RESET): Likewise.
8445         (__pthread_setcanceltype_): Declare.
8446         (__pthread_mutex_lock_internal): Declare.
8447         (__pthread_mutex_unlock_internal): Declare.
8448         (__pthread_once_internal): Declare.
8449         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
8450         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
8452         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
8453         and pthread_mutex_unlock.
8454         * pthread_cond_wait.c: Likewise.
8455         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
8456         * pthread_mutex_unlock.c: Likewise.
8458         * pthread_setcanceltype.c: Add additional alias
8459         __pthread_setcanceltype.
8461         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
8462         * sem_open.c (sem_open): Likewise.
8463         Use __libc_open, __libc_write, and __libc_close instead of
8464         open, write, and close respectively.
8466         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
8467         Rewrite as statement expression since it must return a value.
8469         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
8470         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
8471         __pthread_kill.
8473         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
8474         alias __pthread_once_internal.
8476         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
8478 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
8480         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
8481         * tst-stdio1.c: New file.
8482         * tst-stdio2.c: New file.
8484         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
8486         * Makefile (tests): Comment out tst-locale2 for now.
8487         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
8489         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
8490         -D_IO_MTSAFE_IO.
8491         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
8492         Use _IO_lock_init instead of explicit assignment.
8494         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
8495         Define __libc_lock_* and __libc_lock_recursive macros with
8496         lowlevellock macros, not pthread mutexes.
8498         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
8499         of pthread_mutex_lock.
8500         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
8501         instead of pthread_mutex_unlock.
8503 2002-12-06  Roland McGrath  <roland@redhat.com>
8505         * allocatestack.c (__stack_user): Use uninitialized defn.
8506         * init.c (__pthread_initialize_minimal): Initialize it here.
8508 2002-12-05  Roland McGrath  <roland@redhat.com>
8510         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
8511         string.
8512         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
8514         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
8515         missing & here too.
8517 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
8519         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
8520         lowlevellock.
8521         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
8522         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
8523         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
8524         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
8525         for __libc_lock_* macros.
8526         * Makefile (routines): Add libc-lowlevellock.
8528 2002-10-09  Roland McGrath  <roland@redhat.com>
8530         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
8531         Under [__PIC__], call the function via the pointer fetched for
8532         comparison rather than a call by name that uses the PLT.
8533         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
8534         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
8535         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
8536         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
8537         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
8539 2002-12-04  Roland McGrath  <roland@redhat.com>
8541         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
8543         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
8544         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
8546         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
8548 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
8550         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
8551         a completely opaque, non-integer type.
8552         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
8554 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
8556         * sysdeps/i386/tls.h: Include stdlib.h.
8557         * sysdeps/x86_64/tls.h: Likewise.
8559 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
8561         * Makefile (tests): Add tst-locale2.
8562         (tests-static): Likewise.
8563         * tst-locale2.c: New file.
8565         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
8566         volatile and add memory clobbers to lock operations.
8568 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
8570         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
8571         * sysdeps/i386/i486/bits/atomic.h: New file.
8572         * sysdeps/i386/i586/bits/atomic.h: New file.
8573         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
8574         include i486 version.
8575         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
8576         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
8577         Patch by Marijn Ros <marijn@mad.scientist.com>.
8579         * allocatestack.c (get_cached_stack): Don't crash if we first
8580         found a stack with a larger size then needed.
8581         Reported by Hui Huang <hui.huang@sun.com>.
8583         * Makefile (tests): Add tst-sysconf.
8584         * tst-sysconf.c: New file.
8586         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
8587         PTHREAD_THREADS_MAX.
8589 2002-12-02  Roland McGrath  <roland@redhat.com>
8591         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
8592         Declare using hidden_proto instead of attribute_hidden, so there are
8593         non-.hidden static symbols for gdb to find.
8594         (__pthread_keys): Likewise.
8595         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
8596         * allocatestack.c (__stack_user): Likewise.
8597         * pthread_create.c (__pthread_keys): Likewise.
8598         (__nptl_threads_events, __nptl_last_event): Make these static instead
8599         of hidden.
8600         * pthread_key_create.c (__pthread_pthread_keys_max,
8601         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
8603 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
8605         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
8606         statically.
8607         * tst-locale1.c: New file.
8609         * pthread_cond_timedwait.c: Include <stdlib.h>.
8611         * Makefile (tests): Add tst-fork2 and tst-fork3.
8612         * tst-fork2.c: New file.
8613         * tst-fork3.c: New file.
8615 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
8617         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
8619         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
8620         require it to 200112L.
8622         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
8623         instruction only if HAVE_CMOV is defined.
8624         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
8626         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
8628         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
8630         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
8632         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
8634 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
8636         * sysdeps/x86_64/bits/atomic.h: New file.
8638         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
8639         16-bit operations.
8641         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
8642         possible since gettid cannot fail.
8644         * sysdeps/x86_64/pthreaddef.h: New file.
8646         * sysdeps/i386/pthreaddef.h (gettid): Removed.
8648         * sysdeps/x86_64/pthread_spin_init.c: New file.
8649         * sysdeps/x86_64/pthread_spin_lock.c: New file.
8650         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
8651         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
8653         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
8654         Add missing lock prefix.  Minute optimization.
8656         * tst-spin2.c (main): Also check successful trylock call.
8658         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
8659         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
8661         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
8662         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
8664         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
8665         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
8666         value in case of an error.  Add support for INTERNAL_SYSCALL.
8668         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
8669         value in case of an error.
8671         * sysdeps/x86_64/tls.h: New file.
8673 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
8675         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
8676         takes the array member name and the index as parameters.
8677         (THREAD_SETMEM_NC): Likewise.
8678         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
8679         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
8680         interfaces.
8682         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
8683         to decide which code to use.
8684         (THREAD_SETMEM_NC): Likewise.
8686         * allocatestack.c (queue_stack): Don't remove stack from list here.
8687         Do it in the caller.  Correct condition to prematurely terminate
8688         loop to free stacks.
8689         (__deallocate_stack): Remove stack from list here.
8691 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
8693         * Makefile (tests): Add tst-stack1.
8694         * tst-stack1.c: New file.
8696         * allocatestack.c (allocate_stack): Initialize the TCB on a user
8697         provided stack.
8699         * pthread_attr_getstack.c: Return bottom of the thread area.
8701 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
8703         * Makefile (libpthread-routines): Add pt-allocrtsig and
8704         pthread_kill_other_threads.
8705         * pt-allocrtsig.c: New file.
8706         * pthread_kill_other_threads.c: New file.
8707         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
8708         all three functions.
8709         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
8710         allocrtsig.
8711         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
8712         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
8713         and __libc_allocate_rtsig_private.
8714         * Versions (libpthread): Export pthread_kill_other_threads_np,
8715         __libc_current_sigrtmin, and __libc_current_sigrtmax.
8717 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
8719         * allocatestack.c (allocate_stack): stackaddr in attribute points to
8720         the end of the stack.  Adjust computations.
8721         When mprotect call fails dequeue stack and free it.
8722         * pthread_attr_setstack.c: Store top of the stack in stackaddr
8723         attribute.
8724         * pthread_getattr_np.c: Likewise.
8726         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
8727         surprises.
8729 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
8731         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
8732         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
8734 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
8736         * pthread_getspecific.c: Optimize access to first 2nd-level array.
8737         * pthread_setspecific.c: Likewise.
8739 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
8741         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
8742         definitions.  Get them from the official place.
8743         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
8745         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
8746         Use new CLONE_ flags in clone() calls.
8748         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
8749         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
8751         * Versions: Add pthread_* functions for libc.
8752         * forward.c: New file.
8754         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
8755         errno-loc.
8756         * herrno.c: New file.
8757         * res.c: New file.
8759         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
8760         sem_trywait, and sem_timedwait.  Add herrno and res.
8761         * sem_init.c: Don't initialize lock and waiters members.
8762         * sem_open.c: Likewise.
8763         * sem_post.c: Removed.
8764         * sem_wait.c: Removed.
8765         * sem_trywait.c: Removed.
8766         * sem_timedwait.c: Removed.
8767         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
8768         Includes full implementations of sem_post, sem_wait, sem_trywait,
8769         and sem_timedwait.
8770         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
8771         for new implementation.
8772         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
8773         and waiters fields.
8775         * tst-sem3.c: Improve error message.
8776         * tst-signal3.c: Likewise.
8778         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
8779         to tell the kernel about the termination futex and to initialize tid
8780         member.  Don't initialize main_thread.
8781         * descr.h (struct pthread): Remove main_thread member.
8782         * cancelllation.c (__do_cancel): Remove code handling main thread.
8783         The main thread is not special anymore.
8785         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
8786         size of the stacks to stack_cache_actsize.
8788         * pt-readv.c: Add missing "defined".
8789         * pt-sigwait.c: Likewise.
8790         * pt-writev.c: Likewise.
8792 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
8794         * Versions: Export __connect from libpthread.
8795         Patch by Luca Barbieri <ldb@ldb.ods.org>.
8797         * Makefile (libpthread-routines): Add pt-raise.
8798         * sysdeps/unix/sysv/linux/raise.c: New file.
8799         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
8800         * sysdeps/generic/pt-raise.c: New file.
8802         * pthread_cond_init.c: Initialize all data elements of the condvar
8803         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
8805         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
8806         * pthread_create.c: Likewise.
8808         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
8809         * tst-key1.c: New file.
8810         * tst-key2.c: New file.
8811         * tst-key3.c: New file.
8813         * Versions: Export pthread_detach for version GLIBC_2.0.
8814         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
8816 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
8818         * pthread_key_create.c: Terminate search after an unused key was found.
8819         Patch by Luca Barbieri <ldb@ldb.ods.org>.
8821         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
8822         Patch by Luca Barbieri <ldb@ldb.ods.org>.
8824 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
8826         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
8827         dynamic lookup for errno in PIC.
8829         * allocatestack.c (get_cached_stack): Rearrange code slightly to
8830         release the stack lock as soon as possible.
8831         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
8832         the static TLS block.
8833         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
8835         * cancellation.c: Renamed from cancelation.c.
8836         * Makefile: Adjust accordingly.
8837         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
8838         * cleanup_defer.c: Use CANCELLATION_P.
8839         * pthread_testcancel.c: Likewise.
8840         * descr.h: Fix spelling in comments.
8841         * init.c: Likewise.
8842         * pthread_getattr_np.c: Likewise.
8843         * pthread_getschedparam.c: Likewise.
8844         * pthread_setschedparam.c: Likewise.
8845         * Versions: Likewise.
8847         * pt-pselect.c: New file.
8848         * Makefile (libpthread-routines): Add pt-pselect.
8849         * Versions: Add pselect.
8851         * tst-cancel4.c: New file.
8852         * Makefile (tests): Add tst-cancel4.
8854 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
8856         * pthread_mutex_lock.c: Always record lock ownership.
8857         * pthread_mutex_timedlock.c: Likewise.
8858         * pthread_mutex_trylock.c: Likewise.
8860         * pt-readv.c: New file.
8861         * pt-writev.c: New file.
8862         * pt-creat.c: New file.
8863         * pt-msgrcv.c: New file.
8864         * pt-msgsnd.c: New file.
8865         * pt-poll.c: New file.
8866         * pt-select.c: New file.
8867         * pt-sigpause.c: New file.
8868         * pt-sigsuspend.c: New file.
8869         * pt-sigwait.c: New file.
8870         * pt-sigwaitinfo.c: New file.
8871         * pt-waitid.c: New file.
8872         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
8873         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
8874         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
8875         * Versions: Add all the new functions.
8877         * tst-exit1.c: New file.
8878         * Makefile (tests): Add tst-exit1.
8880         * sem_timedwait.c: Minor optimization for more optimal fastpath.
8882 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
8884         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
8886         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
8887         call.  pthread_join is an official cancellation point.
8888         * pthread_timedjoin.c: Likewise.
8890         * pthread_cond_wait.c: Revert order in which internal lock are dropped
8891         and the condvar's mutex are retrieved.
8892         * pthread_cond_timedwait.c: Likewise.
8893         Reported by dice@saros.East.Sun.COM.
8895 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
8897         * pthreadP.h: Cut out all type definitions and move them...
8898         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
8899         * pthreadP.h: Include <internaltypes.h>.
8901         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
8902         performance tweaks.
8904         * sem_trywait.c: Shuffle #includes around to get right order.
8905         * sem_timedwait.c: Likewise.
8906         * sem_post.c: Likewise.
8907         * sem_wait.c: Likewise.
8909         * nptl 0.3 released.
8911         * Makefile (tests): Add tst-signal3.
8912         * tst-signal3.c: New file.
8914 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
8916         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
8917         the asms modify the sem object.
8918         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
8920         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
8921         the actual members.
8922         * pthreadP.h (struct sem): New type.  Actual semaphore type.
8923         * semaphoreP.h: Include pthreadP.h.
8924         * sem_getvalue.c: Adjust to sem_t change.
8925         * sem_init.c: Likewise.
8926         * sem_open.c: Likewise.
8927         * sem_post.c: Likewise.
8928         * sem_timedwait.c: Likewise.
8929         * sem_trywait.c: Likewise.
8930         * sem_wait.c: Likewise.
8932 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
8934         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
8935         * tst-basic2.c: New file.
8936         * tst-exec1.c: New file.
8937         * tst-exec2.c: New file.
8938         * tst-exec3.c: New file.
8940         * tst-fork1.c: Remove extra */.
8942         * nptl 0.2 released.  The API for IA-32 is complete.