Updated to fedora-glibc-20080802T0809
[glibc.git] / nptl / ChangeLog
blob7c251a2b8490708a314f3931b07cd875064a3055
1 2008-07-30  Ulrich Drepper  <drepper@redhat.com>
3         * tst-align2.c (f): Print message that f is reached.
5 2008-04-28  Hiroki Kaminaga  <kaminaga@sm.sony.co.jp>
7         [BZ #6740]
8         * sysdeps/powerpc/tcb-offsets.sym (PRIVATE_FUTEX_OFFSET): Guard symbol
9         definition with #ifndef __ASSUME_PRIVATE_FUTEX.
11 2008-07-25  Ulrich Drepper  <drepper@redhat.com>
13         * sysdeps/unix/sysv/linux/mq_notify.c (init_mq_netlink): Use
14         SOCK_CLOEXEC if possible.
16 2008-05-29  Ulrich Drepper  <drepper@redhat.com>
18         * Makefile (tests): Add tst-rwlock2a.
19         * tst-rwlock2.c: Use TYPE macro to decide what rwlock type to use.
20         * tst-rwlock2a.c: New file.
22 2008-06-12  Ulrich Drepper  <drepper@redhat.com>
24         * sysdeps/pthread/pthread.h: Remove inadvertant checkin.
26 2008-05-17  Samuel Thibault  <samuel.thibault@ens-lyon.org>
28         * sysdeps/pthread/pthread.h: Fix typo in comment.
30 2008-05-28  Ulrich Drepper  <drepper@redhat.com>
32         * sysdeps/pthread/createthread.c (do_clone): Pass accurate length
33         of CPU set to the kernel.
35 2008-05-23  Paul Pluzhnikov  <ppluzhnikov@google.com>
37         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Add
38         cfi directives.
39         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
40         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
41         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
42         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
43         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
44         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
46 2008-05-22  Paul Pluzhnikov  <ppluzhnikov@google.com>
48         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S: Add
49         cfi directives.
50         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
51         Likewise.
52         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
53         Likewise.
54         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
55         Likewise.
57 2008-05-26  Ulrich Drepper  <drepper@redhat.com>
59         * tst-typesizes.c: Explicitly check __SIZEOF_PTHREAD_* constants.
61 2008-05-20  Jakub Jelinek  <jakub@redhat.com>
63         David S. Miller  <davem@davemloft.net>
65         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
67 2008-05-10  Ulrich Drepper  <drepper@redhat.com>
69         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Access
70         __pshared correctly.
71         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
72         Likewise.
73         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
74         Likewise.
75         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
76         Likewise.
77         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
78         Likewise.
79         Reported by Clemens Kolbitsch <clemens.kol@gmx.at>.
81 2008-04-14  David S. Miller  <davem@davemloft.net>
83         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
84         (__old_sem_wait): Fix argument to lll_futex_wait().
86 2007-11-26  Daniel Jacobowitz  <dan@codesourcery.com>
88         * pthread_create.c: Require pthread_mutex_trylock and
89         pthread_key_delete for libgcc.
91 2008-04-08  Jakub Jelinek  <jakub@redhat.com>
93         [BZ #6020]
94         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h
95         (lll_futex_wake_unlock): Add private argument to the pre-v9 macro.
96         Patch by Sunil Amitkumar Janki <devel.sjanki@gmail.com>.
98 2008-03-27  Ulrich Drepper  <drepper@redhat.com>
100         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine ARG_MAX if
101         <linux/limits.h> has defined it.
102         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
103         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
104         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
105         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
107 2008-03-18  Jakub Jelinek  <jakub@redhat.com>
109         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Use __ASSEMBLER__ instead
110         of ASSEMBLER.
111         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
112         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Likewise.
114 2008-03-14  Ulrich Drepper  <drepper@redhat.com>
116         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
117         HAVE_DL_DISCOVER_OSVERSION.
118         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
119         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Likewise.
121 2008-03-07  Ulrich Drepper  <drepper@redhat.com>
123         [BZ #5778]
124         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Change
125         _POSIX_CHOWN_RESTRICTED value to zero.
127 2008-01-31  Roland McGrath  <roland@redhat.com>
129         * Makefile (omit-deps): Variable removed.
131 2008-01-30  Ulrich Drepper  <drepper@redhat.com>
133         * sysdeps/unix/sysv/linux/x86_64/sem_post.S (sem_post): Avoid
134         unnecessary addr32 prefix.
136 2008-01-29  Roland McGrath  <roland@redhat.com>
138         * Makeconfig (ptw-CPPFLAGS, sysd-rules-patterns): New variables.
140 2008-01-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
142         * sysdeps/unix/sysv/linux/sh/sem_post.S: Don't overflow value field.
144 2008-01-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
146         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XADD): Use
147         a scratch register.
148         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
149         (__lll_lock_wait_private): Fix typo.
150         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
151         (pthread_barrier_wait): Likewise.  Adjust XADD use.
152         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
153         Adjust XADD use.
154         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
155         (pthread_rwlock_timedrdlock): Return correct return value.
156         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
157         (pthread_rwlock_timedwrlock): Likewise.
159 2008-01-15  Ulrich Drepper  <drepper@redhat.com>
161         * tst-eintr2.c (do_test): make sure that if mutex_lock in main
162         thread returns the program exits with an error code.
164 2008-01-10  Ulrich Drepper  <drepper@redhat.com>
166         * pthread-errnos.sym: Add EOVERFLOW.
167         * sysdeps/unix/sysv/linux/structsem.sym: Add SEM_VALUE_MAX.
168         * sysdeps/unix/sysv/linux/sem_post.c: Don't overflow value field.
169         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
170         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
172 2007-12-14  Ulrich Drepper  <drepper@redhat.com>
174         * sysdeps/x86_64/pthreaddef.h (ARCH_RETRY_MMAP): Take additional
175         parameter.  Passed it as permission to mmap.
176         * allocatestack.c (allocate_stack): Pass prot as second parameter
177         to ARCH_RETRY_MMAP.
179 2007-12-12  Ulrich Drepper  <drepper@redhat.com>
181         * tst-basic7.c: Allocate memory for the stack.
183         [BZ #5465]
184         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S [!SHARED]
185         (__pthread_cond_timedwait): Don't use VDSO.
186         Patch by Michal Januszewski.
188 2007-12-07  Ulrich Drepper  <drepper@redhat.com>
190         [BZ #5455]
191         * sysdeps/pthread/pthread.h [!__EXCEPTIONS] (pthread_cleanup_pop):
192         Allow label before pthread_cleanup_pop.
193         (pthread_cleanup_pop_restore_np): Likewise.
195 2007-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
197         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
198         Store 2 before returning ETIMEDOUT.
200 2007-11-23  Ulrich Drepper  <drepper@redhat.com>
202         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
203         Store 2 before returning ETIMEDOUT.
204         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise
205         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
206         (__lll_lock_wait_private): Optimize.
207         (__lll_lock_wait): Likewise.
209 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
211         * sysdeps/pthread/pthread.h (pthread_cleanup_push,
212         pthread_cleanup_push_defer_np): Add extra (void *) cast to shut up
213         g++ 4.1 and 4.2 -Wstrict-aliasing warnings.
215 2007-11-08  Ulrich Drepper  <drepper@redhat.com>
217         [BZ #5240]
218         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
219         If we time out, try one last time to lock the futex to avoid
220         losing a wakeup signal.
221         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
222         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
224         [BZ #5245]
225         * sysdeps/pthread/createthread.c (do_clone): Translate clone error
226         if necessary.
228 2007-11-07  Ulrich Drepper  <drepper@redhat.com>
230         [BZ #5245]
231         * allocatestack.c (allocate_stack): Change ENOMEM error in case
232         mmap failed to EAGAIN.
233         * Makefile (tests): Add tst-basic7.
234         * tst-basic7.c: New file.
236 2007-11-05  Ulrich Drepper  <drepper@redhat.com>
238         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
239         Use __linkin_atfork.
241 2007-11-03  Mike Frysinger  <vapier@gentoo.org>
243         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (LOAD_FUTEX_WAIT): Add
244         missing line continuations.
245         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S (LOAD_FUTEX_WAIT,
246         LOAD_FUTEX_WAKE): Likewise.  Also add missing 3rd parameter.
248 2007-10-28  Ulrich Drepper  <drepper@redhat.com>
250         [BZ #5220]
251         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Declare
252         __active_timer_sigev_thread and __active_timer_sigev_thread_lock.
253         (struct timer): Add next element.
254         * sysdeps/unix/sysv/linux/timer_create.c: For SIGEV_THREAD timers,
255         enqueue timer structure into __active_timer_sigev_thread list.
256         * sysdeps/unix/sysv/linux/timer_delete.c: For SIGEV_THREAD timers,
257         remove timer struct from __active_timer_sigev_thread.
258         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
259         Before using timer structure make sure it is still on the
260         __active_timer_sigev_thread list.  Keep lock until done.
261         Define __active_timer_sigev_thread and
262         __active_timer_sigev_thread_lock.
264 2007-10-27  Ulrich Drepper  <drepper@redhat.com>
266         * sysdeps/pthread/malloc-machine.h: Define ATFORK_MEM.
267         Redefine thread_atfork for use of ATFORK_MEM.
268         * sysdeps/unix/sysv/linux/fork.h: Define __linkin_atfork.
269         * sysdeps/unix/sysv/linux/register-atfork.c (__linkin_atfork): New
270         function.
271         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
272         Use atomic operation when removing first element of list.
274 2007-10-17  Jakub Jelinek  <jakub@redhat.com>
276         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__old_sem_post): New
277         routine instead of an alias to __new_sem_post.
279 2007-10-15  Jakub Jelinek  <jakub@redhat.com>
281         * init.c (__pthread_initialize_minimal): Initialize word to appease
282         valgrind.
284 2007-10-10  Jakub Jelinek  <jakub@redhat.com>
286         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
287         libc.so just clear NAME.
288         (__libc_rwlock_fini): Nop inside of libc.so.
289         * tst-initializers1.c (main): Test if PTHREAD_RWLOCK_INITIALIZER is
290         all zeros.
292 2007-09-02  Ulrich Drepper  <drepper@redhat.com>
294         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
295         (__pthread_cond_wait): Fix unlocking of internal lock after mutex
296         unlocking failed.
297         Patch by Luca Barbieri <luca.barbieri@gmail.com>.
299 2007-08-21  Ulrich Drepper  <drepper@redhat.com>
301         [BZ #4938]
302         * allocatestack.c (__reclaim_stacks): Clear the TSD in the
303         reclaimed stack if necessary.
304         * Makefile (tests): Add tst-tsd6.
305         * tst-tsd6.c: New file.
307 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
309         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
310         Add private argument.
312 2007-08-20  Ulrich Drepper  <drepper@redhat.com>
314         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
315         (__pthread_cond_timedwait): Use clock_gettime from VDSO if possible.
317 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
319         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h
320         (__lll_robust_timedlock): Pass private as last argument to
321         __lll_robust_timedlock_wait.
322         (__lll_unlock): Fix a pasto.
324 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
326         * sysdeps/unix/sysv/linux/sparc/internaltypes.h (sparc_new_sem,
327         sparc_old_sem): New structs.
328         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
329         (__sem_wait_cleanup): New function.
330         (__new_sem_wait): Use sparc_new_sem structure.  Bump and afterwards
331         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
332         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
333         lll_futex_wait.
334         (__old_sem_wait): New function.
335         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: Include
336         nptl/sysdeps/unix/sysv/linux/sparc version.
337         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c:
338         Likewise.
339         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: Likewise.
340         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
341         (__new_sem_trywait): Use sparc_old_sem structure.
342         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
343         (sem_timedwait): Use sparc_new_sem structure.  Bump and afterwards
344         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
345         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
346         lll_futex_timed_wait.
347         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c (__new_sem_post):
348         Use sparc_new_sem structure.  Only wake if nwaiters > 0.  Pass
349         isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
350         lll_futex_wake.
351         (__old_sem_post): New function.
352         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: New file.
353         * sysdeps/unix/sysv/linux/sparc/sem_init.c: New file.
354         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: New file.
355         * sysdeps/unix/sysv/linux/sparc/sem_post.c: New file.
356         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: Remove.
357         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: Remove.
359 2007-08-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
361         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
362         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
363         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
364         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
365         * sysdeps/unix/sysv/linux/shpthread_cond_signal.S
366         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
367         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
368         Use FUTEX_WAKE_OP.
369         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
370         kernel-features.h and tcb-offsets.h.
371         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
372         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
373         process private.
374         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
375         tcb-offsets.h.
376         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE
377         to lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
378         process private.
379         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use #ifdef
380         __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
381         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
382         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
383         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
384         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
385         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
387 2007-08-14  Jakub Jelinek  <jakub@redhat.com>
389         * sysdeps/unix/sysv/linux/lowlevellock.c: Comment fix.
390         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
391         (__lll_timedwait_tid): Pass LLL_SHARED as 4th argument to
392         lll_futex_timed_wait.
394         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock,
395         __lll_robust_unlock): Rewrite as macros instead of inline functions.
396         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock,
397         __lll_robust_unlock, __lll_wait_tid): Likewise.
399 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
401         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
402         Fix a pasto.
403         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
404         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
405         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
406         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
407         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
408         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
409         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
410         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Include
411         kernel-features.h.
412         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
413         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
414         process private.  Switch DW_CFA_advance_loc1 and some
415         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
416         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
417         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE to
418         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
419         process private.  Switch DW_CFA_advance_loc{1,2} and some
420         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
421         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use
422         #ifdef __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
423         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
424         Likewise.
425         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
426         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
427         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
428         Likewise.
429         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
430         (__pthread_cond_broadcast): Compare %r8 instead of
431         dep_mutex-cond_*(%rdi) with $-1.
432         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
433         (__pthread_cond_signal): Xor FUTEX_WAKE_OP with FUTEX_WAKE instead
434         of oring.
436 2007-08-13  Ulrich Drepper  <drepper@redhat.com>
438         * sysdeps/unix/sysv/linux/i386/i786/Implies: New file.
440 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
442         * allocatestack.c: Include kernel-features.h.
443         * pthread_create.c: Likewise.
444         * pthread_mutex_init.c: Likewise.
445         * init.c: Likewise.
446         * pthread_cond_timedwait.c: Likewise.
447         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
448         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
449         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
450         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
451         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
452         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
453         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
454         Likewise.
455         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
456         Likewise.
457         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
458         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
459         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
460         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
462 2007-08-12  Jakub Jelinek  <jakub@redhat.com>
464         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
465         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
466         byte elements.  One of them is the new __shared element.
467         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
468         adjust names of other padding elements.
469         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
470         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
471         byte elements.  One of them is the new __shared element.
472         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
473         adjust names of other padding elements.
474         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_rwlock_t):
475         Renamed __pad1 element to __shared, adjust names of other padding
476         elements.
477         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
478         (pthread_rwlock_t): Likewise.
479         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock): Fix a
480         typo.
482 2007-08-09  Anton Blanchard  <anton@samba.org>
484         * sysdeps/unix/sysv/linux/powerpc/pthread_spin_unlock.c: New file.
486 2007-08-12  Ulrich Drepper  <drepper@redhat.com>
488         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Include
489         <kernel-features.h>.
490         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
492 2007-08-11  Ulrich Drepper  <drepper@redhat.com>
494         * pthreadP.h (PTHREAD_ROBUST_MUTEX_PSHARED): Define.
495         * pthread_mutex_lock.c: Use it instead of PTHREAD_MUTEX_PSHARED when
496         dealing with robust mutexes.
497         * pthread_mutex_timedlock.c: Likewise.
498         * pthread_mutex_trylock.c: Likewise.
499         * pthread_mutex_unlock.c: Likewise.
500         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
502 2007-08-06  Jakub Jelinek  <jakub@redhat.com>
504         * pthreadP.h (PTHREAD_MUTEX_PSHARED_BIT): Define.
505         (PTHREAD_MUTEX_TYPE): Mask __kind with 127.
506         (PTHREAD_MUTEX_PSHARED): Define.
507         * pthread_mutex_init.c (__pthread_mutex_init): Set
508         PTHREAD_MUTEX_PSHARED_BIT for pshared or robust
509         mutexes.
510         * pthread_mutex_lock.c (LLL_MUTEX_LOCK): Take mutex as argument
511         instead of its __data.__lock field, pass PTHREAD_MUTEX_PSHARED
512         as second argument to lll_lock.
513         (LLL_MUTEX_TRYLOCK): Take mutex as argument
514         instead of its __data.__lock field.
515         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
516         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
517         to lll_robust_lock.
518         (__pthread_mutex_lock): Update LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
519         LLL_ROBUST_MUTEX_LOCK users, use PTHREAD_MUTEX_TYPE (mutex)
520         instead of mutex->__data.__kind directly, pass
521         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock and lll_futex_wait.
522         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use
523         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
524         directly, pass PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock.
525         (pthread_mutex_timedlock): Pass PTHREAD_MUTEX_PSHARED (mutex)
526         to lll_timedlock, lll_robust_timedlock, lll_unlock and
527         lll_futex_timed_wait.  Use PTHREAD_MUTEX_TYPE (mutex) instead
528         of mutex->__data.__kind directly.
529         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Pass
530         PTHREAD_MUTEX_PSHARED (mutex) to lll_timedlock,
531         lll_robust_timedlock, lll_unlock and lll_futex_timed_wait.  Use
532         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind directly.
533         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Pass
534         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock, lll_robust_unlock
535         and lll_futex_wake.
536         * pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Pass
537         PTHREAD_MUTEX_PSHARED (mutex) to lll_futex_wait and lll_futex_wake.
538         Use PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
539         directly.
540         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK):
541         Take mutex as argument instead of its __data.__lock field, pass
542         PTHREAD_MUTEX_PSHARED as second argument to lll_cond_lock.
543         (LLL_MUTEX_TRYLOCK): Take mutex as argument instead of its
544         __data.__lock field.
545         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
546         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
547         to lll_robust_cond_lock.
548         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Add pshared
549         variable, pass it to lll_lock, lll_unlock, lll_futex_requeue and
550         lll_futex_wake.  Don't use lll_futex_requeue if dependent mutex
551         has PTHREAD_MUTEX_PSHARED_BIT bit set in its __data.__kind.
552         * pthread_cond_destroy.c (__pthread_cond_destroy): Add pshared
553         variable, pass it to lll_lock, lll_unlock, lll_futex_wake and
554         lll_futex_wait.
555         * pthread_cond_signal.c (__pthread_cond_signal): Add pshared
556         variable, pass it to lll_lock, lll_unlock, lll_futex_wake_unlock and
557         lll_futex_wake.
558         * pthread_cond_timedwait.c (__pthread_cond_wait): Add
559         pshared variable, pass it to lll_lock, lll_unlock,
560         lll_futex_timedwait and lll_futex_wake.
561         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait): Add
562         pshared variable, pass it to lll_lock, lll_unlock, lll_futex_wait
563         and lll_futex_wake.
564         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_requeue,
565         lll_futex_wake_unlock): Add private argument, use __lll_private_flag
566         macro.
567         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue,
568         lll_futex_wake_unlock): Likewise.
569         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_requeue):
570         Likewise.
571         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_futex_requeue,
572         lll_futex_wake_unlock): Likewise.
573         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_requeue):
574         Likewise.
575         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue,
576         lll_futex_wake_unlock): Likewise.
577         (lll_futex_wake): Fix a typo.
578         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym (PS_BIT): Add.
579         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
580         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
581         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
582         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
583         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
584         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
585         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
586         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
587         (__pthread_cond_timedwait): Likewise.
588         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
589         (__condvar_cleanup, __pthread_cond_wait): Likewise.
591 2007-08-05  Jakub Jelinek  <jakub@redhat.com>
593         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
594         Don't use CGOTSETUP and CGOTRESTORE macros.
595         (CGOTSETUP, CGOTRESTORE): Remove.
596         <IS_IN_rtld> (CENABLE, CDISABLE): Don't use JUMPTARGET, branch to
597         @local symbol.
599 2007-08-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
601         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Remove
602         definitions for private futexes.
603         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Include
604         kernel-features.h and lowlevellock.h.  Use private futexes if
605         they are available.
606         (__lll_lock_wait_private, __lll_unlock_wake_private): New.
607         (__lll_mutex_lock_wait): Rename to
608         (__lll_lock_wait): ... this.  Don't compile in for libc.so.
609         (__lll_mutex_timedlock_wait): Rename to ...
610         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.
611         Don't compile in for libc.so.
612         (__lll_mutex_unlock_wake): Rename to ...
613         (__lll_unlock_wake): ... this.  Don't compile in for libc.so.
614         (__lll_timedwait_tid): Use __NR_gettimeofday.
615         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Allow including
616         the header from assembler.  Renamed all lll_mutex_* resp.
617         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
618         Renamed all LLL_MUTEX_LOCK_* macros to LLL_LOCK_*.
619         (FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE):
620         Define.
621         (__lll_lock_wait_private): Add prototype.
622         (__lll_lock_wait, __lll_timedlock_wait, __lll_robust_lock_wait,
623         __lll_robust_timedlock_wait, __lll_unlock_wake_private,
624         __lll_unlock_wake): Likewise.
625         (lll_lock): Add private argument.  Call __lll_lock_wait_private
626         if private is constant LLL_PRIVATE.
627         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
628         lll_timedlock, lll_robust_timedlock): Add private argument.
629         (lll_unlock): Add private argument.  Call __lll_unlock_wake_private
630         if private is constant LLL_PRIVATE.
631         (lll_robust_unlock, lll_robust_dead): Add private argument.
632         (lll_lock_t): Remove.
633         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
634         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
635         lll_cond_wake, lll_cond_broadcast): Remove.
636         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: Include
637         kernel-features.h and lowlevellock.h.
638         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
639         (LOAD_FUTEX_WAIT): Define.
640         (__lll_robust_mutex_lock_wait): Rename to ...
641         (__lll_robust_lock_wait): ... this.  Add private argument.
642         Use LOAD_FUTEX_WAIT macro.
643         (__lll_robust_mutex_timedlock_wait): Rename to ...
644         (__lll_robust_timedlock_wait): ... this.    Add private argument.
645         Use __NR_gettimeofday.  Use LOAD_FUTEX_WAIT macro.
646         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Include
647         lowlevellock.h.
648         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
649         (pthread_barrier_wait): Use __lll_{lock,unlock}_* instead of
650         __lll_mutex_{lock,unlock}_*.
651         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Include
652         lowlevellock.h and pthread-errnos.h.
653         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
654         FUTEX_CMP_REQUEUE, EINVAL): Remove.
655         (__pthread_cond_broadcast): Use __lll_{lock,unlock}_* instead of
656         __lll_mutex_{lock,unlock}_*.
657         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Include
658         lowlevellock.h and pthread-errnos.h.
659         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE, EINVAL): Remove.
660         (__pthread_cond_signal): Use __lll_{lock,unlock}_* instead of
661         __lll_mutex_{lock,unlock}_*.
662         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
663         lowlevellock.h.
664         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE): Remove.
665         (__pthread_cond_timedwait): Use __lll_{lock,unlock}_* instead of
666         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
667         (__condvar_tw_cleanup): Likewise.
668         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
669         lowlevellock.h.
670         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
671         (__pthread_cond_wait): Use __lll_{lock,unlock}_* instead of
672         __lll_mutex_{lock,unlock}_*.
673         ( __condvar_w_cleanup): Likewise.
674         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Include lowlevellock.h.
675         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
676         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Include
677         lowlevellock.h.
678         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
679         (__pthread_rwlock_rdlock): Use __lll_{lock,unlock}_* instead of
680         __lll_mutex_{lock,unlock}_*.
681         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Include
682         lowlevellock.h.
683         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
684         FUTEX_PRIVATE_FLAG): Remove.
685         (pthread_rwlock_timedrdlock): Use __lll_{lock,unlock}_* instead of
686         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
687         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Include
688         lowlevellock.h.
689         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
690         FUTEX_PRIVATE_FLAG): Remove.
691         (pthread_rwlock_timedwrlock): Use __lll_{lock,unlock}_* instead of
692         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
693         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Include
694         lowlevellock.h.
695         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
696         (__pthread_rwlock_unlock): Use __lll_{lock,unlock}_* instead of
697         __lll_mutex_{lock,unlock}_*.
698         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Include
699         lowlevellock.h.
700         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
701         (__pthread_rwlock_wrlock): Use __lll_{lock,unlock}_* instead of
702         __lll_mutex_{lock,unlock}_*.
703         * sysdeps/unix/sysv/linux/sh/sem_post.S: Include lowlevellock.h.
704         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
705         (__new_sem_post): Use standard initial exec code sequences.
706         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Include
707         lowlevellock.h.
708         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
709         FUTEX_PRIVATE_FLAG): Remove.
710         (sem_timedwait): Use __NR_gettimeofday.  Use standard initial
711         exec code sequences.
712         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Include lowlevellock.h.
713         (__new_sem_trywait): Use standard initial exec code sequences.
714         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Include lowlevellock.h.
715         (__new_sem_wait): Use standard initial exec code sequences.
717 2007-07-31  Anton Blanchard  <anton@samba.org>
719         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
720         Use __asm __volatile (__lll_acq_instr ::: "memory") instead of
721         atomic_full_barrier.
723 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
725         * allocatestack.c (stack_cache_lock): Change type to int.
726         (get_cached_stack, allocate_stack, __deallocate_stack,
727         __make_stacks_executable, __find_thread_by_id, __nptl_setxid,
728         __pthread_init_static_tls, __wait_lookup_done): Add LLL_PRIVATE
729         as second argument to lll_lock and lll_unlock macros on
730         stack_cache_lock.
731         * pthread_create.c (__find_in_stack_list): Likewise.
732         (start_thread): Similarly with pd->lock.  Use lll_robust_dead
733         macro instead of lll_robust_mutex_dead, pass LLL_SHARED to it
734         as second argument.
735         * descr.h (struct pthread): Change lock and setxid_futex field
736         type to int.
737         * old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0): Use
738         LLL_LOCK_INITIALIZER instead of LLL_MUTEX_LOCK_INITIALIZER.
739         * old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
740         * old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
741         Likewise.
742         * old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
743         * pthread_cond_init.c (__pthread_cond_init): Likewise.
744         * pthreadP.h (__attr_list_lock): Change type to int.
745         * pthread_attr_init.c (__attr_list_lock): Likewise.
746         * pthread_barrier_destroy.c (pthread_barrier_destroy): Pass
747         ibarrier->private ^ FUTEX_PRIVATE_FLAG as second argument to
748         lll_{,un}lock.
749         * pthread_barrier_wait.c (pthread_barrier_wait): Likewise and
750         also for lll_futex_{wake,wait}.
751         * pthread_barrier_init.c (pthread_barrier_init): Make iattr
752         a pointer to const.
753         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Pass
754         LLL_SHARED as second argument to lll_{,un}lock.
755         * pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
756         * pthread_cond_signal.c (__pthread_cond_singal): Likewise.
757         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
758         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait):
759         Likewise.
760         * pthread_getattr_np.c (pthread_getattr_np): Add LLL_PRIVATE
761         as second argument to lll_{,un}lock macros on pd->lock.
762         * pthread_getschedparam.c (__pthread_getschedparam): Likewise.
763         * pthread_setschedparam.c (__pthread_setschedparam): Likewise.
764         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
765         * tpp.c (__pthread_tpp_change_priority, __pthread_current_priority):
766         Likewise.
767         * sysdeps/pthread/createthread.c (do_clone, create_thread):
768         Likewise.
769         * pthread_once.c (once_lock): Change type to int.
770         (__pthread_once): Pass LLL_PRIVATE as second argument to
771         lll_{,un}lock macros on once_lock.
772         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Use
773         lll_{,un}lock macros instead of lll_mutex_{,un}lock, pass
774         rwlock->__data.__shared as second argument to them and similarly
775         for lll_futex_w*.
776         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
777         Likewise.
778         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
779         Likewise.
780         * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Likewise.
781         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Likewise.
782         * pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Likewise.
783         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
784         * sem_close.c (sem_close): Pass LLL_PRIVATE as second argument
785         to lll_{,un}lock macros on __sem_mappings_lock.
786         * sem_open.c (check_add_mapping): Likewise.
787         (__sem_mappings_lock): Change type to int.
788         * semaphoreP.h (__sem_mappings_lock): Likewise.
789         * pthread_mutex_lock.c (LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
790         LLL_ROBUST_MUTEX_LOCK): Use lll_{,try,robust_}lock macros
791         instead of lll_*mutex_*, pass LLL_SHARED as last
792         argument.
793         (__pthread_mutex_lock): Use lll_unlock instead of lll_mutex_unlock,
794         pass LLL_SHARED as last argument.
795         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK,
796         LLL_MUTEX_TRYLOCK, LLL_ROBUST_MUTEX_LOCK): Use
797         lll_{cond_,cond_try,robust_cond}lock macros instead of lll_*mutex_*,
798         pass LLL_SHARED as last argument.
799         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
800         lll_{timed,try,robust_timed,un}lock instead of lll_*mutex*, pass
801         LLL_SHARED as last argument.
802         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Similarly.
803         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
804         Similarly.
805         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_lock,
806         __libc_lock_lock_recursive, __libc_lock_unlock,
807         __libc_lock_unlock_recursive): Pass LLL_PRIVATE as second
808         argument to lll_{,un}lock.
809         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_lock,
810         _IO_lock_unlock): Likewise.
811         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Don't use
812         compound literal.
813         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
814         Pass LLL_PRIVATE as second argument to lll_{,un}lock macros on
815         __fork_lock.
816         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork,
817         free_mem): Likewise.
818         (__fork_lock): Change type to int.
819         * sysdeps/unix/sysv/linux/fork.h (__fork_lock): Likewise.
820         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Pass
821         isem->private ^ FUTEX_PRIVATE_FLAG as second argument to
822         lll_futex_wake.
823         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
824         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Likewise.
825         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait_private):
826         New function.
827         (__lll_lock_wait, __lll_timedlock_wait): Add private argument and
828         pass it through to lll_futex_*wait, only compile in when
829         IS_IN_libpthread.
830         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
831         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Add private
832         argument and pass it through to lll_futex_*wait.
833         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Renamed all
834         lll_mutex_* resp. lll_robust_mutex_* macros to lll_* resp.
835         lll_robust_*.  Renamed all __lll_mutex_* resp. __lll_robust_mutex_*
836         inline functions to __lll_* resp. __lll_robust_*.
837         (LLL_MUTEX_LOCK_INITIALIZER): Remove.
838         (lll_mutex_dead): Add private argument.
839         (__lll_lock_wait_private): New prototype.
840         (__lll_lock_wait, __lll_robust_lock_wait, __lll_lock_timedwait,
841         __lll_robust_lock_timedwait): Add private argument to prototypes.
842         (__lll_lock): Add private argument, if it is constant LLL_PRIVATE,
843         call __lll_lock_wait_private, otherwise pass private to
844         __lll_lock_wait.
845         (__lll_robust_lock, __lll_cond_lock, __lll_timedlock,
846         __lll_robust_timedlock): Add private argument, pass it to
847         __lll_*wait functions.
848         (__lll_unlock): Add private argument, if it is constant LLL_PRIVATE,
849         call __lll_unlock_wake_private, otherwise pass private to
850         __lll_unlock_wake.
851         (__lll_robust_unlock): Add private argument, pass it to
852         __lll_robust_unlock_wake.
853         (lll_lock, lll_robust_lock, lll_cond_lock, lll_timedlock,
854         lll_robust_timedlock, lll_unlock, lll_robust_unlock): Add private
855         argument, pass it through to __lll_* inline function.
856         (__lll_mutex_unlock_force, lll_mutex_unlock_force): Remove.
857         (lll_lock_t): Remove.
858         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
859         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
860         lll_cond_wake, lll_cond_broadcast): Remove.
861         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
862         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
863         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
864         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
865         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Allow including
866         the header from assembler.  Renamed all lll_mutex_* resp.
867         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
868         (LOCK, FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP,
869         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
870         (LLL_MUTEX_LOCK_INITIALIZER, LLL_MUTEX_LOCK_INITIALIZER_LOCKED,
871         LLL_MUTEX_LOCK_INITIALIZER_WAITERS): Remove.
872         (__lll_mutex_lock_wait, __lll_mutex_timedlock_wait,
873         __lll_mutex_unlock_wake, __lll_lock_wait, __lll_unlock_wake):
874         Remove prototype.
875         (__lll_trylock_asm, __lll_lock_asm_start, __lll_unlock_asm): Define.
876         (lll_robust_trylock, lll_cond_trylock): Use LLL_LOCK_INITIALIZER*
877         rather than LLL_MUTEX_LOCK_INITIALIZER* macros.
878         (lll_trylock): Likewise, use __lll_trylock_asm, pass
879         MULTIPLE_THREADS_OFFSET as another asm operand.
880         (lll_lock): Add private argument, use __lll_lock_asm_start, pass
881         MULTIPLE_THREADS_OFFSET as last asm operand, call
882         __lll_lock_wait_private if private is constant LLL_PRIVATE,
883         otherwise pass private as another argument to __lll_lock_wait.
884         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
885         lll_timedlock, lll_robust_timedlock): Add private argument, pass
886         private as another argument to __lll_*lock_wait call.
887         (lll_unlock): Add private argument, use __lll_unlock_asm, pass
888         MULTIPLE_THREADS_OFFSET as another asm operand, call
889         __lll_unlock_wake_private if private is constant LLL_PRIVATE,
890         otherwise pass private as another argument to __lll_unlock_wake.
891         (lll_robust_unlock): Add private argument, pass private as another
892         argument to __lll_unlock_wake.
893         (lll_robust_dead): Add private argument, use __lll_private_flag
894         macro.
895         (lll_islocked): Use LLL_LOCK_INITIALIZER instead of
896         LLL_MUTEX_LOCK_INITIALIZER.
897         (lll_lock_t): Remove.
898         (LLL_LOCK_INITIALIZER_WAITERS): Define.
899         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
900         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
901         lll_cond_wake, lll_cond_broadcast): Remove.
902         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
903         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Revert
904         2007-05-2{3,9} changes.
905         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Include
906         kernel-features.h and lowlevellock.h.
907         (LOAD_PRIVATE_FUTEX_WAIT): Define.
908         (LOAD_FUTEX_WAIT): Rewritten.
909         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
910         define.
911         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
912         (__lll_mutex_lock_wait): Rename to ...
913         (__lll_lock_wait): ... this.  Take futex addr from %edx instead of
914         %ecx, %ecx is now private argument.  Don't compile in for libc.so.
915         (__lll_mutex_timedlock_wait): Rename to ...
916         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.  %esi
917         contains private argument.  Don't compile in for libc.so.
918         (__lll_mutex_unlock_wake): Rename to ...
919         (__lll_unlock_wake): ... this.  %ecx contains private argument.
920         Don't compile in for libc.so.
921         (__lll_timedwait_tid): Use __NR_gettimeofday.
922         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Include
923         kernel-features.h and lowlevellock.h.
924         (LOAD_FUTEX_WAIT): Define.
925         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
926         define.
927         (__lll_robust_mutex_lock_wait): Rename to ...
928         (__lll_robust_lock_wait): ... this.  Futex addr is now in %edx
929         argument, %ecx argument contains private.  Use LOAD_FUTEX_WAIT
930         macro.
931         (__lll_robust_mutex_timedlock_wait): Rename to ...
932         (__lll_robust_timedlock_wait): ... this.  Use __NR_gettimeofday.
933         %esi argument contains private, use LOAD_FUTEX_WAIT macro.
934         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Include
935         lowlevellock.h.
936         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
937         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
938         PRIVATE(%ebx) ^ LLL_SHARED as private argument in %ecx to
939         __lll_lock_wait and __lll_unlock_wake, pass MUTEX(%ebx) address
940         to __lll_lock_wait in %edx.
941         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
942         Include lowlevellock.h and pthread-errnos.h.
943         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
944         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
945         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*, pass
946         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
947         pass LLL_SHARED in %ecx to both __lll_lock_wait and
948         __lll_unlock_wake.
949         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
950         Include lowlevellock.h and pthread-errnos.h.
951         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
952         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
953         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*, pass
954         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
955         pass LLL_SHARED in %ecx to both __lll_lock_wait and
956         __lll_unlock_wake.
957         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
958         Include lowlevellock.h.
959         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
960         Don't define.
961         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*, pass
962         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
963         pass LLL_SHARED in %ecx to both __lll_lock_wait and
964         __lll_unlock_wake.  Use __NR_gettimeofday.
965         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
966         Include lowlevellock.h.
967         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
968         (__pthread_cond_wait, __condvar_w_cleanup): Rename __lll_mutex_*
969         to __lll_*, pass cond_lock address in %edx rather than %ecx to
970         __lll_lock_wait, pass LLL_SHARED in %ecx to both __lll_lock_wait
971         and __lll_unlock_wake.
972         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S:
973         Include lowlevellock.h.
974         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
975         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*, pass
976         MUTEX(%ebx) address in %edx rather than %ecx to
977         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
978         and __lll_unlock_wake.  Move return value from %ecx to %edx
979         register.
980         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
981         Include lowlevellock.h.
982         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
983         Don't define.
984         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
985         MUTEX(%ebp) address in %edx rather than %ecx to
986         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
987         and __lll_unlock_wake.  Move return value from %ecx to %edx
988         register.  Use __NR_gettimeofday.
989         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
990         Include lowlevellock.h.
991         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
992         Don't define.
993         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
994         MUTEX(%ebp) address in %edx rather than %ecx to
995         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
996         and __lll_unlock_wake.  Move return value from %ecx to %edx
997         register.  Use __NR_gettimeofday.
998         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
999         Include lowlevellock.h.
1000         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1001         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*, pass
1002         MUTEX(%edi) address in %edx rather than %ecx to
1003         __lll_lock_wait, pass PSHARED(%edi) in %ecx to both __lll_lock_wait
1004         and __lll_unlock_wake.
1005         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
1006         Include lowlevellock.h.
1007         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1008         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1009         MUTEX(%ebx) address in %edx rather than %ecx to
1010         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
1011         and __lll_unlock_wake.  Move return value from %ecx to %edx
1012         register.
1013         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Include
1014         lowlevellock.h.
1015         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1016         define.
1017         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Include lowlevellock.h.
1018         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1019         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Include
1020         lowlevellock.h.
1021         (LOCK, SYS_futex, SYS_gettimeofday, FUTEX_WAIT): Don't define.
1022         (sem_timedwait): Use __NR_gettimeofday.
1023         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Include
1024         lowlevellock.h.
1025         (LOCK): Don't define.
1026         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include
1027         lowlevellock.h.
1028         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1029         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Wake only when there
1030         are waiters.
1031         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Revert
1032         2007-05-2{3,9} changes.
1033         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Include
1034         kernel-features.h and lowlevellock.h.
1035         (LOAD_PRIVATE_FUTEX_WAIT): Define.
1036         (LOAD_FUTEX_WAIT): Rewritten.
1037         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
1038         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
1039         (__lll_mutex_lock_wait): Rename to ...
1040         (__lll_lock_wait): ... this.  %esi is now private argument.
1041         Don't compile in for libc.so.
1042         (__lll_mutex_timedlock_wait): Rename to ...
1043         (__lll_timedlock_wait): ... this.  %esi contains private argument.
1044         Don't compile in for libc.so.
1045         (__lll_mutex_unlock_wake): Rename to ...
1046         (__lll_unlock_wake): ... this.  %esi contains private argument.
1047         Don't compile in for libc.so.
1048         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Include
1049         kernel-features.h and lowlevellock.h.
1050         (LOAD_FUTEX_WAIT): Define.
1051         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
1052         (__lll_robust_mutex_lock_wait): Rename to ...
1053         (__lll_robust_lock_wait): ... this.  %esi argument contains private.
1054         Use LOAD_FUTEX_WAIT macro.
1055         (__lll_robust_mutex_timedlock_wait): Rename to ...
1056         (__lll_robust_timedlock_wait): ... this. %esi argument contains
1057         private, use LOAD_FUTEX_WAIT macro.
1058         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Include
1059         lowlevellock.h.
1060         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1061         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
1062         PRIVATE(%rdi) ^ LLL_SHARED as private argument in %esi to
1063         __lll_lock_wait and __lll_unlock_wake.
1064         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S:
1065         Include lowlevellock.h and pthread-errnos.h.
1066         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1067         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
1068         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*,
1069         pass LLL_SHARED in %esi to both __lll_lock_wait and
1070         __lll_unlock_wake.
1071         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S:
1072         Include lowlevellock.h and pthread-errnos.h.
1073         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
1074         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
1075         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*,
1076         pass LLL_SHARED in %esi to both __lll_lock_wait and
1077         __lll_unlock_wake.
1078         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:
1079         Include lowlevellock.h.
1080         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1081         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*,
1082         pass LLL_SHARED in %esi to both __lll_lock_wait and
1083         __lll_unlock_wake.
1084         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
1085         Include lowlevellock.h.
1086         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1087         (__pthread_cond_wait, __condvar_cleanup): Rename __lll_mutex_*
1088         to __lll_*, pass LLL_SHARED in %esi to both __lll_lock_wait
1089         and __lll_unlock_wake.
1090         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:
1091         Include lowlevellock.h.
1092         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1093         Don't define.
1094         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*,
1095         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1096         and __lll_unlock_wake.
1097         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1098         Include lowlevellock.h.
1099         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1100         Don't define.
1101         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1102         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1103         and __lll_unlock_wake.
1104         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1105         Include lowlevellock.h.
1106         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1107         Don't define.
1108         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1109         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1110         and __lll_unlock_wake.
1111         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S:
1112         Include lowlevellock.h.
1113         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1114         Don't define.
1115         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*,
1116         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1117         and __lll_unlock_wake.
1118         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:
1119         Include lowlevellock.h.
1120         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1121         Don't define.
1122         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1123         pass PSHARED(%rdi) in %ecx to both __lll_lock_wait
1124         and __lll_unlock_wake.
1125         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Include
1126         lowlevellock.h.
1127         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1128         define.
1129         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Include lowlevellock.h.
1130         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1131         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Include
1132         lowlevellock.h.
1133         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1134         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Include
1135         lowlevellock.h.
1136         (LOCK): Don't define.
1137         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Include
1138         lowlevellock.h.
1139         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1140         * sysdeps/unix/sysv/linux/sparc/internaltypes.h: New file.
1141         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c: New file.
1142         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c: New file.
1143         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c: New file.
1144         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
1145         (__lll_lock_wait_private): New function.
1146         (__lll_lock_wait, __lll_timedlock_wait): Add private argument, pass
1147         it to lll_futex_*wait.  Don't compile in for libc.so.
1148         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c:
1149         Remove.
1150         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
1151         (struct sparc_pthread_barrier): Remove.
1152         (pthread_barrier_wait): Use union sparc_pthread_barrier instead of
1153         struct sparc_pthread_barrier.  Pass
1154         ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE to lll_{,un}lock
1155         and lll_futex_wait macros.
1156         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
1157         Remove.
1158         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1159         Include sparc pthread_barrier_wait.c instead of generic one.
1161 2007-07-30  Jakub Jelinek  <jakub@redhat.com>
1163         * tst-rwlock14.c (do_test): Avoid warnings on 32-bit arches.
1165         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
1166         (pthread_rwlock_timedrdlock): Copy futex retval to %esi rather than
1167         %ecx.
1168         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
1169         (pthread_rwlock_timedwrlock): Likewise.
1170         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
1171         (__pthread_rwlock_unlock): Fix MUTEX != 0 args to __lll_*.
1173 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
1175         * sysdeps/sparc/tls.h (tcbhead_t): Add private_futex field.
1177 2007-07-26  Jakub Jelinek  <jakub@redhat.com>
1179         * tst-locale2.c (useless): Add return statement.
1181 2007-07-24  Jakub Jelinek  <jakub@redhat.com>
1183         * allocatestack.c (__nptl_setxid, __wait_lookup_done): Replace
1184         lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).
1185         * pthread_create.c (start_thread): Likewise.
1186         * init.c (sighandler_setxid): Likewise.
1187         * sysdeps/alpha/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1188         * sysdeps/ia64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1189         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1190         * sysdeps/s390/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1191         * sysdeps/powerpc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1192         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1193         * sysdeps/sparc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1194         * sysdeps/sh/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1195         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY, AIO_MISC_WAIT):
1196         Likewise.
1197         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY, GAI_MISC_WAIT):
1198         Likewise.
1199         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1200         Likewise.
1201         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_waitzero,
1202         __rtld_notify): Likewise.
1203         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Likewise.
1204         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (clear_once_control,
1205         __pthread_once): Likewise.
1206         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (clear_once_control,
1207         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1208         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1209         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1210         (lll_futex_wait): Add private argument, define as wrapper around
1211         lll_futex_timed_wait.
1212         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1213         use __lll_private_flag macro.
1214         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1215         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1216         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (clear_once_control,
1217         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1218         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1219         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1220         (lll_futex_wait): Add private argument, define as wrapper around
1221         lll_futex_timed_wait.
1222         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1223         use __lll_private_flag macro.
1224         (__lll_mutex_unlock, __lll_robust_mutex_unlock, lll_wait_tid,
1225         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1226         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
1227         Define.
1228         (lll_futex_timed_wait, lll_futex_wake): Use it.
1229         (lll_private_futex_wait, lll_private_futex_timed_wait,
1230         lll_private_futex_wake): Removed.
1231         * sysdeps/unix/sysv/linux/s390/pthread_once.c (clear_once_control,
1232         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1233         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1234         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1235         (lll_futex_wait): Add private argument, define as wrapper around
1236         lll_futex_timed_wait.
1237         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1238         use __lll_private_flag macro.
1239         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1240         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1241         to lll_futex_*.
1242         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1243         (lll_private_futex_wait, lll_private_futex_timed_wait,
1244         lll_private_futex_wake): Removed.
1245         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_private_flag):
1246         Fix !__ASSUME_PRIVATE_FUTEX non-constant private case.
1247         (lll_private_futex_wait, lll_private_futex_timed_wait,
1248         lll_private_futex_wake): Removed.
1249         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (clear_once_control,
1250         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1251         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1252         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1253         (lll_futex_wait): Add private argument, define as wrapper around
1254         lll_futex_timed_wait.
1255         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1256         use __lll_private_flag macro.
1257         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1258         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1259         to lll_futex_*.
1260         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (__lll_private_flag):
1261         Define.
1262         (lll_futex_timed_wait, lll_futex_wake): Use it.
1263         (lll_private_futex_wait, lll_private_futex_timed_wait,
1264         lll_private_futex_wake): Removed.
1266 2007-07-27  Jakub Jelinek  <jakub@redhat.com>
1268         * sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
1269         of the structure for sparc32.
1271 2007-07-26  Aurelien Jarno  <aurelien@aurel32.net>
1273         * sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
1275 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1277         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1278         code used when private futexes are assumed.
1279         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1280         Likewise.
1282 2007-07-23  Jakub Jelinek  <jakub@redhat.com>
1284         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1285         (__lll_private_flag): Define.
1286         (lll_futex_wait): Define as a wrapper around lll_futex_timed_wait.
1287         (lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Use
1288         __lll_private_flag.
1289         (lll_private_futex_wait, lll_private_futex_timedwait,
1290         lll_private_futex_wake): Define as wrapper around non-_private
1291         macros.
1292         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1293         (__lll_private_flag): Define.
1294         (lll_futex_timed_wait, lll_futex_wake): Use __lll_private_flag.
1295         (lll_private_futex_wait, lll_private_futex_timedwait,
1296         lll_private_futex_wake): Define as wrapper around non-_private
1297         macros.
1299 2007-07-10  Steven Munroe  <sjmunroe@us.ibm.com>
1301         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Add LLL_SHARED
1302         parameter to lll_futex_wait call.
1303         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1305         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
1306         Replace lll_futex_wait with lll_private_futex_wait.
1307         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1308         Add LLL_SHARED parameter to lll_futex_wake().
1310         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define LLL_PRIVATE
1311         LLL_SHARED, lll_private_futex_wait, lll_private_futex_timed_wait and
1312         lll_private_futex_wake.
1313         (lll_futex_wait): Add private parameter. Adjust FUTEX_PRIVATE_FLAG
1314         bit from private parm before syscall.
1315         (lll_futex_timed_wait): Likewise.
1316         (lll_futex_wake): Likewise.
1317         (lll_futex_wake_unlock): Likewise.
1318         (lll_mutex_unlock): Add LLL_SHARED parm to lll_futex_wake call.
1319         (lll_robust_mutex_unlock): Likewise.
1320         (lll_mutex_unlock_force): Likewise.
1321         (lll_wait_tid): Add LLL_SHARED parm to lll_futex_wait call.
1323 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1325         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1326         compilation when unconditionally using private futexes.
1327         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1328         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1329         Likewise.
1330         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1331         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1333 2007-07-17  Jakub Jelinek  <jakub@redhat.com>
1335         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
1336         Define.
1338 2007-07-06  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1340         * sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and
1341         kernel-features.h.
1343 2007-05-16  Roland McGrath  <roland@redhat.com>
1345         * init.c (__nptl_initial_report_events): New variable.
1346         (__pthread_initialize_minimal_internal): Initialize pd->report_events
1347         to that.
1349 2007-06-22  Jakub Jelinek  <jakub@redhat.com>
1351         * pthread_getattr_np.c (pthread_getattr_np): Clear cpuset and
1352         cpusetsize if pthread_getaffinity_np failed with ENOSYS.
1354 2007-06-19  Ulrich Drepper  <drepper@redhat.com>
1356         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Remove mrlock
1357         implementation.
1359 2007-06-18  Ulrich Drepper  <drepper@redhat.com>
1361         * pthreadP.h: Define PTHREAD_MUTEX_TYPE.
1362         * phtread_mutex_lock.c: Use PTHREAD_MUTEX_TYPE.
1363         * pthread_mutex_timedlock.c: Likewise.
1364         * pthread_mutex_trylock.c: Likewise.
1365         * pthread_mutex_unlock.c: Likewise.
1367 2007-06-17  Andreas Schwab  <schwab@suse.de>
1369         * sysdeps/pthread/pt-initfini.c: Tell gcc about the nonstandard
1370         sections.
1372 2007-06-17  Ulrich Drepper  <drepper@redhat.com>
1374         * allocatestack.c (allocate_stack): Make code compile if
1375         __ASSUME_PRIVATE_FUTEX is set.
1377 2007-06-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1379         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S:
1380         (__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
1381         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
1382         (__pthread_rwlock_wrlock): Likewise.
1383         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
1384         (pthread_rwlock_timedrdlock): Likewise.
1385         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
1386         (pthread_rwlock_timedwrlock): Likewise.
1387         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
1388         (__pthread_rwlock_unlock): Likewise.
1390 2007-06-10  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1392         * sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
1393         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
1394         Split __flags into __flags, __shared, __pad1 and __pad2.
1395         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
1396         futexes if they are available.
1397         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
1398         in libc-lowlevellock.S allow using private futexes.
1399         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
1400         FUTEX_PRIVATE_FLAG.  Add additional parameter to lll_futex_wait,
1401         lll_futex_timed_wait and lll_futex_wake.  Change lll_futex_wait
1402         to call lll_futex_timed_wait.  Add lll_private_futex_wait,
1403         lll_private_futex_timed_wait and lll_private_futex_wake.
1404         (lll_robust_mutex_unlock): Fix typo.
1405         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
1406         field in futex command setup.
1407         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
1408         COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
1409         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
1410         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
1411         if they are available.  Remove clear_once_control.
1412         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
1413         futexes if they are available.
1414         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1415         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1416         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1417         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1418         * sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
1419         Wake only when there are waiters.
1420         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
1421         support.  Indicate that there are waiters.  Remove unnecessary
1422         extra cancellation test.
1423         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.  Removed
1424         left-over duplication of __sem_wait_cleanup.
1426 2007-06-07  Ulrich Drepper  <drepper@redhat.com>
1428         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Add additional
1429         parameter to lll_futex_wait, lll_futex_timed_wait, and
1430         lll_futex_wake.  Change lll_futex_wait to call lll_futex_timed_wait.
1431         Add lll_private_futex_wait, lll_private_futex_timed_wait, and
1432         lll_private_futex_wake.
1433         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1434         * allocatestack.c: Adjust use of lll_futex_* macros.
1435         * init.c: Likewise.
1436         * lowlevellock.h: Likewise.
1437         * pthread_barrier_wait.c: Likewise.
1438         * pthread_cond_broadcast.c: Likewise.
1439         * pthread_cond_destroy.c: Likewise.
1440         * pthread_cond_signal.c: Likewise.
1441         * pthread_cond_timedwait.c: Likewise.
1442         * pthread_cond_wait.c: Likewise.
1443         * pthread_create.c: Likewise.
1444         * pthread_mutex_lock.c: Likewise.
1445         * pthread_mutex_setprioceiling.c: Likewise.
1446         * pthread_mutex_timedlock.c: Likewise.
1447         * pthread_mutex_unlock.c: Likewise.
1448         * pthread_rwlock_timedrdlock.c: Likewise.
1449         * pthread_rwlock_timedwrlock.c: Likewise.
1450         * pthread_rwlock_unlock.c: Likewise.
1451         * sysdeps/alpha/tls.h: Likewise.
1452         * sysdeps/i386/tls.h: Likewise.
1453         * sysdeps/ia64/tls.h: Likewise.
1454         * sysdeps/powerpc/tls.h: Likewise.
1455         * sysdeps/pthread/aio_misc.h: Likewise.
1456         * sysdeps/pthread/gai_misc.h: Likewise.
1457         * sysdeps/s390/tls.h: Likewise.
1458         * sysdeps/sh/tls.h: Likewise.
1459         * sysdeps/sparc/tls.h: Likewise.
1460         * sysdeps/unix/sysv/linux/fork.c: Likewise.
1461         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
1462         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
1463         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Likewise.
1464         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
1465         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1466         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
1467         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
1468         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
1469         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
1470         Likewise.
1471         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise.
1472         * sysdeps/x86_64/tls.h: Likewise.
1474 2007-05-29  Ulrich Drepper  <drepper@redhat.com>
1476         * pthread_getattr_np.c: No need to install a cancellation handler,
1477         this is no cancellation point.
1478         * pthread_getschedparam.c: Likewise.
1479         * pthread_setschedparam.c: Likewise.
1480         * pthread_setschedprio.c: Likewise.
1481         * sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
1482         lll_unlock_wake_cb.
1483         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
1484         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1485         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1486         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1487         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1488         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1489         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
1490         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
1491         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1492         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
1493         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1494         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1496         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
1497         whether there are more than one thread makes no sense here since
1498         we only call the slow path if the locks are taken.
1499         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
1501         * sysdeps/unix/sysv/linux/internaltypes.h: Introduce
1502         COND_NWAITERS_SHIFT.
1503         * pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of
1504         COND_CLOCK_BITS.
1505         * pthread_cond_init.c: Likewise.
1506         * pthread_cond_timedwait.c: Likewise.
1507         * pthread_cond_wait.c: Likewise.
1508         * pthread_condattr_getclock.c: Likewise.
1509         * pthread_condattr_setclock.c: Likewise.
1510         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise.
1511         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1512         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1513         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1514         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1516 2007-05-28  Jakub Jelinek  <jakub@redhat.com>
1518         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
1519         unistd.h.
1521         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
1522         insn suffix.
1523         (THREAD_GSCOPE_GET_FLAG): Remove.
1524         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Remove.
1525         * allocatestack.c (__wait_lookup_done): Revert 2007-05-24
1526         changes.
1527         * sysdeps/powerpc/tls.h (tcbhead_t): Remove gscope_flag.
1528         (THREAD_GSCOPE_GET_FLAG): Remove.
1529         (THREAD_GSCOPE_RESET_FLAG): Use THREAD_SELF->header.gscope_flag
1530         instead of THREAD_GSCOPE_GET_FLAG.
1531         (THREAD_GSCOPE_SET_FLAG): Likewise.  Add atomic_write_barrier after
1532         it.
1533         * sysdeps/s390/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1534         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1535         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1536         THREAD_GSCOPE_WAIT): Define.
1537         * sysdeps/sparc/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1538         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1539         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1540         THREAD_GSCOPE_WAIT): Define.
1541         * sysdeps/sh/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1542         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1543         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1544         THREAD_GSCOPE_WAIT): Define.
1545         * sysdeps/ia64/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1546         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1547         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1548         THREAD_GSCOPE_WAIT): Define.
1550 2007-05-24  Richard Henderson  <rth@redhat.com>
1552         * descr.h (struct pthread): Add header.gscope_flag.
1553         * sysdeps/alpha/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1554         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1555         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1556         THREAD_GSCOPE_WAIT): Define.
1558 2007-05-27  Ulrich Drepper  <drepper@redhat.com>
1560         * init.c: Make it compile with older kernel headers.
1562         * tst-initializers1.c: Show through exit code which test failed.
1564         * pthread_rwlock_init.c: Also initialize __shared field.
1565         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
1566         element in rwlock structure into four byte elements.  One of them is
1567         the new __shared element.
1568         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
1569         Likewise.
1570         [__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
1571         __shared, adjust names of other padding elements.
1572         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1573         * sysdeps/pthread/pthread.h: Adjust rwlock initializers.
1574         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
1575         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
1576         FUTEX_PRIVATE_FLAG.
1577         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
1578         futex to use private operations if possible.
1579         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1580         Likewise.
1581         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1582         Likewise.
1583         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1584         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1585         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1586         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1587         Likewise.
1588         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1589         Likewise.
1590         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1591         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1593 2007-05-26  Ulrich Drepper  <drepper@redhat.com>
1595         * pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
1596         * pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
1597         * pthread_rwlock_timedrdlock.c: Likewise.
1598         * pthread_rwlock_tryrdlock.c: Likewise.
1600         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
1601         optimization.
1603         * sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
1604         * sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
1605         duplication of __sem_wait_cleanup.
1607         * allocatestack.c: Revert last change.
1608         * init.c: Likewise.
1609         * sysdeps/i386/tls.h: Likewise.
1610         * sysdeps/x86_64/tls.h: Likewise.
1611         * descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
1612         header structure.
1613         * sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
1615         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
1616         Add private field.
1617         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
1618         * pthread_barrier_init.c: Set private flag if pshared and private
1619         futexes are supported.
1620         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
1621         private field in futex command setup.
1622         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
1624 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1626         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
1627         support.
1628         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1629         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1630         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1631         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1632         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1634         * semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
1635         * sem_init.c (__new_sem_init): Rewrite to initialize all three
1636         fields in the structure.
1637         (__old_sem_init): New function.
1638         * sem_open.c: Initialize all fields of the structure.
1639         * sem_getvalue.c: Adjust for renamed element.
1640         * sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
1641         (gen-as-const-headers): Add structsem.sym.
1642         * sysdeps/unix/sysv/linux/structsem.sym: New file.
1643         * sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
1644         struct new_sem.  Add struct old_sem.
1645         * sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
1646         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
1647         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1648         * sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
1649         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1650         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1651         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1652         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1653         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1654         * Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
1655         * tst-sem10.c: New file.
1656         * tst-sem11.c: New file.
1657         * tst-sem12.c: New file.
1658         * tst-typesizes.c: Test struct new_sem and struct old_sem instead
1659         of struct sem.
1661 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1662             Jakub Jelinek  <jakub@redhat.com>
1664         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
1665         Move __pthread_enable_asynccancel right before futex syscall.
1666         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
1667         Likewise.
1669 2007-05-24  Jakub Jelinek  <jakub@redhat.com>
1671         * sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
1672         THREAD_COPY_PRIVATE_FUTEX): Define.
1673         * sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
1674         THREAD_COPY_PRIVATE_FUTEX): Define.
1675         * allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
1676         * init.c (__pthread_initialize_minimal_internal): Use
1677         THREAD_SET_PRIVATE_FUTEX.
1679         * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
1680         (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
1681         THREAD_GSCOPE_FLAG_WAIT): Define.
1682         (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG,
1683         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define.
1684         * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use
1685         PTR_DEMANGLE.
1686         (THREAD_GSCOPE_GET_FLAG): Define.
1687         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define.
1688         * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
1689         instead of ->header.gscope_flag directly.
1691 2007-05-23  Ulrich Drepper  <drepper@redhat.com>
1693         * init.c (__pthread_initialize_minimal_internal): Check whether
1694         private futexes are available.
1695         * allocatestack.c (allocate_stack): Copy private_futex field from
1696         current thread into the new stack.
1697         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
1698         futexes if they are available.
1699         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
1700         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
1701         in libc-lowlevellock.S allow using private futexes.
1702         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1703         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
1704         FUTEX_PRIVATE_FLAG.
1705         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1706         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
1707         if they are available.
1708         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
1709         * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
1710         * sysdeps/i386/tcb-offsets.sym: Likewise.
1711         * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
1712         * sysdeps/i386/tls.h (tcbhead_t): Likewise.
1714 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
1716         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1717         Remove ptr_wait_lookup_done again.
1718         * init.c (pthread_functions): Don't add .ptr_wait_lookup_done here.
1719         (__pthread_initialize_minimal_internal): Initialize
1720         _dl_wait_lookup_done pointer in _rtld_global directly.
1721         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1722         Remove code to code _dl_wait_lookup_done.
1723         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
1724         encrypted for now.
1726 2007-05-21  Jakub Jelinek  <jakub@redhat.com>
1728         * tst-robust9.c (do_test): Don't fail if ENABLE_PI and
1729         pthread_mutex_init failed with ENOTSUP.
1731 2007-05-19  Ulrich Drepper  <drepper@redhat.com>
1733         * allocatestack.c (__wait_lookup_done): New function.
1734         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1735         Add ptr_wait_lookup_done.
1736         * init.c (pthread_functions): Initialize .ptr_wait_lookup_done.
1737         * pthreadP.h: Declare __wait_lookup_done.
1738         * sysdeps/i386/tls.h (tcbhead_t): Add gscope_flag.
1739         Define macros to implement reference handling of global scope.
1740         * sysdeps/x86_64/tls.h: Likewise.
1741         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1742         Initialize GL(dl_wait_lookup_done).
1744 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
1746         [BZ #4512]
1747         * pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
1748         is detected.
1749         * pthread_mutex_timedlock.c: Likewise.
1750         * pthread_mutex_trylock.c: Likewise.
1751         Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
1753         * Makefile (tests): Add tst-robust9 and tst-robustpi9.
1754         * tst-robust9.c: New file.
1755         * tst-robustpi9.c: New file.
1757         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
1758         unnecessary extra cancellation test.
1760 2007-05-14  Ulrich Drepper  <drepper@redhat.com>
1762         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
1763         extra cancellation test.
1764         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1766 2007-05-10  Ulrich Drepper  <drepper@redhat.com>
1768         * descr.h (struct pthread): Rearrange members to fill hole in
1769         64-bit layout.
1771         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1772         (__pthread_setaffinity_new): If syscall was successful and
1773         RESET_VGETCPU_CACHE is defined, use it before returning.
1774         * sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
1776 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
1778         [BZ #4455]
1779         * tst-align2.c: Include stackinfo.h.
1780         * tst-getpid1.c: Likewise.
1782 2007-05-02  Carlos O'Donell  <carlos@systemhalted.org>
1784         [BZ #4455]
1785         * tst-align2.c (do_test): Add _STACK_GROWS_UP case.
1786         * tst-getpid1.c (do_test): Likewise.
1788         [BZ #4456]
1789         * allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
1790         (allocate_stack): Likewise.
1792 2007-05-07  Ulrich Drepper  <drepper@redhat.com>
1794         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
1795         (__lll_robust_lock_wait): Fix race caused by reloading of futex value.
1796         (__lll_robust_timedlock_wait): Likewise.
1797         Reported by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
1799 2007-05-06  Mike Frysinger  <vapier@gentoo.org>
1801         [BZ #4465]
1802         * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
1803         * tst-cancel4.c (tf_fdatasync): New test.
1805 2007-04-27  Ulrich Drepper  <drepper@redhat.com>
1807         [BZ #4392]
1808         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Treat error
1809         check mutexes like normal mutexes.
1811         [BZ #4306]
1812         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
1813         Initialize the whole sigevent structure to appease valgrind.
1815 2007-04-25  Ulrich Drepper  <drepper@redhat.com>
1817         * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
1818         * sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
1820 2007-04-06  Ulrich Drepper  <drepper@redhat.com>
1822         * tst-locale1.c: Avoid warnings.
1823         * tst-locale2.c: Likewise.
1825 2007-03-19  Steven Munroe  <sjmunroe@us.ibm.com>
1827         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1828         (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
1830 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
1832         * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
1833         __extern_always_inline where appropriate.
1834         * sysdeps/pthread/pthread.h: Likewise.
1836 2007-03-13  Richard Henderson  <rth@redhat.com>
1838         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
1839         separate cfi regions for the two subsections.
1841 2007-02-25  Ulrich Drepper  <drepper@redhat.com>
1843         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
1844         new thread, don't just decrement it.
1845         Patch by Suzuki K P <suzuki@in.ibm.com>.
1847 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
1849         * sysdeps/pthread/pthread-functions.h: Correct last patch, correct
1850         PTHFCT_CALL definition.
1852 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
1854         * sysdeps/pthread/pthread-functions.h: If PTR_DEMANGLE is not
1855         available, don't use it.
1857 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
1859         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1860         (__lll_mutex_timedlock_wait): Use correct pointer when we don't
1861         call into the kernel to delay.
1863 2007-01-18  Ulrich Drepper  <drepper@redhat.com>
1865         * tst-initializers1.c: We want to test the initializers as seen
1866         outside of libc, so undefined _LIBC.
1868         * pthread_join.c (cleanup): Avoid warning.
1870 2007-01-17  Ulrich Drepper  <drepper@redhat.com>
1872         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1873         (__lll_timedwait_tid): Add unwind info.
1875         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Don't just copy the
1876         function table, mangle the pointers.
1877         * sysdeps/pthread/pthread-functions.h: Define PTHFCT_CALL.
1878         * forward.c: Use PTHFCT_CALL and __libc_pthread_functions_init.
1879         * sysdeps/pthread/bits/libc-lock.h: When using __libc_pthread_functions
1880         demangle pointers before use.
1881         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Use PTHFCT_CALL to
1882         demangle pointer.
1883         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
1884         * sysdeps/pthread/setxid.h: Likewise.
1886 2007-01-12  Ulrich Drepper  <drepper@redhat.com>
1888         * tst-rwlock7.c: Show some more information in case of correct
1889         behavior.
1891 2007-01-11  Ulrich Drepper  <drepper@redhat.com>
1893         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1894         (lll_futex_timed_wait): Undo part of last change, don't negate
1895         return value.
1897 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
1899         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups.  Define
1900         FUTEX_CMP_REQUEUE and lll_futex_requeue.
1902 2006-12-28  David S. Miller  <davem@davemloft.net>
1904         * shlib-versions: Fix sparc64 linux target specification.
1906 2007-01-10  Jakub Jelinek  <jakub@redhat.com>
1908         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1909         Adjust include path for pthread_barrier_wait.c move.
1911 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
1913         * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
1914         tid isn't reread from pd->tid in between ESRCH test and the syscall.
1916 2006-12-06  Jakub Jelinek  <jakub@redhat.com>
1918         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
1919         6 argument cancellable syscalls.
1920         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
1921         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
1922         6 argument cancellable syscalls.
1923         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
1925 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
1927         * sysdeps/unix/sysv/linux/rtld-lowlevel.h
1928         (__rtld_mrlock_initialize): Add missing closing parenthesis.
1930 2006-10-30  Jakub Jelinek  <jakub@redhat.com>
1932         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
1933         __sync_lock_release instead of __sync_lock_release_si.
1935 2006-10-29  Jakub Jelinek  <jakub@redhat.com>
1937         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P):
1938         Define.
1939         (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld.
1940         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
1941         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
1942         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
1943         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
1944         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
1945         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
1946         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
1947         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
1948         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
1949         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
1951 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
1953         * sysdeps/pthread/pthread_barrier_wait.c: Move to...
1954         * pthread_barrier_wait.c: ...here.
1955         * sysdeps/pthread/pthread_cond_broadcast.c: Move to...
1956         * pthread_cond_broadcast.c: ...here.
1957         * sysdeps/pthread/pthread_cond_signal.c: Move to...
1958         * pthread_cond_signal.c: ...here.
1959         * sysdeps/pthread/pthread_cond_timedwait.c: Move to...
1960         * pthread_cond_timedwait.c: ...here.
1961         * sysdeps/pthread/pthread_cond_wait.c: Move to...
1962         * pthread_cond_wait.c: ...here.
1963         * sysdeps/pthread/pthread_once.c: Move to...
1964         * pthread_once.c: ...here.
1965         * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to...
1966         * pthread_rwlock_rdlock.c: ...here.
1967         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to...
1968         * pthread_rwlock_timedrdlock.c: ...here.
1969         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to...
1970         * pthread_rwlock_timedwrlock.c: ...here.
1971         * sysdeps/pthread/pthread_rwlock_unlock.c: Move to...
1972         * pthread_rwlock_unlock.c: ...here.
1973         * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to...
1974         * pthread_rwlock_wrlock.c: ...here.
1975         * sysdeps/pthread/pthread_spin_destroy.c: Move to...
1976         * pthread_spin_destroy.c: ...here.
1977         * sysdeps/pthread/pthread_spin_init.c: Move to...
1978         * pthread_spin_init.c: ...here.
1979         * sysdeps/pthread/pthread_spin_unlock.c: Move to...
1980         * pthread_spin_unlock.c: ...here.
1981         * sysdeps/pthread/pthread_getcpuclockid.c: Move to...
1982         * pthread_getcpuclockid.c: ...here.
1984         * init.c: USE_TLS support is now always enabled.
1985         * tst-tls5.h: Likewise.
1986         * sysdeps/alpha/tls.h: Likewise.
1987         * sysdeps/i386/tls.h: Likewise.
1988         * sysdeps/ia64/tls.h: Likewise.
1989         * sysdeps/powerpc/tls.h: Likewise.
1990         * sysdeps/s390/tls.h: Likewise.
1991         * sysdeps/sh/tls.h: Likewise.
1992         * sysdeps/sparc/tls.h: Likewise.
1993         * sysdeps/x86_64/tls.h: Likewise.
1995 2006-10-27  Jakub Jelinek  <jakub@redhat.com>
1997         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
1998         __rtld_mrlock_change): Update oldval if atomic compare and exchange
1999         failed.
2001         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
2002         Define to THREAD_SELF->header.multiple_threads.
2003         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
2004         Likewise.
2005         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
2006         Likewise.
2007         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
2008         (SINGLE_THREAD_P): Likewise.
2009         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
2010         (SINGLE_THREAD_P): Likewise.
2011         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2012         (SINGLE_THREAD_P): Likewise.
2013         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
2014         (SINGLE_THREAD_P): Likewise.
2015         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P):
2016         Likewise.
2017         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
2018         (SINGLE_THREAD_P): Likewise.
2019         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
2020         (SINGLE_THREAD_P): Likewise.
2021         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P):
2022         Likewise.
2024 2006-10-26  Jakub Jelinek  <jakub@redhat.com>
2026         * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3
2027         by default rather than 2_3_3.
2029 2006-10-17  Jakub Jelinek  <jakub@redhat.com>
2031         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
2032         __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
2033         atomic_* instead of catomic_* macros.
2035 2006-10-12  Ulrich Drepper  <drepper@redhat.com>
2037         [BZ #3285]
2038         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX.
2039         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
2040         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
2041         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
2042         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
2043         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX.
2044         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
2045         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
2046         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
2047         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise.
2048         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
2049         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
2050         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
2052 2006-10-11  Ulrich Drepper  <drepper@redhat.com>
2054         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for
2055         cancelable syscalls with six parameters.
2057         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
2058         operations instead of atomic_*.
2060 2006-10-09  Ulrich Drepper  <drepper@redhat.com>
2062         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
2064 2006-10-07  Ulrich Drepper  <drepper@redhat.com>
2066         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file.
2067         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file.
2068         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c:
2069         New file.
2070         * pthread_attr_setstack.c: Allow overwriting the version number of the
2071         new symbol.
2072         * pthread_attr_setstacksize.c: Likewise.
2073         (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use
2074         it.
2075         * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add
2076         pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6.
2078 2006-09-24  Ulrich Drepper  <drepper@redhat.com>
2080         [BZ #3251]
2081         * descr.h (ENQUEUE_MUTEX_BOTH): Add cast to avoid warning.
2082         Patch by Petr Baudis.
2084 2006-09-18  Jakub Jelinek  <jakub@redhat.com>
2086         * tst-kill4.c (do_test): Explicitly set tf thread's stack size.
2088         * tst-cancel2.c (tf): Loop as long as something was written.
2090 2006-09-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2092         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: For PI
2093         mutexes wake all mutexes.
2094         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Don't increment
2095         WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2096         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2098 2006-09-12  Ulrich Drepper  <drepper@redhat.com>
2100         * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use
2101         to guarantee the thread is always canceled.
2103 2006-09-08  Jakub Jelinek  <jakub@redhat.com>
2105         * tst-cond22.c: Include pthread.h instead of pthreadP.h.
2106         Include stdlib.h.
2107         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Only
2108         increase FUTEX if increasing WAKEUP_SEQ.  Fix comment typo.
2109         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2110         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2111         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2113 2006-09-08  Ulrich Drepper  <drepper@redhat.com>
2115         [BZ #3123]
2116         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Don't
2117         increment WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2118         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2119         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2120         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2121         * Makefile (tests): Add tst-cond22.
2122         * tst-cond22.c: New file.
2124 2006-09-05  Ulrich Drepper  <drepper@redhat.com>
2126         [BZ #3124]
2127         * descr.h (struct pthread): Add parent_cancelhandling.
2128         * sysdeps/pthread/createthread.c (create_thread): Pass parent
2129         cancelhandling value to child.
2130         * pthread_create.c (start_thread): If parent thread was canceled
2131         reset the SIGCANCEL mask.
2132         * Makefile (tests): Add tst-cancel25.
2133         * tst-cancel25.c: New file.
2135 2006-09-05  Jakub Jelinek  <jakub@redhat.com>
2136             Ulrich Drepper  <drepper@redhat.com>
2138         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
2139         counterp if it is already zero.
2140         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
2142 2006-03-04  Jakub Jelinek  <jakub@redhat.com>
2143             Roland McGrath  <roland@redhat.com>
2145         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2146         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2147         LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
2148         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2149         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2150         lll_robust_mutex_timedlock, lll_mutex_unlock,
2151         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2152         Add _L_*_ symbols around the subsection.
2153         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
2154         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2156 2006-03-03  Jakub Jelinek  <jakub@redhat.com>
2157             Roland McGrath  <roland@redhat.com>
2159         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2160         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2161         LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
2162         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2163         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2164         lll_robust_mutex_timedlock, lll_mutex_unlock,
2165         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2166         Add _L_*_ symbols around the subsection.
2167         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
2168         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2170 2006-08-31  Ulrich Drepper  <drepper@redhat.com>
2172         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Undo last
2173         change because it can disturb too much existing code.  If real hard
2174         reader preference is needed we'll introduce another type.
2175         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2176         (pthread_rwlock_timedwrlock): Likewise.
2177         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2178         Likewise.
2180 2006-08-30  Ulrich Drepper  <drepper@redhat.com>
2182         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Respect
2183         reader preference.
2184         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2185         (pthread_rwlock_timedwrlock): Likewise.
2186         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2187         Likewise.
2189 2006-08-25  Jakub Jelinek  <jakub@redhat.com>
2191         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
2192         Only define ifdef SHARED.
2194 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
2196         * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
2197         (free_stacks): ...here.
2198         (__free_stack_cache): New function.
2199         * pthreadP.h: Declare __free_stack_cache.
2200         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
2201         ptr_freeres.
2202         * init.c (pthread_functions): Initialize ptr_freeres.
2203         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
2204         New freeres function.
2206 2006-07-30  Joseph S. Myers  <joseph@codesourcery.com>
2208         [BZ #3018]
2209         * Makefile (extra-objs): Add modules to extra-test-objs instead.
2211 2006-08-20  Ulrich Drepper  <drepper@redhat.com>
2213         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2214         _XOPEN_REALTIME_THREADS.
2216 2006-08-15  Jakub Jelinek  <jakub@redhat.com>
2218         * sysdeps/unix/sysv/linux/clock_settime.c (INTERNAL_VSYSCALL): Use
2219         HAVE_CLOCK_GETRES_VSYSCALL as guard macro rather than
2220         HAVE_CLOCK_GETTIME_VSYSCALL.
2221         (maybe_syscall_settime_cpu): Use plain INTERNAL_VSYSCALL here.
2223 2006-08-14  Jakub Jelinek  <jakub@redhat.com>
2225         * sysdeps/unix/sysv/linux/bits/posix_opt.h
2226         (_POSIX_THREAD_PRIO_PROTECT): Define to 200112L.
2227         * descr.h (struct priority_protection_data): New type.
2228         (struct pthread): Add tpp field.
2229         * pthreadP.h (PTHREAD_MUTEX_PP_NORMAL_NP,
2230         PTHREAD_MUTEX_PP_RECURSIVE_NP, PTHREAD_MUTEX_PP_ERRORCHECK_NP,
2231         PTHREAD_MUTEX_PP_ADAPTIVE_NP): New enum values.
2232         * pthread_mutex_init.c (__pthread_mutex_init): Handle non-robust
2233         TPP mutexes.
2234         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle TPP mutexes.
2235         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
2236         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
2237         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
2238         * tpp.c: New file.
2239         * pthread_setschedparam.c (__pthread_setschedparam): Handle priority
2240         boosted by TPP.
2241         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
2242         * pthread_mutexattr_getprioceiling.c
2243         (pthread_mutexattr_getprioceiling): If ceiling is 0, ensure it is
2244         in the SCHED_FIFO priority range.
2245         * pthread_mutexattr_setprioceiling.c
2246         (pthread_mutexattr_setprioceiling): Fix prioceiling validation.
2247         * pthread_mutex_getprioceiling.c (pthread_mutex_getprioceiling): Fail
2248         if mutex is not TPP.  Ceiling is now in __data.__lock.
2249         * pthread_mutex_setprioceiling.c: Include stdbool.h.
2250         (pthread_mutex_setprioceiling): Fix prioceiling validation.  Ceiling
2251         is now in __data.__lock.  Add locking.
2252         * pthread_create.c (__free_tcb): Free pd->tpp structure.
2253         * Makefile (libpthread-routines): Add tpp.
2254         (xtests): Add tst-mutexpp1, tst-mutexpp6 and tst-mutexpp10.
2255         * tst-tpp.h: New file.
2256         * tst-mutexpp1.c: New file.
2257         * tst-mutexpp6.c: New file.
2258         * tst-mutexpp10.c: New file.
2259         * tst-mutex1.c (TEST_FUNCTION): Don't redefine if already defined.
2260         * tst-mutex6.c (TEST_FUNCTION): Likewise.
2262 2006-08-12  Ulrich Drepper  <drepper@redhat.com>
2264         [BZ #2843]
2265         * pthread_join.c (pthread_join): Account for self being canceled
2266         when checking for deadlocks.
2267         * tst-join5.c: Cleanups.  Allow to be used in tst-join6.
2268         (tf1): Don't print anything after pthread_join returns, this would be
2269         another cancellation point.
2270         (tf2): Likewise.
2271         * tst-join6.c: New file.
2272         * Makefile (tests): Add tst-join6.
2274 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
2276         [BZ #2892]
2277         * pthread_setspecific.c (__pthread_setspecific): Check
2278         out-of-range index before checking for unused key.
2280         * sysdeps/pthread/gai_misc.h: New file.
2282 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
2284         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
2285         file.  Don't use sysctl.
2286         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
2287         overwrite the file if this is likely not true.
2289 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
2291         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
2292         * Makefile (tests): Add tst-getpid3.
2293         * tst-getpid3.c: New file.
2295 2006-07-30  Roland McGrath  <roland@redhat.com>
2297         * Makefile (libpthread-routines): Add ptw-sigsuspend.
2299         * sysdeps/unix/sysv/linux/i386/not-cancel.h
2300         (pause_not_cancel): New macro.
2301         (nanosleep_not_cancel): New macro.
2302         (sigsuspend_not_cancel): New macro.
2303         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
2304         nanosleep_not_cancel macro from <not-cancel.h>.
2305         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
2306         macro from <not-cancel.h>.
2308 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
2309             Jakub Jelinek  <jakub@redhat.com>
2311         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
2312         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
2313         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
2314         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
2315         * pthread_mutex_init.c: Add support for priority inheritance mutex.
2316         * pthread_mutex_lock.c: Likewise.
2317         * pthread_mutex_timedlock.c: Likewise.
2318         * pthread_mutex_trylock.c: Likewise.
2319         * pthread_mutex_unlock.c: Likewise.
2320         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
2321         all mutexes.
2322         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
2323         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
2324         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
2325         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
2326         pthread-pi-defines.sym.
2327         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
2328         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
2329         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2330         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2331         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2332         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2333         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2334         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2335         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2336         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2337         _POSIX_THREAD_PRIO_INHERIT to 200112L.
2338         * tst-mutex1.c: Adjust to allow use in PI mutex test.
2339         * tst-mutex2.c: Likewise.
2340         * tst-mutex3.c: Likewise.
2341         * tst-mutex4.c: Likewise.
2342         * tst-mutex5.c: Likewise.
2343         * tst-mutex6.c: Likewise.
2344         * tst-mutex7.c: Likewise.
2345         * tst-mutex7a.c: Likewise.
2346         * tst-mutex8.c: Likewise.
2347         * tst-mutex9.c: Likewise.
2348         * tst-robust1.c: Likewise.
2349         * tst-robust7.c: Likewise.
2350         * tst-robust8.c: Likewise.
2351         * tst-mutexpi1.c: New file.
2352         * tst-mutexpi2.c: New file.
2353         * tst-mutexpi3.c: New file.
2354         * tst-mutexpi4.c: New file.
2355         * tst-mutexpi5.c: New file.
2356         * tst-mutexpi6.c: New file.
2357         * tst-mutexpi7.c: New file.
2358         * tst-mutexpi7a.c: New file.
2359         * tst-mutexpi8.c: New file.
2360         * tst-mutexpi9.c: New file.
2361         * tst-robust1.c: New file.
2362         * tst-robust2.c: New file.
2363         * tst-robust3.c: New file.
2364         * tst-robust4.c: New file.
2365         * tst-robust5.c: New file.
2366         * tst-robust6.c: New file.
2367         * tst-robust7.c: New file.
2368         * tst-robust8.c: New file.
2369         * Makefile (tests): Add the new tests.
2371         * pthread_create.c (start_thread): Add some casts to avoid warnings.
2372         * pthread_mutex_destroy.c: Remove unneeded label.
2374 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
2376         * pthread_mutex_init.c (__pthread_mutex_init): Move some
2377         computations to compile time.
2379 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
2381         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
2383 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
2385         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
2387 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
2389         * pthread_key_create.c (__pthread_key_create): Do away with
2390         __pthread_keys_lock.
2392         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2393         (__kernel_cpumask_size): Mark as hidden.
2394         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
2396         * sem_open.c (__sem_mappings_lock): Mark as hidden.
2397         * semaphoreP.h (__sem_mappings_lock): Likewise.
2399 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
2401         * pthread_atfork.c: Mark __dso_handle as hidden.
2403 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
2405         [BZ #2644]
2406         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
2407         the reload problem.  Change the one path in pthread_cancel_init
2408         which causes the problem.  Force gcc to reload.  Simplify callers.
2409         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
2410         (_Unwind_GetBSP): Undo last patch.
2412 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
2414         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
2415         function pointer is reloaded after pthread_cancel_init calls.
2417         [BZ #2644]
2418         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
2419         pointers are reloaded after pthread_cancel_init calls.
2421 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
2423         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
2424         __always_inline.
2426 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
2428         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
2429         Allocate new object which is passed to timer_sigev_thread so that
2430         the timer can be deleted before the new thread is scheduled.
2432 2006-04-26  Roland McGrath  <roland@redhat.com>
2434         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
2436 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
2438         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
2439         suffix for conditional jumps.
2440         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
2441         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2442         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
2443         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
2444         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2445         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2447         * init.c (sigcancel_handler): Compare with correct PID even if the
2448         thread is in the middle of a fork call.
2449         (sighandler_setxid): Likewise.
2450         Reported by Suzuki K P <suzuki@in.ibm.com> .
2452 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
2454         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
2456 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
2458         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
2459         fails [Coverity CID 105].
2461 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
2463         * sysdeps/pthread/pthread.h: Add nonnull attributes.
2465 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
2467         [BZ #2505]
2468         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
2469         Define __lll_rel_instr using lwsync.
2471 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
2473         * allocatestack.c (allocate_stack): Always initialize robust_head.
2474         * descr.h: Define struct robust_list_head.
2475         (struct pthread): Use robust_list_head in robust mutex list definition.
2476         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
2477         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
2478         (__pthread_initialize_minimal_internal): Register robust_list with
2479         the kernel.
2480         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
2481         Declare __set_robust_list_avail.
2482         * pthread_create.c (start_thread): Register robust_list of new thread.
2483         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
2484         waiters.
2485         * pthread_mutex_destroy.c: For robust mutexes don't look at the
2486         number of users, it's unreliable.
2487         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
2488         set_robust_list syscall is available.
2489         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
2490         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
2491         Set robust_head.list_op_pending before trying to lock a robust mutex.
2492         * pthread_mutex_timedlock.c: Likewise.
2493         * pthread_mutex_trylock.c: Likewise.
2494         * pthread_mutex_unlock.c: Likewise for unlocking.
2495         * Makefile (tests): Add tst-robust8.
2496         * tst-robust8.c: New file.
2498 2006-03-08  Andreas Schwab  <schwab@suse.de>
2500         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
2501         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
2503 2006-03-05  Roland McGrath  <roland@redhat.com>
2505         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
2506         and $config_os doesn't match *linux*.
2508 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
2510         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
2511         Use __syscall_error.
2512         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2513         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
2514         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
2515         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2516         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
2517         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
2519 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
2521         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
2523 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
2525         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
2526         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
2527         mutex.
2528         (__lll_robust_timedlock_wait): Likewise.
2529         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
2530         (__lll_robust_lock_wait): Likewise.
2531         (__lll_robust_timedlock_wait): Likewise.
2532         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
2533         (__lll_robust_lock_wait): Likewise.
2534         (__lll_robust_timedlock_wait): Likewise.
2536 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
2538         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
2539         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2540         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2541         lll_robust_mutex_unlock): Define.
2542         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2544 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
2546         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
2547         instead of <clone.S>.
2549 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
2551         * Makefile (libpthread-routines): Add
2552         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
2553         and pthread_mutex_[sg]etprioceiling.
2554         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
2555         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
2556         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
2557         pthread_mutex_setprioceiling.
2558         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
2559         PTHREAD_PRIO_PROTECT): New enum values.
2560         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
2561         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
2562         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
2563         prototypes.
2564         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
2565         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
2566         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
2567         Define.
2568         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
2569         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
2570         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
2571         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
2572         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
2573         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
2574         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
2575         protocol mutexes.
2576         * pthread_mutex_getprioceiling.c: New file.
2577         * pthread_mutex_setprioceiling.c: New file.
2578         * pthread_mutexattr_getprioceiling.c: New file.
2579         * pthread_mutexattr_setprioceiling.c: New file.
2580         * pthread_mutexattr_getprotocol.c: New file.
2581         * pthread_mutexattr_setprotocol.c: New file.
2583 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
2585         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
2587 2006-02-27  Roland McGrath  <roland@redhat.com>
2589         * sysdeps/pthread/Subdirs: List nptl here too.
2590         * configure (libc_add_on_canonical): New variable.
2592         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
2594         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
2595         self to get main source tree's file.
2596         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
2597         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
2598         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
2599         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
2600         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
2601         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
2602         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
2603         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
2604         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
2605         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
2606         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
2607         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
2608         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
2610         * Makefile: Use $(sysdirs) in vpath directive.
2612         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
2613         (CPPFLAGS-timer_routines.c): Likewise.
2615         * Makeconfig (includes): Variable removed.
2617 2006-02-26  Roland McGrath  <roland@redhat.com>
2619         * sysdeps/generic/pt-raise.c: Moved to ...
2620         * pt-raise.c: ... here.
2621         * sysdeps/generic/lowlevellock.h: Moved to ...
2622         * lowlevellock.h: ... here.
2624 2006-02-23  Roland McGrath  <roland@redhat.com>
2626         * descr.h (struct pthread): Add final member `end_padding'.
2627         (PTHREAD_STRUCT_END_PADDING): Use it.
2629 2006-02-20  Roland McGrath  <roland@redhat.com>
2631         * sysdeps/mips: Directory removed, saved in ports repository.
2632         * sysdeps/unix/sysv/linux/mips: Likewise.
2634 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
2636         * tst-robust1.c: Add second mutex to check that the mutex list is
2637         handled correctly.
2639 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
2641         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
2642         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2643         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2644         lll_robust_mutex_unlock): New macros.
2645         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2646         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2647         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2648         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2649         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
2651 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2653         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
2654         definitions.
2655         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
2657 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
2659         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2660         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
2661         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2662         (lll_robust_mutex_unlock): Likewise.
2664 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
2666         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
2667         Set robust_list.__next rather than robust_list.
2668         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
2669         (__pthread_list_t): New typedef.
2670         (pthread_mutex_t): Replace __next and __prev fields with __list.
2671         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
2672         (__pthread_list_t): New typedef.
2673         (pthread_mutex_t): Replace __next and __prev fields with __list.
2674         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2675         (__pthread_list_t, __pthread_slist_t): New typedefs.
2676         (pthread_mutex_t): Replace __next and __prev fields with __list.
2677         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
2678         (__pthread_list_t, __pthread_slist_t): New typedefs.
2679         (pthread_mutex_t): Replace __next and __prev fields with __list.
2680         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
2681         (__pthread_list_t, __pthread_slist_t): New typedefs.
2682         (pthread_mutex_t): Replace __next and __prev fields with __list.
2683         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
2684         (__pthread_slist_t): New typedef.
2685         (pthread_mutex_t): Replace __next field with __list.
2687 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
2689         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
2690         PTHREAD_MUTEX_OWNERDEAD.
2691         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
2692         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
2693         * Makefile (libpthread-routines): Add lowlevelrobustlock.
2694         * pthread_create.c (start_thread): Very much simplify robust_list loop.
2695         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
2696         to PTHREAD_MUTEX_INCONSISTENT.
2697         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
2698         * pthread_mutex_lock.c: Reimplement robust mutex handling.
2699         * pthread_mutex_trylock.c: Likewise.
2700         * pthread_mutex_timedlock.c: Likewise.
2701         * pthread_mutex_unlock.c: Likewise.
2702         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
2703         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
2704         lowlevelrobustlock.sym.
2705         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
2706         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
2707         definitions.
2708         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2709         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
2710         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
2711         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
2712         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
2714 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
2716         * allocatestack.c (allocate_stack): Initialize robust_list.
2717         * init.c (__pthread_initialize_minimal_internal): Likewise.
2718         * descr.h (struct xid_command): Pretty printing.
2719         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
2720         robust_list.  Adjust macros.
2721         * pthread_create.c (start_thread): Adjust robust_list handling.
2722         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
2723         but the owner for all robust mutex types.
2724         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
2725         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
2726         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2727         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
2729         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
2730         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
2732 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
2734         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
2735         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
2737 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2739         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
2740         Return status.
2741         (lll_futex_timed_wait): Define.
2743 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
2745         * tst-cancel4.c: Test ppoll.
2747 2006-01-18  Andreas Jaeger  <aj@suse.de>
2749         [BZ #2167]
2750         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
2751         (pthread_mutex_t): Follow changes for other archs.  Based on patch
2752         by Jim Gifford <patches@jg555.com>.
2754 2006-01-13  Richard Henderson  <rth@redhat.com>
2756         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
2758 2006-01-10  Roland McGrath  <roland@redhat.com>
2760         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
2761         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
2762         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
2763         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
2764         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
2765         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
2766         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
2767         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
2768         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
2769         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
2771 2006-01-09  Roland McGrath  <roland@redhat.com>
2773         * tst-initializers1-c89.c: New file.
2774         * tst-initializers1-c99.c: New file.
2775         * tst-initializers1-gnu89.c: New file.
2776         * tst-initializers1-gnu99.c: New file.
2777         * Makefile (tests): Add them.
2778         (CFLAGS-tst-initializers1-c89.c): New variable.
2779         (CFLAGS-tst-initializers1-c99.c): New variable.
2780         (CFLAGS-tst-initializers1-gnu89.c): New variable.
2781         (CFLAGS-tst-initializers1-gnu99.c): New variable.
2783         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2784         Use __extension__ on anonymous union definition.
2785         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2786         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2787         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2788         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2789         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2791 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
2793         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
2794         Don't give the union a name because it changes the mangled name.
2795         Instead name the struct for __data.
2796         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
2797         Likewise.
2798         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
2799         Likewise.
2801 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
2803         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
2804         stack bias to mc_ftp field.
2806 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
2808         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
2809         being too clever and reloading the futex value where it shouldn't.
2811 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
2813         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
2814         correct type.
2816 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
2818         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
2819         Add cfi directives.
2821 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
2823         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
2824         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
2825         rename in tcbhead_t.
2827         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2828         Don't give the union a name because it changes the mangled name.
2829         Instead name the struct for __data.
2830         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2831         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2832         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2833         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2834         * pthread_create.c (start_thread): Adjust robust mutex free loop.
2835         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
2837 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
2839         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
2840         Return status.
2841         (lll_futex_timed_wait): Define.
2842         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2843         * sysdeps/pthread/aio_misc.h: New file.
2845 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
2847         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
2849 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
2851         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2852         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
2853         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2855 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
2857         * tst-cancel24.cc: Use C headers instead of C++ headers.
2859 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
2861         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
2862         sparc-linux configured glibc.
2863         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
2864         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
2865         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
2866         atomic_compare_and_exchange_val_24_acq instead of
2867         atomic_compare_and_exchange_val_acq.
2868         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
2869         instead of atomic_exchange_rel.
2870         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
2871         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
2872         file.
2873         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
2874         file.
2875         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
2876         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
2877         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
2878         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
2879         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
2880         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
2881         New file.
2882         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2883         New file.
2884         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
2885         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
2886         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
2887         file.
2888         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
2889         file.
2890         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
2892 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
2894         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
2895         mutex initializers.
2897 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
2899         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
2900         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2901         THREAD_COPY_POINTER_GUARD): Define.
2902         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
2903         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
2905 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
2907         * version.c: Update copyright year.
2909 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2911         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
2912         .eh_frame section, use cfi_* directives.
2913         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
2915 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
2917         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
2918         now.
2920 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
2922         * sysdeps/pthread/sigaction.c: Removed.
2923         * sigaction.c: New file.
2924         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
2926 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
2928         * Makefile (tests): Add tst-signal7.
2929         * tst-signal7.c: New file.
2931 2005-12-27  Roland McGrath  <roland@redhat.com>
2933         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
2934         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
2935         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
2936         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
2937         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
2938         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
2939         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
2940         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
2941         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
2942         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
2943         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
2945 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
2947         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
2948         and __prev field to pthread_mutex_t.
2949         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2950         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2951         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2952         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2953         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
2954         to pthread_mutex_t.
2956 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
2958         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
2959         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
2960         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
2961         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
2962         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
2963         and PTHREAD_MUTEXATTR_FLAG_BITS.
2964         * descr.h (struct pthread): Add robust_list field and define
2965         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
2966         * pthread_mutexattr_getrobust.c: New file.
2967         * pthread_mutexattr_setrobust.c: New file.
2968         * pthread_mutex_consistent.c: New file.
2969         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
2970         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
2971         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
2972         Adjust pthread_mutex_t initializers.
2973         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
2974         field to pthread_mutex_t.
2975         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
2976         and __prev field to pthread_mutex_t.
2977         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
2978         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
2979         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
2980         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
2981         * pthread_mutexattr_gettype.c: Likewise.
2982         * pthread_mutexattr_setpshared.c: Likewise.
2983         * pthread_mutexattr_settype.c: Likewise.
2984         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
2985         Initialize mutex kind according to robust flag.
2986         * pthread_mutex_lock.c: Implement local robust mutex.
2987         * pthread_mutex_timedlock.c: Likewise.
2988         * pthread_mutex_trylock.c: Likewise.
2989         * pthread_mutex_unlock.c: Likewise.
2990         * pthread_create.c (start_thread): Mark robust mutexes which remained
2991         locked as dead.
2992         * tst-robust1.c: New file.
2993         * tst-robust2.c: New file.
2994         * tst-robust3.c: New file.
2995         * tst-robust4.c: New file.
2996         * tst-robust5.c: New file.
2997         * tst-robust6.c: New file.
2998         * tst-robust7.c: New file.
2999         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
3000         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
3001         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
3002         tst-robust5, tst-robust6, and tst-robust7.
3004         * tst-typesizes.c: New file.
3005         * Makefile (tests): Add tst-typesizes.
3007         * tst-once3.c: More debug output.
3009 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
3011         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
3012         missing after last change.
3014         * version.c: Update copyright year.
3016 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
3018         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
3019         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
3020         * pthread_mutex_trylock.c: Likewise.
3021         * pthread_mutex_timedlock.c: Likewise.
3022         * pthread_mutex_unlock.c: Likewise.
3024 2005-12-22  Roland McGrath  <roland@redhat.com>
3026         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
3027         so that #include_next's search location is not reset to the -I..
3028         directory where <nptl/...> can be found.
3030 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
3032         [BZ #1913]
3033         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3034         Fix unwind info.  Remove useless branch prediction prefix.
3035         * tst-cancel24.cc: New file.
3036         * Makefile: Add rules to build and run tst-cancel24.
3038 2005-12-21  Roland McGrath  <roland@redhat.com>
3040         * libc-cancellation.c: Use <> rather than "" #includes.
3041         * pt-cleanup.c: Likewise.
3042         * pthread_create.c: Likewise.
3043         * pthread_join.c: Likewise.
3044         * pthread_timedjoin.c: Likewise.
3045         * pthread_tryjoin.c: Likewise.
3046         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
3047         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
3048         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
3049         * unwind.c: Likewise.
3051 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3053         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
3054         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
3055         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3056         THREAD_COPY_POINTER_GUARD): Define.
3058 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
3060         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
3061         rather than one.
3062         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3063         THREAD_COPY_POINTER_GUARD): Define.
3064         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
3065         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
3066         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3067         THREAD_COPY_POINTER_GUARD): Define.
3068         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
3069         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
3070         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
3071         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
3072         Use PTR_DEMANGLE for B0 if defined.
3074 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
3076         * pthread_create.c (__pthread_create_2_1): Use
3077         THREAD_COPY_POINTER_GUARD if available.
3078         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
3079         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3080         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
3081         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
3082         * sysdeps/x86_64/tls.h: Likewise.
3084 2005-12-15  Roland McGrath  <roland@redhat.com>
3086         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
3088 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
3090         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
3091         sysdeps/generic.
3092         * errno-loc.c: New file.
3094 2005-12-12  Roland McGrath  <roland@redhat.com>
3096         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
3097         adjustments before choosing stack size.  Update minimum stack size
3098         calculation to match allocate_stack change.
3100 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
3102         * allocatestack.c (allocate_stack): Don't demand that there is an
3103         additional full page available on the stack beside guard, TLS, the
3104         minimum stack.
3106 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
3108         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3109         (__cleanup_fct_attribute): Use __regparm__ not regparm.
3111         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
3112         compiling 32-bit code we must define __cleanup_fct_attribute.
3114 005-11-24  Jakub Jelinek  <jakub@redhat.com>
3116         [BZ #1920]
3117         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
3118         __attribute__ instead of __attribute.
3119         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3120         (__cleanup_fct_attribute): Likewise.
3122 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
3124         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
3125         a write barrier before writing libgcc_s_getcfa.
3127 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
3129         * sysdeps/unix/sysv/linux/configure: Removed.
3131 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
3133         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
3134         optional init_array/fini_array support.
3136 2005-10-24  Roland McGrath  <roland@redhat.com>
3138         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
3139         versioned_symbol use.
3141 2005-10-16  Roland McGrath  <roland@redhat.com>
3143         * init.c (__pthread_initialize_minimal_internal): Even when using a
3144         compile-time default stack size, apply the minimum that allocate_stack
3145         will require, and round up to page size.
3147 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
3149         * Makefile ($(test-modules)): Remove static pattern rule.
3151 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
3152             Ulrich Drepper  <drepper@redhat.com>
3154         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
3155         alignment in callback function.
3156         * Makefile: Add rules to build and run tst-align3.
3157         * tst-align3.c: New file.
3159 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
3161         * allocatestack.c (setxid_signal_thread): Add
3162         INTERNAL_SYSCALL_DECL (err).
3164 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
3166         * allocatestack.c (setxid_signal_thread): Need to use
3167         atomic_compare_and_exchange_bool_acq.
3169 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
3170             Jakub Jelinek  <jakub@redhat.com>
3172         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
3173         CANCEL_RESTMASK.
3174         (struct pthread): Move specific_used field to avoid padding.
3175         Add setxid_futex field.
3176         * init.c (sighandler_setxid): Reset setxid flag and release the
3177         setxid futex.
3178         * allocatestack.c (setxid_signal_thread): New function.  Broken
3179         out of the bodies of the two loops in __nptl_setxid.  For undetached
3180         threads check whether they are exiting and if yes, don't send a signal.
3181         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
3182         * pthread_create.c (start_thread): For undetached threads, check
3183         whether setxid bit is set.  If yes, wait until signal has been
3184         processed.
3186         * allocatestack.c (STACK_VARIABLES): Initialize them.
3187         * pthread_create.c (__pthread_create_2_1): Initialize pd.
3189 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
3191         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
3192         waiters, awake all waiters on the associated mutex.
3194 2005-09-22  Roland McGrath  <roland@redhat.com>
3196         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
3197         ../sysdeps/x86_64/hp-timing.h).
3199 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
3201         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
3202         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3203         (lll_futex_wake_unlock): Define.
3204         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
3205         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3206         (lll_futex_wake_unlock): Define.
3207         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
3208         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3209         (lll_futex_wake_unlock): Define.
3210         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
3211         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3212         (lll_futex_wake_unlock): Define.
3213         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
3214         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3215         (lll_futex_wake_unlock): Define.
3216         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
3217         lll_futex_wake_unlock.
3218         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3219         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3220         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3221         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
3222         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3223         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3225 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3227         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
3228         Fix typo in register name.
3230 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
3232         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3233         Use __sigfillset.  Document that sigfillset does the right thing wrt
3234         to SIGSETXID.
3236 2005-08-08  Jakub Jelinek  <jakub@redhat.com>
3238         * tst-stackguard1.c (do_test): Likewise.
3240 2005-07-29  Jakub Jelinek  <jakub@redhat.com>
3242         * tst-stackguard1.c (do_test): Don't fail if the poor man's
3243         randomization doesn't work well enough.
3245 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3247         [BZ #1102]
3248         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
3249         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
3250         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
3251         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
3252         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
3253         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
3254         in the structure.
3255         * Makefile (tests): Add tst-initializers1.
3256         (CFLAGS-tst-initializers1.c): Set.
3257         * tst-initializers1.c: New test.
3259 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3261         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
3262         Make sure __flags are located at offset 48 from the start of the
3263         structure.
3265 2005-07-02  Roland McGrath  <roland@redhat.com>
3267         * Makeconfig: Comment fix.
3269 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
3271         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
3272         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
3273         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
3274         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
3275         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3276         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3277         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
3278         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
3279         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
3280         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3282 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
3284         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
3285         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3286         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
3287         fields.
3288         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3289         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
3290         field.  Put in sysinfo field unconditionally.
3291         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3292         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
3293         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3294         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
3295         fields.
3296         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3297         * pthread_create.c (__pthread_create_2_1): Use
3298         THREAD_COPY_STACK_GUARD macro.
3299         * Makefile: Add rules to build and run tst-stackguard1{,-static}
3300         tests.
3301         * tst-stackguard1.c: New file.
3302         * tst-stackguard1-static.c: New file.
3304 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
3306         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
3307         Invoke CGOTSETUP and CGOTRESTORE.
3308         (CGOTSETUP, CGOTRESTORE): Define.
3310 2005-05-29  Richard Henderson  <rth@redhat.com>
3312         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
3313         (tf_write, tf_writev): Use it.
3314         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
3315         the system minimum.
3317 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
3319         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3320         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
3321         __librt_*_asynccancel@local.
3323 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
3325         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
3326         all occurrences of JUMPTARGET.  Instead append @local to labels.
3328 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
3330         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
3331         size/alignment of struct pthread rather than tcbhead_t.
3332         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3333         Likewise.
3334         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3335         Likewise.
3336         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3337         Likewise.
3339 2005-05-19  Richard Henderson  <rth@redhat.com>
3341         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
3342         __sync_val_compare_and_swap, not explicit _si variant.
3343         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
3345 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
3347         [BZ #915]
3348         * sysdeps/pthread/pthread.h: Avoid empty initializers.
3350 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
3352         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
3353         .eh_frame section, use cfi_* directives.
3355 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
3357         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
3358         of "" includes.
3360 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
3362         [BZ #1075]
3363         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
3364         aio_write blocks.
3366 2005-04-27  Roland McGrath  <roland@redhat.com>
3368         * Makefile (tests): Remove tst-clock2.
3370         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
3371         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
3372         translating to the kernel clockid_t for our own process/thread clock.
3374         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
3376 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
3378         * old_pthread_cond_init.c: Include <errno.h>.
3379         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
3380         process shared or uses clock other than CLOCK_REALTIME.
3381         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
3383 2005-04-13  David S. Miller  <davem@davemloft.net>
3385         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
3386         * sysdeps/sparc/sparc64/clone.S: New file.
3388 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
3390         [BZ #1102]
3391         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
3392         __inline instead of inline.
3393         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
3395 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
3397         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
3398         functionally equivalent, but shorter instructions.
3399         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
3400         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3401         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
3402         Likewise.
3403         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
3404         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3405         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3406         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3407         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3408         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
3409         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3410         Likewise.
3411         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3412         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
3413         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3414         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
3415         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3417 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
3419         * sysdeps/mips/Makefile: New file.
3420         * sysdeps/mips/nptl-sysdep.S: New file.
3421         * sysdeps/mips/tcb-offsets.sym: New file.
3422         * sysdeps/mips/pthread_spin_lock.S: New file.
3423         * sysdeps/mips/pthread_spin_trylock.S: New file.
3424         * sysdeps/mips/pthreaddef.h: New file.
3425         * sysdeps/mips/tls.h: New file.
3426         * sysdeps/mips/jmpbuf-unwind.h: New file.
3427         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
3428         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
3429         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
3430         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
3431         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
3432         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
3433         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
3434         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
3435         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
3436         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
3438 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
3440         [BZ #1112]
3441         * pthread_create.c (__pthread_create_2_1): Rename syscall error
3442         variable to scerr.
3444 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
3446         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
3448 2005-02-25  Roland McGrath  <roland@redhat.com>
3450         * alloca_cutoff.c: Correct license text.
3451         * tst-unload.c: Likewise.
3452         * sysdeps/pthread/allocalim.h: Likewise.
3453         * sysdeps/pthread/pt-initfini.c: Likewise.
3454         * sysdeps/pthread/bits/libc-lock.h: Likewise.
3455         * sysdeps/pthread/bits/sigthread.h: Likewise.
3456         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
3457         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
3459 2005-02-16  Roland McGrath  <roland@redhat.com>
3461         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
3462         Use unsigned int * for ptr_nthreads.
3464 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
3466         [BZ #721]
3467         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
3468         gcc4.
3470 2005-02-07  Richard Henderson  <rth@redhat.com>
3472         [BZ #787]
3473         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
3474         argument.
3476 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
3478         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
3479         order of arguments in invocation of atomic_add_zero.
3481 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
3483         [BZ #737]
3484         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
3485         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
3486         at least gotntpoff relocation and addition.
3487         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
3488         Likewise.
3489         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
3490         Likewise.
3491         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3492         Likewise.
3494 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
3496         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
3497         entry for static tls deallocation fix.
3498         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
3499         also contains information whether the memory pointed to is static
3500         TLS or not.
3501         * sysdeps/i386/tls.h: Likewise.
3502         * sysdeps/ia64/tls.h: Likewise.
3503         * sysdeps/powerpc/tls.h: Likewise.
3504         * sysdeps/s390/tls.h: Likewise.
3505         * sysdeps/sh/tls.h: Likewise.
3506         * sysdeps/sparc/tls.h: Likewise.
3507         * sysdeps/x86_64/tls.h: Likewise.
3509 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
3511         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
3513 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
3515         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
3516         %esp.
3517         * Makefile (tests): Add tst-align2.
3518         * tst-align2.c: New test.
3519         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
3520         -mpreferred-stack-boundary=4.
3522 2004-12-18  Roland McGrath  <roland@redhat.com>
3524         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
3525         New file removed withdrawn for the moment.
3527 2004-12-17  Richard Henderson  <rth@redhat.com>
3529         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
3530         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
3532 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
3534         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
3535         Increased PTHREAD_STACK_MIN.
3537         * tst-context1.c (stacks): Use bigger stack size.
3539 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
3541         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
3542         * sysdeps/sparc/tcb-offsets.sym: Add TID.
3544 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
3546         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
3547         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
3548         * sysdeps/s390/tcb-offsets.sym (TID): Add.
3550 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
3552         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
3554 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
3556         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
3557         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
3559         * tst-getpid1.c: If child crashes, report this first.  Print which
3560         signal.
3562 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
3564         * init.c (__pthread_initialize_minimal_internal): Also unblock
3565         SIGSETXID.
3567 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
3569         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
3570         _POSIX_THREAD_CPUTIME): Define to 0.
3571         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
3572         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
3573         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
3574         __timer_signal_thread_tclk): Remove.
3575         (init_module): Remove their initialization.
3576         (thread_cleanup): Remove their cleanup assertions.
3577         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
3578         __timer_signal_thread_tclk): Remove.
3579         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
3580         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
3581         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
3583 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
3585         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
3586         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
3588         * Makefile (tests): Add tst-getpid2.
3589         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
3590         (do_test): Use it.  Use __clone2 instead of clone on ia64.
3591         * tst-getpid2.c: New test.
3593 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3595         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
3597 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
3599         * Makefile (tests): Add tst-getpid1.
3600         * tst-getpid1.c: New file.
3601         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
3602         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
3604 2004-12-02  Roland McGrath  <roland@redhat.com>
3606         * Makefile (libpthread-nonshared): Variable removed.
3607         ($(objpfx)libpthread_nonshared.a): Target removed.
3608         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
3609         These are now handled by generic magic from
3610         libpthread-static-only-routines being set.
3612 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
3614         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
3615         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
3616         _POSIX_THREAD_PRIO_PROTECT): Define.
3617         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3618         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3619         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3621 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
3623         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
3624         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
3625         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
3626         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
3627         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3628         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3629         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3631 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
3633         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
3635         * Makefile (libpthread-routines): Add pthread_setschedprio.
3636         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
3637         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
3638         * pthread_setschedprio.c: New file.
3640 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
3642         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
3643         * pthread_cancel.c (pthread_create): Likewise.
3645         * Makefile (libpthread-routines): Add vars.
3646         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
3647         * init.c (__default_stacksize, __is_smp): Remove.
3648         * vars.c: New file.
3649         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
3650         and define a wrapper macro.
3651         (PTHREAD_STATIC_FN_REQUIRE): Define.
3652         * allocatestack.c (__find_thread_by_id): Undefine.
3653         * pthread_create (__pthread_keys): Remove.
3654         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
3655         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
3656         PTHREAD_STATIC_FN_REQUIRE.
3658 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3660         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
3661         parameter to REGISTER macro.
3663 2004-11-17  Roland McGrath  <roland@redhat.com>
3665         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
3666         Make sure SIGCANCEL is blocked as well.
3668 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3670         * sysdeps/pthread/setxid.h: New file.
3671         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
3672         (struct xid_command): Add forward decl.
3673         (struct pthread_functions): Change return type of __nptl_setxid hook
3674         to int.
3675         * pthreadP.h (__nptl_setxid): Change return type to int.
3676         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
3677         calling thread, return its return value and set errno on failure.
3678         * descr.h (struct xid_command): Change id type to long array.
3680         * Makefile: Add rules to build and test tst-setuid1 and
3681         tst-setuid1-static.
3682         * tst-setuid1.c: New test.
3683         * tst-setuid1-static.c: New test.
3685 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3687         * Makefile (tests): Add tst-exit3.
3688         * tst-exit3.c: New test.
3690 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
3692         * Makefile (tests): Add tst-exit2.
3693         * tst-exit2.c: New file.
3695 2004-11-09  Roland McGrath  <roland@redhat.com>
3697         [BZ #530]
3698         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
3699         here, before calling clone.
3700         * pthread_create.c (start_thread): Don't do it here.
3702 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
3704         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
3706 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
3708         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
3709         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
3710         assembler warning.
3712 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
3714         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
3715         if sched_priority is not between minprio and maxprio.
3717 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3719         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
3720         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
3722         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3723         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
3725 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
3727         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
3728         not-cancelable I/O functions.
3730 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3732         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3733         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3734         make sure 2 is stored in the futex and we looked at the old value.
3735         Fix a few other problems to return the correct value.
3737 2004-10-14  Richard Henderson  <rth@redhat.com>
3739         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
3740         make gcc4 happy.
3742 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
3744         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
3745         of pthread-functions.h and pthreaddef.h.
3746         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
3748         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
3749         Change __data.__nwaiters from int to unsigned int.
3751         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
3752         sysconf (_SC_THREAD_CPUTIME) returns negative value.
3754         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
3755         before return type.
3757         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
3758         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
3760 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
3762         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
3763         test fails, remove message queue.
3764         (tf_msgsnd): Likewise.
3766 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3768         * tst-clock1.c: Change #ifdef to #if defined.
3769         * tst-clock2.c: Likewise.
3770         * tst-cond11.c: Likewise.
3772         * sysdeps/pthread/timer_create.c (timer_create): Use
3773         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
3774         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
3775         THREAD_CPUTIME.
3777 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3779         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
3780         _POSIX_THREAD_CPUTIME): Define to 0.
3782 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
3784         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
3785         and _POSIX_THREAD_CPUTIME to zero.
3786         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3787         * tst-barrier2.c: Fix testing for POSIX feature.
3788         * tst-clock1.c: Likewise.
3789         * tst-clock2.c: Likewise.
3790         * tst-cond11.c: Likewise.
3791         * tst-cond4.c: Likewise.
3792         * tst-cond6.c: Likewise.
3793         * tst-flock2.c: Likewise.
3794         * tst-mutex4.c: Likewise.
3795         * tst-mutex9.c: Likewise.
3796         * tst-rwlock12.c: Likewise.
3797         * tst-rwlock4.c: Likewise.
3798         * tst-signal1.c: Likewise.
3799         * tst-spin2.c: Likewise.
3800         * sysdeps/pthread/posix-timer.h: Likewise.
3801         * sysdeps/pthread/timer_create.c: Likewise.
3802         * sysdeps/pthread/timer_routines.c: Likewise.
3804 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
3806         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3807         (__lll_mutex_timedlock_wait): Address futex correctly.
3809         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
3810         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3811         make sure 2 is stored in the futex and we looked at the old value.
3812         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3813         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
3814         which might very well made the code not working at all before.
3815         [BZ #417]
3817 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
3819         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
3820         allow SIGSETXID to be sent.
3821         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
3822         for SIGSETXID to be defined.
3823         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
3824         SIGSETXID cannot be blocked.
3826         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3827         Add __extension__ to long long types.
3828         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3829         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3830         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3831         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3832         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
3833         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3834         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3836 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
3838         * descr.h (struct pthread): Add stopped_start field.
3839         * sysdeps/pthread/createthread.c (create_thread): Set
3840         start_stopped flag in descriptor for new thread appropriately.
3841         * pthread_create.c (start_thread): Only take lock to be stopped on
3842         startup if stopped_start flag says so.
3844 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
3846         * pthread_create.c (__pthread_create_2_1): Remember whether thread
3847         is created detached and if yes, do not try to free the stack in case
3848         the thread creation failed.
3849         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
3850         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
3851         case there has been no error.  [BZ #405]
3853         * pthread_create.c (start_thread): Don't wait for scheduler data
3854         etc to be set at the beginning of the function.  The cancellation
3855         infrastructure must have been set up.  And enable async
3856         cancellation before potentially going to sleep.  [BZ #401]
3858 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
3860         * Versions: Remove exports for pthread_set*id_np functions.
3861         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
3862         for now.
3863         * Makefile: Don't build pthread_set*id code for now.
3865 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
3867         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
3868         internal use.
3869         * allocatestack.c (__nptl_setxid): New function.
3870         * descr.h (struct xid_command): Define type.
3871         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
3872         (sighandler_setxid): New function.
3873         (__pthread_initialize_minimal): Register sighandler_setxid for
3874         SIGCANCEL.
3875         * pt-allocrtsig.c: Update comment.
3876         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
3877         Declare __nptl_setxid.
3878         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
3879         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
3880         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
3881         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
3882         and pthread_setresuid_np.
3883         * pthread_setgid_np.c: New file.
3884         * pthread_setuid_np.c: New file.
3885         * pthread_setegid_np.c: New file.
3886         * pthread_seteuid_np.c: New file.
3887         * pthread_setregid_np.c: New file.
3888         * pthread_setreuid_np.c: New file.
3889         * pthread_setresgid_np.c: New file.
3890         * pthread_setresuid_np.c: New file.
3891         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
3892         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
3893         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
3894         and pthread_setresuid_np.
3895         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
3896         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
3897         pthread_setregid, and pthread_setresgid.
3899 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
3901         * allocatestack.c (allocate_stack): Return EAGAIN instead of
3902         ENOMEM when out of memory.
3904 2004-09-10  Roland McGrath  <roland@redhat.com>
3906         [BZ #379]
3907         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
3908         code, since we don't try to use the broken CLONE_STOPPED any more.
3909         * pthread_create.c (start_thread): Likewise.
3911 2004-09-15  Richard Henderson  <rth@redhat.com>
3913         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
3915 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
3917         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
3918         (__libc_unwind_longjmp): Delete macro and declare as function.
3919         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
3920         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
3921         nptl directory.
3922         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
3923         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
3924         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
3926 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
3928         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
3929         for __USE_XOPEN2K.
3930         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
3931         types also for __USE_XOPEN2K.
3932         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3933         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3934         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3935         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3936         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3937         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3938         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3939         [BZ #320]
3941 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
3943         * sysdeps/pthread/pthread.h
3944         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
3945         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
3946         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
3947         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
3948         [BZ #375]
3950 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
3952         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
3953         PSEUDO to be used with . prefix.
3955         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
3956         Use atomic_increment instead of atomic_exchange_and_add.
3957         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
3958         Likewise.
3959         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
3960         Likewise.
3961         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
3962         Likewise.
3964         * allocatestack.c (allocate_stack): Use atomic_increment_val
3965         instead of atomic_exchange_and_add.
3966         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
3967         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
3968         Likewise.
3969         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
3970         Likewise.
3972         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
3973         the initialization function might throw.
3975 2005-09-05  Richard Henderson  <rth@redhat.com>
3977         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
3978         Move definition inside libpthread, libc, librt check.  Provide
3979         definition for rtld.
3981 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
3983         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
3984         waiters, awake all waiters on the associated mutex.
3986 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
3988         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
3989         * sysdeps/i386/jmpbuf-unwind.h: Likewise
3990         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3991         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3992         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3993         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3994         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3995         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
3996         * unwind.c: Use it.
3998         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3999         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
4000         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4001         Likewise.
4002         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4003         Decrement __nwaiters.  If pthread_cond_destroy has been called and
4004         this is the last waiter, signal pthread_cond_destroy caller and
4005         avoid using the pthread_cond_t structure after unlock.
4006         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4007         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4008         Read clock type from the least significant bits of __nwaiters instead
4009         of __clock.
4010         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4011         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
4013 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
4015         [BZ #342]
4016         * Makefile (tests): Add tst-cond20 and tst-cond21.
4017         * tst-cond20.c: New test.
4018         * tst-cond21.c: New test.
4019         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
4020         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
4021         it unsigned int.
4022         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4023         Likewise.
4024         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4025         (pthread_cond_t): Likewise.
4026         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4027         Likewise.
4028         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4029         Likewise.
4030         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4031         Likewise.
4032         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
4033         (cond_nwaiters): New.
4034         (clock_bits): New.
4035         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
4036         if there are waiters not signalled yet.
4037         Wait until all already signalled waiters wake up.
4038         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
4039         __nwaiters.  If pthread_cond_destroy has been called and this is the
4040         last waiter, signal pthread_cond_destroy caller and avoid using
4041         the pthread_cond_t structure after unlock.
4042         (__pthread_cond_wait): Increment __nwaiters in the beginning,
4043         decrement it when leaving.  If pthread_cond_destroy has been called
4044         and this is the last waiter, signal pthread_cond_destroy caller.
4045         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4046         Likewise.  Read clock type from the least significant bits of
4047         __nwaiters instead of __clock.
4048         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
4049         whether clock ID can be encoded in COND_CLOCK_BITS bits.
4050         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
4051         clock type just from the last COND_CLOCK_BITS bits of value.
4052         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
4053         instead of __clock, just from second bit of condattr's value.
4055 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
4057         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
4058         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
4059         != 64.
4060         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4062 2004-08-15  Roland McGrath  <roland@frob.com>
4064         * pthread_atfork.c: Update copyright terms including special exception
4065         for these trivial files, which are statically linked into executables
4066         that use dynamic linking for the significant library code.
4068 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
4070         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
4071         pthread_rwlock_rdlock.
4072         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
4073         Decrease __nr_readers_queued after reacquiring lock.
4074         * sysdeps/pthread/pthread_rwlock_timedrdlock
4075         (pthread_rwlock_timedrdlock): Likewise.
4076         Reported by Bob Cook <bobcook47@hotmail.com>.
4078 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
4080         * tst-rwlock14.c (tf): Read main thread handle from *ARG
4081         before pthread_barrier_wait.
4083 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
4085         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
4086         Remove unnecessary exception handling data.
4088 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
4090         [BZ #284]
4091         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
4092         instead of clockid_t.
4094 2004-07-21  Roland McGrath  <roland@redhat.com>
4096         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
4098 2004-07-19  Roland McGrath  <roland@redhat.com>
4100         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
4102 2004-07-02  Roland McGrath  <roland@redhat.com>
4104         * configure: Don't exit.
4106 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4108         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4109         (__pthread_cond_timedwait): Check for invalid nanosecond in
4110         timeout value.
4112 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
4114         * Makefile: Add rules to build and run tst-fini1.
4115         * tst-fini1.c: New file.
4116         * tst-fini1mod.c: New file.
4118 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
4120         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
4121         if no cancellation support is needed.
4122         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
4123         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
4124         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4125         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
4126         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
4127         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
4128         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
4129         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
4130         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
4132         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
4133         only if not already defined.
4135 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
4137         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
4138         constraint "m" instead of "0" for futex.
4140         * shlib-versions: Add powerpc64-.*-linux.*.
4142 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
4144         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
4145         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
4146         for valid tv_nsec.
4147         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
4148         1 billion and 64-bit tv_nsec which is valid when truncated to 32
4149         bits.
4151 2004-06-29  Roland McGrath  <roland@redhat.com>
4153         * Banner: NPTL no longer has its own version number.
4154         * Makefile (nptl-version): Variable removed.
4155         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
4156         using $(version), the glibc version number.
4158 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4160         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4161         Fix branch offset for a PLT entry.
4162         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
4163         Likewise.
4164         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
4165         Likewise.
4166         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
4167         Likewise.
4168         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
4169         Likewise.
4171 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4173         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
4174         unconditionally.
4176 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4178         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
4179         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
4180         instead of tv_sec.
4181         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
4182         (pthread_rwlock_timedrdlock): Likewise.
4184 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
4186         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4187         Set __r7 to val, not mutex.
4189 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
4191         * Makefile: Add rules to build tst-rwlock14.
4192         * tst-rwlock14.c: New file.
4194 2004-06-24  Boris Hu  <boris.hu@intel.com>
4196         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
4197         check.
4198         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
4200 2004-06-19  Andreas Jaeger  <aj@suse.de>
4202         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
4203         assembler in last patch.
4205 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
4207         * sysdeps/pthread/pthread_cond_timedwait.c
4208         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
4209         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4210         (__pthread_cond_timedwait): Check for invalid nanosecond in
4211         timeout value.
4212         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4213         * tst-cond19.c: New file.
4214         * Makefile: Add rules to build and run tst-cond19.
4216 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
4218         * tst-context1.c (GUARD_PATTERN): Defined.
4219         (tst_context_t): Define struct containing ucontext_t & guard words.
4220         (ctx): Declare as an array of tst_context_t.
4221         (fct): Verify uc_link & guard words are still valid.
4222         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
4224 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4226         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4227         Add __data.__futex field, reshuffle __data.__clock.
4228         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
4229         (__pthread_cond_signal): Increment __futex at the same time as
4230         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4231         address of low 32-bits of __wakeup_seq to futex syscall.
4232         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4233         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4234         releasing internal lock to FUTEX_WAIT.
4235         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4236         (__pthread_cond_timedwait): Likewise.
4237         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4238         (FUTEX_CMP_REQUEUE): Define.
4239         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4240         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4241         Pass __futex value from before the unlock and __futex address instead
4242         of address of low 32-bits of __wakeup_seq to futex syscall.
4243         Fallback to FUTEX_WAKE all on any errors.
4245 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
4247         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
4248         comment typo.
4249         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
4250         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
4251         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
4252         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
4253         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
4255 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4257         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
4258         Add memory clobber to inline assembly.
4259         (__lll_mutex_trylock): Likewise.
4260         (__lll_mutex_cond_trylock): Likewise.
4262 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4264         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4265         Pass val argument as 6th system call argument in %r7.
4267 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4269         * Makefile (tests): Add tst-cond16.
4270         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
4271         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
4272         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4273         Add __data.__futex field, reshuffle __data.__clock.
4274         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
4275         (__pthread_cond_signal): Increment __futex at the same time as
4276         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4277         address of low 32-bits of __wakeup_seq to futex syscall.
4278         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
4279         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4280         releasing internal lock to FUTEX_WAIT.
4281         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
4282         (__pthread_cond_timedwait): Likewise.
4283         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
4284         (FUTEX_CMP_REQUEUE): Define.
4285         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4286         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4287         Pass __futex value from before the unlock and __futex address instead
4288         of address of low 32-bits of __wakeup_seq to futex syscall.
4289         Fallback to FUTEX_WAKE all on any errors.
4290         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
4291         Define.
4292         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4293         internally.  Return non-zero if error, zero if success.
4294         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4295         Add __data.__futex field, reshuffle __data.__clock.
4296         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
4297         Define.
4298         (lll_futex_requeue): Add val argument, return 1 unconditionally
4299         for the time being.
4300         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4301         Add __data.__futex field, reshuffle __data.__clock.
4302         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4303         Define.
4304         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4305         internally.  Return non-zero if error, zero if success.
4306         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4307         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
4308         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4309         Define.
4310         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4311         internally.  Return non-zero if error, zero if success.
4312         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4313         Add __data.__futex field, reshuffle __data.__clock.
4314         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
4315         Define.
4316         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4317         internally.  Return non-zero if error, zero if success.
4318         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4319         Add __data.__futex field, reshuffle __data.__clock.
4320         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4321         Add __data.__futex field, reshuffle __data.__clock.
4322         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
4323         Increment __futex at the same time as __wakeup_seq or __total_seq.
4324         Pass address of __futex instead of address of low 32-bits of
4325         __wakeup_seq to futex syscall.
4326         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4327         Pass __futex value from before releasing internal lock
4328         to FUTEX_WAIT.
4329         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4330         Likewise.  Avoid unnecessary shadowing of variables.
4331         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
4332         Set __futex to 2 * __total_seq.  Pass __futex value from before the
4333         unlock and __futex address instead of address of low 32-bits of
4334         __wakeup_seq to futex_requeue macro, adjust for new return value
4335         meaning.
4336         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
4337         (__pthread_cond_signal): Increment __futex at the same time as
4338         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4339         address of low 32-bits of __wakeup_seq to futex syscall.
4340         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
4341         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4342         releasing internal lock to FUTEX_WAIT.
4343         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4344         (__pthread_cond_timedwait): Likewise.
4345         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4346         (FUTEX_CMP_REQUEUE): Define.
4347         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4348         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4349         Pass __futex value from before the unlock and __futex address instead
4350         of address of low 32-bits of __wakeup_seq to futex syscall.
4351         Fallback to FUTEX_WAKE all on any errors.
4353 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4355         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
4356         Add nop to align the end of critical section.
4357         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
4359 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4361         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4362         Add __broadcast_seq field.
4363         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
4364         all waiters as woken with woken_seq and bump broadcast counter.
4365         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
4366         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
4367         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4368         Comment typo fixes.  Avoid returning -ETIMEDOUT.
4370 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
4372         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4373         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
4374         Reported by Kaz Kojima.
4376 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
4378         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
4380 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4382         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
4383         __broadcast_seq with bc_seq after acquiring internal lock instead of
4384         before it.
4386 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
4388         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
4389         compilation.
4390         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4391         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
4392         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4393         (pthread_cond_t): Add __data.__broadcast_seq field.
4394         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4395         (FRAME_SIZE): Define.
4396         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
4397         Comment typo fixes.
4398         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
4399         Define.
4400         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
4401         typo fixes.
4402         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4403         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
4404         fixes.
4406 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
4408         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
4409         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4410         Add __broadcast_seq field.
4411         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4412         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4413         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4414         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4415         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4416         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
4417         all waiters as woken with woken_seq and bump broadcast counter.
4418         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
4419         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
4420         __broadcast_seq field.
4421         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4422         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4423         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
4424         * pthread_cond_init.c: Initialize __broadcast_seq field.
4425         * Makefile (tests): Add tst-cond17 and tst-cond18.
4426         Add .NOTPARALLEL goal.
4427         * tst-cond16.c: New file.  From Jakub.
4428         * tst-cond17.c: New file.  From Jakub.
4429         * tst-cond18.c: New file.  From Jakub.
4431 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
4433         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
4434         unwind info.
4436         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4437         Parametrize frame size.  Correct some unwind info.
4438         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4440 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4442         * tst-stack3.c: Note testing functionality beyond POSIX.
4444 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4446         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
4447         Change conditional from ifdef to if.
4449 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
4451         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
4452         SYSDEP_CANCEL_ERROR): Define.
4453         (PSEUDO): Use it.
4455 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
4457         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
4459 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
4461         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
4463 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4465         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
4466         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4467         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
4468         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4470 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
4472         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
4473         thread has all signals blocked.
4475 2004-04-18  Andreas Jaeger  <aj@suse.de>
4477         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
4478         (SEM_VALUE_MAX): Add missing brace.
4480 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4482         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
4483         in rt subdir.
4484         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
4485         * sysdeps/pthread/tst-mqueue8x.c: New test.
4486         * tst-cancel4.c: Update comment about message queues.
4488         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
4489         return it_value { 0, 0 }.
4490         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
4491         like SIGEV_SIGNAL.
4492         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
4493         assertion for SIGEV_NONE.
4494         (thread_attr_compare): Compare all attributes, not just a partial
4495         subset.
4497 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4499         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
4501 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
4503         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
4504         Just use a plain number.
4505         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
4506         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
4507         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
4508         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
4509         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
4510         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
4511         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4513 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4515         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
4516         frame info.
4517         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4519 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
4521         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
4522         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
4523         of calling sigwaitinfo.
4525 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
4527         * allocatestack.c (allocate_stack): Set reported_guardsize
4528         unconditionally.
4529         * pthread_getattr_np.c (pthread_getattr_np): Use
4530         reported_guardsize instead of guardsize.
4531         * descr.h (struct pthread): Add reported_guardsize field.
4533 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
4535         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
4537 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
4539         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
4541 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
4543         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
4544         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
4545         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
4546         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
4547         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
4548         Define.
4549         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
4550         (_POSIX_MESSAGE_PASSING): Define.
4551         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
4552         (_POSIX_MESSAGE_PASSING): Define.
4553         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
4554         (_POSIX_MESSAGE_PASSING): Define.
4556 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
4558         * tst-context1.c (fct): Check whether correct stack is used.
4560 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
4562         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
4563         matching constraints for asm mem parameters.
4565         * tst-clock2.c (tf): Don't define unless needed.
4567 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
4569         * Makefile (link-libc-static): Use $(static-gnulib) instead of
4570         $(gnulib).
4572 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
4574         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
4575         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
4576         * pthreadP.h: Declare __nptl_deallocate_tsd.
4577         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
4578         Adjust caller.
4580         * Makefile (tests): Add tst-tsd5.
4581         * tst-tsd5.c: New file.
4583 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
4585         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4586         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
4587         is SHLIB_COMPAT check.
4588         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
4589         (__pthread_attr_getaffinity_old): Likewise.
4590         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4591         (__pthread_getaffinity_old): Likewise.
4592         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4593         (__pthread_setaffinity_old): Likewise.
4595 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
4597         * allocatestack.c (_make_stacks_executable): Call
4598         _dl_make_stack_executable first.
4600 2004-03-24  Roland McGrath  <roland@redhat.com>
4602         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
4603         constraint instead of "0".
4605 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
4607         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4608         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
4610         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
4611         code to avoid warning.
4613 2004-03-24  Andreas Jaeger  <aj@suse.de>
4615         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4616         (__pthread_attr_setaffinity_old): Remove const.
4618 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
4620         * sysdeps/unix/sysv/linux/smp.h: New file.
4621         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
4622         * init.c: Define __is_smp.
4623         (__pthread_initialize_minimal_internal): Call is_smp_system to
4624         initialize __is_smp.
4625         * pthreadP.h: Declare __is_smp.
4626         Define MAX_ADAPTIVE_COUNT is necessary.
4627         * pthread_mutex_init.c: Add comment regarding __spins field.
4628         * pthread_mutex_lock.c: Implement adaptive mutex type.
4629         * pthread_mutex_timedlock.c: Likewise.
4630         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
4631         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
4632         Add __spins field.
4633         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4634         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4635         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4636         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4637         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4638         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4639         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4640         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
4641         lll_mutex_cond_trylock.
4642         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4643         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4644         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4645         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4646         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4647         Define BUSY_WAIT_NOP.
4648         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4649         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4651         * tst-mutex5.c: Add support for testing adaptive mutexes.
4652         * tst-mutex7.c: Likewise.
4653         * tst-mutex5a.c: New file.
4654         * tst-mutex7a.c: New file.
4655         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
4657         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4658         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
4659         vgettimeofday call might destroy the content.
4661         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
4662         @pause in the loop.
4664         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4665         No need to restrict type of ret.  Make it int.  Add comment.
4667         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4668         Remove unnecessary setne instruction.
4670 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
4672         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4673         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
4674         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
4675         If realloc fails, break out of the loop.
4677 2004-03-20  Andreas Jaeger  <aj@suse.de>
4679         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4680         (__pthread_setaffinity_old): Fix interface.
4681         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4682         (__pthread_getaffinity_old): Likewise.
4684         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4685         (__pthread_setaffinity_new): Remove duplicate declaration.
4687 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4689         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
4690         the return value to a safe register.
4691         (CDISABLE): Set the function argument correctly.
4693 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4695         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
4696         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
4697         Rewrite so that only one locked memory operation per round is needed.
4698         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
4699         (pthread_barrier_wait): After wakeup, release lock only when the
4700         last thread stopped using the barrier object.
4701         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4702         (__pthread_cond_wait): Don't store mutex address if the current
4703         value is ~0l.  Add correct cleanup support and unwind info.
4704         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4705         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4706         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
4707         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
4708         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4709         Add correct cleanup support and unwind info.
4710         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
4711         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
4712         information for syscall wrappers.
4714 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
4716         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
4717         cpusetsize field, remove next.
4718         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
4719         parameter for size of the CPU set.
4720         (pthread_setaffinity_np): Likewise.
4721         (pthread_attr_getaffinity_np): Likewise.
4722         (pthread_attr_setaffinity_np): Likewise.
4723         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
4724         interface change, keep compatibility code.
4725         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
4726         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
4727         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
4728         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
4729         __pthread_getaffinity_np.
4730         * Versions: Add version for changed interfaces.
4731         * tst-attr3.c: Adjust test for interface change.
4732         * pthread_getattr_np.c: Query the kernel about the affinity mask with
4733         increasing buffer sizes.
4734         * pthread_attr_destroy.c: Remove unused list handling.
4735         * pthread_attr_init.c: Likewise.
4737 2004-03-17  Roland McGrath  <roland@redhat.com>
4739         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
4740         first argument to clock_getres so we ever enable kernel timers.
4742 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
4744         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
4746 2004-03-12  Richard Henderson  <rth@redhat.com>
4748         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
4749         oldvalue from CENABLE to CDISABLE.
4751 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
4753         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
4754         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
4755         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
4756         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
4758 2004-03-11  Richard Henderson  <rth@redhat.com>
4760         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
4761         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
4762         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
4764 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4766         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
4767         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
4768         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
4770 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4772         * forward.c (__pthread_cond_broadcast_2_0,
4773         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
4774         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
4775         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
4777 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4779         * sysdeps/sh/tcb-offsets.sym: Add PID.
4780         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
4781         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
4783 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
4785         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
4786         include <sysdep-cancel.h>, vfork is no cancellation point.
4787         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
4788         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
4789         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
4791 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
4793         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
4794         libc_hidden_def.
4795         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
4796         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
4797         Likewise.
4798         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
4799         Likewise.
4800         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
4801         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
4802         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
4803         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
4804         of DO_CALL_VIA_BREAK.  Work around a gas problem.
4806         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
4807         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
4808         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
4809         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
4810         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
4811         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
4813         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
4814         a local register for saving old PID.  Negate PID in parent upon exit.
4816         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
4817         tcb-offsets.h.
4818         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
4819         before syscall, set to the old value in the parent afterwards.
4820         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
4821         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
4822         tcb-offsets.h.
4823         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
4824         before syscall, set to the old value in the parent afterwards.
4825         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
4826         * sysdeps/s390/tcb-offsets.sym: Add PID.
4828         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
4829         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
4830         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
4831         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
4832         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
4833         * sysdeps/sparc/tcb-offsets.sym: Add PID.
4835 2004-03-10  Andreas Schwab  <schwab@suse.de>
4837         * sysdeps/ia64/tcb-offsets.sym: Add PID.
4838         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
4839         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
4841 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
4843         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
4844         * tst-cancel21.c (do_one_test): Likewise.
4845         Reported by Gordon Jin <gordon.jin@intel.com>.
4847 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
4849         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
4850         if non-zero and set to INT_MIN if zero.
4851         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
4852         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
4853         (SAVE_PID, RESTORE_PID): Define.
4854         (__vfork): Use it.
4855         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
4856         Use relative path to avoid including NPTL i386/vfork.S.
4857         (SAVE_PID, RESTORE_PID): Define.
4858         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
4859         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
4860         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
4861         tst-vfork2x.
4862         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
4863         * tst-vfork1.c: New test.
4864         * tst-vfork2.c: New test.
4865         * tst-vfork1x.c: New test.
4866         * tst-vfork2x.c: New test.
4868 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
4870         * sysdeps/i386/tcb-offsets.sym: Add PID.
4871         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4872         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
4873         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
4875 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
4877         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
4879 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
4881         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
4882         _rtld_global_ro.
4884 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
4886         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
4887         _rtld_global_ro.
4889         * tst-once4.c: Remove unnecessary macro definition.
4891         * tst-mutex7.c (do_test): Limit thread stack size.
4892         * tst-once2.c (do_test): Likewise.
4893         * tst-tls3.c (do_test): Likewise.
4894         * tst-tls1.c (do_test): Likewise.
4895         * tst-signal3.c (do_test): Likewise.
4896         * tst-kill6.c (do_test): Likewise.
4897         * tst-key4.c (do_test): Likewise.
4898         * tst-join4.c (do_test): Likewise.
4899         * tst-fork1.c (do_test): Likewise.
4900         * tst-context1.c (do_test): Likewise.
4901         * tst-cond2.c (do_test): Likewise.
4902         * tst-cond10.c (do_test): Likewise.
4903         * tst-clock2.c (do_test): Likewise.
4904         * tst-cancel10.c (do_test): Likewise.
4905         * tst-basic2.c (do_test): Likewise.
4906         * tst-barrier4.c (do_test): Likewise.
4908 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
4910         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
4912 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
4914         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4915         (__pthread_cond_timedwait): Optimize wakeup test.
4916         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
4917         (__pthread_cond_wait): Likewise.
4918         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4919         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4920         Likewise.
4922 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
4924         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4925         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
4926         the atomic instruction needed.
4927         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4928         (__lll_mutex_lock_wait): Likewise.
4930 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
4932         * Makefile (tests): Add tst-cond14 and tst-cond15.
4933         * tst-cond14.c: New file.
4934         * tst-cond15.c: New file.
4936 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
4938         * sysdeps/pthread/createthread.c (create_thread): Remove use of
4939         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
4940         needs to be implemented differently to be useful.
4942 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
4944         * pthread_attr_setschedparam.c: Don't test priority against limits
4945         here.  Set ATTR_FLAG_SCHED_SET flag.
4946         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
4947         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
4948         from parent thread to child.  If attribute is used and scheduling
4949         parameters are not inherited, copy parameters from attribute or
4950         compute them.  Check priority value.
4951         * pthread_getschedparam.c: If the parameters aren't known yet get
4952         them from the kernel.
4953         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
4954         ATTR_FLAG_POLICY_SET flag for thread.
4955         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
4956         and ATTR_FLAG_POLICY_SET.
4958         * sysdeps/pthread/createthread.c: Use tgkill if possible.
4960         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
4961         fail if stack address hasn't been set.  Just return 0.
4963 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
4965         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
4966         libpthread for the files in this list.
4967         (CFLAGS-tst-unload): Removed.
4968         * tst-unload.c (do_test): Don't use complete path for
4969         LIBPHREAD_SO.
4971         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
4972         tst-_res1mod2.
4974 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
4976         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4977         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
4978         operation per round is needed.
4979         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4980         (__lll_mutex_lock_wait): Likewise.
4982 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
4984         * tst-cancel9.c (cleanup): Don't print to stderr.
4986 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4988         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
4990 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
4992         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
4993         (__syscall_error_handler2): Call CDISABLE.
4994         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
4995         (__syscall_error_handler2): Call CDISABLE.
4997         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4998         Release lock before the loop, don't reacquire it.
5000         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
5002 2004-02-19  Andreas Schwab  <schwab@suse.de>
5004         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5005         Fix last change.
5007 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
5009         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
5010         (pthread_barrier_wait): After wakeup, release lock only when the
5011         last thread stopped using the barrier object.
5012         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
5013         (pthread_barrier_wait): Likewise.
5014         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5015         Likewise.
5016         * Makefile (tests): Add tst-barrier4.
5017         * tst-barrier4.c: New file.
5019         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5020         (__pthread_cond_timedwait): Perform timeout test while holding
5021         internal lock to prevent wakeup race.
5022         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
5023         * sysdeps/pthread/pthread_cond_timedwait.c
5024         (__pthread_cond_timedwait): Likewise.
5025         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5026         (__pthread_cond_timedwait): Likewise.
5028 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
5030         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
5031         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
5032         * Makefile (tests): Add tst-rwlock13.
5033         * tst-rwlock13.c: New test.
5035 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
5037         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5038         (__condvar_tw_cleanup): Little optimization.
5039         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
5041 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
5043         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
5044         libpthread as "lib" parameter to SHLIB_COMPAT.
5045         (__novmx_siglongjmp): Fix typo in function name.
5046         (__novmx_longjmp): Fix typo in function name.
5048 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
5050         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
5051         __builtin_expect.
5053         * sysdeps/generic/pt-longjmp.c: Moved to...
5054         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
5056 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
5058         * Makefile (libpthread-routines): Add pt-cleanup.
5059         * pt-longjmp.c: Removed.
5060         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
5061         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
5062         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
5063         Version longjmp, siglongjmp for GLIBC_2.3.4.
5064         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
5066 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
5068         * sysdeps/pthread/pthread_cond_timedwait.c
5069         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
5070         Reuse code.  Add __builtin_expects.
5072         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5073         (__pthread_cond_timedwait): Get internal lock in case timeout has
5074         passed before the futex syscall.
5075         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5077 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
5079         * allocatestack.c: Pretty printing.
5081         * sysdeps/pthread/createthread.c (create_thread): Don't add
5082         CLONE_DETACHED bit if it is not necessary.
5084 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
5086         * pthread_getattr_np.c: Include ldsodefs.h.
5088 2004-01-16  Richard Henderson  <rth@redhat.com>
5090         * allocatestack.c: Don't declare __libc_stack_end.
5091         * init.c (__pthread_initialize_minimal_internal): Likewise.
5092         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
5094 2004-01-15  Richard Henderson  <rth@redhat.com>
5096         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
5097         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
5098         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
5099         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
5100         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
5101         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
5102         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
5103         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
5105 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
5107         * init.c (pthread_functions): Make array const.
5109 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
5111         * allocatestack.c (__make_stacks_executable): Change interface.
5112         Check parameters.  Pass parameter on to libc counterpart.
5113         * pthreadP.h: Change declaration.
5115 2004-01-13  Richard Henderson  <rth@redhat.com>
5117         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
5118         prototype form.
5119         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
5120         Likewise.
5122         * sysdeps/alpha/Makefile: New file.
5123         * sysdeps/alpha/tcb-offsets.sym: New file.
5124         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
5125         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
5127         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
5128         on powerpc version.
5130 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
5132         * Makefile (tests): Add tst-backtrace1.
5133         * tst-backtrace1.c: New test.
5135 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
5137         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
5138         register as second parameter to the REGISTER macro.
5139         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
5140         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
5141         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
5142         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
5143         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
5144         of thread register as second parameter to REGISTER macro in 64 case.
5146 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
5148         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
5149         (CFLAGS-getpid.o): Defined.
5150         (CFLAGS-getpid.os): Defined.
5152 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
5154         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
5155         returned for main thread does not overlap with any other VMA.
5156         Patch by Jakub Jelinek.
5158 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
5160         * tst-raise1.c: Include stdio.h.
5162 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
5164         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
5165         setting with __ASSUME_TGKILL || defined __NR_tgkill.
5166         If pid is 0, set it to selftid.
5167         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
5168         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
5169         != 0, return self->tid without doing a syscall.
5170         * descr.h (struct pthread): Move pid field after tid.
5172         * Makefile (tests): Add tst-raise1.
5173         * tst-raise1.c: New file.
5175 2003-12-23  Roland McGrath  <roland@redhat.com>
5177         * tst-oddstacklimit.c: New file.
5178         * Makefile (tests): Add it.
5179         (tst-oddstacklimit-ENV): New variable.
5181         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
5182         value up to page size for __default_stacksize.
5184 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
5186         * Makefile (tests): Add tst-eintr5.
5187         * tst-eintr5.c: New file.
5189         * eintr.c (eintr_source): Prevent sending signal to self.
5191         * tst-eintr2.c (tf1): Improve error message.
5193 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
5195         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
5196         * sysdeps/unix/sysv/linux/getpid.c: New file.
5197         * pthread_cancel.c: Add comment explaining use of PID field.
5198         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
5199         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
5200         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
5201         temporarily to signal the field must not be relied on and updated
5202         by getpid().
5203         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
5204         temporarily negative.
5205         * sysdeps/unix/sysv/linux/raise.c: Likewise.
5207 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
5209         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
5210         (eintr_source): If ARG != NULL, use pthread_kill.
5211         * tst-eintr1.c: Adjust for this change.
5212         * tst-eintr2.c: Likewise.
5213         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
5214         * tst-eintr3.c: New file.
5215         * tst-eintr4.c: New file.
5217 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
5219         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
5220         if CANCELSTATE_BITMASK is set.
5221         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
5222         Likewise.
5224         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
5225         (tests-reverse): Add tst-cancel23.
5226         * tst-cancel22.c: New test.
5227         * tst-cancel23.c: New test.
5229 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
5231         * tst-eintr1.c: Better error messages.
5233         * Makefile (tests): Add tst-eintr2.
5234         * tst-eintr2.c: New file.
5236 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
5238         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
5239         (CFLAGS-tst-cancelx21.c): Set.
5240         * tst-cancel21.c: New test.
5241         * tst-cancelx21.c: New test.
5243         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
5244         comparison operand.
5245         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
5246         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
5247         * pt-longjmp.c: Include jmpbuf-unwind.h.
5248         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
5249         _JMPBUF_UNWINDS.  Adjust compared pointers.
5250         * init.c (__pthread_initialize_minimal_internal): Initialize
5251         pd->stackblock_size.
5252         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
5253         * sysdeps/alpha/jmpbuf-unwind.h: New file.
5254         * sysdeps/i386/jmpbuf-unwind.h: New file.
5255         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
5256         * sysdeps/s390/jmpbuf-unwind.h: New file.
5257         * sysdeps/sh/jmpbuf-unwind.h: New file.
5258         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
5259         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
5260         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
5261         (_JMPBUF_CFA_UNWINDS): Remove.
5262         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
5264 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
5266         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
5267         (CFLAGS-tst-cancelx20.c): Set.
5268         * tst-cancel20.c: New test.
5269         * tst-cancelx20.c: New test.
5271 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
5273         * init.c (__pthread_initialize_minimal_internal): Don't treat
5274         architectures with separate register stack special here when
5275         computing default stack size.
5277 2003-12-17  Roland McGrath  <roland@redhat.com>
5279         * Makefile (tst-cancelx7-ARGS): New variable.
5280         Reportd by Greg Schafer <gschafer@zip.com.au>.
5282 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
5284         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
5285         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
5286         (tst-stack3-ENV): Set.
5287         ($(objpfx)tst-stack3-mem): New.
5288         * tst-stack3.c: New test.
5290 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
5292         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
5293         Add unwind directives.  Drop unused .regstk directive.
5294         (_fini_EPILOG_BEGINS): Add unwind directives.
5296 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
5298         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
5299         Assume parameter is a pointer.
5300         (lll_futex_wake): Likewise.
5301         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
5302         Likewise.
5303         (lll_futex_wake): Likewise.
5304         Reported by Boris Hu.
5305         * sysdeps/unix/sysv/linux/unregister-atfork.c
5306         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
5308         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
5310 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
5312         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
5313         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
5314         __rtld_lock_initialize for ld.so lock.
5315         Patch in part by Adam Li <adam.li@intel.com>.
5317 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
5319         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
5320         in $(gnulib).  Also, remove stale comment.
5322 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
5324         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
5325         advantage of new syscall stub and optimize accordingly.
5327         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
5328         from SYS_futex, to match expectations of
5329         sysdep.h:DO_INLINE_SYSCALL.
5330         (lll_futex_clobbers): Remove.
5331         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
5332         (lll_futex_wake): Likewise.
5333         (lll_futex_requeue): Likewise.
5334         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
5335         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
5336         Jelinek).
5337         (__lll_mutex_lock): Likewise.
5338         (__lll_mutex_cond_lock): Likewise.
5339         (__lll_mutex_timed_lock): Likewise.
5340         (__lll_mutex_unlock): Likewise.
5341         (__lll_mutex_unlock_force): Likewise.
5343         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
5344         comes before the include of <sysdep.h>.
5345         (THREAD_SELF_SYSINFO): New macro.
5346         (THREAD_SYSINFO): Likewise.
5347         (INIT_SYSINFO): New macro.
5348         (TLS_INIT_TP): Call INIT_SYSINFO.
5350         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
5352         * sysdeps/pthread/createthread.c (create_thread): Use
5353         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
5354         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
5355         THREAD_SELF_SYSINFO instead of open code.
5356         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
5357         (THREAD_SYSINFO): Likewise.
5359         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
5361         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
5363 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
5365         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
5366         instead of .init.  Patch by David Mosberger.
5368 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
5370         * sysdeps/pthread/configure.in: Remove broken declaration in C
5371         cleanup handling check.
5373 2003-11-30  Andreas Jaeger  <aj@suse.de>
5375         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
5376         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
5377         Likewise.
5379 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
5381         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
5382         * pthread_attr_destroy.c: Include shlib-compat.h.
5383         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
5384         is set in iattr->flags.
5385         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
5387 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
5389         * Makefile (distribute): Add tst-cleanup4aux.c.
5391         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
5392         include.
5394 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
5396         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
5397         pthread_cond_signal.
5399         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
5400         store mutex address if the current value is ~0l.
5401         * sysdeps/pthread/pthread_cond_timedwait.c
5402         (__pthread_cond_timedwait): Likewise.
5403         * sysdeps/pthread/pthread_cond_broadcast.c
5404         (__pthread_cond_broadcast): Don't use requeue for pshared
5405         condvars.
5407         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5408         (__pthread_cond_wait): Don't store mutex address if the current
5409         value is ~0l.
5410         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5411         (__pthread_cond_timedwait): Likewise.
5412         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5413         (__pthread_cond_broadcast): Don't use requeue for pshared
5414         condvars.
5416         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
5417         element with ~0l for pshared condvars, with NULL otherwise.
5419         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5420         (__pthread_cond_wait): Don't store mutex address if the current
5421         value is ~0l.
5422         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5423         (__pthread_cond_timedwait): Likewise.
5424         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
5425         (__pthread_cond_broadcast): Don't use requeue for pshared
5426         condvars.
5428         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
5429         * tst-cond12.c: New file.
5430         * tst-cond13.c: New file.
5432 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
5434         * sysdeps/pthread/configure.in: Make missing forced unwind support
5435         fatal.
5437 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
5439         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
5441 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
5443         * Makefile: Add magic to clean up correctly.
5445 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
5447         * unwind.c (FRAME_LEFT): Define.
5448         (unwind_stop): Handle old style cleanups here.
5449         (__pthread_unwind): Handle old style cleanups only if
5450         !HAVE_FORCED_UNWIND.
5451         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
5452         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
5453         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
5454         ($(objpfx)tst-cleanupx4): Likewise.
5455         * tst-cleanup4.c: New test.
5456         * tst-cleanup4aux.c: New.
5457         * tst-cleanupx4.c: New test.
5459 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
5461         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
5462         lll_mutex_*lock macros to skip atomic operations on some archs.
5464 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
5466         * sysdeps/pthread/tst-timer.c (main): Initialize
5467         sigev2.sigev_value as well.
5469 2003-10-15  Roland McGrath  <roland@redhat.com>
5471         * sysdeps/pthread/configure.in: Barf if visibility attribute support
5472         is missing.
5473         * sysdeps/pthread/configure: Regenerated.
5475 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5477         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
5478         locking macros.  No distinction between normal and mutex locking
5479         anymore.
5480         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
5481         Merge bits from lowlevelmutex.S we still need.
5482         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
5483         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
5484         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
5485         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
5486         new mutex implementation.
5487         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
5488         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
5489         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5490         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
5491         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
5492         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
5493         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
5494         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
5495         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5496         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
5497         symbol for entry point to avoid cancellation.
5499 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
5501         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
5502         changes.
5503         (SAVE_OLDTYPE_0): Fix a typo.
5505 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
5507         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
5508         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
5510 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5512         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
5513         correct offset.
5515 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
5517         * Makefile (tests): Add tst-cancel19.
5518         * tst-cancel19.c: New test.
5520 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5522         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
5523         restoring of the old cancellation type.
5525 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
5527         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
5529 2003-09-27  Wolfram Gloger  <wg@malloc.de>
5531         * sysdeps/pthread/malloc-machine.h: New file
5533 2003-09-24  Roland McGrath  <roland@redhat.com>
5535         * allocatestack.c (__make_stacks_executable): Don't ignore return
5536         value from _dl_make_stack_executable.
5538 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
5540         * allocatestack.c (__make_stacks_executable): Also change
5541         permission of the currently unused stacks.
5543         * allocatestack.c (change_stack_perm): Split out from
5544         __make_stacks_executable.
5545         (allocate_stack): If the required permission changed between the time
5546         we started preparing the stack and queueing it, change the permission.
5547         (__make_stacks_executable): Call change_stack_perm.
5549         * Makefile: Build tst-execstack-mod locally.
5550         * tst-execstack-mod.c: New file.
5552 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
5554         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
5556 2003-09-23  Roland McGrath  <roland@redhat.com>
5558         * tst-execstack.c: New file.
5559         * Makefile (tests): Add it.
5560         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
5561         (LDFLAGS-tst-execstack): New variable.
5563         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
5564         whether to use PROT_EXEC for stack mmap.
5565         (__make_stacks_executable): New function.
5566         * pthreadP.h: Declare it.
5567         * init.c (__pthread_initialize_minimal_internal): Set
5568         GL(dl_make_stack_executable_hook) to that.
5570 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5572         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
5573         recommendation from AMD re avoidance of lock prefix.
5575 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
5577         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
5578         lll_futex_timed_wait instead of lll_futex_wait.
5579         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
5580         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
5581         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
5582         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
5583         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
5584         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
5585         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
5586         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
5587         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
5588         Completely revamp the locking macros.  No distinction between
5589         normal and mutex locking anymore.
5590         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
5591         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
5592         __lll_lock_timedwait): Fix prototypes.
5593         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
5594         __lll_lock_timedwait): Likewise.
5595         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
5596         macros, add __builtin_expect.
5597         (lll_mutex_timedlock): Likewise.  Fix return value.
5598         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
5599         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
5600         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
5601         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
5602         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
5603         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
5604         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
5605         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
5607 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5609         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5610         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
5611         operation if possible.
5613         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
5614         like jumping over the lock prefix.
5616 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
5618         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
5619         locking macros.  No distinction between normal and mutex locking
5620         anymore.
5621         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
5622         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
5623         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
5624         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
5625         locking.  Merge bits from lowlevelmutex.S we still need.
5626         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
5627         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
5628         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
5629         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
5630         * Makefile (routines): Remove libc-lowlevelmutex.
5631         (libpthread-rountines): Remove lowlevelmutex.
5632         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
5633         for new mutex implementation.
5634         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5635         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5636         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5637         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5638         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5639         Likewise.
5640         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5641         Likewise.
5642         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
5643         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5644         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
5645         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
5646         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5647         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5648         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
5649         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
5650         Likewise.
5651         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
5652         Likewise.
5653         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
5654         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
5655         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5656         Don't use requeue.
5657         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
5658         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
5660 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
5662         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
5663         in parameters of asm with output parameters.
5665         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
5666         type of DECR parameter to int.
5667         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
5669 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
5671         * tst-attr3.c (tf, do_test): Print stack start/end/size and
5672         guardsize for each thread.
5674 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5676         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
5677         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5678         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
5680         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
5681         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
5682         NULL.
5683         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
5684         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
5685         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5686         (pthread_getaffinity_np): Add hidden_def.
5688         * Makefile (tests): Add tst-attr3.
5689         * tst-attr3.c: New test.
5691         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
5693 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5695         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
5696         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
5698 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5700         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
5701         * tst-align.c: Include tst-stack-align.h.
5702         (tf, do_test): Use TEST_STACK_ALIGN macro.
5704 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
5706         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
5707         variable.
5709 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
5711         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
5712         stack-related values for the initial thread.
5714 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5716         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
5718 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
5720         * pthread_mutex_lock.c: Minor code rearrangements.
5722 2003-09-05  Roland McGrath  <roland@redhat.com>
5724         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
5725         Instead, include ../nptl_db/db_info.c to do its magic.
5726         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
5727         (__pthread_pthread_key_2ndlevel_size): Likewise.
5728         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
5729         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
5730         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
5731         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
5732         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
5733         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
5734         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
5735         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
5736         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
5737         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
5738         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
5739         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
5740         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
5741         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
5742         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
5743         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
5744         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
5746 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
5748         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
5749         of pthread_t to be compatible with LT.
5750         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5751         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5752         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5753         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5754         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
5755         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5756         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5758 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
5760         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
5762 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
5764         * unwind-forcedunwind.c: Move to...
5765         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
5766         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
5767         * sysdeps/pthread/jmpbuf-unwind.h: New file.
5768         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
5769         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
5770         * unwind.c: Include jmpbuf-unwind.h.
5771         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
5773 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
5775         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
5776         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
5777         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
5778         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
5779         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
5780         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
5781         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
5782         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
5783         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
5784         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
5785         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
5786         function.
5787         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
5788         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
5789         * Makefile (tests): Add tst-stack2.
5790         * tst-stack2.c: New test.
5791         * tst-stack1.c: Include limits.h and sys/param.h.
5792         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
5794         * pthread_condattr_setpshared.c: Include errno.h.
5795         (pthread_condattr_setpshared): Return EINVAL if pshared
5796         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
5798         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
5799         defined symbol for entry point to avoid cancellation.
5800         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
5801         Likewise.
5802         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
5803         Likewise.
5804         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
5805         Likewise.
5806         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
5807         Likewise.
5808         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
5809         Likewise.
5810         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
5811         __close_nocancel, __read_nocancel, __write_nocancel,
5812         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
5813         libpthread.so or librt.so, define to corresponding function
5814         without _nocancel suffix.
5815         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
5816         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
5817         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
5819         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
5821 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
5823         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
5824         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
5826         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
5827         in subsections has a symbol associated with it.
5829         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
5830         defined symbol for entry point to avoid cancellation.
5831         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
5833 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
5835         * Makefile (tests): Add tst-tls5.
5836         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
5837         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
5838         ($(objpfx)tst-tls5): New.
5839         ($(objpfx)tst-tls6.out): Likewise.
5840         (tests): Depend on $(objpfx)tst-tls6.out.
5841         * tst-tls3.c: Include stdint.h and pthreaddef.h.
5842         (do_test): Check pthread_self () return value alignment.
5843         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
5844         (tf): Check pthread_self () return value alignment.
5845         * tst-tls5.c: New test.
5846         * tst-tls5.h: New.
5847         * tst-tls5mod.c: New.
5848         * tst-tls5moda.c: New.
5849         * tst-tls5modb.c: New.
5850         * tst-tls5modc.c: New.
5851         * tst-tls5modd.c: New.
5852         * tst-tls5mode.c: New.
5853         * tst-tls5modf.c: New.
5854         * tst-tls6.sh: New test.
5856         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
5857         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
5858         * init.c (pthread_functions): Initialize them.
5859         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
5860         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
5861         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
5862         pthread_cond_timedwait@@GLIBC_2.3.2.
5864 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
5866         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
5867         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
5868         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
5869         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
5870         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
5871         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
5873         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
5875         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
5876         _POSIX_THREAD_PRIORITY_SCHEDULING.
5877         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
5879 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
5881         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
5882         nested function, use static inline function from libio.h.
5883         Code by Richard Henderson.
5885         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
5886         weak.
5888 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
5890         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
5891         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
5892         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
5893         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
5894         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
5895         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
5896         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
5897         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
5898         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
5899         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
5900         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
5901         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
5902         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
5903         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
5904         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
5905         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
5906         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
5907         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
5908         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
5909         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
5910         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
5911         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
5912         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
5913         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
5914         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
5915         * sysdeps/sparc/tls.h: New file.
5916         * sysdeps/sparc/tcb-offsets.sym: New file.
5917         * sysdeps/sparc/Makefile: New file.
5918         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
5919         * init.c [__sparc__] (__NR_set_tid_address): Define.
5921 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
5923         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
5924         _IO_release_lock): Define.
5926 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
5928         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
5929         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
5931 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
5933         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
5934         (__pthread_cleanup_class): Add missing return types of member
5935         functions.
5937 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
5939         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
5940         (lll_mutex_unlock_force): Add memory barrier between store and futex
5941         syscall.
5943 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
5945         * tst-cancel4.c (do_test): Also unlink tempfname and remove
5946         tempmsg in first loop.
5948 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
5950         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
5951         _POSIX_THREAD_PRIORITY_SCHEDULING.
5952         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
5954 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
5956         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
5957         (__rtld_lock_default_lock_recursive,
5958         __rtld_lock_default_unlock_recursive): Define.
5959         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
5960         __rtld_lock_unlock_recursive): Define using
5961         GL(_dl_rtld_*lock_recursive).
5962         * init.c (__pthread_initialize_minimal_internal): Initialize
5963         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
5964         Lock GL(_dl_load_lock) the same number of times as
5965         GL(_dl_load_lock) using non-mt implementation was nested.
5967         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
5968         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
5970 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
5972         * tst-cancel17.c (do_test): Make len2 maximum of page size and
5973         PIPE_BUF.
5975 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
5977         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
5979 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
5981         * sysdeps/pthread/createthread.c (do_clone): Move error handling
5982         to first syscall error check.  Move syscall error check for tkill
5983         into __ASSUME_CLONE_STOPPED #ifdef.
5985 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
5987         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
5988         is not defined, do explicit synchronization.
5989         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
5990         is not defined also unlock pd->lock for non-debugging case in case
5991         it is necessary.
5992         * pthread_create.c (start_thread): Always get and release pd->lock
5993         if __ASSUME_CLONE_STOPPED is not defined.
5994         (start_thread_debug): Removed.  Adjust users.
5995         * allocatestack.c (allocate_stack): Always initialize lock if
5996         __ASSUME_CLONE_STOPPED is not defined.
5997         * Makefile (tests): Add tst-sched1.
5998         * tst-sched1.c: New file.
6000         * sysdeps/pthread/createthread.c (do_clone): Only use
6001         sched_setschduler and pass correct parameters.
6003 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6005         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
6006         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
6007         PTHREAD_STACK_MIN in comments.
6009 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6011         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
6012         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
6013         argument.
6014         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
6015         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
6016         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
6017         (__pthread_cleanup_upto): Fix prototype.
6018         (_longjmp_unwind): Adjust caller.
6019         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
6020         Change second argument to const struct pointer.
6021         * tst-sem8.c (main): Remove unused s2 and s3 variables.
6022         * tst-sem9.c (main): Likewise.
6023         * unwind.c: Include string.h for strlen prototype.
6025 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
6027         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6028         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
6029         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
6030         Define HAVE_CMOV.
6031         Patch by Nicholas Miell <nmiell@attbi.com>.
6033 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
6035         * init.c (__pthread_initialize_minimal_internal): Initialize
6036         GL(dl_init_static_tls).
6037         * pthreadP.h (__pthread_init_static_tls): New prototype.
6038         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
6039         New functions.
6040         * Makefile (tests): Add tst-tls4.
6041         (modules-names): Add tst-tls4moda and tst-tls4modb.
6042         ($(objpfx)tst-tls4): Link against libdl and libpthread.
6043         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
6044         tst-tls4modb.so.
6045         * tst-tls4.c: New file.
6046         * tst-tls4moda.c: New file.
6047         * tst-tls4modb.c: New file.
6049 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
6051         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
6052         before __timer_dealloc.
6053         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
6054         Don't call list_unlink.
6056 2003-07-29  Roland McGrath  <roland@redhat.com>
6058         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
6060 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
6062         * descr.h: Don't include lowlevellock.h, pthreaddef.h and dl-sysdep.h
6063         if __need_struct_pthread_size, instead define lll_lock_t.
6065 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
6067         * tst-cancel17.c (do_test): Check if aio_cancel failed.
6068         Don't reuse struct aiocb A if it failed.
6069         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
6070         not just one byte, as that does not block.
6072 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
6074         * sysdeps/pthread/unwind-resume.c: New file.
6075         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
6076         unwind-resume in csu subdir.
6077         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
6078         exceptions.
6079         (librt-sysdep_routines, librt-shared-only-routines): Add
6080         rt-unwind-resume.
6081         * sysdeps/pthread/rt-unwind-resume.c: New file.
6082         * unwind-forcedunwind.c: New file.
6083         * Makefile (libpthread-routines): Add unwind-forcedunwind.
6084         (libpthread-shared-only-routines): Likewise.
6085         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
6086         * pthreadP.h (pthread_cancel_init): New prototype.
6087         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
6089         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
6090         attr argument const struct pthread_attr *.
6092         * res.c (__res_state): Return __resp.
6093         * descr.h: Include resolv.h.
6094         (struct pthread): Add res field.
6095         * pthread_create.c: Include resolv.h.
6096         (start_thread): Initialize __resp.
6097         * Makefile (tests): Add tst-_res1.
6098         (module-names): Add tst-_res1mod1, tst-_res1mod2.
6099         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
6100         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
6101         libpthread.
6102         * tst-_res1.c: New file.
6103         * tst-_res1mod1.c: New file.
6104         * tst-_res1mod2.c: New file.
6106 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
6108         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
6110         * Makefile: Define various *-no-z-defs variables for test DSOs
6111         which has undefined symbols.
6113 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
6115         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
6116         Retry if the stwcx fails to store once_control.
6118 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
6120         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
6121         pthread_attr_setaffinity.
6122         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
6123         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
6124         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
6125         * pthread_attr_destroy.c: Free cpuset element if allocated.
6126         * pthread_create.c: Pass iattr as additional parameter to
6127         create_thread.
6128         * sysdeps/pthread/createthread.c: If attribute is provided and
6129         a new thread is created with affinity set or scheduling parameters,
6130         start thread with CLONE_STOPPED.
6131         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
6132         pthread_attr_setaffinity.
6133         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
6134         cpuset element.
6136 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
6138         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
6140 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
6142         * sysdeps/pthread/configure.in: Require CFI directives also for
6143         ppc and s390.
6145 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
6147         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
6148         Add cfi directives.
6150 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6152         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
6153         CLEANUP_JMP_BUF.
6154         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
6155         registers as variables.  Call __pthread_mutex_unlock_usercnt.
6156         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6157         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
6158         not self pointer in __writer.  Compare with TID to determine
6159         deadlocks.
6160         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6161         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
6162         Likewise.
6163         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
6164         Likewise.
6165         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
6166         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
6167         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
6168         macros also when compiling librt.
6170 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
6172         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
6173         -fasynchronous-unwind-tables.
6174         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
6175         (PSEUDO): Add cfi directives.
6176         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
6177         Likewise.
6178         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
6179         Likewise.
6181 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
6183         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
6184         __pthread_unregister_cancel): Add prototypes and hidden_proto.
6185         * unwind.c (__pthread_unwind_next): Add hidden_def.
6186         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
6187         Likewise.
6188         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
6189         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
6190         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
6191         Likewise.
6192         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
6193         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
6194         Likewise.
6195         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
6196         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
6197         __pthread_unregister_cancel and __pthread_unwind_next.
6199 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
6201         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
6202         different symbol for the cancellation syscall wrapper and
6203         non-cancellation syscall wrapper.
6204         (PSEUDO_END): Define.
6206 2003-07-05  Richard Henderson  <rth@redhat.com>
6208         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
6209         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
6210         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6211         return actual return value from the syscall, not 0.
6213 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
6215         * descr.h (struct pthread): Add pid field.
6216         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
6217         (__reclaim_stacks): Likewise.
6218         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
6219         also check for PID of the signal source.
6220         (__pthread_initialize_minimal_internal): Also initialize pid field
6221         of initial thread's descriptor.
6222         * pthread_cancel.c: Use tgkill instead of tkill if possible.
6223         * sysdeps/unix/sysv/linux/fork.c: Likewise.
6224         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
6225         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
6226         * sysdeps/unix/sysv/linux/raise.c: Likewise.
6228 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
6230         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
6231         Fix use of parameter.
6232         (__libc_cleanup_pop): Likewise.
6234 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
6236         * init.c (sigcancel_handler): Change parameters to match handler
6237         for SA_SIGACTION.  Check signal number and code to recognize
6238         invalid invocations.
6240 2003-07-03  Roland McGrath  <roland@redhat.com>
6242         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
6243         Apply sizeof (struct pthread) bias to r13 value.
6245 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
6247         * sysdeps/pthread/configure.in: Require CFI directives.
6249         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
6250         definition.
6251         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
6252         libpthread compilation.
6253         * unwind.c (__pthread_unwind): Add hidden_def.
6254         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
6256 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6258         * libc-cancellation.c (__libc_cleanup_routine): Define.
6259         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
6260         (__pthread_cleanup_pop): Define.
6262 2003-07-01  Richard Henderson  <rth@redhat.com>
6264         * sysdeps/alpha/elf/pt-initfini.c: New file.
6265         * sysdeps/alpha/pthread_spin_lock.S: New file.
6266         * sysdeps/alpha/pthread_spin_trylock.S: New file.
6267         * sysdeps/alpha/pthreaddef.h: New file.
6268         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
6269         * sysdeps/alpha/tls.h: New file.
6270         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
6271         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
6272         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
6273         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
6274         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
6275         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
6276         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
6277         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
6278         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
6279         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
6281 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6283         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
6284         cleanup support and unwind info.
6286 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
6288         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
6289         Use correct cleanup handler registration.  Add unwind info.
6290         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
6291         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
6292         * tst-once3.c: Add cleanup handler and check it is called.
6293         * tst-once4.c: Likewise.
6294         * tst-oncex3.c: New file.
6295         * tst-oncex4.c: New file.
6296         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
6298 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
6300         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
6302 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
6304         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
6305         (tf_msgsnd): Likewise.
6307         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
6308         premature returns a bit more.
6310 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
6312         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
6313         definition to the front.
6315         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
6316         the cleanup functions to make the names unique.  Fix dwarf opcode
6317         un unwind table.
6318         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
6319         functions to make the names unique.  Fix CFA offset for two blocks.
6321 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
6323         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
6324         missing closing braces.
6325         Patch by Christophe Saout <christophe@saout.de>.
6327 2003-06-24  Roland McGrath  <roland@redhat.com>
6329         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
6331 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
6333         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
6334         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
6336         * pthreadP.h: Declare __find_thread_by_id.
6337         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
6338         * pthread_clock_gettime.c: Allow using other thread's clock.
6339         * pthread_clock_settime.c: Likewise.
6340         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
6341         * Makefile: Add rules to build and run tst-clock2.
6342         * tst-clock2.c: New file.
6344 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
6346         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
6347         to use exception-based cleanup handler.
6348         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6350         * tst-cond8.c (ch): Announce that we are done.
6352         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
6354         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
6355         Also test aio_suspend with timeout value.
6357 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
6359         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
6360         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
6361         attribute_hidden.
6363         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
6364         (__pthread_mutex_lock_internal): Likewise.
6365         (__pthread_mutex_unlock_internal): Likewise.
6366         (__pthread_mutex_unlock_usercnt): Declare.
6367         * pthread_mutex_destroy.c: Always fail if used in any way.
6368         * pthread_mutex_init.c: Update comment.
6369         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
6370         * pthread_mutex_timedlock.c: Adjust __nusers.
6371         * pthread_mutex_trylock.c: Adjust __nusers.
6372         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
6373         and public interfaces are wrapper with pass additional parameter.
6374         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
6375         parameter zero.
6376         * tst-mutex8.c: New file.
6377         * Makefile (tests): Add tst-mutex8.
6378         * sysdeps/pthread/pthread_cond_timedwait.c: Call
6379         __pthread_mutex_unlock_usercnt.
6380         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6381         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6382         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6383         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6384         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6385         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
6386         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6387         Add __nusers.
6388         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6389         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6390         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6391         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6392         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6394         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
6395         * pthread_mutex_timedlock.c: Likewise.
6396         * pthread_mutex_trylock.c: Adjust __nusers.
6397         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
6398         * tst-mutex9.c: New file.
6399         * Makefile (tests): Add tst-mutex9.
6400         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
6401         * sysdeps/ia64/tls.h: Likewise.
6402         * sysdeps/powerpc/tls.h: Likewise.
6403         * sysdeps/s390/tls.h: Likewise.
6404         * sysdeps/sh/tls.h: Likewise.
6405         * sysdeps/x86_64/tls.h: Likewise.
6406         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6407         Change type of __owner.
6408         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6409         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6410         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6411         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6412         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6414 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
6416         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
6417         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
6419         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
6420         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
6421         instead of nr to lll_futex_wake.  Only set errno and return -1
6422         if err < 0.
6424         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
6425         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6426         return actual return value from the syscall, not 0.
6428 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
6430         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
6431         find a random value.
6432         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
6433         errno==EIDRM.
6435         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
6436         compat_timer_settime.
6437         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
6438         compat_timer_gettime.
6439         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
6440         compat_timer_getoverrun.
6441         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
6442         compat_timer_delete.
6444         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
6445         error-checking mutex detect busy mutexes.
6447 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6449         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
6450         Add ax to clobber list.
6451         (lll_mutex_cond_lock): Likewise.
6452         (lll_mutex_unlock): Likewise.
6453         (lll_lock): Likewise.
6454         (lll_unlock): Likewise.
6456         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
6457         * tst-cancel18.c: New file.
6458         * tst-cancelx18.c: New file.
6460         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
6461         and tcdrain.
6463         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
6464         * tst-cancel17.c: New file.
6465         * tst-cancelx17.c: New file.
6467         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
6468         * sysdeps/unix/sysv/linux/sigwait.c: New file.
6469         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
6471         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
6473 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
6475         * sysdeps/pthread/createthread.c (create_thread): Set
6476         header.multiple_threads unconditionally.
6477         * allocatestack.c (allocate_stack): Likewise.
6478         * descr.h (struct pthread): Add header.multiple_threads
6479         unconditionally.
6480         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
6481         Define for librt.  #error if neither libpthread, libc nor librt.
6482         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
6483         Likewise.
6484         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
6485         CDISABLE): Likewise.
6486         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
6487         CDISABLE): Likewise.
6488         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
6489         CDISABLE): Likewise.
6490         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
6491         CDISABLE): Likewise.  Access header.multiple_threads outside of
6492         libc and libpthread.
6493         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
6494         Likewise.
6495         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
6496         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
6498 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6500         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
6501         Also test early cancellation before the thread reaches the cancellation
6502         point.
6504         * Makefile: Compile forward.c with exceptions.
6506         * sysdeps/unix/sysv/linux/sleep.c: New file.
6508 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
6510         * Makefile: Add CFLAGS definition to compile function wrappers
6511         duplicated from libc with exceptions.
6512         * tst-cancel4.c: Also check cancellation handlers.
6514         * Makefile: Add rules to build and run tst-cancel16 and
6515         tst-cancelx16.  Add missing CFLAGS definitions.
6516         * tst-cancel16.c: New file.
6517         * tst-cancelx16.c: New file.
6519 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
6521         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6522         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
6523         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
6524         (DL_SYSINFO_IMPLEMENTATION): Likewise.
6526         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
6527         (LIBC_CANCEL_RESET): Likewise.
6528         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
6529         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
6530         librt-cancellation.
6531         (CFLAGS-libcrt-cancellation.c): Define.
6532         * sysdeps/pthread/librt-cancellation.c: New file.
6533         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
6534         macros also when compiling librt.
6535         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
6536         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
6537         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
6538         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
6539         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
6540         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
6541         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
6543         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
6544         compat_timer_create.
6546 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
6548         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
6550         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
6551         __register_atfork.
6552         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
6553         Add libc_hidden_def.
6555 2003-06-13  Roland McGrath  <roland@redhat.com>
6557         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
6558         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
6560 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
6562         * allocatestack.c (queue_stack): Always inline.
6563         * ptreadhP.h (__do_cancel): Likewise.
6565 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
6567         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
6568         a typo.
6570 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
6572         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6573         (__pthread_cond_signal): Remove incorrect second addition for
6574         cond_lock!=0.
6576 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
6578         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6579         (__pthread_cond_signal): Use correct futex pointer in
6580         __lll_mutex_lock_wait call.
6582         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6583         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
6585 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
6587         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
6588         cancelable.
6589         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6590         Likewise.
6592         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
6593         hand-written CFI generation code.  Since ENTRY/END also initiated
6594         CFI frames this caused two CFI sets to be generated.
6596 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
6598         * cleanup_routine.c: New file.
6599         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
6600         * sysdeps/pthread/pthread.h: Add support for fully exception-based
6601         cleanup handling.
6602         * Makefile (libpthread-routines): Add cleanup_routine.
6603         Add more CFLAGS variables to compile with exceptions.  Add comments
6604         why which file needs unwind tables.
6605         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
6606         tests.
6607         * tst-cancelx1.c: New file.
6608         * tst-cancelx2.c: New file.
6609         * tst-cancelx3.c: New file.
6610         * tst-cancelx4.c: New file.
6611         * tst-cancelx5.c: New file.
6612         * tst-cancelx6.c: New file.
6613         * tst-cancelx7.c: New file.
6614         * tst-cancelx8.c: New file.
6615         * tst-cancelx9.c: New file.
6616         * tst-cancelx10.c: New file.
6617         * tst-cancelx11.c: New file.
6618         * tst-cancelx12.c: New file.
6619         * tst-cancelx13.c: New file.
6620         * tst-cancelx14.c: New file.
6621         * tst-cancelx15.c: New file.
6622         * tst-cleanupx0.c: New file.
6623         * tst-cleanupx0.expect: New file.
6624         * tst-cleanupx1.c: New file.
6625         * tst-cleanupx2.c: New file.
6626         * tst-cleanupx3.c: New file.
6628         * tst-cleanup0.c: Make standard compliant.
6629         * tst-cleanup1.c: Likewise.
6631         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
6632         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
6633         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
6634         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
6635         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
6636         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
6637         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
6638         CLEANUP_JMP_BUF.
6639         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6640         * tst-cancel12.c: New file.
6641         * tst-cancel13.c: New file.
6642         * tst-cancel14.c: New file.
6643         * tst-cancel15.c: New file.
6644         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
6645         and tst-cancel15.
6647         * tst-cancel1.c: Add some comments.
6649         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
6650         timeout correctly.
6652 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
6654         * Makefile (CFLAGS-pthread_cancel.c): Define.
6656 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
6658         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
6659         Change type of __writer element to int.
6660         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6661         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6662         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6663         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6664         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6665         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
6666         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6667         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
6668         Compare with TID to determine deadlocks.
6669         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
6670         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6671         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
6672         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6673         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6674         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6675         Likewise.
6676         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6677         Likewise.
6678         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6679         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
6680         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
6681         Likewise.
6682         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
6683         Likewise.
6684         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
6685         * Makefile (tests): Add tst-rwlock12.
6686         * tst-rwlock12.c: New file.
6688 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
6690         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
6691         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
6692         Remove bogus hidden_proto.
6693         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
6694         Likewise.
6695         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
6696         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
6697         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
6698         ___lll_mutex_timedlock): Likewise.
6700 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
6702         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6703         (__pthread_cond_signal): Add some code to eventually handle
6704         cond_lock!=0.
6706 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
6708         * Makefile (tests): Add tst-exec4.
6709         (tst-exec4-ARGS): Define.
6710         * tst-exec4.c: New file.
6712 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
6714         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
6715         Also fail if tv_nsec < 0.
6716         (__lll_timedwait_tid): Likewise.
6717         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
6718         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
6719         Likewise.
6720         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
6721         Likewise.
6722         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
6723         Likewise.
6724         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6725         Likewise.
6726         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
6727         Likewise.
6728         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
6729         Likewise.
6731         * Makefile (tests): Add tst-sem8 and tst-sem9.
6732         * tst-sem8.c: New file.
6733         * tst-sem9.c: New file.
6734         * sem_open.c: Fix creation of in_use record if the file exists but
6735         no internal record.
6737         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
6738         definitions.
6740         * sysdeps/pthread/timer_create.c (timer_create): In case
6741         evp==NULL, assign timer ID to sival_ptr.
6743         * descr.h (struct pthread_unwind_buf): Change type of prev element to
6744         struct pthread_unwind_buf *.
6745         (struct pthread): Likewise for cleanup_jmp_buf element.
6747         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
6748         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
6749         * unwind.c (__pthread_unwind_next): Likewise.
6751 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
6753         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6754         (lll_futex_timed_wait): Use int for futex value parameter.
6755         (lll_futex_wake): Likewise.
6756         (lll_futex_requeue): Likewise.
6758         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
6759         Replace one memory operation with one register operation.
6761         * tst-join4.c (do_test): Fix error message.
6763         * tst-rwlock6.c (do_test): Use correct format specifier.
6765         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
6766         (__lll_mutex_lock_wait): Replace one memory operation with one
6767         register operation.
6768         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
6769         (__lll_mutex_lock_wait): Likewise.
6771         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6772         (__lll_mutex_cond_lock): Add one to value parameter of
6773         __lll_lock_wait to reflect reality in the futex syscall.
6774         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6775         (lll_mutex_cond_lock): Likewise.
6777 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
6779         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
6780         New function.
6781         (lll_mutex_cond_lock): Define.
6783 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
6785         * Makefile (tests): Add tst-signal6.
6786         * tst-signal6.c: New file.
6788         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
6789         (__lll_mutex_unlock_force): New function
6790         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
6792         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6793         (__lll_mutex_unlock_force): New function.
6794         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
6796         * tst-rwlock7.c (do_test): Use correct format specifier.
6798         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
6799         Find break parameter in correct asm argument.
6801 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
6803         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
6804         Remove out4.
6805         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
6806         error occured.
6807         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
6808         Add __mutex.
6809         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
6810         lll_futex_requeue, lll_mutex_unlock_force): Define.
6812 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
6814         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6815         (pthread_cond_t): Add __mutex.
6816         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
6817         lll_futex_requeue, lll_mutex_unlock_force): Define.
6819 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6821         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
6822         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
6823         Add __mutex field.
6824         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
6825         Define.
6826         (lll_futex_wait, lll_futex_wake): Define.
6827         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
6828         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
6829         FUTEX_REQUEUE instead of FUTEX_WAIT.
6830         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
6831         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
6832         mutex which was used in condvar structure.  Call
6833         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
6834         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
6836         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
6837         include tcb-offsets.h.  Read wakeup value in locked region.
6838         Use the value of gbr register as THREAD_ID.
6839         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6840         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
6841         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
6843         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
6844         macros.
6846 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
6848         * sysdeps/pthread/pthread_cond_broadcast.c
6849         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
6851 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
6853         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
6854         typo in register name.
6855         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
6856         correctly.  Actually use requeue.  Little optimization.
6857         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
6858         mutex address early.  Handle cancellation state as 32-bit value.
6859         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6860         Remove unnecessary label.
6862 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
6864         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
6865         instead of FUTEX_WAIT.
6866         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
6867         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6868         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6869         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
6870         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
6871         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
6872         used in condvar structure.  Call __pthread_mutex_cond_lock instead
6873         of __pthread_mutex_lock_internal.
6874         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6875         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6876         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6877         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
6878         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6879         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6880         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
6881         Add pthread_mutex_cond_lock.
6882         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
6883         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
6884         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
6885         lll_mutex_cond_lock.
6886         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
6887         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6888         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
6889         Add __mutex field.
6890         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6891         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6893         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
6894         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6896         * pthreadP.h: Declare __pthread_mutex_cond_lock.
6897         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
6898         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
6899         macro don't define aliases.
6901         * cancellation.c: Remove __pthread_enable_asynccancel_2.
6902         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
6903         * sysdeps/pthread/pthread_cond_timedwait.c: Use
6904         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
6905         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6906         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6907         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6908         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6909         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6911 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
6913         * sem_open.c: Fix one endless loop.  Implement correct semantics
6914         wrt opening the same semaphore more then once.
6915         * sem_close.c: Adjust for sem_open change.
6916         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
6917         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
6918         * Makefile (tests): Add tst-sem7.
6919         * tst-sem7.c: New file.
6921 2003-05-16  Roland McGrath  <roland@redhat.com>
6923         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
6924         uninitialized variable braino.
6926 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
6928         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
6929         test for syscall availability.
6931         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
6932         __no_posix_timers to -1 if the syscalls don't exist.
6934         * pthread_join.c (pthread_join): Set tid field of the joined
6935         thread to -1.  This isn't necessary but helps to recognize some
6936         error conditions with almost no cost.
6938         * allocatestack.c (FREE_P): Also negative values indicate an
6939         unused stack.
6941         * unwind.c: Include <unistd.h>.
6943 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
6945         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
6947 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
6949         * Makefile (crti-objs, crtn-objs): New variables.
6950         (omit-deps, extra-objs): Add crtn.
6951         ($(objpfx)libpthread.so): Depend on both crti and crtn
6952         and links to them in multidir.
6953         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
6955 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
6957         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6958         (lll_mutex_unlock): Use atomic_exchange_rel.
6960 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
6962         * cond-perf.c (cons): Add missing locking around setting of alldone.
6964 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
6966         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
6967         related macros.
6968         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
6970 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
6972         * tst-sem6.c: New file.
6973         * Makefile (tests): Add tst-sem6.
6975         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
6976         Use atomic_exchange_rel instead of atomic_exchange.
6977         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
6978         Likewise.
6980         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
6981         code for lll_futex_wait and lll_futex_wake in static apps.  Use
6982         vsyscall is possible.
6984         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
6985         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
6986         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
6987         pthread_setaffinity_np.
6988         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
6989         and pthread_setaffinity_np.
6990         * Makefile (libpthread-routines): Add pthread_getaffinity and
6991         pthread_setaffinity.
6993         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
6994         use it in case mmap to allocate the stack fails.
6995         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
6996         ARCH_MAP_FLAGS here.
6997         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
6998         ARCH_RETRY_MMAP.
7000 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
7002         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
7003         handler implementation.  It is now lockless in fork().
7004         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
7005         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
7006         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
7007         declare the __fork_*_lists.
7008         (struct fork_handler): Include pointers to all three functions.
7009         Add next, refcntr and need_signal elements.
7010         (__fork_handlers): New declaration.
7011         (__register_atfork_malloc): Remove declaration.
7012         (HAVE_register_atfork_malloc): Remove definition.
7013         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
7014         __pthread_child_handler variable.
7015         (__libc_pthread_init): Use __register_atfork instead of explicitly
7016         adding to the list.
7017         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
7018         and lll_futex_wake.
7019         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7021         * unwind.c (unwind_cleanup): Print error message and then abort.  This
7022         function must never be reached.
7024         * cond-perf.c: New file.
7026 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
7028         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
7030 2003-05-04  Roland McGrath  <roland@redhat.com>
7032         * Makefile ($(objpfx)../libc.so): New target.
7034 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
7036         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7037         (pthread_condattr_t): Size is only an int, don't use long for
7038         alignment.
7039         (pthread_mutexattr_t): Likewise.
7040         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7041         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7042         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7044 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
7046         * sysdeps/i386/tls.h: Define THREAD_ID.
7047         * sysdeps/ia64/tls.h: Likewise.
7048         * sysdeps/powerpc/tls.h: Likewise.
7049         * sysdeps/s390/tls.h: Likewise.
7050         * sysdeps/sh/tls.h: Likewise.
7051         * sysdeps/x86_64/tls.h: Likewise.
7052         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
7053         record ownership.
7054         * pthread_mutex_timedlock.c: Likewise.
7055         * pthread_mutex_trylock.c: Likewise.
7056         * pthread_mutex_unlock.c: Likewise.
7057         * pthread_rwlock_trywrlock.c: Likewise.
7058         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
7059         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
7060         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
7061         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
7063         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
7064         flag.
7066 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
7068         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7069         (__SIZEOF_PTHREAD_COND_T): Define to 48.
7070         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
7071         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
7072         Make __align long long instead of long.
7073         (pthread_rwlock_t): Formatting.
7074         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
7075         (pthread_rwlock_t): Formatting.
7076         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7077         (pthread_cond_t): Make __align long long instead of long.
7078         (pthread_rwlock_t): Move __flags field to the same position as in
7079         linuxthreads.
7081 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
7083         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
7084         * tst-rwlock7.c (do_test): Likewise.
7086 2003-04-26  Roland McGrath  <roland@redhat.com>
7088         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
7090 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
7092         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
7093         sizeof (struct pthread).
7094         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
7095         1 struct pthread.
7096         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
7097         to 0.
7098         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
7099         struct pthread.
7100         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
7101         to 32-bit bytes.
7102         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
7103         tcbp.
7104         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
7105         unneccessarily.
7106         (NO_TLS_OFFSET): Define.
7107         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
7108         add TLS_TCB_SIZE unnecessarily.
7110 2003-04-22  Roland McGrath  <roland@redhat.com>
7112         * Makeconfig (shared-thread-library): Reverse link order to work
7113         around linker bug.
7115 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
7117         * semaphore.h: Fix typo in comment.
7119 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
7121         * sysdeps/pthread/sigfillset.c: New file.
7123         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
7124         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
7125         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
7126         * sysdeps/pthread/sigaction.c: Likewise.
7127         * sysdeps/pthread/sigprocmask.c: New file.
7128         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
7129         __SIGRTMIN+1.
7130         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7131         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
7132         in this case.
7134 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
7136         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
7137         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
7139         * sysdeps/unix/sysv/linux/unregister-atfork.c
7140         (__unregister_atfork): Don't free memory not allocated dynamically.
7142         * semaphore.h: Remove __THROW marker from cancellation points.
7143         * nptl/sysdeps/pthread/pthread.h: Likewise.
7145 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
7147         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
7148         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
7149         __THROW.
7151 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
7153         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
7155 2003-04-15  Roland McGrath  <roland@redhat.com>
7157         * forward.c (__pthread_unwind): Tweak to avoid warning.
7159 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
7161         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
7163 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
7165         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
7166         overflow CFA advance instructions.
7167         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7169 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
7171         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
7172         * sysdeps/i386/pthread_spin_lock.c: Likewise.
7173         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
7174         defined.
7176         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
7177         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
7178         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
7179         DW_CFA_advance_loc for .Laddl-.Lsubl.
7181 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
7183         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
7184         position-independent unwind data for static libraries.
7185         Add missing unwind info.  Add comments.
7187         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
7188         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7189         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7190         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7192 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
7194         * Makefile: Make sure all cancellation points are compiled with
7195         exception and asynchronous unwind tables.
7197         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
7198         which mishandles loading of global object addresses in PIC.
7199         (THREAD_SETMEM_NC): Likewise.
7201 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7203         * pthread.h: Define new data structure for cleanup buffer.  Declare
7204         new cleanup handler interfaces.
7205         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
7206         (struct pthread): Add cleanup_jmp_buf pointer.  Define
7207         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
7208         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
7209         it.  Declare old cleanup handler installation functions.
7210         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
7211         handling.
7212         * cleanup_defer.c: Likewise.
7213         * cleanup_compat.c: New file.  Old cleanup code.
7214         * cleanup_def_compat.c: New file.  Old cleanup code.
7215         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
7216         if own thread descriptor.
7217         * unwind.c: New file.
7218         * forward.c: Add __pthread_unwind.
7219         * init.c (pthread_functions): Add __pthread_unwind.
7220         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
7221         Add ptr___pthread_unwind.
7222         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
7223         and unwind function.
7224         * Makefile (libpthread-routines): Add cleanup_compat,
7225         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
7226         table generation if necessary.
7227         * version.c: Record whether unwind support is compiled in.
7228         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
7229         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
7230         handler interfaces.
7231         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
7232         complication to generate unwind information for syscall wrappers.
7233         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
7234         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
7235         __cleanup_fct_attribute.
7237         * Makefile: Add rules to build and run tst-cleanup0.
7238         * tst-cleanup0.c: New file.
7239         * tst-cleanup0.expect: New file.
7241         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
7242         caller.  Optimize to avoid often unecessary local variable.
7244 2003-04-11  Roland McGrath  <roland@redhat.com>
7246         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
7247         sets variable `multidir'; include that.
7248         (generated): Add it.
7249         ($(objpfx)$(multidir)/crti.o): New target.
7250         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
7252 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7254         * tst-attr2.c (do_test): Add cast to avoid warning.
7255         * tst-mutex4.c (do_test): Likewise.
7257 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
7259         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
7260         in child.
7262 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
7264         * Makefile (tests): Add tst-detach1.
7265         * tst-detach1.c: New file.
7267 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
7269         * sysdeps/pthread/pthread.h: Remove duplicate
7270         pthread_cleanup_{push,pop} definitions.
7272         * tst-barrier2.c: Eliminate warnings.
7273         * tst-cancel4.c: Likewise.
7274         * tst-cond4.c: Likewise.
7275         * tst-cond6.c: Likewise.
7276         * tst-detach1.c: Likewise.
7277         * tst-rwlock4.c: Likewise.
7278         * tst-rwlock6.c: Likewise.
7279         * tst-rwlock7.c: Likewise.
7280         * tst-sem3.c: Likewise.
7281         * tst-spin2.c: Likewise.
7282         * tst-umask1.c: Likewise.
7284 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
7286         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
7288 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
7290         * descr.h (struct pthread): Move cancelhandling member to the front.
7292 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
7294         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
7295         malloc_parent, and malloc_child statically.
7296         (__register_atfork_malloc): New function.
7297         (free_mem): Don't free any of the malloc_* variables on the list.
7298         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
7299         Define HAVE_register_atfork_malloc.
7301 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
7303         * sysdeps/pthread/createthread.c (create_thread): Add some more
7304         comments explaining when to set multiple_threads and when not.
7306         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7307         THREAD_ATOMIC_BIT_SET if not already defined.
7308         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7309         THREAD_ATOMIC_BIT_SET:
7310         * sysdeps/x86_64/tls.h: Likewise.
7311         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
7312         THREAD_ATOMIC_CMPXCHG_VAL.
7313         (_pthread_cleanup_pop_restore): Likewise.
7314         * cancellation.c (__pthread_enable_asynccancel): Likewise.
7315         (__pthread_enable_asynccancel_2): Likewise.
7316         (__pthread_disable_asynccancel): Likewise.
7317         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7318         (__libc_disable_asynccancel): Likewise.
7319         * init.c (sigcancel_handler): Likewise.
7320         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
7321         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
7323 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
7325         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
7326         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7327         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
7328         * Makefile (tests): Add tst-cancel11.
7329         * tst-cancel11.c: New file.
7331 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
7333         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
7334         round, not the first.  Use specific_used flag instead of local
7335         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
7336         (__free_tcb): Don't call deallocate_tsd here.
7337         (start_thread): Call deallocate_tsd here.
7338         * pthread_setspecific.c: Set specific_used flag really only when
7339         needed.
7340         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
7341         * tst-tsd3.c: New file.
7342         * tst-tsd4.c: New file.
7344 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7346         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
7347         Use atomic_exchange_and_add instead of __lll_add.
7348         (__lll_mutex_timedlock): Likewise.
7349         Patch by Ian Wienand.
7351 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
7353         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7354         (SINGLE_THREAD_P): Fix typo.
7355         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
7357 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7359         * Makefile (tests): Add tst-align.
7360         * tst-align.c: New file.
7361         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
7363         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
7364         function correctly.
7366         * tst-tsd2.c: Add casts to avoid warnings.
7368 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
7370         * descr.h (struct pthread): Move most often used elements to the front.
7372 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
7374         * Makefile (libpthread-routines): Add pthread_atfork.
7375         (libpthread-static-only-routines): Add pthread_atfork.
7377 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7379         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
7380         of TLS_DTV_AT_TP.
7381         (INSTALL_DTV): Add parens.
7382         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
7383         Use passed descr instead of THREAD_SELF.
7384         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
7385         (__lll_mutex_timedlock_wait): Correct expected value after
7386         spurious wakeup.
7387         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
7388         Release lock before waking up the waiters.
7389         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
7390         criteria.  Reorderstruct passed to cleanup handler.  Fix
7391         handling of cancellation and failung pthread_mutex_unlock call.
7392         Use __pthread_enable_asynccancel_2 instead of
7393         __pthread_enable_asynccancel.
7394         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7395         Return result of lock re-get if it fails.
7396         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
7397         for __pthread_cleanup_push.
7398         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
7399         completely broken rwlock implementation.
7400         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7401         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7402         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7403         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
7404         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7405         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
7406         versioned_symbol macro.
7407         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
7408         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
7410 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
7412         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
7413         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
7414         and __helper_tid.
7415         (struct timer): Remove th and bar field.
7416         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
7417         debugging code.  Create only one helper thread.
7418         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
7419         helper thread.
7420         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7421         Renamed.  Define statically.  Use thread info from siginfo.
7422         (__helper_once): New variable.
7423         (__helper_tid): New variable.
7424         (__reset_helper_control): New function.
7425         (__start_helper_thread): New function.
7427         * pthread_create.c (start_thread): Don't use setjmp inside
7428         __builtin_expect to work around gcc bug.
7430         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
7431         timer_delete syscall fails, but not with ENOSYS, set
7432         __no_posix_timers.
7434         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
7435         (timer_settime): Fix typo.
7436         * sysdeps/unix/sysv/linux/timer_getoverr.c
7437         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
7439 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
7441         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
7442         offset of cleanupbuf.__prev.
7444 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
7446         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
7447         of included file.
7449 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
7451         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
7452         NULL provide default definition to syscall.
7454 2003-03-25  Roland McGrath  <roland@redhat.com>
7456         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
7457         (timer_id2ptr): Fix typo.
7459 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
7461         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
7462         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
7463         * sysdeps/ia64/pthreaddef.h: Likewise.
7464         * sysdeps/powerpc/pthreaddef.h: Likewise.
7465         * sysdeps/s390/pthreaddef.h: Likewise.
7466         * sysdeps/sh/pthreaddef.h: Likewise.
7467         * sysdeps/x86_64/pthreaddef.h: Likewise.
7468         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
7469         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
7470         being changed.
7471         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
7472         SIGTIMER is not unblocked.
7473         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
7474         RT signal taken.
7475         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
7476         be send.
7477         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
7478         pass pointer through as ID.
7479         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
7480         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
7481         * sysdeps/unix/sysv/linux/timer_create.c: New file.
7482         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
7483         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
7484         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
7485         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
7486         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
7487         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
7488         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
7489         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
7490         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
7491         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
7492         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
7493         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
7494         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
7495         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
7496         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
7497         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
7498         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
7499         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
7500         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
7501         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
7502         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
7503         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
7504         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
7505         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
7506         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
7507         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
7508         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
7509         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
7510         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
7511         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
7513         * pthreadP.h: Remove FRAME_LEFT definition.
7514         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
7515         already left frame.  Programs which have this problem are not POSIX
7516         compliant.
7517         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
7519 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
7521         * sysdeps/pthread/tst-timer.c: Check return values of the
7522         functions we test.
7524 2003-03-23  Roland McGrath  <roland@redhat.com>
7526         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
7527         * tst-tls3mod.c: Likewise.
7528         * tst-tls1.c: Likewise.
7529         * tst-tls2.c: Likewise.
7531         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
7532         undefined behavior.
7534         * tst-join5.c (tf1, tf2): Add a cast.
7536         * Makeconfig (includes): Append -I$(..)nptl to this variable.
7538         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
7539         Don't test anything.
7540         * tst-cond4.c: Likewise.
7541         * tst-cond6.c: Likewise.
7542         * tst-flock2.c: Likewise.
7543         * tst-mutex4.c: Likewise.
7544         * tst-rwlock4.c: Likewise.
7545         * tst-signal1.c: Likewise.
7546         * tst-spin2.c: Likewise.
7547         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
7549         * tst-mutex4.c: Use test-skeleton.c.
7550         * tst-spin2.c: Likewise.
7551         * tst-sysconf.c: Likewise.
7552         * tst-barrier2.c: Likewise.
7553         * tst-cond4.c: Likewise.
7554         * tst-cond6.c: Likewise.
7555         * tst-rwlock4.c: Likewise.
7556         * tst-unload.c: Likewise.
7557         * tst-flock2.c (do_test): Use return instead of exit.
7559 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
7561         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
7563 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
7565         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7566         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
7567         instead of __lll_compare_and_swap.
7568         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
7569         Likewise.
7570         Removed definition if __lll_compare_and_swap.
7572         * cancellation.c: Adjust for new form of compare&exchange macros.
7573         * cleanup_defer.c: Likewise.
7574         * init.c: Likewise.
7575         * libc-cancellation.c: Likewise.
7576         * old_pthread_cond_broadcast.c: Likewise.
7577         * old_pthread_cond_signal.c: Likewise.
7578         * old_pthread_cond_timedwait.c: Likewise.
7579         * old_pthread_cond_wait.c: Likewise.
7580         * pthread_cancel.c: Likewise.
7581         * pthread_create.c: Likewise.
7582         * pthread_detach.c: Likewise.
7583         * pthread_join.c: Likewise.
7584         * pthread_key_delete.c: Likewise.
7585         * pthread_setcancelstate.c: Likewise.
7586         * pthread_setcanceltype.c: Likewise.
7587         * pthread_timedjoin.c: Likewise.
7588         * pthread_tryjoin.c: Likewise.
7589         * sysdeps/pthread/createthread.c: Likewise.
7591 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
7593         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
7594         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
7595         definitions.  Replace uses with calls to atomic_* functions.
7596         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
7597         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
7598         __lll_test_and_set calls with atomic_exchange_and_add and
7599         atomic_exchange calls respectively.
7600         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
7601         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
7602         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
7603         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
7604         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
7605         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
7606         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
7608         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
7609         returns the old value.
7611 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
7613         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
7614         int for variable OLDVAL and correct inline assembler contraint.
7615         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
7616         type int for variable OLD.
7618         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
7619         only for s390-32.
7620         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7621         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
7622         instead of multiple_threads field in the TCB.
7624 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
7626         * sysdeps/i386/i686/bits/atomic.h: Removed.
7627         * sysdeps/i386/i586/bits/atomic.h: Removed.
7628         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
7629         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
7630         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
7631         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
7632         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
7633         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
7634         * atomic.h: Removed.  Moved to glibc.
7636         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
7637         support for clock selection.
7639         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
7640         signalling waiters.
7642 2003-03-18  Roland McGrath  <roland@redhat.com>
7644         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7645         Add __lll_rel_instr first.  Add memory clobber.
7646         (lll_mutex_unlock): Use __lll_test_and_set.
7647         From Paul Mackerras <paulus@samba.org>.
7649         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
7650         unconditionally.
7651         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7652         (SINGLE_THREAD_P):  Add `header.' prefix.
7653         From Paul Mackerras <paulus@samba.org>.
7655         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
7656         pthread_timedjoin_np to ...
7657         (libpthread: GLIBC_2.3.3): ... here.
7658         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
7660         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
7661         Avoid shadowing VAL variable.
7663         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7664         New macro.
7666 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
7668         * Makefile (tests): Add tst-cond11.
7669         * tst-cond11.c: New file.
7671         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
7672         struct passed to cleanup handler to eliminate one more
7673         instruction.
7674         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7676         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7677         (pthrad_cond_t): Replace __unused field with __clock.
7679         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
7680         waken all waiters in cleanup handler.
7681         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7682         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7684         * pthread_condattr_getclock.c: New file.
7685         * pthread_condattr_setclock.c: New file.
7686         * sysdeps/pthread/pthread.h: Declare these new functions.
7687         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
7688         * Makefile (libpthread-routines): Add the new functions.
7689         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
7690         Renamed field to value.  Document use of the bits.
7691         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
7692         change.
7693         * pthread_condattr_setpshared.c: Likewise.
7694         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
7695         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
7696         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
7697         Add __clock field.
7698         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7699         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7700         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7701         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7702         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
7703         Implement clock selection.
7704         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7705         * pthread-errnos.sym: Add ENOSYS.
7706         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
7707         _POSIX_CLOCK_SELECTION.
7708         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
7710         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
7711         invalid .size directive.
7713 2003-03-17  Roland McGrath  <roland@redhat.com>
7715         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
7716         Formatting tweaks.
7718 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7720         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
7721         Use __lll_add instead of spelling it out.  Use protected symbol names.
7722         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
7723         Use __lll_add.
7724         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
7725         Renamed from lll_compare_and_swap.  Use new name where necessary.
7726         (__lll_add): Defined.
7727         (__lll_dec_if_positive): Defined.
7728         (__lll_test_and_set): Defined.
7729         * sysdeps/ia64/pthread_spin_init.c: Removed.
7730         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
7731         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
7732         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
7733         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
7734         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
7735         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
7736         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
7737         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
7738         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
7739         __sync_lock_release_si.
7740         Patch by Jakub Jelinek.
7742         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
7743         Fix timeout handling.
7744         (__lll_timedwait_tid): Likewise.
7745         (lll_unlock_wake_cb): Wake up other waiters if necessary.
7746         Patch by Jakub Jelinek.
7748         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
7750 2003-03-17  Roland McGrath  <roland@redhat.com>
7752         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
7753         * sysdeps/pthread/pthread_spin_init.c: New file.
7754         * sysdeps/pthread/pthread_spin_unlock.c: New file.
7755         * sysdeps/powerpc/Makefile: New file.
7756         * sysdeps/powerpc/pthread_spin_lock.c: New file.
7757         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
7758         * sysdeps/powerpc/pthreaddef.h: New file.
7759         * sysdeps/powerpc/tcb-offsets.sym: New file.
7760         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
7761         * sysdeps/powerpc/tls.h: New file.
7762         * sysdeps/powerpc/bits/atomic.h: New file.
7763         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
7764         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
7765         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
7767         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
7768         * sysdeps/unix/sysv/linux/sem_post.c: New file.
7769         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
7770         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
7771         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
7772         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
7773         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
7774         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
7775         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
7776         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
7777         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
7778         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
7779         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
7780         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
7781         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
7783         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
7784         not gettimeofday.
7785         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
7786         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
7787         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
7788         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
7789         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
7791 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7793         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
7794         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7795         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7796         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7797         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
7799 2003-03-16  Roland McGrath  <roland@redhat.com>
7801         * tst-fork4.c: Include <string.h>.
7802         * tst-signal2.c: Likewise.
7803         * tst-mutex5.c (do_test): exit -> return.
7804         * tst-mutex2.c: Include <stdlib.h>.
7806 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
7808         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
7809         (__lll_mutex_timedlock_wait): Correct expected value after
7810         spurious wakeup.  Otherwise we would never wait again.
7812         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
7813         zone versus inline asm stupidity.  Use correct instructions.
7815         * tst-rwlock6.c: Add some more status output.
7817 2003-03-15  Roland McGrath  <roland@redhat.com>
7819         * sysdeps/pthread/configure.in: New file.
7820         * sysdeps/pthread/configure: New file (generated).
7822 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
7824         * allocatestack.c (allocate_stack): Store the exact stack size of
7825         user allocated stacks.
7827 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
7829         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
7830         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
7831         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
7832         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
7833         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
7834         Use `header.' prefix.
7835         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
7837 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
7839         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
7840         __builtin_frame_address, use stack pointer.
7842         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
7843         instead of __builtin_frame_pointer.
7845 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
7847         * tst-basic1.c (do_test): Add cast to avoid warning.
7848         * tst-basic2.c (do_test): Likewise.
7850         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
7851         amount of stack correction.
7853         * tst-fork4.c: Use test-skeleton.c.
7855 2003-03-14  Roland McGrath  <roland@redhat.com>
7857         * init.c: Fix typo "#eli" for "#else".
7859 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
7861         * allocatestack.c (__stack_user): Use hidden_data_def.
7862         * pthread_create.c (__pthread_keys): Likewise.
7864         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
7866 2003-03-14  Roland McGrath  <roland@redhat.com>
7868         * tst-fork4.c: New file.
7869         * Makefile (tests): Add it.
7871         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
7872         we always define the padding space.
7873         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
7874         stopped supporting its own extensions fully.
7875         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
7876         struct also called `header', so `header.multiple_threads' is the field
7877         name to use on all machines.
7878         * allocatestack.c (allocate_stack): Use `header.' prefix.
7879         * sysdeps/pthread/createthread.c (create_thread): Likewise.
7880         * pthread_create.c (__pthread_create_2_1): Likewise.
7881         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
7882         (THREAD_SELF): Likewise.
7883         * sysdeps/x86_64/tls.h: Likewise.
7884         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
7885         (SINGLE_THREAD_P): Likewise.
7886         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
7887         (SINGLE_THREAD_P): Likewise.
7888         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7889         (SINGLE_THREAD_P): Likewise.
7891         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
7892         value directly.
7894 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
7896         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
7897         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
7899         * pthread_create.c (start_thread): setjmp is expected to return 0.
7901         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
7902         (THREAD_GETMEM_NC): Likewise.
7904 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
7906         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
7907         and the size of the stack which must be allocated is a multiple,
7908         allocate one more page.
7909         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
7910         MULTI_PAGE_ALIASING.
7912 2003-03-13  Roland McGrath  <roland@redhat.com>
7914         * pthread_create.c (start_thread): Set EXITING_BIT after the
7915         event-reporting (and destructors), not before.
7917 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
7919         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
7920         lll_futex_wake): Declare register variables as long int instead of
7921         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
7922         Make syscall arguments clobbered by the syscall.
7923         (lll_futex_wait): Define using lll_futex_timed_wait.
7925         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
7926         to void *.
7928         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
7929         PPID if [! NDEBUG].
7931         * allocatestack.c (nptl_ncreated): Only declare if
7932         COLORING_INCREMENT != 0.
7934         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
7935         (__libc_enable_asynccancel_2): Remove prototype.
7937         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
7938         ctid to match kernel.
7940 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
7942         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
7943         libc_multiple_threads.
7944         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
7945         __libc_multiple_threads to...
7946         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
7948         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
7949         versioning.
7950         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7951         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7953         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
7954         (__pthread_once_internal): Define.
7956         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
7957         macros instead of .symver directly.
7958         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
7959         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
7961         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
7962         * sysdeps/x86_64/tcb-offsets.sym: New file.
7963         * sysdeps/x86_64/Makefile: New file.
7965         * sysdeps/i386/tcb-offsets.sym: Add SELF.
7966         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
7967         to access own pthread_t in TCB.
7968         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7969         Likewise.
7970         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7971         Likewise.
7972         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7974 2003-03-12  Roland McGrath  <roland@redhat.com>
7976         * pthread-errnos.sym: New file.
7977         * Makefile (gen-as-const-headers): New variable, list that file.
7978         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
7979         header <pthread-errnos.h> instead of defining errno values here.
7980         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
7981         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
7982         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
7983         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7984         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7985         Likewise.
7986         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7987         Likewise.
7988         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
7989         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7990         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
7991         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
7992         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7993         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7994         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7995         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
7996         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7997         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
7998         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
7999         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
8000         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
8001         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
8002         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
8003         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8004         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
8005         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
8006         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
8007         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
8008         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8009         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
8010         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
8011         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
8012         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
8013         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
8014         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
8016         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
8017         CLONE_CHILD_SETTID worked.
8019 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
8021         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
8022         file.
8023         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
8024         file.
8026         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
8027         (pthread_cond_t): Add padding.
8029         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
8030         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
8031         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
8033         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
8034         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
8035         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
8036         (__pthread_rwlock_timedrdlock): Likewise.
8037         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
8038         (__pthread_rwlock_wrlock): Likewise.
8039         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
8040         (__pthread_rwlock_rdlock): Likewise.
8042         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
8044         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
8045         result of lock re-get if it fails.
8047 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8049         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
8050         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
8051         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
8052         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
8053         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
8054         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
8055         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
8056         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
8057         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8058         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8060         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
8061         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
8063         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
8064         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
8065         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
8066         (create_thread): Likewise.
8067         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
8068         * init.c (__pthread_initialize_minimal_internal): Initialize
8069         __libc_multiple_threads_ptr if necessary.
8070         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
8071         __pthread_multiple_threads and __libc_multiple_threads_ptr.
8072         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
8073         __libc_multiple_threads.
8074         (__libc_pthread_init): Return pointer to __libc_pthread_init if
8075         necessary.
8077         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
8078         (THREAD_SETMEM_NC): Likewise.
8080         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
8081         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
8082         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
8083         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
8085         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
8086         Eliminate one entire instruction.
8088         * cancellation.c (__pthread_enable_asynccancel_2): New function.
8089         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
8090         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
8091         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
8092         instead of __pthread_enable_asynccancel.
8093         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8094         (__pthread_cond_wait): Likewise.
8095         * sysdeps/pthread/pthread_cond_timedwait.c
8096         (__pthread_cond_timedwait): Likewise.
8097         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
8099         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8100         (__condvar_cleanup): Wake up all waiters in case we got signaled
8101         after being woken up but before disabling asynchronous
8102         cancellation.
8103         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8104         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
8105         (__condvar_cleanup): Likewise.
8107         * init.c (__NR_set_tid_address): If already defined, don't redefine.
8108         Make it an error if architecture has no #if case.  Add x86-64.
8110         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
8111         pt-initfini.s generation.
8113         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
8114         (TLS_INIT_TP): Fix typo.
8116 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8118         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
8119         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
8121         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
8122         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
8123         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
8124         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
8125         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
8126         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8127         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8128         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8130 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8132         * sysdeps/pthread/pthread_cond_timedwait.c
8133         (__pthread_cond_timedwait): Return the result of the final
8134         locking.  If it succeeds, the regular function return value.
8136         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
8137         Return result of the final locking.
8138         * version.c (__nptl_main): Work around problems with the strange
8139         INTERNAL_SYSCALL macro on ppc32.
8140         * init.c (__pthread_initialize_minimal_internal): Unblock
8141         SIGCANCEL in case the parent blocked it.
8142         Reported by Paul Mackerras <paulus@samba.org>.
8144         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
8145         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
8146         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
8148 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8150         * sysdeps/pthread/pthread_cond_timedwait.c
8151         (__pthread_cond_timedwait): Unlock and fail if
8152         __pthread_mutex_unlock_internal failed.
8154         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
8155         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
8156         Use ARCH_CLONE.
8157         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
8158         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
8159         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
8160         ALLOCATE_STACK): New macros.
8161         (TLS_TPADJ): New macro.
8162         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
8163         (allocate_stack): Handle TLS_DTV_AT_TP and
8164         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
8165         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
8166         Don't set PD->self.
8167         * init.c [__ia64__] (__NR_set_tid_address): Define.
8169         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
8170         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
8171         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
8172         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
8173         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
8174         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
8175         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
8176         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
8177         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
8178         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
8179         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
8180         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
8181         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
8182         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
8183         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
8184         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
8185         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
8186         * sysdeps/ia64/bits/atomic.h: New file.
8187         * sysdeps/ia64/Makefile: New file.
8188         * sysdeps/ia64/pthread_spin_init.c: New file.
8189         * sysdeps/ia64/pthread_spin_lock.c: New file.
8190         * sysdeps/ia64/pthread_spin_trylock.c: New file.
8191         * sysdeps/ia64/pthread_spin_unlock.c: New file.
8192         * sysdeps/ia64/pthreaddef.h: New file.
8193         * sysdeps/ia64/tcb-offsets.sym: New file.
8194         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
8195         * sysdeps/ia64/tls.h: New file.
8197         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
8198         to syscall instead of no arguments.
8200 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
8202         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
8203         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
8204         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
8205         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
8207         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
8208         unused code.
8210         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
8212         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8213         lowlevelbarrier.sym.
8214         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
8215         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
8216         Include lowlevelbarrier.h and don't define offsets locally.
8217         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
8219         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
8220         (__lll_mutex_lock_wait): Reverse order of first two parameters.
8221         (__lll_mutex_timedlock_wait): Likewise.
8222         (lll_mutex_lock): Adjust asm for that.
8223         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
8224         (lll_lock): Adjust asm for operand order change.
8225         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
8226         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
8228         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
8229         Reverse order of parameters.
8230         (__lll_timedwait_tid): Remove regparms attribute.
8231         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
8232         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
8234         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8235         (__lll_timedwait_tid): Remove one unnecessary instruction.
8237         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
8238         __lll_mutex_timedlock_wait only for NOT_IN_libc.
8239         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
8240         lowlevelmutex.S.
8242         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
8243         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
8244         for NOT_IN_libc.
8245         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
8246         lowlevellock.S.
8248         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
8249         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
8250         for libc.so.
8251         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
8252         define LOCK here (if UP is not defined).  The actual code is in
8253         lowlevelmutex.S.
8255         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
8256         LOCK is already defined.  Don't define lll_unlock_wake_cb and
8257         __lll_timedwait_tid for libc.so.
8258         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
8259         define LOCK here (if UP is not defined).  The actual code is in
8260         lowlevellock.S.
8262         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
8263         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
8264         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
8265         instead of lowlevelsem.h.
8266         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8267         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8268         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8270         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8271         lowlevelrwlock.sym.
8272         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
8273         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
8274         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
8276         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
8277         register loading.
8278         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
8279         last changed.  D'oh.
8281         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
8283         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
8284         of __libc_locking_needed.
8285         (lll_trylock): Initialize %eax to zero.
8287         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
8288         pthread_cond_t definition.
8290 2003-03-10  Roland McGrath  <roland@redhat.com>
8292         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
8293         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
8294         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
8295         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
8296         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
8298         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
8299         Instead of setting PD->multiple_threads, set globals
8300         __pthread_multiple_threads and __libc_multiple_threads.
8301         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8302         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
8303         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
8305         * descr.h (struct pthread): Conditionalize first member on
8306         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
8307         containing an anonymous tcbhead_t.  Move `list' member out.
8308         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
8309         * allocatestack.c: Remove use of `header.data.' prefix.
8310         * pthread_create.c: Likewise.
8311         * init.c (__pthread_initialize_minimal_internal): Likewise.
8312         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8313         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
8314         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
8315         * sysdeps/x86_64/tls.h: Likewise.
8316         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
8317         (SINGLE_THREAD_P): Likewise.
8318         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
8319         (SINGLE_THREAD_P): Likewise.
8320         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
8321         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
8323 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
8325         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
8327         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
8328         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8330         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
8331         leftovers from the ia32 code.
8333         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
8334         memory load.
8335         (clear_once_control): Don't load %esi.
8337         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
8338         handling.
8340         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8342         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
8343         * sysdeps/unix/sysv/linux/createthread.c: ...here.
8345         * Makefile (tests): Add tst-cond10.
8346         * tst-cond10.c: New file.
8348 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
8350         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
8351         * tst-signal3.c (do_test): Likewise.
8352         * tst-sem5.c (do_test): Likewise.
8353         * tst-kill6.c (do_test): Likewise.
8354         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
8356         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
8357         of inc/dec.
8358         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
8359         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
8360         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8361         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8362         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8363         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8364         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8365         Likewise.
8366         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8367         Likewise.
8368         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8369         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8370         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8371         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
8372         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
8373         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
8374         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8375         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8377         * allocatestack.c (allocate_stack): If mprotect() fails free the
8378         TLS memory.
8380 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
8382         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
8384         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
8385         lll_wake_tid.  This was used only to work around kernel limits in
8386         the early days.
8387         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
8388         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
8389         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8390         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
8392         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
8393         (__pthread_initialize_minimal_internal): Change initialization of
8394         __static_tls_align_m1 appropriately.
8395         * pthreadP.h (__static_tls_align_m1): Renamed from
8396         __static_tls_align.
8397         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
8398         instead of __static_tls_align-1.
8400 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
8402         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
8404         * pthread_create.c: Define __pthread_keys using nocommon
8405         attribute, not by placing it explicitly in bss.
8406         Remove DEFINE_DEALLOC definition.  Not needed anymore.
8408         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
8409         Use it in mmap call to allocate stacks.
8411         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
8413         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
8414         result of the thread function.
8416 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
8418         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
8419         version is just fine.
8421         * sysdeps/unix/sysv/linux/libc_pthread_init.c
8422         (__pthread_child_handler): Renamed from pthread_child_handler,
8423         exported, and marked hidden.  Change all users.
8424         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
8425         free __pthread_child_handler from child list.
8427 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8429         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
8431         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
8432         Fix handling of cancellation and failing pthread_mutex_unlock call.
8433         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8434         (__pthread_cond_wait): Likewise.
8436         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
8437         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
8438         lll_futex_timed_wait call.
8439         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
8440         (pthread_rwlock_timedwrlock): Likewise.
8442         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
8443         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
8444         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
8446         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
8447         check of lll_futex_wake return value.
8449 2003-03-03  Roland McGrath  <roland@redhat.com>
8451         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
8453         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8454         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
8455         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
8457 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
8459         * sysdeps/pthread/timer_create.c (timer_create): Return correct
8460         error for CPU clocks.
8462         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
8463         _POSIX_MONOTONIC_CLOCK.
8464         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
8466         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
8467         recent kernels.
8469 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8471         * descr.h (struct pthread): Move cleanup field to the front.
8473 2003-03-01  Roland McGrath  <roland@redhat.com>
8475         * sem_open.c (sem_open): Braino fix.
8477 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8479         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
8480         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
8481         __pthread_cleanup_pop functionality.
8482         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8484         * descr.h (struct pthread): Move tid field to the front now that
8485         it is often used.
8487         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
8488         (__lll_mutex_timedlock_wait): Remove.
8489         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8490         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
8491         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8492         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8493         (lll_unlock_wake_cb): Don't save and restore %esi.
8494         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8495         %esi.
8496         (__lll_timedwait_tid): Add alignment.
8497         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
8498         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8499         %esi.
8500         (__lll_timedwait_tid): Removed.
8501         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
8502         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
8503         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
8504         (pthread_barrier_wait): Don't save, load, and restore %esi for
8505         last thread.
8506         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
8507         (__pthread_cond_signal): Don't save, load, and restore %esi.
8508         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
8509         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
8510         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
8511         Don't save, load, and restore %esi.
8513 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
8515         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
8516         Release lock before waking up the waiters.
8518         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
8520         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
8521         (reader_thread): Likewise.
8523         * sysdeps/pthread/pthread_rwlock_unlock.c
8524         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
8525         to wake up readers if there are none.
8527         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
8528         Release internal lock before wake threads.
8530 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
8532         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
8533         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
8534         predefined.
8535         * tst-rwlock9.c: Likewise.
8536         * tst-rwlock10.c: New file.
8537         * tst-rwlock11.c: New file.
8539         * Makefile (tests): Add tst-dlsym1.
8540         * tst-dlsym1.c: New file.
8542         * init.c (__pthread_initialize_minimal_internal): Set
8543         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
8544         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
8546 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
8548         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
8550         * tst-cond2.c: Fix sychronization with child.
8552         * tst-rwlock8.c (reader_thread): Remove unused variable.
8554         * Makefile: Add rules to build and run tst-tls3.
8555         * tst-tls3.c: New file.
8556         * tst-tls3mod.c: New file.
8558         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
8559         * tst-rwlock8.c: New file.
8560         * tst-rwlock9.c: New file.
8561         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
8562         complete broken rwlock implementation.
8563         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8564         Likewise.
8565         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8566         Likewise.
8567         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8568         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8569         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
8570         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
8571         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
8572         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
8573         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
8575 2003-02-23  Roland McGrath  <roland@redhat.com>
8577         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
8579 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
8581         * Makefile (tests): Add tst-context1.
8582         * tst-context1.c: New file.
8584         * Makefile (tests): Add tst-tls1 and tst-tls2.
8585         * tst-tls1.c: New file.
8586         * tst-tls2.c: New file.
8588         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
8589         for failed cmpxchg.
8591         * pthread_create.c (start_thread): Set EXITING_BIT early.
8593         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
8594         (THREAD_GETMEM_NC): Likewise.
8596 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
8598         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
8599         off 3 more bytes by using offset-less instructions when possible.
8601         * Makefile: Add dependency for $(objpfx)version.d.
8603         * eintr.c (eintr_source): Add unnecessary return but the compiler
8604         insists.
8606         * tst-kill3.c: Include <unistd.h>.
8608 2003-02-21  Roland McGrath  <roland@redhat.com>
8610         * pthread_create.c (start_thread): Call __libc_thread_freeres.
8612 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8614         * Makefile (tests): Add tst-eintr1.
8615         (distribute): Add eintr.c.
8616         * tst-eintr1.c: New file.
8617         * eintr.c: New file.
8619         * pthread_cancel.c (pthread_cancel): Use tkill directly.
8621         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
8622         Disallow sending SIGCANCEL.
8624         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
8625         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
8626         * tst-kill1.c: New file.
8627         * tst-kill2.c: New file.
8628         * tst-kill3.c: New file.
8629         * tst-kill5.c: New file.
8630         * tst-kill6.c: New file.
8631         * tst-basic7.c: Renamed to...
8632         * tst-kill4.c: ...this.
8634 2003-02-21  Roland McGrath  <roland@redhat.com>
8636         * Makefile (install-lib-ldscripts): New variable.
8638 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8640         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
8641         * pthread_cancel.c: Use INVALID_TD_P.
8642         * pthread_detach.c: Likewise.
8643         * pthread_getschedparam.c: Likewise.
8644         * pthread_setschedparam.c: Likewise.
8645         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
8646         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
8647         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
8648         * pthread_timedjoin.c: Likewise.
8650         * tst-basic7.c: Include <signal.h>.
8652         * pthread_join.c (pthread_join): Limited checking for invalid
8653         descriptors.
8654         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
8656 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
8658         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
8659         beginning of the loop.  Clear the entire first block of TSD.
8660         * Makefile (tests): Add tst-key4.
8661         * tst-key4.c: New file.
8663 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
8665         * Makefile (tests): Add tst-basic7.
8666         * tst-basic7.c: New file.
8668         * pthread_create.c (deallocate_tsd): Mark as internal_function.
8669         Add some more __builtin_expect.
8671         * pthreadP.h: Define dummy version of DEBUGGING_P.
8673 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
8675         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
8676         _POSIX_THREAD_PRIORITY_SCHEDULING.
8677         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
8678         _XOPEN_REALTIME_THREADS.
8679         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
8681         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
8682         kernel returns EINVAL for PID <= 0, work around it.
8684         * Makefile (tests): Add tst-signal5.
8685         * tst-signal5.c: New file.
8687         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
8688         and LOGIN_NAME_MAX.
8690         * tst-cancel1.c (tf): Block all signals.
8692         * Makefile (tests): Add tst-basic6.
8693         * tst-basic6.c: New file.
8695         * tst-basic1.c: Add test for process ID.
8697         * Makefile (tests): Add tst-cancel10.
8698         * tst-cancel10.c: New file.
8700         * Makefile (tests): Add tst-signal4.
8701         * tst-signal4.c: New file.
8703         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
8704         __sigismember instead of sigismember.  Add __builtin_expect.
8706 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
8708         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
8709         pthread_setcancelstate, and pthread_rwlock_setpshared.
8711         * tst-cancel7.c (do_test): Make sure the pid file exists before
8712         canceling the thread.
8714         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
8715         pthread_rwlock_timedrdlock tests.
8716         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
8717         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8718         Check for invalid tv_nsec field.
8719         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8720         Likewise.
8722         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
8723         recursive mutex of overflow.
8725         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
8727         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
8728         going into an endless loop.
8729         * Makefile (tests): Add tst-cancel9.
8730         * tst-cancel9.c: New file.
8732         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
8734 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
8736         * tst-mutex5.c (do_test): Add more timedlock tests.
8738         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
8739         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
8741         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
8742         use INLINE_SYSCALL.  Error number is returned, not -1.
8744         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
8745         and __deallocate_stack with internal_function.
8746         * pthread_create.c: Adjust definitions appropriately.
8747         * allocatestack.c: Likewise.
8749         * pthread_join.c: Add one more __builtin_expect.
8750         * pthread_timedjoin.c: Likewise.
8752         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
8753         not data of sequence number does not match.
8754         Add one __builtin_expect.
8756         * Makefile (tests): Add tst-clock1.
8757         * tst-clock1.c: New file.
8759         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
8760         negative arguments.
8761         * Makefile (tests): Add tst-basic5.
8762         * tst-basic5.c: New file.
8764 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
8766         * Makefile (tests): Add tst-basic4.
8767         * tst-basic4.c: New file.
8769         * pthreadP.h: Add declaraction for __nptl_nthreads.
8770         * pthread_create.c: Define __nptl_nthreads
8771         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
8772         after thread is done.  If then zero, call exit(0).
8773         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8774         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
8775         * init.c (pthread_functions): Initialize ptr_nthreads.
8776         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
8777         (__reclaim_stacks): Decrement __nptl_nthreads.
8778         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
8779         Define.
8780         * Makefile (tests): Add tst-basic3.
8781         * tst-basic3.c: New file.
8783         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
8784         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
8785         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
8786         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
8787         if asynchronous canceling is enabled.
8788         * pthread_join.c (pthread_join): When recognizing circular joins,
8789         take into account the other thread might be already canceled.
8790         * Makefile (tests): Add tst-join5.
8791         * tst-join5.c: New file.
8793         * Makefile (tests): Add tst-join4.
8794         * tst-join4.c: New file.
8796 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
8798         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
8800 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8802         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
8803         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
8804         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
8805         warning.
8806         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
8807         to avoid warning.
8808         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
8809         error if lll_futex_wake failed.
8811 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
8813         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
8814         handling of cancellation and failung pthread_mutex_unlock call.
8815         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8816         * Makefile (tests): Add tst-cond8 and tst-cond9.
8817         * tst-cond8.c: New file.
8818         * tst-cond9.c: New file.
8820         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
8822         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
8823         non-standard initializers with __USE_GNU.
8825         * Makefile (tests): Add tst-cleanup3.
8826         * tst-cleanup3.c: New file.
8828 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
8830         * Makefile (tests): Add tst-attr1 and tst-attr2.
8831         * tst-attr1.c: New file.
8832         * tst-attr2.c: New file.
8834         * Makefile: Add rules to build and run tst-atfork2 test.
8835         * tst-atfork2.c: New file.
8836         * tst-atfork2mod.c: New file.
8838         * sysdeps/unix/sysv/linux/unregister-atfork.c
8839         (__unregister_atfork): Free the memory allocated for the handlers
8840         after removing them from the lists.
8842         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
8843         cleanup function.
8845         * tst-atfork1.c (do_test): Wait for the child we forked.
8846         Report error in child.
8848         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
8850         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
8852 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
8854         * Makefile (tests): Add tst-cancel8.
8855         * tst-cancel8.c: New file.
8857         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
8858         clearing of control variable.
8859         * Makefile (tests): Add tst-once3 and tst-once4.
8860         * tst-once3.c: New file.
8861         * tst-once4.c: New file.
8863 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
8865         * sysdeps/sh/Makefile: New file.
8866         * sysdeps/sh/bits/atomic.h: New file.
8867         * sysdeps/sh/pthread_spin_init.c: New file.
8868         * sysdeps/sh/pthread_spin_lock.c: New file.
8869         * sysdeps/sh/pthread_spin_trylock.S: New file.
8870         * sysdeps/sh/pthread_spin_unlock.S: New file.
8871         * sysdeps/sh/pthreaddef.h: New file.
8872         * sysdeps/sh/tcb-offsets.sym: New file.
8873         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
8874         * sysdeps/sh/tls.h: New file.
8875         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
8876         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
8877         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
8878         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
8879         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
8880         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
8881         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
8882         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
8883         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
8884         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
8885         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
8886         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
8887         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
8888         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
8889         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
8890         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
8891         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
8892         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
8893         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
8894         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
8895         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
8896         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
8897         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
8898         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
8899         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
8900         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
8901         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
8902         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
8903         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
8904         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
8906 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
8908         * tst-cond2.c: Rearrange code to not rely on behavior undefined
8909         according to POSIX.
8911         * tst-basic2.c (do_test): Lock mutex before creating the thread.
8913 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
8915         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
8916         (TLS_GET_FS): New #define.
8917         (TLS_SET_FS): New #define.
8918         Correct value of __NR_set_thread_area.
8920         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
8922 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
8924         * Makefile (tests): Add tst-popen1.
8925         * tst-popen1.c: New file.
8927         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
8928         but inactive generalization.
8929         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8930         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
8931         Minor optimization, remove one instruction.
8932         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
8934 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8936         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
8938 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8940         * init.c (__NR_set_tid_address): Add #ifdef for s390.
8941         * sysdeps/pthread/pthread_barrier_wait.c: New file.
8942         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
8943         * sysdeps/pthread/pthread_cond_signal.c: New file.
8944         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
8945         * sysdeps/pthread/pthread_cond_wait.c: New file.
8946         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
8947         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
8948         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
8949         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
8950         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
8951         * sysdeps/s390/Makefile: New file.
8952         * sysdeps/s390/bits/atomic.h: New file.
8953         * sysdeps/s390/pthread_spin_init.c: New file.
8954         * sysdeps/s390/pthread_spin_lock.c: New file.
8955         * sysdeps/s390/pthread_spin_trylock.c: New file.
8956         * sysdeps/s390/pthread_spin_unlock.c: New file.
8957         * sysdeps/s390/pthreaddef.h: New file.
8958         * sysdeps/s390/tcb-offsets.sym: New file.
8959         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
8960         * sysdeps/s390/tls.h: New file.
8961         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
8962         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
8963         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
8964         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
8965         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
8966         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
8967         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
8968         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
8969         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
8970         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
8971         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
8972         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
8973         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
8974         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
8975         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
8976         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
8977         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
8978         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
8979         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
8980         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
8981         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
8982         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
8983         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
8985 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
8987         * atomic.h: Add a couple more default implementations.
8988         (atomic_compare_and_exchange_acq): Use
8989         __arch_compare_and_exchange_32_acq in return value definition.  It
8990         always exists.
8991         (atomic_bit_set): Renamed from atomic_set_bit.
8992         Add missing atomic_ prefixes.
8994         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
8995         thread library is available, use correct value to mark initialized
8996         once variable.
8998 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
9000         * allocatestack.c (allocate_stack): Use __getpagesize instead of
9001         __sysconf to determine pagesize.
9003         * pthread_create.c: Include <atomic.h>.
9004         * allocatestack.c (allocate_stack): Implement coloring of the
9005         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
9006         size minus one.  Adjust users.
9007         * sysdeps/i386/i686/Makefile: New file.
9009 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
9011         * allocatestack.c: Improve comment throughout the file.
9013         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9014         (__lll_lock_wait): Add branch prediction.
9015         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
9016         (__lll_lock_wait): Likewise.
9017         (lll_unlock_wake_cb): Removed.
9019 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
9021         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
9022         _POSIX_THREAD_PRIORITY_SCHEDULING.
9024 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
9026         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9027         Fix return type of ptr___pthread_getspecific.
9029 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
9031         * Makefile (tests): Add tst-umask1.
9032         (tst-umask1-ARGS): Define.
9033         * tst-umask1.c: New file.
9035 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
9037         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
9038         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
9039         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
9040         pthread_rwlock_unlock.
9041         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
9042         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
9043         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
9044         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
9045         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9046         New file.
9047         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
9048         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9049         New file.
9050         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
9051         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
9052         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
9053         New file.
9054         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
9055         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
9056         New file.
9057         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
9058         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
9059         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
9060         New file.
9061         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
9062         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
9063         New file.
9064         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
9066         * Makefile (libpthread-routines): Remove lowlevelcond and
9067         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
9068         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
9069         and pthread_cond_broadcast.
9070         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
9071         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
9072         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
9073         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
9074         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
9075         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
9076         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
9077         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
9078         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
9079         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
9080         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
9081         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
9082         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
9083         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
9084         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
9085         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
9086         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
9087         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
9088         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
9089         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
9090         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
9091         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
9092         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
9093         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
9094         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
9095         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
9096         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
9097         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
9098         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
9099         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
9100         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
9102         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
9103         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
9104         of the code is moved to ...
9105         * sysdeps/pthread/createthread.c: ...here.  New file.
9107 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
9109         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
9110         (__new_sem_post): Clear %eax before returning.
9111         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
9113         * Makefile (tests): Add tst-cleanup2.
9114         * tst-cleanup2.c: New file.
9116         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
9117         Interpret first parameter correctly.
9119 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
9121         * Makefile (headers): Add bits/semaphore.h.
9123 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
9125         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
9126         if not SHARED.
9128 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
9130         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
9131         must be used and mapping failed.
9132         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
9134         * Makefile (CFLAGS-pthread_self.os): Define this, not
9135         CFLAGS-pthread_self.c.
9137 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9139         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
9140         lll_unlock_wake_cb.
9142         * Makefile (libpthread-routines): Add version.  Add rules to build
9143         version.os and banner.h.
9144         * version.c: New file.
9146 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
9148         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
9149         the alias unconditional.
9150         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
9152 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9154         * Makefile (CFLAGS-pthread_self.c): New definition.
9156 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9158         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
9159         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
9160         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
9161         * init.c (__pthread_initialize_minimal_internal): Likewise.
9163 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
9165         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
9167         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
9168         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9169         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9170         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
9171         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9172         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9174 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9176         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
9177         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
9178         * tst-cancel-wrappers.sh: Remove all exceptions.
9180 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
9182         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
9183         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
9185         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
9186         Use __libc_pthread_functions array if SHARED.
9188         * pthreadP.h: Move pthread_cond_2_0_t definition to...
9189         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
9191         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
9192         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
9193         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
9194         __libc_ptf_call instead of __libc_maybe_call.
9195         (PTF): New #define.
9196         (__libc_cleanup_region_start): Wrap function name with PTF call.
9197         (__libc_cleanup_region_end): Likewise.
9198         (__libc_cleanup_end): Likewise.
9200         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
9201         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
9202         * pthread_key_create.c: Add __pthread_key_create_internal alias.
9203         * pthreadP.h: Add prototypes.
9205         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
9206         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
9207         __pthread_rwlock_unlock aliases.
9208         * pthreadP.h: Add prototypes for new aliases.
9210         * pthreadP.h (struct pthead_functions): Moved to...
9211         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
9212         * init.c (pthread_functions): Add initializers for new elements.
9214         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
9215         __pthread_cleanup_pop_restore aliases.
9216         * pthreadP.h: Add prototypes.
9218         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
9219         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
9220         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
9221         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
9222         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
9223         * pthreadP.h: Adjust prototypes and callers.
9225 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
9227         * Makefile (tests): Add tst-cancel7.
9228         (tst-cancel7-ARGS): New variable.
9229         * tst-cancel7.c: New file.
9231         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
9232         around gcc defficiencies.
9233         * old_pthread_cond_signal.c: Likewise.
9234         * old_pthread_cond_timedwait.c: Likewise.
9235         * old_pthread_cond_wait.c: Likewise.
9237         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
9239 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9241         * Makefile (tests): Add tst-cond7.
9242         * tst-cond7.c: New file.
9244         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9245         (condvar_cleanup): Get condvar address from the right place.
9247         * atomic.h: Correct definitions of atomic_full_barrier,
9248         atomic_read_barrier, atomic_write_barrier.
9250         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
9251         race-free.
9252         * old_pthread_cond_signal.c: Likewise.
9253         * old_pthread_cond_timedwait.c: Likewise.
9254         * old_pthread_cond_wait.c: Likewise.
9256 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
9258         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
9260 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9262         * pthreadP.h (pthread_cond_2_0_t): New type.
9263         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
9264         Use new type for the 2.0 condvar function prototypes.
9265         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
9266         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
9267         parameter.
9268         * old_pthread_cond_destroy.c: Likewise.
9269         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
9270         * old_pthread_cond_signal.c: Likewise.
9271         * old_pthread_cond_timedwait.c: Likewise.
9272         * old_pthread_cond_wait.c: Likewise.
9274         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9275         (__pthread_cond_wait): Don't save cancellation mode and seq value
9276         in same location.
9278         * herrno.c (__h_errno_location): Don't define as weak.
9280 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9282         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
9283         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
9284         and pthread_cond_wait.
9285         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
9286         Renamed to...
9287         (__pthread_cond_broadcast_2_0): ... this.
9288         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
9289         Renamed to...
9290         (__pthread_cond_destroy_2_0): ... this.
9291         * old_pthread_cond_init.c (__old_pthread_cond_init):
9292         Renamed to...
9293         (__pthread_cond_init_2_0): ... this.
9294         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
9295         Renamed to...
9296         (__pthread_cond_signal_2_0): ... this.
9297         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
9298         Renamed to...
9299         (__pthread_cond_wait_2_0): ... this.
9300         * pthread_cond_destroy.c: Include shlib-compat.h.
9301         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
9302         * pthread_cond_init.c: Include shlib-compat.h.
9303         (pthread_cond_init): Change strong_alias into versioned_symbol.
9304         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
9305         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
9306         fields.
9307         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
9308         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
9309         __pthread_cond_wait_2_0): New prototypes.
9310         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
9311         __old_pthread_cond_init, __old_pthread_cond_signal,
9312         __old_pthread_cond_wait): Removed.
9313         * init.c: Include shlib-compat.h.
9314         (pthread_functions): Guard ptr___pthread_attr_init_2_0
9315         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
9316         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
9317         ptr___pthread_cond_*_2_0 fields.
9318         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
9319         pthread_cond_*@GLIBC_2.0 compatibility symbols.
9321         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
9322         LIBC_SIGACTION was not yet defined.
9323         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
9324         [!defined LIBC_SIGACTION] (__sigaction): New function and
9325         libc_hidden_weak.
9326         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
9327         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
9329 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9331         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
9333 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
9335         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
9336         New, larger type definition.
9337         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
9338         implementation.
9339         * Versions [libpthread]: Add definitions for new pthread_cond_*
9340         interfaces for version GLIBC_2.3.2.
9341         * pthread_cond_init.c: Update initialization for new type definition.
9342         * Makefile (libpthread-routines): Remove pthread_cond_wait,
9343         pthread_cond_timedwait, pthread_cond_signal, and
9344         pthread_cond_broadcast.  Add old_pthread_cond_init,
9345         old_pthread_cond_destroy, old_pthread_cond_wait,
9346         old_pthread_cond_timedwait, old_pthread_cond_signal, and
9347         old_pthread_cond_broadcast.
9348         * old_pthread_cond_broadcast.c: New file.
9349         * old_pthread_cond_destroy.c: New file.
9350         * old_pthread_cond_init.c: New file.
9351         * old_pthread_cond_signal.c: New file.
9352         * old_pthread_cond_timedwait.c: New file.
9353         * old_pthread_cond_wait.c: New file.
9354         * pthreadP.h: Add prototypes for the compatibility interfaces.
9356         * pthread_cond_destroy.c: Don't include <errno.h>.
9358 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
9360         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
9361         unnecessary zero offset when addressing MUTEX.
9363 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9365         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
9366         __register_atfork.
9367         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
9368         for __register_atfork.
9370 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9372         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
9373         instead of ASSEMBLER test macro.
9375         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
9376         __libc_current_sigrtmax): Add libc_hidden_def.
9378         * sysdeps/pthread/list.h: Remove assert.h include.
9380 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9382         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
9383         __pthread_initialize_minimal_internal not
9384         __pthread_initialize_minimal.
9386 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
9388         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
9389         __pthread_initialize_minimal as hidden.
9391         * init.c (__pthread_initialize_minimal_internal): Don't mark as
9392         constructor.
9394 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9396         * Makefile ($(inst_libdir)/libpthread.so): Depend on
9397         $(common-objpfx)format.lds, include that into the output script.
9398         Fix comment.
9399         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
9401 2002-12-28  Andreas Jaeger  <aj@suse.de>
9403         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
9404         nsec resolution changes.
9405         (xstat64_conv): Likewise.
9406         (xstat32_conv): Likewise.
9407         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
9408         struct kernel_stat.
9409         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
9410         structs stat and stat64.
9411         * time/time.h (__timespec_defined): Define for __USE_MISC.
9412         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
9414 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
9416         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
9417         argument.
9418         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
9419         (pthread_exit): Use strong_alias to avoid warnings.
9420         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
9421         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
9422         ptr___pthread_attr_init_2_*.
9423         * init.c (pthread_functions): Adjust.
9425 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
9427         * forward.c: Make all functions available by default again.  It
9428         caused too much trouble.
9430         * pt-siglongjmp.c: Removed.
9432 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
9434         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
9435         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
9436         * sysdeps/i386/Makefile: New file.
9437         * sysdeps/i386/tcb-offsets.sym: New file.
9438         * sysdeps/pthread/tcb-offsets.h: New file.
9439         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9440         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
9442         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
9443         __register_atfork...
9444         (GLIBC_2.3.2): ...here.
9446 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9448         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
9449         pthread_attr_setstackaddr with __attribute_deprecated__.
9451 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9453         * pt-system.c (system): Remove cancellation handling.
9454         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
9455         cancellation routines.
9457 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9459         * descr.h: Include <dl-sysdep.h>.
9460         (struct pthread): Move header.data.list to the back of the struct.
9461         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
9462         (MULTIPLE_THREADS_OFFSET): Adjust offset.
9463         (SYSINFO_OFFSEET): Likewise.
9465 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9467         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
9468         Define.
9469         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
9470         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
9471         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
9472         (USE_DL_SYSINFO): Undef.
9474 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
9476         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
9477         $(common-objpfx)libc.so.
9478         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
9479         it is bigger than pipe buffer size even on arches with bigger
9480         page size.
9481         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
9483 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
9485         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
9486         correct errno access for case that USE___THREAD is not defined.
9488 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
9490         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
9491         Patch by Marijn Ros <marijn@mad.scientist.com>.
9493 2002-12-22  Roland McGrath  <roland@redhat.com>
9495         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
9497 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
9499         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
9501 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
9503         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
9504         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
9505         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
9507         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
9508         of int $0x80.
9509         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9510         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
9511         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
9512         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
9513         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
9514         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
9515         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
9516         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
9518         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
9519         sysenter.
9520         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
9522         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
9524         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
9525         in new TCB.
9526         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
9527         that sysinfo is properly initialized.
9528         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
9529         to 1 only for ld.so.
9531         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
9532         RTLD_CORRECT_DYNAMIC_WEAK.
9534 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
9536         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
9537         Use return 0 as 6th argument to FORWARD4.
9538         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
9540 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9542         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
9543         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
9544         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
9545         (INIT_SYSINFO): New #define.
9546         (TLS_TP_INIT): Use INIT_SYSINFO.
9547         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9548         At test to make sure SYSINFO_OFFSET value is correct.
9549         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
9551 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
9553         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
9554         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
9555         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
9556         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
9557         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
9558         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
9559         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
9561 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9563         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
9564         macro instead of using int $0x80 directly.
9566         * sysdeps/pthread/bits/stdio-lock.h: New file.
9567         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
9568         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
9569         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
9570         * Makefile (routines): Add libc-lowlevelmutex.
9572         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
9573         __i686.get_pc_thunk.dx.
9575 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9577         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
9578         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
9579         ($(objpfx)tst-cancel-wrappers.out): New rule.
9580         * tst-cancel-wrappers.sh: New test.
9581         * tst-locale1.c: Include signal.h.
9582         (uselocale): Test static linking of __libc_current_sigrt*.
9584 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
9586         * Makefile (tests): Add tst-cancel6.
9587         * tst-cancel6.c: New file
9589 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9591         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
9592         Define meaningfully for assembler as well.
9593         * pthreadP.h (struct pthread_functions): Remove
9594         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
9595         and ptr_pthread_attr_init_2_1 fields.
9596         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
9597         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
9598         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
9599         (FORWARD3): Define using FORWARD4.
9600         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
9601         versions.
9602         * pt-system.c: Remove duplicate stdlib.h include.
9604 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
9606         * sem_init.c: Define sem_init@GLIBC_2.0.
9607         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
9608         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
9610         * flockfile.c: Moved to...
9611         * sysdeps/pthread/flockfile.c: ...here.  New file.
9612         * funlockfile.c: Moved to...
9613         * sysdeps/pthread/funlockfile.c: ...here.  New file.
9614         * ftrylockfile.c: Moved to...
9615         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
9617 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
9619         * libc-cancellation.c: Guard both function with
9620         #if !defined NOT_IN_libc.
9621         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
9622         automatically provided pthread wrappers.
9623         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
9624         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
9625         nor in libpthread.
9626         * pt-open.c: Removed.
9627         * pt-fcntl.c: Removed.
9628         * pt-fsync.c: Removed.
9629         * pt-lseek.c: Removed.
9630         * pt-msgrcv.c: Removed.
9631         * pt-msgsnd.c: Removed.
9632         * pt-msync.c: Removed.
9633         * pt-nanosleep.c: Removed.
9634         * pt-open64.c: Removed.
9635         * pt-pause.c: Removed.
9636         * pt-pread.c: Removed.
9637         * pt-pread64.c: Removed.
9638         * pt-pwrite.c: Removed.
9639         * pt-pwrite64.c: Removed.
9640         * pt-read.c: Removed.
9641         * pt-recv.c: Removed.
9642         * pt-recvfrom.c: Removed.
9643         * pt-recvmsg.c: Removed.
9644         * pt-send.c: Removed.
9645         * pt-sendto.c: Removed.
9646         * pt-sigtimedwait.c: Removed.
9647         * pt-sigwait.c: Removed.
9648         * pt-wait.c: Removed.
9649         * pt-waitpid.c: Removed.
9650         * pt-write.c: Removed.
9651         * pt-accept.c: Removed.
9652         * pt-close.c: Removed.
9653         * pt-connect.c: Removed.
9654         * pt-lseek64.c: Removed.
9655         * pt-sendmsg.c: Removed.
9656         * pt-tcdrain.c: Removed.
9658 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
9660         * init.c (__pthread_initialize_minimal_internal): Renamed from
9661         __pthread_initialize_minimal.  Make old name an alias.  This
9662         converts a normal relocation into a relative relocation.
9664         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
9666         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
9667         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
9668         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
9669         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
9670         pt-sigwaitinfo, pt-waitid, and pt-writev.
9671         * pt-creat.c: Removed.
9672         * pt-poll.c: Removed.
9673         * pt-pselect.c: Removed.
9674         * pt-readv.c: Removed.
9675         * pt-select.c: Removed.
9676         * pt-sigpause.c: Removed.
9677         * pt-sigsuspend.c: Removed.
9678         * pt-sigwaitinfo.c: Removed.
9679         * pt-waitid.c: Removed.
9680         * pt-writev.c: Removed.
9682         * init.c (pthread_functions): New variable.
9683         (__pthread_initialize_minimal): Pass pointer to pthread_functions
9684         (or NULL) to __libc_pthread_init.
9685         * forward.c: Rewrite to use __libc:pthread_functions array to get
9686         function addresses.
9687         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
9688         prototype.
9689         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9690         Take new parameter.  Copy content of variable pointed to by it
9691         to __libc_pthread_init.
9693         * pthreadP.h (struct pthread_functions): New type.
9694         (__libc_pthread_init): Declare.
9696         * pthread_attr_destroy.c: Add namespace protected alias.
9697         * pthread_attr_getdetachstate.c: Likewise.
9698         * pthread_attr_getinheritsched.c: Likewise.
9699         * pthread_attr_getschedparam.c: Likewise.
9700         * pthread_attr_getschedpolicy.c: Likewise.
9701         * pthread_attr_getscope.c: Likewise.
9702         * pthread_attr_setdetachstate.c: Likewise.
9703         * pthread_attr_setinheritsched.c: Likewise.
9704         * pthread_attr_setschedparam.c: Likewise.
9705         * pthread_attr_setschedpolicy.c: Likewise.
9706         * pthread_attr_setscope.c: Likewise.
9707         * pthread_cond_broadcast.c: Likewise.
9708         * pthread_cond_destroy.c: Likewise.
9709         * pthread_cond_init.c: Likewise.
9710         * pthread_cond_signal.c: Likewise.
9711         * pthread_cond_wait.c: Likewise.
9712         * pthread_condattr_destroy.c: Likewise.
9713         * pthread_condattr_init.c: Likewise.
9714         * pthread_equal.c: Likewise.
9715         * pthread_exit.c: Likewise.
9716         * pthread_getschedparam.c: Likewise.
9717         * pthread_self.c: Likewise.
9718         * pthread_setcancelstate.c: Likewise.
9719         * pthread_setschedparam.c: Likewise.
9720         * pthread_mutex_destroy.c: Likewise.
9721         * pthread_mutex_init.c: Likewise.
9722         * pthreadP.h: Add prototypes for the aliases.
9724         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
9725         multiple_threads member in correct TCB to 1.
9727         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
9728         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
9729         member of thread decriptor, otherwise return unconditionally 1.
9731 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9733         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
9734         regular Linux version.  Remove file.
9735         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
9736         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
9737         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
9738         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
9739         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
9740         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
9741         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
9742         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
9743         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
9744         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
9745         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
9746         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
9747         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
9748         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
9749         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
9750         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
9751         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
9752         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
9753         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
9754         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
9755         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
9756         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
9757         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
9758         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
9759         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
9760         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
9761         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
9762         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
9763         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
9764         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
9766 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9768         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
9769         * sysdeps/unix/sysv/linux/open.c: Removed.
9770         * sysdeps/unix/sysv/linux/fsync.c: Removed.
9771         * sysdeps/unix/sysv/linux/lseek.c: Removed.
9772         * sysdeps/unix/sysv/linux/msync.c: Removed.
9773         * sysdeps/unix/sysv/linux/read.c: Removed.
9774         * sysdeps/unix/sysv/linux/close.c: Removed.
9775         * sysdeps/unix/sysv/linux/creat.c: Removed.
9776         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
9777         * sysdeps/unix/sysv/linux/pause.c: Removed.
9778         * sysdeps/unix/sysv/linux/select.c: Removed.
9779         * sysdeps/unix/sysv/linux/write.c: Removed.
9781 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9783         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
9784         element in TCB to see whether locking is needed.
9786         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
9787         MULTIPLE_THREADS_OFFSET value is correct.
9789         * sysdeps/unix/sysv/linux/close.c: New file.
9790         * sysdeps/unix/sysv/linux/connect.S: New file.
9791         * sysdeps/unix/sysv/linux/creat.c: New file.
9792         * sysdeps/unix/sysv/linux/fsync.c: New file.
9793         * sysdeps/unix/sysv/linux/llseek.c: New file.
9794         * sysdeps/unix/sysv/linux/lseek.c: New file.
9795         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
9796         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
9797         * sysdeps/unix/sysv/linux/msync.c: New file.
9798         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
9799         * sysdeps/unix/sysv/linux/open.c: New file.
9800         * sysdeps/unix/sysv/linux/open64.c: New file.
9801         * sysdeps/unix/sysv/linux/pause.c: New file.
9802         * sysdeps/unix/sysv/linux/poll.c: New file.
9803         * sysdeps/unix/sysv/linux/pread.c: New file.
9804         * sysdeps/unix/sysv/linux/pread64.c: New file.
9805         * sysdeps/unix/sysv/linux/pselect.c: New file.
9806         * sysdeps/unix/sysv/linux/pwrite.c: New file.
9807         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
9808         * sysdeps/unix/sysv/linux/readv.c: New file.
9809         * sysdeps/unix/sysv/linux/recv.S: New file.
9810         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
9811         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
9812         * sysdeps/unix/sysv/linux/select.c: New file.
9813         * sysdeps/unix/sysv/linux/send.S: New file.
9814         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
9815         * sysdeps/unix/sysv/linux/sendto.S: New file.
9816         * sysdeps/unix/sysv/linux/sigpause.c: New file.
9817         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
9818         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
9819         * sysdeps/unix/sysv/linux/sigwait.c: New file.
9820         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
9821         * sysdeps/unix/sysv/linux/system.c: New file.
9822         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
9823         * sysdeps/unix/sysv/linux/wait.c: New file.
9824         * sysdeps/unix/sysv/linux/waitid.c: New file.
9825         * sysdeps/unix/sysv/linux/waitpid.c: New file.
9826         * sysdeps/unix/sysv/linux/writev.c: New file.
9827         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
9829         * pt-readv.c: Fix comment.
9831 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9833         * tst-cleanup1.c: Include stdlib.h.
9835         * tst-cancel5.c: New test.
9836         * Makefile (tests): Add tst-cancel5.
9837         (tst-cancel5): Link against libc.so libpthread.so in that order.
9839 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
9841         * forward.c (test_loaded): Prevent recursive calls.
9843         * Makefile (routines): Add libc-cancellation.
9844         * libc-cancellation.c: New file.
9845         * descr.h (struct pthread): Add multiple_threads field.
9846         * allocatestack.c (allocate_stack): Initialize multiple_header field of
9847         new thread descriptor to 1.
9848         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
9849         Initialize multiple_thread field after successful thread creation.
9850         * cancellation.c (__do_cancel): Move to pthreadP.h.
9851         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
9852         (__pthread_disable_asynccancel): Add internal_function attribute.
9853         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
9854         * pthread_setcancelstate.c: Likewise.
9855         * pthread_setcanceltype.c: Likewise.
9856         * pthread_exit.c: Likewise.
9857         * pthreadP.h (CANCELLATION_P): Likewise.
9858         (__do_cancel): Define as static inline.
9859         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
9860         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
9861         declarations.
9862         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
9863         fields.  Define MULTIPLE_THREADS_OFFSET.
9864         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
9865         declaration.
9866         * sysdeps/unix/sysv/linux/accept.S: New file.
9867         * sysdeps/unix/sysv/linux/read.c: New file.
9868         * sysdeps/unix/sysv/linux/write.c: New file.
9869         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
9870         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
9871         initialization of __libc_locking_needed.
9872         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
9873         __libc_locking_needed, use multiple_threads field in TCB.
9874         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9876 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
9878         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
9879         version.
9880         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
9882         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
9883         access to __libc_locking_needed for PIC.
9885 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
9887         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
9888         declare for libc.so.
9889         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
9890         expression.
9891         (__libc_lock_lock): Put into statement expression.
9892         (__libc_lock_unlock): Remove trailing semicolon.
9893         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
9895 2002-12-12  Roland McGrath  <roland@redhat.com>
9897         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
9898         "m" constraint to refer to __libc_locking_needed.  Declare it here.
9900 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
9902         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
9903         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
9904         Initialize __libc_locking_needed.
9905         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
9906         instead of __register_pthread_fork_handler.
9907         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
9908         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
9909         fork-gen with libc_pthread_init.
9910         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
9911         of __register_pthread_fork_handler.
9912         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
9913         of __register_pthread_fork_handler.
9914         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
9915         __libc_locking_needed to determine whether lock prefix can be avoided.
9916         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9918 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
9920         * Makefile (tests): Add tst-cleanup1.
9921         * tst-cleanup1.c: New file.
9922         * cancellation.c (__cleanup_thread): Removed.
9923         (__do_cancel): Remove call to __cleanup_thread.
9924         * pthreadP.h: Remove __cleanup_thread prorotype.
9926         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
9927         Remember function and argument even if cancellation handler
9928         function is not available.
9929         (__libc_cleanup_region_end): Execute registered function directly if
9930         pthread functions are not available.
9931         (__libc_cleanup_end): Likewise.
9933         * init.c (__pthread_initialize_minimal): Fix initialization in
9934         static lib by preventing gcc from being too clever.
9936 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
9938         * init.c (__pthread_initialize_minimal): Remove unneccesary
9939         sigaddset call.
9941         * Makefile (tests): We can run tst-locale2 now.
9943 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
9945         * Versions: Remove duplicated sigwait entry.
9947 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
9949         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
9950         inside libpthread.
9952         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
9954         * pthreadP.h: Declare __pthread_enable_asynccancel and
9955         __pthread_disable_asynccancel.
9956         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
9957         (CANCEL_RESET): Use __pthread_disable_asynccancel.
9958         * cancellation.c (__pthread_enable_asynccancel): New function.
9959         (__pthread_disable_asynccancel): New function.
9960         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
9961         * pt-close.c: Likewise.
9962         * pt-connect.c: Likewise.
9963         * pt-creat.c: Likewise.
9964         * pt-fcntl.c: Likewise.
9965         * pt-fsync.c: Likewise.
9966         * pt-lseek.c: Likewise.
9967         * pt-lseek64.c: Likewise.
9968         * pt-msgrcv.c: Likewise.
9969         * pt-msgsnd.c: Likewise.
9970         * pt-msync.c: Likewise.
9971         * pt-nanosleep.c: Likewise.
9972         * pt-open.c: Likewise.
9973         * pt-open64.c: Likewise.
9974         * pt-pause.c: Likewise.
9975         * pt-poll.c: Likewise.
9976         * pt-pread.c: Likewise.
9977         * pt-pread64.c: Likewise.
9978         * pt-pselect.c: Likewise.
9979         * pt-pwrite.c: Likewise.
9980         * pt-pwrite64.c: Likewise.
9981         * pt-read.c: Likewise.
9982         * pt-readv.c: Likewise.
9983         * pt-recv.c: Likewise.
9984         * pt-recvfrom.c: Likewise.
9985         * pt-recvmsg.c: Likewise.
9986         * pt-select.c: Likewise.
9987         * pt-send.c: Likewise.
9988         * pt-sendmsg.c: Likewise.
9989         * pt-sendto.c: Likewise.
9990         * pt-sigpause.c: Likewise.
9991         * pt-sigsuspend.c: Likewise.
9992         * pt-sigtimedwait.c: Likewise.
9993         * pt-sigwait.c: Likewise.
9994         * pt-sigwaitinfo.c: Likewise.
9995         * pt-system.c: Likewise.
9996         * pt-tcdrain.c: Likewise.
9997         * pt-wait.c: Likewise.
9998         * pt-waitid.c: Likewise.
9999         * pt-waitpid.c: Likewise.
10000         * pt-write.c: Likewise.
10001         * pt-writev.c: Likewise.
10002         * pthread_join.c: Likewise.
10003         * pthread_timedjoin.c: Likewise.
10005         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
10006         (__xpg_sigpause): New function.
10007         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
10009 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
10011         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
10013         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
10014         _GI_pthread_cleanup_pop to pthreadP.h.
10016         * ftrylockfile.c: Use _IO_lock_trylock instead of
10017         pthread_mutex_trylock.
10019         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
10020         (CANCEL_RESET): Likewise.
10021         (__pthread_setcanceltype_): Declare.
10022         (__pthread_mutex_lock_internal): Declare.
10023         (__pthread_mutex_unlock_internal): Declare.
10024         (__pthread_once_internal): Declare.
10025         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
10026         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
10028         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
10029         and pthread_mutex_unlock.
10030         * pthread_cond_wait.c: Likewise.
10031         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
10032         * pthread_mutex_unlock.c: Likewise.
10034         * pthread_setcanceltype.c: Add additional alias
10035         __pthread_setcanceltype.
10037         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
10038         * sem_open.c (sem_open): Likewise.
10039         Use __libc_open, __libc_write, and __libc_close instead of
10040         open, write, and close respectively.
10042         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
10043         Rewrite as statement expression since it must return a value.
10045         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
10046         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
10047         __pthread_kill.
10049         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
10050         alias __pthread_once_internal.
10052         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
10054 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
10056         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
10057         * tst-stdio1.c: New file.
10058         * tst-stdio2.c: New file.
10060         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
10062         * Makefile (tests): Comment out tst-locale2 for now.
10063         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
10065         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
10066         -D_IO_MTSAFE_IO.
10067         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
10068         Use _IO_lock_init instead of explicit assignment.
10070         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
10071         Define __libc_lock_* and __libc_lock_recursive macros with
10072         lowlevellock macros, not pthread mutexes.
10074         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
10075         of pthread_mutex_lock.
10076         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
10077         instead of pthread_mutex_unlock.
10079 2002-12-06  Roland McGrath  <roland@redhat.com>
10081         * allocatestack.c (__stack_user): Use uninitialized defn.
10082         * init.c (__pthread_initialize_minimal): Initialize it here.
10084 2002-12-05  Roland McGrath  <roland@redhat.com>
10086         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
10087         string.
10088         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
10090         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
10091         missing & here too.
10093 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
10095         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10096         lowlevellock.
10097         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
10098         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
10099         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
10100         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
10101         for __libc_lock_* macros.
10102         * Makefile (routines): Add libc-lowlevellock.
10104 2002-10-09  Roland McGrath  <roland@redhat.com>
10106         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
10107         Under [__PIC__], call the function via the pointer fetched for
10108         comparison rather than a call by name that uses the PLT.
10109         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
10110         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
10111         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
10112         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
10113         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
10115 2002-12-04  Roland McGrath  <roland@redhat.com>
10117         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
10119         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
10120         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
10122         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
10124 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10126         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
10127         a completely opaque, non-integer type.
10128         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
10130 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
10132         * sysdeps/i386/tls.h: Include stdlib.h.
10133         * sysdeps/x86_64/tls.h: Likewise.
10135 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10137         * Makefile (tests): Add tst-locale2.
10138         (tests-static): Likewise.
10139         * tst-locale2.c: New file.
10141         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
10142         volatile and add memory clobbers to lock operations.
10144 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
10146         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
10147         * sysdeps/i386/i486/bits/atomic.h: New file.
10148         * sysdeps/i386/i586/bits/atomic.h: New file.
10149         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
10150         include i486 version.
10151         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
10152         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
10153         Patch by Marijn Ros <marijn@mad.scientist.com>.
10155         * allocatestack.c (get_cached_stack): Don't crash if we first
10156         found a stack with a larger size then needed.
10157         Reported by Hui Huang <hui.huang@sun.com>.
10159         * Makefile (tests): Add tst-sysconf.
10160         * tst-sysconf.c: New file.
10162         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
10163         PTHREAD_THREADS_MAX.
10165 2002-12-02  Roland McGrath  <roland@redhat.com>
10167         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
10168         Declare using hidden_proto instead of attribute_hidden, so there are
10169         non-.hidden static symbols for gdb to find.
10170         (__pthread_keys): Likewise.
10171         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
10172         * allocatestack.c (__stack_user): Likewise.
10173         * pthread_create.c (__pthread_keys): Likewise.
10174         (__nptl_threads_events, __nptl_last_event): Make these static instead
10175         of hidden.
10176         * pthread_key_create.c (__pthread_pthread_keys_max,
10177         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
10179 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
10181         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
10182         statically.
10183         * tst-locale1.c: New file.
10185         * pthread_cond_timedwait.c: Include <stdlib.h>.
10187         * Makefile (tests): Add tst-fork2 and tst-fork3.
10188         * tst-fork2.c: New file.
10189         * tst-fork3.c: New file.
10191 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
10193         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
10195         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
10196         require it to 200112L.
10198         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
10199         instruction only if HAVE_CMOV is defined.
10200         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
10202         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
10204         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
10206         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
10208         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
10210 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
10212         * sysdeps/x86_64/bits/atomic.h: New file.
10214         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
10215         16-bit operations.
10217         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
10218         possible since gettid cannot fail.
10220         * sysdeps/x86_64/pthreaddef.h: New file.
10222         * sysdeps/i386/pthreaddef.h (gettid): Removed.
10224         * sysdeps/x86_64/pthread_spin_init.c: New file.
10225         * sysdeps/x86_64/pthread_spin_lock.c: New file.
10226         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
10227         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
10229         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
10230         Add missing lock prefix.  Minute optimization.
10232         * tst-spin2.c (main): Also check successful trylock call.
10234         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
10235         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
10237         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
10238         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
10240         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
10241         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
10242         value in case of an error.  Add support for INTERNAL_SYSCALL.
10244         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
10245         value in case of an error.
10247         * sysdeps/x86_64/tls.h: New file.
10249 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10251         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
10252         takes the array member name and the index as parameters.
10253         (THREAD_SETMEM_NC): Likewise.
10254         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
10255         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
10256         interfaces.
10258         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
10259         to decide which code to use.
10260         (THREAD_SETMEM_NC): Likewise.
10262         * allocatestack.c (queue_stack): Don't remove stack from list here.
10263         Do it in the caller.  Correct condition to prematurely terminate
10264         loop to free stacks.
10265         (__deallocate_stack): Remove stack from list here.
10267 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10269         * Makefile (tests): Add tst-stack1.
10270         * tst-stack1.c: New file.
10272         * allocatestack.c (allocate_stack): Initialize the TCB on a user
10273         provided stack.
10275         * pthread_attr_getstack.c: Return bottom of the thread area.
10277 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
10279         * Makefile (libpthread-routines): Add pt-allocrtsig and
10280         pthread_kill_other_threads.
10281         * pt-allocrtsig.c: New file.
10282         * pthread_kill_other_threads.c: New file.
10283         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
10284         all three functions.
10285         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10286         allocrtsig.
10287         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
10288         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
10289         and __libc_allocate_rtsig_private.
10290         * Versions (libpthread): Export pthread_kill_other_threads_np,
10291         __libc_current_sigrtmin, and __libc_current_sigrtmax.
10293 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
10295         * allocatestack.c (allocate_stack): stackaddr in attribute points to
10296         the end of the stack.  Adjust computations.
10297         When mprotect call fails dequeue stack and free it.
10298         * pthread_attr_setstack.c: Store top of the stack in stackaddr
10299         attribute.
10300         * pthread_getattr_np.c: Likewise.
10302         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
10303         surprises.
10305 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
10307         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
10308         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10310 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
10312         * pthread_getspecific.c: Optimize access to first 2nd-level array.
10313         * pthread_setspecific.c: Likewise.
10315 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
10317         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
10318         definitions.  Get them from the official place.
10319         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
10321         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
10322         Use new CLONE_ flags in clone() calls.
10324         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
10325         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
10327         * Versions: Add pthread_* functions for libc.
10328         * forward.c: New file.
10330         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
10331         errno-loc.
10332         * herrno.c: New file.
10333         * res.c: New file.
10335         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
10336         sem_trywait, and sem_timedwait.  Add herrno and res.
10337         * sem_init.c: Don't initialize lock and waiters members.
10338         * sem_open.c: Likewise.
10339         * sem_post.c: Removed.
10340         * sem_wait.c: Removed.
10341         * sem_trywait.c: Removed.
10342         * sem_timedwait.c: Removed.
10343         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
10344         Includes full implementations of sem_post, sem_wait, sem_trywait,
10345         and sem_timedwait.
10346         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
10347         for new implementation.
10348         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
10349         and waiters fields.
10351         * tst-sem3.c: Improve error message.
10352         * tst-signal3.c: Likewise.
10354         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
10355         to tell the kernel about the termination futex and to initialize tid
10356         member.  Don't initialize main_thread.
10357         * descr.h (struct pthread): Remove main_thread member.
10358         * cancelllation.c (__do_cancel): Remove code handling main thread.
10359         The main thread is not special anymore.
10361         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
10362         size of the stacks to stack_cache_actsize.
10364         * pt-readv.c: Add missing "defined".
10365         * pt-sigwait.c: Likewise.
10366         * pt-writev.c: Likewise.
10368 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
10370         * Versions: Export __connect from libpthread.
10371         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10373         * Makefile (libpthread-routines): Add pt-raise.
10374         * sysdeps/unix/sysv/linux/raise.c: New file.
10375         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
10376         * sysdeps/generic/pt-raise.c: New file.
10378         * pthread_cond_init.c: Initialize all data elements of the condvar
10379         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10381         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
10382         * pthread_create.c: Likewise.
10384         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
10385         * tst-key1.c: New file.
10386         * tst-key2.c: New file.
10387         * tst-key3.c: New file.
10389         * Versions: Export pthread_detach for version GLIBC_2.0.
10390         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
10392 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
10394         * pthread_key_create.c: Terminate search after an unused key was found.
10395         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10397         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
10398         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10400 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
10402         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
10403         dynamic lookup for errno in PIC.
10405         * allocatestack.c (get_cached_stack): Rearrange code slightly to
10406         release the stack lock as soon as possible.
10407         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
10408         the static TLS block.
10409         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
10411         * cancellation.c: Renamed from cancelation.c.
10412         * Makefile: Adjust accordingly.
10413         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
10414         * cleanup_defer.c: Use CANCELLATION_P.
10415         * pthread_testcancel.c: Likewise.
10416         * descr.h: Fix spelling in comments.
10417         * init.c: Likewise.
10418         * pthread_getattr_np.c: Likewise.
10419         * pthread_getschedparam.c: Likewise.
10420         * pthread_setschedparam.c: Likewise.
10421         * Versions: Likewise.
10423         * pt-pselect.c: New file.
10424         * Makefile (libpthread-routines): Add pt-pselect.
10425         * Versions: Add pselect.
10427         * tst-cancel4.c: New file.
10428         * Makefile (tests): Add tst-cancel4.
10430 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
10432         * pthread_mutex_lock.c: Always record lock ownership.
10433         * pthread_mutex_timedlock.c: Likewise.
10434         * pthread_mutex_trylock.c: Likewise.
10436         * pt-readv.c: New file.
10437         * pt-writev.c: New file.
10438         * pt-creat.c: New file.
10439         * pt-msgrcv.c: New file.
10440         * pt-msgsnd.c: New file.
10441         * pt-poll.c: New file.
10442         * pt-select.c: New file.
10443         * pt-sigpause.c: New file.
10444         * pt-sigsuspend.c: New file.
10445         * pt-sigwait.c: New file.
10446         * pt-sigwaitinfo.c: New file.
10447         * pt-waitid.c: New file.
10448         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
10449         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
10450         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
10451         * Versions: Add all the new functions.
10453         * tst-exit1.c: New file.
10454         * Makefile (tests): Add tst-exit1.
10456         * sem_timedwait.c: Minor optimization for more optimal fastpath.
10458 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
10460         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
10462         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
10463         call.  pthread_join is an official cancellation point.
10464         * pthread_timedjoin.c: Likewise.
10466         * pthread_cond_wait.c: Revert order in which internal lock are dropped
10467         and the condvar's mutex are retrieved.
10468         * pthread_cond_timedwait.c: Likewise.
10469         Reported by dice@saros.East.Sun.COM.
10471 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
10473         * pthreadP.h: Cut out all type definitions and move them...
10474         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
10475         * pthreadP.h: Include <internaltypes.h>.
10477         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
10478         performance tweaks.
10480         * sem_trywait.c: Shuffle #includes around to get right order.
10481         * sem_timedwait.c: Likewise.
10482         * sem_post.c: Likewise.
10483         * sem_wait.c: Likewise.
10485         * nptl 0.3 released.
10487         * Makefile (tests): Add tst-signal3.
10488         * tst-signal3.c: New file.
10490 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
10492         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
10493         the asms modify the sem object.
10494         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
10496         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
10497         the actual members.
10498         * pthreadP.h (struct sem): New type.  Actual semaphore type.
10499         * semaphoreP.h: Include pthreadP.h.
10500         * sem_getvalue.c: Adjust to sem_t change.
10501         * sem_init.c: Likewise.
10502         * sem_open.c: Likewise.
10503         * sem_post.c: Likewise.
10504         * sem_timedwait.c: Likewise.
10505         * sem_trywait.c: Likewise.
10506         * sem_wait.c: Likewise.
10508 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
10510         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
10511         * tst-basic2.c: New file.
10512         * tst-exec1.c: New file.
10513         * tst-exec2.c: New file.
10514         * tst-exec3.c: New file.
10516         * tst-fork1.c: Remove extra */.
10518         * nptl 0.2 released.  The API for IA-32 is complete.