* pthread_mutex_lock.c (__pthread_mutex_lock): Handle only the
[glibc.git] / nptl / ChangeLog
blob79bf2d72ff089550ae6dade537d01da344b118ab
1 2008-12-09  Jakub Jelinek  <jakub@redhat.com>
3         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle only the
4         fast path here, for robust/PI/PP mutexes call
5         __pthread_mutex_lock_full.  Don't use switch, instead use a series
6         of ifs according to their probability.
7         (__pthread_mutex_lock_full): New function.
8         * pthread_mutex_unlock.c: Include assert.h.
9         (__pthread_mutex_unlock_usercnt): Handle only the
10         fast path here, for robust/PI/PP mutexes call
11         __pthread_mutex_unlock_full.  Don't use switch, instead use a series
12         of ifs according to their probability.
13         (__pthread_mutex_unlock_full): New function.
14         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c
15         (__pthread_mutex_lock_full): Define.
17 2008-12-08  Ulrich Drepper  <drepper@redhat.com>
19         * sysdeps/x86_64/tls.h (tcbhead_t): Add fields reserved for TM
20         implementation.  Add necessary padding and.
21         * descr.h (struct pthread): Increase padding for tcbhead_t to 24
22         words.
24 2008-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
26         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define FUTEX_WAIT_BITSET
27         and FUTEX_WAKE_BITSET.
29 2008-12-02  Ulrich Drepper  <drepper@redhat.com>
31         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_WAIT_BITSET
32         and FUTEX_WAKE_BITSET.
33         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
34         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
35         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
36         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
38 2008-11-25  Roland McGrath  <roland@redhat.com>
40         * sysdeps/alpha, sysdeps/unix/sysv/linux/alpha:
41         Subdirectories moved to ports repository as
42         sysdeps/.../nptl subdirectories.
44 2008-11-12  Jakub Jelinek  <jakub@redhat.com>
46         [BZ #7008]
47         * pthread_condattr_setclock.c (pthread_condattr_setclock): Fix masking
48         of old value.
49         * pthread_cond_init.c (__pthread_cond_init): Fix
50         cond->__data.__nwaiters initialization.
51         * Makefile (tests): Add tst-cond23.
52         * tst-cond23.c: New test.
54 2008-11-07  Jakub Jelinek  <jakub@redhat.com>
56         * sysdeps/pthread/malloc-machine.h (MALLOC): Adjust __libc_tsd_define
57         arguments.
58         (tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get}
59         arguments.
61 2008-11-01  Ulrich Drepper  <drepper@redhat.com>
63         [BZ #6955]
64         * pthread_mutex_lock.c: Add support for private PI mutexes.
65         * pthread_mutex_timedlock.c: Likewise.
66         * pthread_mutex_trylock.c: Likewise.
67         * pthread_mutex_unlock.c: Likewise.
68         Patch mostly by Ben Jackson <ben@ben.com>.
70 2008-10-31  Ulrich Drepper  <drepper@redhat.com>
72         [BZ #6843]
73         * sysdeps/pthread/gai_misc.h (__gai_create_helper_thread):
74         Increase stack size for helper thread.
76 2008-10-06  Martin Schwidefsky  <schwidefsky@de.ibm.com>
78         * sysdeps/s390/tls.h (THREAD_SET_STACK_GUARD): Add empty inline
79         assembly with a clobber list for access registers a0 and a1.
81 2008-09-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
83         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Add memory barrier
84         to force runp->refcntr to be read from memory.
86 2008-09-08  Richard Guenther  <rguenther@suse.de>
88         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_lock,
89         lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
90         lll_timedlock, lll_robust_timedlock, lll_unlock,
91         lll_robust_unlock): Promote private to int.
93 2008-08-15  Ulrich Drepper  <drepper@redhat.com>
95         * sysdeps/x86_64/pthreaddef.h: Remove ARCH_MAP_FLAGS and
96         ARCH_RETRY_MMAP definitions.
97         * allocatestack.c: Remove definition of ARCH_MAP_FLAGS.
98         Define MAP_STACK when not defined.
99         (allocate_stack): Use MAP_STACK instead of ARCH_MAP_FLAGS.  Remove
100         handling of ARCH_RETRY_MMAP.
102 2008-07-30  Ulrich Drepper  <drepper@redhat.com>
104         * tst-align2.c (f): Print message that f is reached.
106 2008-04-28  Hiroki Kaminaga  <kaminaga@sm.sony.co.jp>
108         [BZ #6740]
109         * sysdeps/powerpc/tcb-offsets.sym (PRIVATE_FUTEX_OFFSET): Guard symbol
110         definition with #ifndef __ASSUME_PRIVATE_FUTEX.
112 2008-07-25  Ulrich Drepper  <drepper@redhat.com>
114         * sysdeps/unix/sysv/linux/mq_notify.c (init_mq_netlink): Use
115         SOCK_CLOEXEC if possible.
117 2008-05-29  Ulrich Drepper  <drepper@redhat.com>
119         * Makefile (tests): Add tst-rwlock2a.
120         * tst-rwlock2.c: Use TYPE macro to decide what rwlock type to use.
121         * tst-rwlock2a.c: New file.
123 2008-06-12  Ulrich Drepper  <drepper@redhat.com>
125         * sysdeps/pthread/pthread.h: Remove inadvertant checkin.
127 2008-05-17  Samuel Thibault  <samuel.thibault@ens-lyon.org>
129         * sysdeps/pthread/pthread.h: Fix typo in comment.
131 2008-05-28  Ulrich Drepper  <drepper@redhat.com>
133         * sysdeps/pthread/createthread.c (do_clone): Pass accurate length
134         of CPU set to the kernel.
136 2008-05-23  Paul Pluzhnikov  <ppluzhnikov@google.com>
138         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Add
139         cfi directives.
140         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
141         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
142         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
143         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
144         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
145         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
147 2008-05-22  Paul Pluzhnikov  <ppluzhnikov@google.com>
149         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S: Add
150         cfi directives.
151         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
152         Likewise.
153         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
154         Likewise.
155         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
156         Likewise.
158 2008-05-26  Ulrich Drepper  <drepper@redhat.com>
160         * tst-typesizes.c: Explicitly check __SIZEOF_PTHREAD_* constants.
162 2008-05-20  Jakub Jelinek  <jakub@redhat.com>
164         David S. Miller  <davem@davemloft.net>
166         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
168 2008-05-10  Ulrich Drepper  <drepper@redhat.com>
170         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Access
171         __pshared correctly.
172         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
173         Likewise.
174         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
175         Likewise.
176         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
177         Likewise.
178         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
179         Likewise.
180         Reported by Clemens Kolbitsch <clemens.kol@gmx.at>.
182 2008-04-14  David S. Miller  <davem@davemloft.net>
184         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
185         (__old_sem_wait): Fix argument to lll_futex_wait().
187 2007-11-26  Daniel Jacobowitz  <dan@codesourcery.com>
189         * pthread_create.c: Require pthread_mutex_trylock and
190         pthread_key_delete for libgcc.
192 2008-04-08  Jakub Jelinek  <jakub@redhat.com>
194         [BZ #6020]
195         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h
196         (lll_futex_wake_unlock): Add private argument to the pre-v9 macro.
197         Patch by Sunil Amitkumar Janki <devel.sjanki@gmail.com>.
199 2008-03-27  Ulrich Drepper  <drepper@redhat.com>
201         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine ARG_MAX if
202         <linux/limits.h> has defined it.
203         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
204         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
205         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
206         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
208 2008-03-18  Jakub Jelinek  <jakub@redhat.com>
210         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Use __ASSEMBLER__ instead
211         of ASSEMBLER.
212         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
213         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Likewise.
215 2008-03-14  Ulrich Drepper  <drepper@redhat.com>
217         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
218         HAVE_DL_DISCOVER_OSVERSION.
219         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
220         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Likewise.
222 2008-03-07  Ulrich Drepper  <drepper@redhat.com>
224         [BZ #5778]
225         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Change
226         _POSIX_CHOWN_RESTRICTED value to zero.
228 2008-01-31  Roland McGrath  <roland@redhat.com>
230         * Makefile (omit-deps): Variable removed.
232 2008-01-30  Ulrich Drepper  <drepper@redhat.com>
234         * sysdeps/unix/sysv/linux/x86_64/sem_post.S (sem_post): Avoid
235         unnecessary addr32 prefix.
237 2008-01-29  Roland McGrath  <roland@redhat.com>
239         * Makeconfig (ptw-CPPFLAGS, sysd-rules-patterns): New variables.
241 2008-01-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
243         * sysdeps/unix/sysv/linux/sh/sem_post.S: Don't overflow value field.
245 2008-01-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
247         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XADD): Use
248         a scratch register.
249         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
250         (__lll_lock_wait_private): Fix typo.
251         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
252         (pthread_barrier_wait): Likewise.  Adjust XADD use.
253         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
254         Adjust XADD use.
255         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
256         (pthread_rwlock_timedrdlock): Return correct return value.
257         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
258         (pthread_rwlock_timedwrlock): Likewise.
260 2008-01-15  Ulrich Drepper  <drepper@redhat.com>
262         * tst-eintr2.c (do_test): make sure that if mutex_lock in main
263         thread returns the program exits with an error code.
265 2008-01-10  Ulrich Drepper  <drepper@redhat.com>
267         * pthread-errnos.sym: Add EOVERFLOW.
268         * sysdeps/unix/sysv/linux/structsem.sym: Add SEM_VALUE_MAX.
269         * sysdeps/unix/sysv/linux/sem_post.c: Don't overflow value field.
270         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
271         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
273 2007-12-14  Ulrich Drepper  <drepper@redhat.com>
275         * sysdeps/x86_64/pthreaddef.h (ARCH_RETRY_MMAP): Take additional
276         parameter.  Passed it as permission to mmap.
277         * allocatestack.c (allocate_stack): Pass prot as second parameter
278         to ARCH_RETRY_MMAP.
280 2007-12-12  Ulrich Drepper  <drepper@redhat.com>
282         * tst-basic7.c: Allocate memory for the stack.
284         [BZ #5465]
285         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S [!SHARED]
286         (__pthread_cond_timedwait): Don't use VDSO.
287         Patch by Michal Januszewski.
289 2007-12-07  Ulrich Drepper  <drepper@redhat.com>
291         [BZ #5455]
292         * sysdeps/pthread/pthread.h [!__EXCEPTIONS] (pthread_cleanup_pop):
293         Allow label before pthread_cleanup_pop.
294         (pthread_cleanup_pop_restore_np): Likewise.
296 2007-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
298         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
299         Store 2 before returning ETIMEDOUT.
301 2007-11-23  Ulrich Drepper  <drepper@redhat.com>
303         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
304         Store 2 before returning ETIMEDOUT.
305         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise
306         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
307         (__lll_lock_wait_private): Optimize.
308         (__lll_lock_wait): Likewise.
310 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
312         * sysdeps/pthread/pthread.h (pthread_cleanup_push,
313         pthread_cleanup_push_defer_np): Add extra (void *) cast to shut up
314         g++ 4.1 and 4.2 -Wstrict-aliasing warnings.
316 2007-11-08  Ulrich Drepper  <drepper@redhat.com>
318         [BZ #5240]
319         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
320         If we time out, try one last time to lock the futex to avoid
321         losing a wakeup signal.
322         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
323         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
325         [BZ #5245]
326         * sysdeps/pthread/createthread.c (do_clone): Translate clone error
327         if necessary.
329 2007-11-07  Ulrich Drepper  <drepper@redhat.com>
331         [BZ #5245]
332         * allocatestack.c (allocate_stack): Change ENOMEM error in case
333         mmap failed to EAGAIN.
334         * Makefile (tests): Add tst-basic7.
335         * tst-basic7.c: New file.
337 2007-11-05  Ulrich Drepper  <drepper@redhat.com>
339         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
340         Use __linkin_atfork.
342 2007-11-03  Mike Frysinger  <vapier@gentoo.org>
344         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (LOAD_FUTEX_WAIT): Add
345         missing line continuations.
346         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S (LOAD_FUTEX_WAIT,
347         LOAD_FUTEX_WAKE): Likewise.  Also add missing 3rd parameter.
349 2007-10-28  Ulrich Drepper  <drepper@redhat.com>
351         [BZ #5220]
352         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Declare
353         __active_timer_sigev_thread and __active_timer_sigev_thread_lock.
354         (struct timer): Add next element.
355         * sysdeps/unix/sysv/linux/timer_create.c: For SIGEV_THREAD timers,
356         enqueue timer structure into __active_timer_sigev_thread list.
357         * sysdeps/unix/sysv/linux/timer_delete.c: For SIGEV_THREAD timers,
358         remove timer struct from __active_timer_sigev_thread.
359         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
360         Before using timer structure make sure it is still on the
361         __active_timer_sigev_thread list.  Keep lock until done.
362         Define __active_timer_sigev_thread and
363         __active_timer_sigev_thread_lock.
365 2007-10-27  Ulrich Drepper  <drepper@redhat.com>
367         * sysdeps/pthread/malloc-machine.h: Define ATFORK_MEM.
368         Redefine thread_atfork for use of ATFORK_MEM.
369         * sysdeps/unix/sysv/linux/fork.h: Define __linkin_atfork.
370         * sysdeps/unix/sysv/linux/register-atfork.c (__linkin_atfork): New
371         function.
372         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
373         Use atomic operation when removing first element of list.
375 2007-10-17  Jakub Jelinek  <jakub@redhat.com>
377         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__old_sem_post): New
378         routine instead of an alias to __new_sem_post.
380 2007-10-15  Jakub Jelinek  <jakub@redhat.com>
382         * init.c (__pthread_initialize_minimal): Initialize word to appease
383         valgrind.
385 2007-10-10  Jakub Jelinek  <jakub@redhat.com>
387         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
388         libc.so just clear NAME.
389         (__libc_rwlock_fini): Nop inside of libc.so.
390         * tst-initializers1.c (main): Test if PTHREAD_RWLOCK_INITIALIZER is
391         all zeros.
393 2007-09-02  Ulrich Drepper  <drepper@redhat.com>
395         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
396         (__pthread_cond_wait): Fix unlocking of internal lock after mutex
397         unlocking failed.
398         Patch by Luca Barbieri <luca.barbieri@gmail.com>.
400 2007-08-21  Ulrich Drepper  <drepper@redhat.com>
402         [BZ #4938]
403         * allocatestack.c (__reclaim_stacks): Clear the TSD in the
404         reclaimed stack if necessary.
405         * Makefile (tests): Add tst-tsd6.
406         * tst-tsd6.c: New file.
408 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
410         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
411         Add private argument.
413 2007-08-20  Ulrich Drepper  <drepper@redhat.com>
415         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
416         (__pthread_cond_timedwait): Use clock_gettime from VDSO if possible.
418 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
420         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h
421         (__lll_robust_timedlock): Pass private as last argument to
422         __lll_robust_timedlock_wait.
423         (__lll_unlock): Fix a pasto.
425 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
427         * sysdeps/unix/sysv/linux/sparc/internaltypes.h (sparc_new_sem,
428         sparc_old_sem): New structs.
429         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
430         (__sem_wait_cleanup): New function.
431         (__new_sem_wait): Use sparc_new_sem structure.  Bump and afterwards
432         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
433         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
434         lll_futex_wait.
435         (__old_sem_wait): New function.
436         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: Include
437         nptl/sysdeps/unix/sysv/linux/sparc version.
438         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c:
439         Likewise.
440         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: Likewise.
441         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
442         (__new_sem_trywait): Use sparc_old_sem structure.
443         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
444         (sem_timedwait): Use sparc_new_sem structure.  Bump and afterwards
445         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
446         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
447         lll_futex_timed_wait.
448         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c (__new_sem_post):
449         Use sparc_new_sem structure.  Only wake if nwaiters > 0.  Pass
450         isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
451         lll_futex_wake.
452         (__old_sem_post): New function.
453         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: New file.
454         * sysdeps/unix/sysv/linux/sparc/sem_init.c: New file.
455         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: New file.
456         * sysdeps/unix/sysv/linux/sparc/sem_post.c: New file.
457         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: Remove.
458         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: Remove.
460 2007-08-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
462         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
463         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
464         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
465         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
466         * sysdeps/unix/sysv/linux/shpthread_cond_signal.S
467         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
468         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
469         Use FUTEX_WAKE_OP.
470         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
471         kernel-features.h and tcb-offsets.h.
472         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
473         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
474         process private.
475         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
476         tcb-offsets.h.
477         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE
478         to lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
479         process private.
480         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use #ifdef
481         __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
482         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
483         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
484         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
485         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
486         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
488 2007-08-14  Jakub Jelinek  <jakub@redhat.com>
490         * sysdeps/unix/sysv/linux/lowlevellock.c: Comment fix.
491         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
492         (__lll_timedwait_tid): Pass LLL_SHARED as 4th argument to
493         lll_futex_timed_wait.
495         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock,
496         __lll_robust_unlock): Rewrite as macros instead of inline functions.
497         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock,
498         __lll_robust_unlock, __lll_wait_tid): Likewise.
500 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
502         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
503         Fix a pasto.
504         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
505         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
506         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
507         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
508         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
509         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
510         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
511         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Include
512         kernel-features.h.
513         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
514         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
515         process private.  Switch DW_CFA_advance_loc1 and some
516         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
517         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
518         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE to
519         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
520         process private.  Switch DW_CFA_advance_loc{1,2} and some
521         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
522         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use
523         #ifdef __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
524         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
525         Likewise.
526         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
527         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
528         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
529         Likewise.
530         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
531         (__pthread_cond_broadcast): Compare %r8 instead of
532         dep_mutex-cond_*(%rdi) with $-1.
533         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
534         (__pthread_cond_signal): Xor FUTEX_WAKE_OP with FUTEX_WAKE instead
535         of oring.
537 2007-08-13  Ulrich Drepper  <drepper@redhat.com>
539         * sysdeps/unix/sysv/linux/i386/i786/Implies: New file.
541 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
543         * allocatestack.c: Include kernel-features.h.
544         * pthread_create.c: Likewise.
545         * pthread_mutex_init.c: Likewise.
546         * init.c: Likewise.
547         * pthread_cond_timedwait.c: Likewise.
548         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
549         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
550         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
551         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
552         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
553         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
554         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
555         Likewise.
556         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
557         Likewise.
558         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
559         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
560         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
561         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
563 2007-08-12  Jakub Jelinek  <jakub@redhat.com>
565         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
566         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
567         byte elements.  One of them is the new __shared element.
568         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
569         adjust names of other padding elements.
570         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
571         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
572         byte elements.  One of them is the new __shared element.
573         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
574         adjust names of other padding elements.
575         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_rwlock_t):
576         Renamed __pad1 element to __shared, adjust names of other padding
577         elements.
578         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
579         (pthread_rwlock_t): Likewise.
580         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock): Fix a
581         typo.
583 2007-08-09  Anton Blanchard  <anton@samba.org>
585         * sysdeps/unix/sysv/linux/powerpc/pthread_spin_unlock.c: New file.
587 2007-08-12  Ulrich Drepper  <drepper@redhat.com>
589         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Include
590         <kernel-features.h>.
591         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
593 2007-08-11  Ulrich Drepper  <drepper@redhat.com>
595         * pthreadP.h (PTHREAD_ROBUST_MUTEX_PSHARED): Define.
596         * pthread_mutex_lock.c: Use it instead of PTHREAD_MUTEX_PSHARED when
597         dealing with robust mutexes.
598         * pthread_mutex_timedlock.c: Likewise.
599         * pthread_mutex_trylock.c: Likewise.
600         * pthread_mutex_unlock.c: Likewise.
601         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
603 2007-08-06  Jakub Jelinek  <jakub@redhat.com>
605         * pthreadP.h (PTHREAD_MUTEX_PSHARED_BIT): Define.
606         (PTHREAD_MUTEX_TYPE): Mask __kind with 127.
607         (PTHREAD_MUTEX_PSHARED): Define.
608         * pthread_mutex_init.c (__pthread_mutex_init): Set
609         PTHREAD_MUTEX_PSHARED_BIT for pshared or robust
610         mutexes.
611         * pthread_mutex_lock.c (LLL_MUTEX_LOCK): Take mutex as argument
612         instead of its __data.__lock field, pass PTHREAD_MUTEX_PSHARED
613         as second argument to lll_lock.
614         (LLL_MUTEX_TRYLOCK): Take mutex as argument
615         instead of its __data.__lock field.
616         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
617         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
618         to lll_robust_lock.
619         (__pthread_mutex_lock): Update LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
620         LLL_ROBUST_MUTEX_LOCK users, use PTHREAD_MUTEX_TYPE (mutex)
621         instead of mutex->__data.__kind directly, pass
622         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock and lll_futex_wait.
623         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use
624         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
625         directly, pass PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock.
626         (pthread_mutex_timedlock): Pass PTHREAD_MUTEX_PSHARED (mutex)
627         to lll_timedlock, lll_robust_timedlock, lll_unlock and
628         lll_futex_timed_wait.  Use PTHREAD_MUTEX_TYPE (mutex) instead
629         of mutex->__data.__kind directly.
630         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Pass
631         PTHREAD_MUTEX_PSHARED (mutex) to lll_timedlock,
632         lll_robust_timedlock, lll_unlock and lll_futex_timed_wait.  Use
633         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind directly.
634         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Pass
635         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock, lll_robust_unlock
636         and lll_futex_wake.
637         * pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Pass
638         PTHREAD_MUTEX_PSHARED (mutex) to lll_futex_wait and lll_futex_wake.
639         Use PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
640         directly.
641         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK):
642         Take mutex as argument instead of its __data.__lock field, pass
643         PTHREAD_MUTEX_PSHARED as second argument to lll_cond_lock.
644         (LLL_MUTEX_TRYLOCK): Take mutex as argument instead of its
645         __data.__lock field.
646         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
647         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
648         to lll_robust_cond_lock.
649         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Add pshared
650         variable, pass it to lll_lock, lll_unlock, lll_futex_requeue and
651         lll_futex_wake.  Don't use lll_futex_requeue if dependent mutex
652         has PTHREAD_MUTEX_PSHARED_BIT bit set in its __data.__kind.
653         * pthread_cond_destroy.c (__pthread_cond_destroy): Add pshared
654         variable, pass it to lll_lock, lll_unlock, lll_futex_wake and
655         lll_futex_wait.
656         * pthread_cond_signal.c (__pthread_cond_signal): Add pshared
657         variable, pass it to lll_lock, lll_unlock, lll_futex_wake_unlock and
658         lll_futex_wake.
659         * pthread_cond_timedwait.c (__pthread_cond_wait): Add
660         pshared variable, pass it to lll_lock, lll_unlock,
661         lll_futex_timedwait and lll_futex_wake.
662         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait): Add
663         pshared variable, pass it to lll_lock, lll_unlock, lll_futex_wait
664         and lll_futex_wake.
665         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_requeue,
666         lll_futex_wake_unlock): Add private argument, use __lll_private_flag
667         macro.
668         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue,
669         lll_futex_wake_unlock): Likewise.
670         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_requeue):
671         Likewise.
672         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_futex_requeue,
673         lll_futex_wake_unlock): Likewise.
674         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_requeue):
675         Likewise.
676         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue,
677         lll_futex_wake_unlock): Likewise.
678         (lll_futex_wake): Fix a typo.
679         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym (PS_BIT): Add.
680         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
681         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
682         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
683         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
684         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
685         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
686         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
687         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
688         (__pthread_cond_timedwait): Likewise.
689         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
690         (__condvar_cleanup, __pthread_cond_wait): Likewise.
692 2007-08-05  Jakub Jelinek  <jakub@redhat.com>
694         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
695         Don't use CGOTSETUP and CGOTRESTORE macros.
696         (CGOTSETUP, CGOTRESTORE): Remove.
697         <IS_IN_rtld> (CENABLE, CDISABLE): Don't use JUMPTARGET, branch to
698         @local symbol.
700 2007-08-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
702         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Remove
703         definitions for private futexes.
704         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Include
705         kernel-features.h and lowlevellock.h.  Use private futexes if
706         they are available.
707         (__lll_lock_wait_private, __lll_unlock_wake_private): New.
708         (__lll_mutex_lock_wait): Rename to
709         (__lll_lock_wait): ... this.  Don't compile in for libc.so.
710         (__lll_mutex_timedlock_wait): Rename to ...
711         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.
712         Don't compile in for libc.so.
713         (__lll_mutex_unlock_wake): Rename to ...
714         (__lll_unlock_wake): ... this.  Don't compile in for libc.so.
715         (__lll_timedwait_tid): Use __NR_gettimeofday.
716         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Allow including
717         the header from assembler.  Renamed all lll_mutex_* resp.
718         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
719         Renamed all LLL_MUTEX_LOCK_* macros to LLL_LOCK_*.
720         (FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE):
721         Define.
722         (__lll_lock_wait_private): Add prototype.
723         (__lll_lock_wait, __lll_timedlock_wait, __lll_robust_lock_wait,
724         __lll_robust_timedlock_wait, __lll_unlock_wake_private,
725         __lll_unlock_wake): Likewise.
726         (lll_lock): Add private argument.  Call __lll_lock_wait_private
727         if private is constant LLL_PRIVATE.
728         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
729         lll_timedlock, lll_robust_timedlock): Add private argument.
730         (lll_unlock): Add private argument.  Call __lll_unlock_wake_private
731         if private is constant LLL_PRIVATE.
732         (lll_robust_unlock, lll_robust_dead): Add private argument.
733         (lll_lock_t): Remove.
734         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
735         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
736         lll_cond_wake, lll_cond_broadcast): Remove.
737         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: Include
738         kernel-features.h and lowlevellock.h.
739         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
740         (LOAD_FUTEX_WAIT): Define.
741         (__lll_robust_mutex_lock_wait): Rename to ...
742         (__lll_robust_lock_wait): ... this.  Add private argument.
743         Use LOAD_FUTEX_WAIT macro.
744         (__lll_robust_mutex_timedlock_wait): Rename to ...
745         (__lll_robust_timedlock_wait): ... this.    Add private argument.
746         Use __NR_gettimeofday.  Use LOAD_FUTEX_WAIT macro.
747         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Include
748         lowlevellock.h.
749         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
750         (pthread_barrier_wait): Use __lll_{lock,unlock}_* instead of
751         __lll_mutex_{lock,unlock}_*.
752         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Include
753         lowlevellock.h and pthread-errnos.h.
754         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
755         FUTEX_CMP_REQUEUE, EINVAL): Remove.
756         (__pthread_cond_broadcast): Use __lll_{lock,unlock}_* instead of
757         __lll_mutex_{lock,unlock}_*.
758         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Include
759         lowlevellock.h and pthread-errnos.h.
760         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE, EINVAL): Remove.
761         (__pthread_cond_signal): Use __lll_{lock,unlock}_* instead of
762         __lll_mutex_{lock,unlock}_*.
763         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
764         lowlevellock.h.
765         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE): Remove.
766         (__pthread_cond_timedwait): Use __lll_{lock,unlock}_* instead of
767         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
768         (__condvar_tw_cleanup): Likewise.
769         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
770         lowlevellock.h.
771         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
772         (__pthread_cond_wait): Use __lll_{lock,unlock}_* instead of
773         __lll_mutex_{lock,unlock}_*.
774         ( __condvar_w_cleanup): Likewise.
775         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Include lowlevellock.h.
776         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
777         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Include
778         lowlevellock.h.
779         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
780         (__pthread_rwlock_rdlock): Use __lll_{lock,unlock}_* instead of
781         __lll_mutex_{lock,unlock}_*.
782         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Include
783         lowlevellock.h.
784         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
785         FUTEX_PRIVATE_FLAG): Remove.
786         (pthread_rwlock_timedrdlock): Use __lll_{lock,unlock}_* instead of
787         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
788         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Include
789         lowlevellock.h.
790         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
791         FUTEX_PRIVATE_FLAG): Remove.
792         (pthread_rwlock_timedwrlock): Use __lll_{lock,unlock}_* instead of
793         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
794         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Include
795         lowlevellock.h.
796         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
797         (__pthread_rwlock_unlock): Use __lll_{lock,unlock}_* instead of
798         __lll_mutex_{lock,unlock}_*.
799         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Include
800         lowlevellock.h.
801         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
802         (__pthread_rwlock_wrlock): Use __lll_{lock,unlock}_* instead of
803         __lll_mutex_{lock,unlock}_*.
804         * sysdeps/unix/sysv/linux/sh/sem_post.S: Include lowlevellock.h.
805         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
806         (__new_sem_post): Use standard initial exec code sequences.
807         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Include
808         lowlevellock.h.
809         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
810         FUTEX_PRIVATE_FLAG): Remove.
811         (sem_timedwait): Use __NR_gettimeofday.  Use standard initial
812         exec code sequences.
813         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Include lowlevellock.h.
814         (__new_sem_trywait): Use standard initial exec code sequences.
815         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Include lowlevellock.h.
816         (__new_sem_wait): Use standard initial exec code sequences.
818 2007-07-31  Anton Blanchard  <anton@samba.org>
820         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
821         Use __asm __volatile (__lll_acq_instr ::: "memory") instead of
822         atomic_full_barrier.
824 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
826         * allocatestack.c (stack_cache_lock): Change type to int.
827         (get_cached_stack, allocate_stack, __deallocate_stack,
828         __make_stacks_executable, __find_thread_by_id, __nptl_setxid,
829         __pthread_init_static_tls, __wait_lookup_done): Add LLL_PRIVATE
830         as second argument to lll_lock and lll_unlock macros on
831         stack_cache_lock.
832         * pthread_create.c (__find_in_stack_list): Likewise.
833         (start_thread): Similarly with pd->lock.  Use lll_robust_dead
834         macro instead of lll_robust_mutex_dead, pass LLL_SHARED to it
835         as second argument.
836         * descr.h (struct pthread): Change lock and setxid_futex field
837         type to int.
838         * old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0): Use
839         LLL_LOCK_INITIALIZER instead of LLL_MUTEX_LOCK_INITIALIZER.
840         * old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
841         * old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
842         Likewise.
843         * old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
844         * pthread_cond_init.c (__pthread_cond_init): Likewise.
845         * pthreadP.h (__attr_list_lock): Change type to int.
846         * pthread_attr_init.c (__attr_list_lock): Likewise.
847         * pthread_barrier_destroy.c (pthread_barrier_destroy): Pass
848         ibarrier->private ^ FUTEX_PRIVATE_FLAG as second argument to
849         lll_{,un}lock.
850         * pthread_barrier_wait.c (pthread_barrier_wait): Likewise and
851         also for lll_futex_{wake,wait}.
852         * pthread_barrier_init.c (pthread_barrier_init): Make iattr
853         a pointer to const.
854         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Pass
855         LLL_SHARED as second argument to lll_{,un}lock.
856         * pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
857         * pthread_cond_signal.c (__pthread_cond_singal): Likewise.
858         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
859         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait):
860         Likewise.
861         * pthread_getattr_np.c (pthread_getattr_np): Add LLL_PRIVATE
862         as second argument to lll_{,un}lock macros on pd->lock.
863         * pthread_getschedparam.c (__pthread_getschedparam): Likewise.
864         * pthread_setschedparam.c (__pthread_setschedparam): Likewise.
865         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
866         * tpp.c (__pthread_tpp_change_priority, __pthread_current_priority):
867         Likewise.
868         * sysdeps/pthread/createthread.c (do_clone, create_thread):
869         Likewise.
870         * pthread_once.c (once_lock): Change type to int.
871         (__pthread_once): Pass LLL_PRIVATE as second argument to
872         lll_{,un}lock macros on once_lock.
873         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Use
874         lll_{,un}lock macros instead of lll_mutex_{,un}lock, pass
875         rwlock->__data.__shared as second argument to them and similarly
876         for lll_futex_w*.
877         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
878         Likewise.
879         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
880         Likewise.
881         * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Likewise.
882         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Likewise.
883         * pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Likewise.
884         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
885         * sem_close.c (sem_close): Pass LLL_PRIVATE as second argument
886         to lll_{,un}lock macros on __sem_mappings_lock.
887         * sem_open.c (check_add_mapping): Likewise.
888         (__sem_mappings_lock): Change type to int.
889         * semaphoreP.h (__sem_mappings_lock): Likewise.
890         * pthread_mutex_lock.c (LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
891         LLL_ROBUST_MUTEX_LOCK): Use lll_{,try,robust_}lock macros
892         instead of lll_*mutex_*, pass LLL_SHARED as last
893         argument.
894         (__pthread_mutex_lock): Use lll_unlock instead of lll_mutex_unlock,
895         pass LLL_SHARED as last argument.
896         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK,
897         LLL_MUTEX_TRYLOCK, LLL_ROBUST_MUTEX_LOCK): Use
898         lll_{cond_,cond_try,robust_cond}lock macros instead of lll_*mutex_*,
899         pass LLL_SHARED as last argument.
900         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
901         lll_{timed,try,robust_timed,un}lock instead of lll_*mutex*, pass
902         LLL_SHARED as last argument.
903         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Similarly.
904         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
905         Similarly.
906         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_lock,
907         __libc_lock_lock_recursive, __libc_lock_unlock,
908         __libc_lock_unlock_recursive): Pass LLL_PRIVATE as second
909         argument to lll_{,un}lock.
910         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_lock,
911         _IO_lock_unlock): Likewise.
912         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Don't use
913         compound literal.
914         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
915         Pass LLL_PRIVATE as second argument to lll_{,un}lock macros on
916         __fork_lock.
917         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork,
918         free_mem): Likewise.
919         (__fork_lock): Change type to int.
920         * sysdeps/unix/sysv/linux/fork.h (__fork_lock): Likewise.
921         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Pass
922         isem->private ^ FUTEX_PRIVATE_FLAG as second argument to
923         lll_futex_wake.
924         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
925         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Likewise.
926         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait_private):
927         New function.
928         (__lll_lock_wait, __lll_timedlock_wait): Add private argument and
929         pass it through to lll_futex_*wait, only compile in when
930         IS_IN_libpthread.
931         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
932         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Add private
933         argument and pass it through to lll_futex_*wait.
934         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Renamed all
935         lll_mutex_* resp. lll_robust_mutex_* macros to lll_* resp.
936         lll_robust_*.  Renamed all __lll_mutex_* resp. __lll_robust_mutex_*
937         inline functions to __lll_* resp. __lll_robust_*.
938         (LLL_MUTEX_LOCK_INITIALIZER): Remove.
939         (lll_mutex_dead): Add private argument.
940         (__lll_lock_wait_private): New prototype.
941         (__lll_lock_wait, __lll_robust_lock_wait, __lll_lock_timedwait,
942         __lll_robust_lock_timedwait): Add private argument to prototypes.
943         (__lll_lock): Add private argument, if it is constant LLL_PRIVATE,
944         call __lll_lock_wait_private, otherwise pass private to
945         __lll_lock_wait.
946         (__lll_robust_lock, __lll_cond_lock, __lll_timedlock,
947         __lll_robust_timedlock): Add private argument, pass it to
948         __lll_*wait functions.
949         (__lll_unlock): Add private argument, if it is constant LLL_PRIVATE,
950         call __lll_unlock_wake_private, otherwise pass private to
951         __lll_unlock_wake.
952         (__lll_robust_unlock): Add private argument, pass it to
953         __lll_robust_unlock_wake.
954         (lll_lock, lll_robust_lock, lll_cond_lock, lll_timedlock,
955         lll_robust_timedlock, lll_unlock, lll_robust_unlock): Add private
956         argument, pass it through to __lll_* inline function.
957         (__lll_mutex_unlock_force, lll_mutex_unlock_force): Remove.
958         (lll_lock_t): Remove.
959         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
960         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
961         lll_cond_wake, lll_cond_broadcast): Remove.
962         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
963         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
964         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
965         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
966         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Allow including
967         the header from assembler.  Renamed all lll_mutex_* resp.
968         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
969         (LOCK, FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP,
970         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
971         (LLL_MUTEX_LOCK_INITIALIZER, LLL_MUTEX_LOCK_INITIALIZER_LOCKED,
972         LLL_MUTEX_LOCK_INITIALIZER_WAITERS): Remove.
973         (__lll_mutex_lock_wait, __lll_mutex_timedlock_wait,
974         __lll_mutex_unlock_wake, __lll_lock_wait, __lll_unlock_wake):
975         Remove prototype.
976         (__lll_trylock_asm, __lll_lock_asm_start, __lll_unlock_asm): Define.
977         (lll_robust_trylock, lll_cond_trylock): Use LLL_LOCK_INITIALIZER*
978         rather than LLL_MUTEX_LOCK_INITIALIZER* macros.
979         (lll_trylock): Likewise, use __lll_trylock_asm, pass
980         MULTIPLE_THREADS_OFFSET as another asm operand.
981         (lll_lock): Add private argument, use __lll_lock_asm_start, pass
982         MULTIPLE_THREADS_OFFSET as last asm operand, call
983         __lll_lock_wait_private if private is constant LLL_PRIVATE,
984         otherwise pass private as another argument to __lll_lock_wait.
985         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
986         lll_timedlock, lll_robust_timedlock): Add private argument, pass
987         private as another argument to __lll_*lock_wait call.
988         (lll_unlock): Add private argument, use __lll_unlock_asm, pass
989         MULTIPLE_THREADS_OFFSET as another asm operand, call
990         __lll_unlock_wake_private if private is constant LLL_PRIVATE,
991         otherwise pass private as another argument to __lll_unlock_wake.
992         (lll_robust_unlock): Add private argument, pass private as another
993         argument to __lll_unlock_wake.
994         (lll_robust_dead): Add private argument, use __lll_private_flag
995         macro.
996         (lll_islocked): Use LLL_LOCK_INITIALIZER instead of
997         LLL_MUTEX_LOCK_INITIALIZER.
998         (lll_lock_t): Remove.
999         (LLL_LOCK_INITIALIZER_WAITERS): Define.
1000         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1001         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1002         lll_cond_wake, lll_cond_broadcast): Remove.
1003         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1004         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Revert
1005         2007-05-2{3,9} changes.
1006         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Include
1007         kernel-features.h and lowlevellock.h.
1008         (LOAD_PRIVATE_FUTEX_WAIT): Define.
1009         (LOAD_FUTEX_WAIT): Rewritten.
1010         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
1011         define.
1012         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
1013         (__lll_mutex_lock_wait): Rename to ...
1014         (__lll_lock_wait): ... this.  Take futex addr from %edx instead of
1015         %ecx, %ecx is now private argument.  Don't compile in for libc.so.
1016         (__lll_mutex_timedlock_wait): Rename to ...
1017         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.  %esi
1018         contains private argument.  Don't compile in for libc.so.
1019         (__lll_mutex_unlock_wake): Rename to ...
1020         (__lll_unlock_wake): ... this.  %ecx contains private argument.
1021         Don't compile in for libc.so.
1022         (__lll_timedwait_tid): Use __NR_gettimeofday.
1023         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Include
1024         kernel-features.h and lowlevellock.h.
1025         (LOAD_FUTEX_WAIT): Define.
1026         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
1027         define.
1028         (__lll_robust_mutex_lock_wait): Rename to ...
1029         (__lll_robust_lock_wait): ... this.  Futex addr is now in %edx
1030         argument, %ecx argument contains private.  Use LOAD_FUTEX_WAIT
1031         macro.
1032         (__lll_robust_mutex_timedlock_wait): Rename to ...
1033         (__lll_robust_timedlock_wait): ... this.  Use __NR_gettimeofday.
1034         %esi argument contains private, use LOAD_FUTEX_WAIT macro.
1035         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Include
1036         lowlevellock.h.
1037         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1038         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
1039         PRIVATE(%ebx) ^ LLL_SHARED as private argument in %ecx to
1040         __lll_lock_wait and __lll_unlock_wake, pass MUTEX(%ebx) address
1041         to __lll_lock_wait in %edx.
1042         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
1043         Include lowlevellock.h and pthread-errnos.h.
1044         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1045         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
1046         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*, pass
1047         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1048         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1049         __lll_unlock_wake.
1050         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
1051         Include lowlevellock.h and pthread-errnos.h.
1052         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
1053         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
1054         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*, pass
1055         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1056         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1057         __lll_unlock_wake.
1058         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
1059         Include lowlevellock.h.
1060         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1061         Don't define.
1062         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*, pass
1063         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1064         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1065         __lll_unlock_wake.  Use __NR_gettimeofday.
1066         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
1067         Include lowlevellock.h.
1068         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1069         (__pthread_cond_wait, __condvar_w_cleanup): Rename __lll_mutex_*
1070         to __lll_*, pass cond_lock address in %edx rather than %ecx to
1071         __lll_lock_wait, pass LLL_SHARED in %ecx to both __lll_lock_wait
1072         and __lll_unlock_wake.
1073         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S:
1074         Include lowlevellock.h.
1075         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1076         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*, pass
1077         MUTEX(%ebx) address in %edx rather than %ecx to
1078         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
1079         and __lll_unlock_wake.  Move return value from %ecx to %edx
1080         register.
1081         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1082         Include lowlevellock.h.
1083         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1084         Don't define.
1085         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1086         MUTEX(%ebp) address in %edx rather than %ecx to
1087         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
1088         and __lll_unlock_wake.  Move return value from %ecx to %edx
1089         register.  Use __NR_gettimeofday.
1090         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1091         Include lowlevellock.h.
1092         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1093         Don't define.
1094         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1095         MUTEX(%ebp) address in %edx rather than %ecx to
1096         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
1097         and __lll_unlock_wake.  Move return value from %ecx to %edx
1098         register.  Use __NR_gettimeofday.
1099         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
1100         Include lowlevellock.h.
1101         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1102         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*, pass
1103         MUTEX(%edi) address in %edx rather than %ecx to
1104         __lll_lock_wait, pass PSHARED(%edi) in %ecx to both __lll_lock_wait
1105         and __lll_unlock_wake.
1106         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
1107         Include lowlevellock.h.
1108         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1109         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1110         MUTEX(%ebx) address in %edx rather than %ecx to
1111         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
1112         and __lll_unlock_wake.  Move return value from %ecx to %edx
1113         register.
1114         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Include
1115         lowlevellock.h.
1116         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1117         define.
1118         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Include lowlevellock.h.
1119         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1120         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Include
1121         lowlevellock.h.
1122         (LOCK, SYS_futex, SYS_gettimeofday, FUTEX_WAIT): Don't define.
1123         (sem_timedwait): Use __NR_gettimeofday.
1124         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Include
1125         lowlevellock.h.
1126         (LOCK): Don't define.
1127         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include
1128         lowlevellock.h.
1129         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1130         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Wake only when there
1131         are waiters.
1132         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Revert
1133         2007-05-2{3,9} changes.
1134         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Include
1135         kernel-features.h and lowlevellock.h.
1136         (LOAD_PRIVATE_FUTEX_WAIT): Define.
1137         (LOAD_FUTEX_WAIT): Rewritten.
1138         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
1139         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
1140         (__lll_mutex_lock_wait): Rename to ...
1141         (__lll_lock_wait): ... this.  %esi is now private argument.
1142         Don't compile in for libc.so.
1143         (__lll_mutex_timedlock_wait): Rename to ...
1144         (__lll_timedlock_wait): ... this.  %esi contains private argument.
1145         Don't compile in for libc.so.
1146         (__lll_mutex_unlock_wake): Rename to ...
1147         (__lll_unlock_wake): ... this.  %esi contains private argument.
1148         Don't compile in for libc.so.
1149         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Include
1150         kernel-features.h and lowlevellock.h.
1151         (LOAD_FUTEX_WAIT): Define.
1152         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
1153         (__lll_robust_mutex_lock_wait): Rename to ...
1154         (__lll_robust_lock_wait): ... this.  %esi argument contains private.
1155         Use LOAD_FUTEX_WAIT macro.
1156         (__lll_robust_mutex_timedlock_wait): Rename to ...
1157         (__lll_robust_timedlock_wait): ... this. %esi argument contains
1158         private, use LOAD_FUTEX_WAIT macro.
1159         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Include
1160         lowlevellock.h.
1161         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1162         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
1163         PRIVATE(%rdi) ^ LLL_SHARED as private argument in %esi to
1164         __lll_lock_wait and __lll_unlock_wake.
1165         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S:
1166         Include lowlevellock.h and pthread-errnos.h.
1167         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1168         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
1169         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*,
1170         pass LLL_SHARED in %esi to both __lll_lock_wait and
1171         __lll_unlock_wake.
1172         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S:
1173         Include lowlevellock.h and pthread-errnos.h.
1174         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
1175         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
1176         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*,
1177         pass LLL_SHARED in %esi to both __lll_lock_wait and
1178         __lll_unlock_wake.
1179         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:
1180         Include lowlevellock.h.
1181         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1182         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*,
1183         pass LLL_SHARED in %esi to both __lll_lock_wait and
1184         __lll_unlock_wake.
1185         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
1186         Include lowlevellock.h.
1187         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1188         (__pthread_cond_wait, __condvar_cleanup): Rename __lll_mutex_*
1189         to __lll_*, pass LLL_SHARED in %esi to both __lll_lock_wait
1190         and __lll_unlock_wake.
1191         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:
1192         Include lowlevellock.h.
1193         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1194         Don't define.
1195         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*,
1196         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1197         and __lll_unlock_wake.
1198         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1199         Include lowlevellock.h.
1200         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1201         Don't define.
1202         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1203         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1204         and __lll_unlock_wake.
1205         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1206         Include lowlevellock.h.
1207         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1208         Don't define.
1209         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1210         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1211         and __lll_unlock_wake.
1212         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S:
1213         Include lowlevellock.h.
1214         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1215         Don't define.
1216         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*,
1217         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1218         and __lll_unlock_wake.
1219         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:
1220         Include lowlevellock.h.
1221         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1222         Don't define.
1223         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1224         pass PSHARED(%rdi) in %ecx to both __lll_lock_wait
1225         and __lll_unlock_wake.
1226         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Include
1227         lowlevellock.h.
1228         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1229         define.
1230         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Include lowlevellock.h.
1231         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1232         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Include
1233         lowlevellock.h.
1234         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1235         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Include
1236         lowlevellock.h.
1237         (LOCK): Don't define.
1238         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Include
1239         lowlevellock.h.
1240         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1241         * sysdeps/unix/sysv/linux/sparc/internaltypes.h: New file.
1242         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c: New file.
1243         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c: New file.
1244         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c: New file.
1245         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
1246         (__lll_lock_wait_private): New function.
1247         (__lll_lock_wait, __lll_timedlock_wait): Add private argument, pass
1248         it to lll_futex_*wait.  Don't compile in for libc.so.
1249         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c:
1250         Remove.
1251         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
1252         (struct sparc_pthread_barrier): Remove.
1253         (pthread_barrier_wait): Use union sparc_pthread_barrier instead of
1254         struct sparc_pthread_barrier.  Pass
1255         ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE to lll_{,un}lock
1256         and lll_futex_wait macros.
1257         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
1258         Remove.
1259         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1260         Include sparc pthread_barrier_wait.c instead of generic one.
1262 2007-07-30  Jakub Jelinek  <jakub@redhat.com>
1264         * tst-rwlock14.c (do_test): Avoid warnings on 32-bit arches.
1266         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
1267         (pthread_rwlock_timedrdlock): Copy futex retval to %esi rather than
1268         %ecx.
1269         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
1270         (pthread_rwlock_timedwrlock): Likewise.
1271         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
1272         (__pthread_rwlock_unlock): Fix MUTEX != 0 args to __lll_*.
1274 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
1276         * sysdeps/sparc/tls.h (tcbhead_t): Add private_futex field.
1278 2007-07-26  Jakub Jelinek  <jakub@redhat.com>
1280         * tst-locale2.c (useless): Add return statement.
1282 2007-07-24  Jakub Jelinek  <jakub@redhat.com>
1284         * allocatestack.c (__nptl_setxid, __wait_lookup_done): Replace
1285         lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).
1286         * pthread_create.c (start_thread): Likewise.
1287         * init.c (sighandler_setxid): Likewise.
1288         * sysdeps/alpha/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1289         * sysdeps/ia64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1290         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1291         * sysdeps/s390/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1292         * sysdeps/powerpc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1293         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1294         * sysdeps/sparc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1295         * sysdeps/sh/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1296         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY, AIO_MISC_WAIT):
1297         Likewise.
1298         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY, GAI_MISC_WAIT):
1299         Likewise.
1300         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1301         Likewise.
1302         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_waitzero,
1303         __rtld_notify): Likewise.
1304         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Likewise.
1305         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (clear_once_control,
1306         __pthread_once): Likewise.
1307         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (clear_once_control,
1308         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1309         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1310         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1311         (lll_futex_wait): Add private argument, define as wrapper around
1312         lll_futex_timed_wait.
1313         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1314         use __lll_private_flag macro.
1315         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1316         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1317         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (clear_once_control,
1318         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1319         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1320         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1321         (lll_futex_wait): Add private argument, define as wrapper around
1322         lll_futex_timed_wait.
1323         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1324         use __lll_private_flag macro.
1325         (__lll_mutex_unlock, __lll_robust_mutex_unlock, lll_wait_tid,
1326         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1327         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
1328         Define.
1329         (lll_futex_timed_wait, lll_futex_wake): Use it.
1330         (lll_private_futex_wait, lll_private_futex_timed_wait,
1331         lll_private_futex_wake): Removed.
1332         * sysdeps/unix/sysv/linux/s390/pthread_once.c (clear_once_control,
1333         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1334         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1335         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1336         (lll_futex_wait): Add private argument, define as wrapper around
1337         lll_futex_timed_wait.
1338         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1339         use __lll_private_flag macro.
1340         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1341         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1342         to lll_futex_*.
1343         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1344         (lll_private_futex_wait, lll_private_futex_timed_wait,
1345         lll_private_futex_wake): Removed.
1346         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_private_flag):
1347         Fix !__ASSUME_PRIVATE_FUTEX non-constant private case.
1348         (lll_private_futex_wait, lll_private_futex_timed_wait,
1349         lll_private_futex_wake): Removed.
1350         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (clear_once_control,
1351         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1352         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1353         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1354         (lll_futex_wait): Add private argument, define as wrapper around
1355         lll_futex_timed_wait.
1356         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1357         use __lll_private_flag macro.
1358         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1359         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1360         to lll_futex_*.
1361         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (__lll_private_flag):
1362         Define.
1363         (lll_futex_timed_wait, lll_futex_wake): Use it.
1364         (lll_private_futex_wait, lll_private_futex_timed_wait,
1365         lll_private_futex_wake): Removed.
1367 2007-07-27  Jakub Jelinek  <jakub@redhat.com>
1369         * sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
1370         of the structure for sparc32.
1372 2007-07-26  Aurelien Jarno  <aurelien@aurel32.net>
1374         * sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
1376 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1378         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1379         code used when private futexes are assumed.
1380         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1381         Likewise.
1383 2007-07-23  Jakub Jelinek  <jakub@redhat.com>
1385         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1386         (__lll_private_flag): Define.
1387         (lll_futex_wait): Define as a wrapper around lll_futex_timed_wait.
1388         (lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Use
1389         __lll_private_flag.
1390         (lll_private_futex_wait, lll_private_futex_timedwait,
1391         lll_private_futex_wake): Define as wrapper around non-_private
1392         macros.
1393         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1394         (__lll_private_flag): Define.
1395         (lll_futex_timed_wait, lll_futex_wake): Use __lll_private_flag.
1396         (lll_private_futex_wait, lll_private_futex_timedwait,
1397         lll_private_futex_wake): Define as wrapper around non-_private
1398         macros.
1400 2007-07-10  Steven Munroe  <sjmunroe@us.ibm.com>
1402         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Add LLL_SHARED
1403         parameter to lll_futex_wait call.
1404         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1406         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
1407         Replace lll_futex_wait with lll_private_futex_wait.
1408         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1409         Add LLL_SHARED parameter to lll_futex_wake().
1411         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define LLL_PRIVATE
1412         LLL_SHARED, lll_private_futex_wait, lll_private_futex_timed_wait and
1413         lll_private_futex_wake.
1414         (lll_futex_wait): Add private parameter. Adjust FUTEX_PRIVATE_FLAG
1415         bit from private parm before syscall.
1416         (lll_futex_timed_wait): Likewise.
1417         (lll_futex_wake): Likewise.
1418         (lll_futex_wake_unlock): Likewise.
1419         (lll_mutex_unlock): Add LLL_SHARED parm to lll_futex_wake call.
1420         (lll_robust_mutex_unlock): Likewise.
1421         (lll_mutex_unlock_force): Likewise.
1422         (lll_wait_tid): Add LLL_SHARED parm to lll_futex_wait call.
1424 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1426         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1427         compilation when unconditionally using private futexes.
1428         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1429         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1430         Likewise.
1431         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1432         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1434 2007-07-17  Jakub Jelinek  <jakub@redhat.com>
1436         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
1437         Define.
1439 2007-07-06  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1441         * sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and
1442         kernel-features.h.
1444 2007-05-16  Roland McGrath  <roland@redhat.com>
1446         * init.c (__nptl_initial_report_events): New variable.
1447         (__pthread_initialize_minimal_internal): Initialize pd->report_events
1448         to that.
1450 2007-06-22  Jakub Jelinek  <jakub@redhat.com>
1452         * pthread_getattr_np.c (pthread_getattr_np): Clear cpuset and
1453         cpusetsize if pthread_getaffinity_np failed with ENOSYS.
1455 2007-06-19  Ulrich Drepper  <drepper@redhat.com>
1457         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Remove mrlock
1458         implementation.
1460 2007-06-18  Ulrich Drepper  <drepper@redhat.com>
1462         * pthreadP.h: Define PTHREAD_MUTEX_TYPE.
1463         * phtread_mutex_lock.c: Use PTHREAD_MUTEX_TYPE.
1464         * pthread_mutex_timedlock.c: Likewise.
1465         * pthread_mutex_trylock.c: Likewise.
1466         * pthread_mutex_unlock.c: Likewise.
1468 2007-06-17  Andreas Schwab  <schwab@suse.de>
1470         * sysdeps/pthread/pt-initfini.c: Tell gcc about the nonstandard
1471         sections.
1473 2007-06-17  Ulrich Drepper  <drepper@redhat.com>
1475         * allocatestack.c (allocate_stack): Make code compile if
1476         __ASSUME_PRIVATE_FUTEX is set.
1478 2007-06-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1480         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S:
1481         (__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
1482         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
1483         (__pthread_rwlock_wrlock): Likewise.
1484         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
1485         (pthread_rwlock_timedrdlock): Likewise.
1486         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
1487         (pthread_rwlock_timedwrlock): Likewise.
1488         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
1489         (__pthread_rwlock_unlock): Likewise.
1491 2007-06-10  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1493         * sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
1494         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
1495         Split __flags into __flags, __shared, __pad1 and __pad2.
1496         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
1497         futexes if they are available.
1498         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
1499         in libc-lowlevellock.S allow using private futexes.
1500         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
1501         FUTEX_PRIVATE_FLAG.  Add additional parameter to lll_futex_wait,
1502         lll_futex_timed_wait and lll_futex_wake.  Change lll_futex_wait
1503         to call lll_futex_timed_wait.  Add lll_private_futex_wait,
1504         lll_private_futex_timed_wait and lll_private_futex_wake.
1505         (lll_robust_mutex_unlock): Fix typo.
1506         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
1507         field in futex command setup.
1508         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
1509         COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
1510         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
1511         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
1512         if they are available.  Remove clear_once_control.
1513         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
1514         futexes if they are available.
1515         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1516         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1517         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1518         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1519         * sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
1520         Wake only when there are waiters.
1521         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
1522         support.  Indicate that there are waiters.  Remove unnecessary
1523         extra cancellation test.
1524         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.  Removed
1525         left-over duplication of __sem_wait_cleanup.
1527 2007-06-07  Ulrich Drepper  <drepper@redhat.com>
1529         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Add additional
1530         parameter to lll_futex_wait, lll_futex_timed_wait, and
1531         lll_futex_wake.  Change lll_futex_wait to call lll_futex_timed_wait.
1532         Add lll_private_futex_wait, lll_private_futex_timed_wait, and
1533         lll_private_futex_wake.
1534         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1535         * allocatestack.c: Adjust use of lll_futex_* macros.
1536         * init.c: Likewise.
1537         * lowlevellock.h: Likewise.
1538         * pthread_barrier_wait.c: Likewise.
1539         * pthread_cond_broadcast.c: Likewise.
1540         * pthread_cond_destroy.c: Likewise.
1541         * pthread_cond_signal.c: Likewise.
1542         * pthread_cond_timedwait.c: Likewise.
1543         * pthread_cond_wait.c: Likewise.
1544         * pthread_create.c: Likewise.
1545         * pthread_mutex_lock.c: Likewise.
1546         * pthread_mutex_setprioceiling.c: Likewise.
1547         * pthread_mutex_timedlock.c: Likewise.
1548         * pthread_mutex_unlock.c: Likewise.
1549         * pthread_rwlock_timedrdlock.c: Likewise.
1550         * pthread_rwlock_timedwrlock.c: Likewise.
1551         * pthread_rwlock_unlock.c: Likewise.
1552         * sysdeps/alpha/tls.h: Likewise.
1553         * sysdeps/i386/tls.h: Likewise.
1554         * sysdeps/ia64/tls.h: Likewise.
1555         * sysdeps/powerpc/tls.h: Likewise.
1556         * sysdeps/pthread/aio_misc.h: Likewise.
1557         * sysdeps/pthread/gai_misc.h: Likewise.
1558         * sysdeps/s390/tls.h: Likewise.
1559         * sysdeps/sh/tls.h: Likewise.
1560         * sysdeps/sparc/tls.h: Likewise.
1561         * sysdeps/unix/sysv/linux/fork.c: Likewise.
1562         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
1563         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
1564         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Likewise.
1565         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
1566         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1567         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
1568         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
1569         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
1570         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
1571         Likewise.
1572         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise.
1573         * sysdeps/x86_64/tls.h: Likewise.
1575 2007-05-29  Ulrich Drepper  <drepper@redhat.com>
1577         * pthread_getattr_np.c: No need to install a cancellation handler,
1578         this is no cancellation point.
1579         * pthread_getschedparam.c: Likewise.
1580         * pthread_setschedparam.c: Likewise.
1581         * pthread_setschedprio.c: Likewise.
1582         * sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
1583         lll_unlock_wake_cb.
1584         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
1585         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1586         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1587         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1588         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1589         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1590         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
1591         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
1592         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1593         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
1594         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1595         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1597         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
1598         whether there are more than one thread makes no sense here since
1599         we only call the slow path if the locks are taken.
1600         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
1602         * sysdeps/unix/sysv/linux/internaltypes.h: Introduce
1603         COND_NWAITERS_SHIFT.
1604         * pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of
1605         COND_CLOCK_BITS.
1606         * pthread_cond_init.c: Likewise.
1607         * pthread_cond_timedwait.c: Likewise.
1608         * pthread_cond_wait.c: Likewise.
1609         * pthread_condattr_getclock.c: Likewise.
1610         * pthread_condattr_setclock.c: Likewise.
1611         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise.
1612         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1613         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1614         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1615         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1617 2007-05-28  Jakub Jelinek  <jakub@redhat.com>
1619         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
1620         unistd.h.
1622         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
1623         insn suffix.
1624         (THREAD_GSCOPE_GET_FLAG): Remove.
1625         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Remove.
1626         * allocatestack.c (__wait_lookup_done): Revert 2007-05-24
1627         changes.
1628         * sysdeps/powerpc/tls.h (tcbhead_t): Remove gscope_flag.
1629         (THREAD_GSCOPE_GET_FLAG): Remove.
1630         (THREAD_GSCOPE_RESET_FLAG): Use THREAD_SELF->header.gscope_flag
1631         instead of THREAD_GSCOPE_GET_FLAG.
1632         (THREAD_GSCOPE_SET_FLAG): Likewise.  Add atomic_write_barrier after
1633         it.
1634         * sysdeps/s390/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1635         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1636         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1637         THREAD_GSCOPE_WAIT): Define.
1638         * sysdeps/sparc/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1639         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1640         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1641         THREAD_GSCOPE_WAIT): Define.
1642         * sysdeps/sh/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1643         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1644         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1645         THREAD_GSCOPE_WAIT): Define.
1646         * sysdeps/ia64/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1647         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1648         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1649         THREAD_GSCOPE_WAIT): Define.
1651 2007-05-24  Richard Henderson  <rth@redhat.com>
1653         * descr.h (struct pthread): Add header.gscope_flag.
1654         * sysdeps/alpha/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1655         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1656         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1657         THREAD_GSCOPE_WAIT): Define.
1659 2007-05-27  Ulrich Drepper  <drepper@redhat.com>
1661         * init.c: Make it compile with older kernel headers.
1663         * tst-initializers1.c: Show through exit code which test failed.
1665         * pthread_rwlock_init.c: Also initialize __shared field.
1666         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
1667         element in rwlock structure into four byte elements.  One of them is
1668         the new __shared element.
1669         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
1670         Likewise.
1671         [__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
1672         __shared, adjust names of other padding elements.
1673         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1674         * sysdeps/pthread/pthread.h: Adjust rwlock initializers.
1675         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
1676         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
1677         FUTEX_PRIVATE_FLAG.
1678         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
1679         futex to use private operations if possible.
1680         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1681         Likewise.
1682         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1683         Likewise.
1684         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1685         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1686         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1687         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1688         Likewise.
1689         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1690         Likewise.
1691         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1692         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1694 2007-05-26  Ulrich Drepper  <drepper@redhat.com>
1696         * pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
1697         * pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
1698         * pthread_rwlock_timedrdlock.c: Likewise.
1699         * pthread_rwlock_tryrdlock.c: Likewise.
1701         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
1702         optimization.
1704         * sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
1705         * sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
1706         duplication of __sem_wait_cleanup.
1708         * allocatestack.c: Revert last change.
1709         * init.c: Likewise.
1710         * sysdeps/i386/tls.h: Likewise.
1711         * sysdeps/x86_64/tls.h: Likewise.
1712         * descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
1713         header structure.
1714         * sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
1716         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
1717         Add private field.
1718         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
1719         * pthread_barrier_init.c: Set private flag if pshared and private
1720         futexes are supported.
1721         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
1722         private field in futex command setup.
1723         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
1725 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1727         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
1728         support.
1729         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1730         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1731         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1732         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1733         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1735         * semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
1736         * sem_init.c (__new_sem_init): Rewrite to initialize all three
1737         fields in the structure.
1738         (__old_sem_init): New function.
1739         * sem_open.c: Initialize all fields of the structure.
1740         * sem_getvalue.c: Adjust for renamed element.
1741         * sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
1742         (gen-as-const-headers): Add structsem.sym.
1743         * sysdeps/unix/sysv/linux/structsem.sym: New file.
1744         * sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
1745         struct new_sem.  Add struct old_sem.
1746         * sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
1747         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
1748         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1749         * sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
1750         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1751         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1752         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1753         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1754         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1755         * Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
1756         * tst-sem10.c: New file.
1757         * tst-sem11.c: New file.
1758         * tst-sem12.c: New file.
1759         * tst-typesizes.c: Test struct new_sem and struct old_sem instead
1760         of struct sem.
1762 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1763             Jakub Jelinek  <jakub@redhat.com>
1765         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
1766         Move __pthread_enable_asynccancel right before futex syscall.
1767         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
1768         Likewise.
1770 2007-05-24  Jakub Jelinek  <jakub@redhat.com>
1772         * sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
1773         THREAD_COPY_PRIVATE_FUTEX): Define.
1774         * sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
1775         THREAD_COPY_PRIVATE_FUTEX): Define.
1776         * allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
1777         * init.c (__pthread_initialize_minimal_internal): Use
1778         THREAD_SET_PRIVATE_FUTEX.
1780         * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
1781         (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
1782         THREAD_GSCOPE_FLAG_WAIT): Define.
1783         (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG,
1784         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define.
1785         * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use
1786         PTR_DEMANGLE.
1787         (THREAD_GSCOPE_GET_FLAG): Define.
1788         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define.
1789         * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
1790         instead of ->header.gscope_flag directly.
1792 2007-05-23  Ulrich Drepper  <drepper@redhat.com>
1794         * init.c (__pthread_initialize_minimal_internal): Check whether
1795         private futexes are available.
1796         * allocatestack.c (allocate_stack): Copy private_futex field from
1797         current thread into the new stack.
1798         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
1799         futexes if they are available.
1800         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
1801         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
1802         in libc-lowlevellock.S allow using private futexes.
1803         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1804         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
1805         FUTEX_PRIVATE_FLAG.
1806         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1807         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
1808         if they are available.
1809         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
1810         * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
1811         * sysdeps/i386/tcb-offsets.sym: Likewise.
1812         * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
1813         * sysdeps/i386/tls.h (tcbhead_t): Likewise.
1815 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
1817         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1818         Remove ptr_wait_lookup_done again.
1819         * init.c (pthread_functions): Don't add .ptr_wait_lookup_done here.
1820         (__pthread_initialize_minimal_internal): Initialize
1821         _dl_wait_lookup_done pointer in _rtld_global directly.
1822         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1823         Remove code to code _dl_wait_lookup_done.
1824         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
1825         encrypted for now.
1827 2007-05-21  Jakub Jelinek  <jakub@redhat.com>
1829         * tst-robust9.c (do_test): Don't fail if ENABLE_PI and
1830         pthread_mutex_init failed with ENOTSUP.
1832 2007-05-19  Ulrich Drepper  <drepper@redhat.com>
1834         * allocatestack.c (__wait_lookup_done): New function.
1835         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1836         Add ptr_wait_lookup_done.
1837         * init.c (pthread_functions): Initialize .ptr_wait_lookup_done.
1838         * pthreadP.h: Declare __wait_lookup_done.
1839         * sysdeps/i386/tls.h (tcbhead_t): Add gscope_flag.
1840         Define macros to implement reference handling of global scope.
1841         * sysdeps/x86_64/tls.h: Likewise.
1842         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1843         Initialize GL(dl_wait_lookup_done).
1845 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
1847         [BZ #4512]
1848         * pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
1849         is detected.
1850         * pthread_mutex_timedlock.c: Likewise.
1851         * pthread_mutex_trylock.c: Likewise.
1852         Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
1854         * Makefile (tests): Add tst-robust9 and tst-robustpi9.
1855         * tst-robust9.c: New file.
1856         * tst-robustpi9.c: New file.
1858         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
1859         unnecessary extra cancellation test.
1861 2007-05-14  Ulrich Drepper  <drepper@redhat.com>
1863         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
1864         extra cancellation test.
1865         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1867 2007-05-10  Ulrich Drepper  <drepper@redhat.com>
1869         * descr.h (struct pthread): Rearrange members to fill hole in
1870         64-bit layout.
1872         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1873         (__pthread_setaffinity_new): If syscall was successful and
1874         RESET_VGETCPU_CACHE is defined, use it before returning.
1875         * sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
1877 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
1879         [BZ #4455]
1880         * tst-align2.c: Include stackinfo.h.
1881         * tst-getpid1.c: Likewise.
1883 2007-05-02  Carlos O'Donell  <carlos@systemhalted.org>
1885         [BZ #4455]
1886         * tst-align2.c (do_test): Add _STACK_GROWS_UP case.
1887         * tst-getpid1.c (do_test): Likewise.
1889         [BZ #4456]
1890         * allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
1891         (allocate_stack): Likewise.
1893 2007-05-07  Ulrich Drepper  <drepper@redhat.com>
1895         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
1896         (__lll_robust_lock_wait): Fix race caused by reloading of futex value.
1897         (__lll_robust_timedlock_wait): Likewise.
1898         Reported by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
1900 2007-05-06  Mike Frysinger  <vapier@gentoo.org>
1902         [BZ #4465]
1903         * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
1904         * tst-cancel4.c (tf_fdatasync): New test.
1906 2007-04-27  Ulrich Drepper  <drepper@redhat.com>
1908         [BZ #4392]
1909         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Treat error
1910         check mutexes like normal mutexes.
1912         [BZ #4306]
1913         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
1914         Initialize the whole sigevent structure to appease valgrind.
1916 2007-04-25  Ulrich Drepper  <drepper@redhat.com>
1918         * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
1919         * sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
1921 2007-04-06  Ulrich Drepper  <drepper@redhat.com>
1923         * tst-locale1.c: Avoid warnings.
1924         * tst-locale2.c: Likewise.
1926 2007-03-19  Steven Munroe  <sjmunroe@us.ibm.com>
1928         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1929         (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
1931 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
1933         * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
1934         __extern_always_inline where appropriate.
1935         * sysdeps/pthread/pthread.h: Likewise.
1937 2007-03-13  Richard Henderson  <rth@redhat.com>
1939         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
1940         separate cfi regions for the two subsections.
1942 2007-02-25  Ulrich Drepper  <drepper@redhat.com>
1944         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
1945         new thread, don't just decrement it.
1946         Patch by Suzuki K P <suzuki@in.ibm.com>.
1948 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
1950         * sysdeps/pthread/pthread-functions.h: Correct last patch, correct
1951         PTHFCT_CALL definition.
1953 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
1955         * sysdeps/pthread/pthread-functions.h: If PTR_DEMANGLE is not
1956         available, don't use it.
1958 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
1960         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1961         (__lll_mutex_timedlock_wait): Use correct pointer when we don't
1962         call into the kernel to delay.
1964 2007-01-18  Ulrich Drepper  <drepper@redhat.com>
1966         * tst-initializers1.c: We want to test the initializers as seen
1967         outside of libc, so undefined _LIBC.
1969         * pthread_join.c (cleanup): Avoid warning.
1971 2007-01-17  Ulrich Drepper  <drepper@redhat.com>
1973         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1974         (__lll_timedwait_tid): Add unwind info.
1976         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Don't just copy the
1977         function table, mangle the pointers.
1978         * sysdeps/pthread/pthread-functions.h: Define PTHFCT_CALL.
1979         * forward.c: Use PTHFCT_CALL and __libc_pthread_functions_init.
1980         * sysdeps/pthread/bits/libc-lock.h: When using __libc_pthread_functions
1981         demangle pointers before use.
1982         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Use PTHFCT_CALL to
1983         demangle pointer.
1984         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
1985         * sysdeps/pthread/setxid.h: Likewise.
1987 2007-01-12  Ulrich Drepper  <drepper@redhat.com>
1989         * tst-rwlock7.c: Show some more information in case of correct
1990         behavior.
1992 2007-01-11  Ulrich Drepper  <drepper@redhat.com>
1994         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1995         (lll_futex_timed_wait): Undo part of last change, don't negate
1996         return value.
1998 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
2000         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups.  Define
2001         FUTEX_CMP_REQUEUE and lll_futex_requeue.
2003 2006-12-28  David S. Miller  <davem@davemloft.net>
2005         * shlib-versions: Fix sparc64 linux target specification.
2007 2007-01-10  Jakub Jelinek  <jakub@redhat.com>
2009         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2010         Adjust include path for pthread_barrier_wait.c move.
2012 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
2014         * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
2015         tid isn't reread from pd->tid in between ESRCH test and the syscall.
2017 2006-12-06  Jakub Jelinek  <jakub@redhat.com>
2019         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
2020         6 argument cancellable syscalls.
2021         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
2022         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
2023         6 argument cancellable syscalls.
2024         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
2026 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
2028         * sysdeps/unix/sysv/linux/rtld-lowlevel.h
2029         (__rtld_mrlock_initialize): Add missing closing parenthesis.
2031 2006-10-30  Jakub Jelinek  <jakub@redhat.com>
2033         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
2034         __sync_lock_release instead of __sync_lock_release_si.
2036 2006-10-29  Jakub Jelinek  <jakub@redhat.com>
2038         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P):
2039         Define.
2040         (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld.
2041         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
2042         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
2043         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
2044         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
2045         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2046         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
2047         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
2048         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2049         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2050         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
2052 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
2054         * sysdeps/pthread/pthread_barrier_wait.c: Move to...
2055         * pthread_barrier_wait.c: ...here.
2056         * sysdeps/pthread/pthread_cond_broadcast.c: Move to...
2057         * pthread_cond_broadcast.c: ...here.
2058         * sysdeps/pthread/pthread_cond_signal.c: Move to...
2059         * pthread_cond_signal.c: ...here.
2060         * sysdeps/pthread/pthread_cond_timedwait.c: Move to...
2061         * pthread_cond_timedwait.c: ...here.
2062         * sysdeps/pthread/pthread_cond_wait.c: Move to...
2063         * pthread_cond_wait.c: ...here.
2064         * sysdeps/pthread/pthread_once.c: Move to...
2065         * pthread_once.c: ...here.
2066         * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to...
2067         * pthread_rwlock_rdlock.c: ...here.
2068         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to...
2069         * pthread_rwlock_timedrdlock.c: ...here.
2070         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to...
2071         * pthread_rwlock_timedwrlock.c: ...here.
2072         * sysdeps/pthread/pthread_rwlock_unlock.c: Move to...
2073         * pthread_rwlock_unlock.c: ...here.
2074         * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to...
2075         * pthread_rwlock_wrlock.c: ...here.
2076         * sysdeps/pthread/pthread_spin_destroy.c: Move to...
2077         * pthread_spin_destroy.c: ...here.
2078         * sysdeps/pthread/pthread_spin_init.c: Move to...
2079         * pthread_spin_init.c: ...here.
2080         * sysdeps/pthread/pthread_spin_unlock.c: Move to...
2081         * pthread_spin_unlock.c: ...here.
2082         * sysdeps/pthread/pthread_getcpuclockid.c: Move to...
2083         * pthread_getcpuclockid.c: ...here.
2085         * init.c: USE_TLS support is now always enabled.
2086         * tst-tls5.h: Likewise.
2087         * sysdeps/alpha/tls.h: Likewise.
2088         * sysdeps/i386/tls.h: Likewise.
2089         * sysdeps/ia64/tls.h: Likewise.
2090         * sysdeps/powerpc/tls.h: Likewise.
2091         * sysdeps/s390/tls.h: Likewise.
2092         * sysdeps/sh/tls.h: Likewise.
2093         * sysdeps/sparc/tls.h: Likewise.
2094         * sysdeps/x86_64/tls.h: Likewise.
2096 2006-10-27  Jakub Jelinek  <jakub@redhat.com>
2098         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
2099         __rtld_mrlock_change): Update oldval if atomic compare and exchange
2100         failed.
2102         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
2103         Define to THREAD_SELF->header.multiple_threads.
2104         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
2105         Likewise.
2106         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
2107         Likewise.
2108         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
2109         (SINGLE_THREAD_P): Likewise.
2110         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
2111         (SINGLE_THREAD_P): Likewise.
2112         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2113         (SINGLE_THREAD_P): Likewise.
2114         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
2115         (SINGLE_THREAD_P): Likewise.
2116         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P):
2117         Likewise.
2118         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
2119         (SINGLE_THREAD_P): Likewise.
2120         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
2121         (SINGLE_THREAD_P): Likewise.
2122         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P):
2123         Likewise.
2125 2006-10-26  Jakub Jelinek  <jakub@redhat.com>
2127         * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3
2128         by default rather than 2_3_3.
2130 2006-10-17  Jakub Jelinek  <jakub@redhat.com>
2132         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
2133         __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
2134         atomic_* instead of catomic_* macros.
2136 2006-10-12  Ulrich Drepper  <drepper@redhat.com>
2138         [BZ #3285]
2139         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX.
2140         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
2141         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
2142         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
2143         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
2144         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX.
2145         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
2146         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
2147         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
2148         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise.
2149         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
2150         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
2151         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
2153 2006-10-11  Ulrich Drepper  <drepper@redhat.com>
2155         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for
2156         cancelable syscalls with six parameters.
2158         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
2159         operations instead of atomic_*.
2161 2006-10-09  Ulrich Drepper  <drepper@redhat.com>
2163         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
2165 2006-10-07  Ulrich Drepper  <drepper@redhat.com>
2167         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file.
2168         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file.
2169         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c:
2170         New file.
2171         * pthread_attr_setstack.c: Allow overwriting the version number of the
2172         new symbol.
2173         * pthread_attr_setstacksize.c: Likewise.
2174         (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use
2175         it.
2176         * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add
2177         pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6.
2179 2006-09-24  Ulrich Drepper  <drepper@redhat.com>
2181         [BZ #3251]
2182         * descr.h (ENQUEUE_MUTEX_BOTH): Add cast to avoid warning.
2183         Patch by Petr Baudis.
2185 2006-09-18  Jakub Jelinek  <jakub@redhat.com>
2187         * tst-kill4.c (do_test): Explicitly set tf thread's stack size.
2189         * tst-cancel2.c (tf): Loop as long as something was written.
2191 2006-09-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2193         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: For PI
2194         mutexes wake all mutexes.
2195         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Don't increment
2196         WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2197         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2199 2006-09-12  Ulrich Drepper  <drepper@redhat.com>
2201         * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use
2202         to guarantee the thread is always canceled.
2204 2006-09-08  Jakub Jelinek  <jakub@redhat.com>
2206         * tst-cond22.c: Include pthread.h instead of pthreadP.h.
2207         Include stdlib.h.
2208         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Only
2209         increase FUTEX if increasing WAKEUP_SEQ.  Fix comment typo.
2210         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2211         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2212         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2214 2006-09-08  Ulrich Drepper  <drepper@redhat.com>
2216         [BZ #3123]
2217         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Don't
2218         increment WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2219         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2220         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2221         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2222         * Makefile (tests): Add tst-cond22.
2223         * tst-cond22.c: New file.
2225 2006-09-05  Ulrich Drepper  <drepper@redhat.com>
2227         [BZ #3124]
2228         * descr.h (struct pthread): Add parent_cancelhandling.
2229         * sysdeps/pthread/createthread.c (create_thread): Pass parent
2230         cancelhandling value to child.
2231         * pthread_create.c (start_thread): If parent thread was canceled
2232         reset the SIGCANCEL mask.
2233         * Makefile (tests): Add tst-cancel25.
2234         * tst-cancel25.c: New file.
2236 2006-09-05  Jakub Jelinek  <jakub@redhat.com>
2237             Ulrich Drepper  <drepper@redhat.com>
2239         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
2240         counterp if it is already zero.
2241         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
2243 2006-03-04  Jakub Jelinek  <jakub@redhat.com>
2244             Roland McGrath  <roland@redhat.com>
2246         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2247         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2248         LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
2249         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2250         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2251         lll_robust_mutex_timedlock, lll_mutex_unlock,
2252         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2253         Add _L_*_ symbols around the subsection.
2254         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
2255         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2257 2006-03-03  Jakub Jelinek  <jakub@redhat.com>
2258             Roland McGrath  <roland@redhat.com>
2260         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2261         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2262         LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
2263         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2264         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2265         lll_robust_mutex_timedlock, lll_mutex_unlock,
2266         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2267         Add _L_*_ symbols around the subsection.
2268         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
2269         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2271 2006-08-31  Ulrich Drepper  <drepper@redhat.com>
2273         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Undo last
2274         change because it can disturb too much existing code.  If real hard
2275         reader preference is needed we'll introduce another type.
2276         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2277         (pthread_rwlock_timedwrlock): Likewise.
2278         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2279         Likewise.
2281 2006-08-30  Ulrich Drepper  <drepper@redhat.com>
2283         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Respect
2284         reader preference.
2285         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2286         (pthread_rwlock_timedwrlock): Likewise.
2287         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2288         Likewise.
2290 2006-08-25  Jakub Jelinek  <jakub@redhat.com>
2292         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
2293         Only define ifdef SHARED.
2295 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
2297         * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
2298         (free_stacks): ...here.
2299         (__free_stack_cache): New function.
2300         * pthreadP.h: Declare __free_stack_cache.
2301         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
2302         ptr_freeres.
2303         * init.c (pthread_functions): Initialize ptr_freeres.
2304         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
2305         New freeres function.
2307 2006-07-30  Joseph S. Myers  <joseph@codesourcery.com>
2309         [BZ #3018]
2310         * Makefile (extra-objs): Add modules to extra-test-objs instead.
2312 2006-08-20  Ulrich Drepper  <drepper@redhat.com>
2314         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2315         _XOPEN_REALTIME_THREADS.
2317 2006-08-15  Jakub Jelinek  <jakub@redhat.com>
2319         * sysdeps/unix/sysv/linux/clock_settime.c (INTERNAL_VSYSCALL): Use
2320         HAVE_CLOCK_GETRES_VSYSCALL as guard macro rather than
2321         HAVE_CLOCK_GETTIME_VSYSCALL.
2322         (maybe_syscall_settime_cpu): Use plain INTERNAL_VSYSCALL here.
2324 2006-08-14  Jakub Jelinek  <jakub@redhat.com>
2326         * sysdeps/unix/sysv/linux/bits/posix_opt.h
2327         (_POSIX_THREAD_PRIO_PROTECT): Define to 200112L.
2328         * descr.h (struct priority_protection_data): New type.
2329         (struct pthread): Add tpp field.
2330         * pthreadP.h (PTHREAD_MUTEX_PP_NORMAL_NP,
2331         PTHREAD_MUTEX_PP_RECURSIVE_NP, PTHREAD_MUTEX_PP_ERRORCHECK_NP,
2332         PTHREAD_MUTEX_PP_ADAPTIVE_NP): New enum values.
2333         * pthread_mutex_init.c (__pthread_mutex_init): Handle non-robust
2334         TPP mutexes.
2335         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle TPP mutexes.
2336         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
2337         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
2338         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
2339         * tpp.c: New file.
2340         * pthread_setschedparam.c (__pthread_setschedparam): Handle priority
2341         boosted by TPP.
2342         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
2343         * pthread_mutexattr_getprioceiling.c
2344         (pthread_mutexattr_getprioceiling): If ceiling is 0, ensure it is
2345         in the SCHED_FIFO priority range.
2346         * pthread_mutexattr_setprioceiling.c
2347         (pthread_mutexattr_setprioceiling): Fix prioceiling validation.
2348         * pthread_mutex_getprioceiling.c (pthread_mutex_getprioceiling): Fail
2349         if mutex is not TPP.  Ceiling is now in __data.__lock.
2350         * pthread_mutex_setprioceiling.c: Include stdbool.h.
2351         (pthread_mutex_setprioceiling): Fix prioceiling validation.  Ceiling
2352         is now in __data.__lock.  Add locking.
2353         * pthread_create.c (__free_tcb): Free pd->tpp structure.
2354         * Makefile (libpthread-routines): Add tpp.
2355         (xtests): Add tst-mutexpp1, tst-mutexpp6 and tst-mutexpp10.
2356         * tst-tpp.h: New file.
2357         * tst-mutexpp1.c: New file.
2358         * tst-mutexpp6.c: New file.
2359         * tst-mutexpp10.c: New file.
2360         * tst-mutex1.c (TEST_FUNCTION): Don't redefine if already defined.
2361         * tst-mutex6.c (TEST_FUNCTION): Likewise.
2363 2006-08-12  Ulrich Drepper  <drepper@redhat.com>
2365         [BZ #2843]
2366         * pthread_join.c (pthread_join): Account for self being canceled
2367         when checking for deadlocks.
2368         * tst-join5.c: Cleanups.  Allow to be used in tst-join6.
2369         (tf1): Don't print anything after pthread_join returns, this would be
2370         another cancellation point.
2371         (tf2): Likewise.
2372         * tst-join6.c: New file.
2373         * Makefile (tests): Add tst-join6.
2375 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
2377         [BZ #2892]
2378         * pthread_setspecific.c (__pthread_setspecific): Check
2379         out-of-range index before checking for unused key.
2381         * sysdeps/pthread/gai_misc.h: New file.
2383 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
2385         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
2386         file.  Don't use sysctl.
2387         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
2388         overwrite the file if this is likely not true.
2390 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
2392         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
2393         * Makefile (tests): Add tst-getpid3.
2394         * tst-getpid3.c: New file.
2396 2006-07-30  Roland McGrath  <roland@redhat.com>
2398         * Makefile (libpthread-routines): Add ptw-sigsuspend.
2400         * sysdeps/unix/sysv/linux/i386/not-cancel.h
2401         (pause_not_cancel): New macro.
2402         (nanosleep_not_cancel): New macro.
2403         (sigsuspend_not_cancel): New macro.
2404         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
2405         nanosleep_not_cancel macro from <not-cancel.h>.
2406         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
2407         macro from <not-cancel.h>.
2409 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
2410             Jakub Jelinek  <jakub@redhat.com>
2412         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
2413         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
2414         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
2415         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
2416         * pthread_mutex_init.c: Add support for priority inheritance mutex.
2417         * pthread_mutex_lock.c: Likewise.
2418         * pthread_mutex_timedlock.c: Likewise.
2419         * pthread_mutex_trylock.c: Likewise.
2420         * pthread_mutex_unlock.c: Likewise.
2421         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
2422         all mutexes.
2423         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
2424         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
2425         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
2426         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
2427         pthread-pi-defines.sym.
2428         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
2429         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
2430         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2431         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2432         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2433         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2434         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2435         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2436         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2437         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2438         _POSIX_THREAD_PRIO_INHERIT to 200112L.
2439         * tst-mutex1.c: Adjust to allow use in PI mutex test.
2440         * tst-mutex2.c: Likewise.
2441         * tst-mutex3.c: Likewise.
2442         * tst-mutex4.c: Likewise.
2443         * tst-mutex5.c: Likewise.
2444         * tst-mutex6.c: Likewise.
2445         * tst-mutex7.c: Likewise.
2446         * tst-mutex7a.c: Likewise.
2447         * tst-mutex8.c: Likewise.
2448         * tst-mutex9.c: Likewise.
2449         * tst-robust1.c: Likewise.
2450         * tst-robust7.c: Likewise.
2451         * tst-robust8.c: Likewise.
2452         * tst-mutexpi1.c: New file.
2453         * tst-mutexpi2.c: New file.
2454         * tst-mutexpi3.c: New file.
2455         * tst-mutexpi4.c: New file.
2456         * tst-mutexpi5.c: New file.
2457         * tst-mutexpi6.c: New file.
2458         * tst-mutexpi7.c: New file.
2459         * tst-mutexpi7a.c: New file.
2460         * tst-mutexpi8.c: New file.
2461         * tst-mutexpi9.c: New file.
2462         * tst-robust1.c: New file.
2463         * tst-robust2.c: New file.
2464         * tst-robust3.c: New file.
2465         * tst-robust4.c: New file.
2466         * tst-robust5.c: New file.
2467         * tst-robust6.c: New file.
2468         * tst-robust7.c: New file.
2469         * tst-robust8.c: New file.
2470         * Makefile (tests): Add the new tests.
2472         * pthread_create.c (start_thread): Add some casts to avoid warnings.
2473         * pthread_mutex_destroy.c: Remove unneeded label.
2475 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
2477         * pthread_mutex_init.c (__pthread_mutex_init): Move some
2478         computations to compile time.
2480 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
2482         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
2484 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
2486         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
2488 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
2490         * pthread_key_create.c (__pthread_key_create): Do away with
2491         __pthread_keys_lock.
2493         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2494         (__kernel_cpumask_size): Mark as hidden.
2495         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
2497         * sem_open.c (__sem_mappings_lock): Mark as hidden.
2498         * semaphoreP.h (__sem_mappings_lock): Likewise.
2500 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
2502         * pthread_atfork.c: Mark __dso_handle as hidden.
2504 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
2506         [BZ #2644]
2507         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
2508         the reload problem.  Change the one path in pthread_cancel_init
2509         which causes the problem.  Force gcc to reload.  Simplify callers.
2510         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
2511         (_Unwind_GetBSP): Undo last patch.
2513 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
2515         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
2516         function pointer is reloaded after pthread_cancel_init calls.
2518         [BZ #2644]
2519         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
2520         pointers are reloaded after pthread_cancel_init calls.
2522 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
2524         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
2525         __always_inline.
2527 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
2529         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
2530         Allocate new object which is passed to timer_sigev_thread so that
2531         the timer can be deleted before the new thread is scheduled.
2533 2006-04-26  Roland McGrath  <roland@redhat.com>
2535         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
2537 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
2539         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
2540         suffix for conditional jumps.
2541         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
2542         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2543         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
2544         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
2545         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2546         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2548         * init.c (sigcancel_handler): Compare with correct PID even if the
2549         thread is in the middle of a fork call.
2550         (sighandler_setxid): Likewise.
2551         Reported by Suzuki K P <suzuki@in.ibm.com> .
2553 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
2555         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
2557 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
2559         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
2560         fails [Coverity CID 105].
2562 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
2564         * sysdeps/pthread/pthread.h: Add nonnull attributes.
2566 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
2568         [BZ #2505]
2569         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
2570         Define __lll_rel_instr using lwsync.
2572 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
2574         * allocatestack.c (allocate_stack): Always initialize robust_head.
2575         * descr.h: Define struct robust_list_head.
2576         (struct pthread): Use robust_list_head in robust mutex list definition.
2577         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
2578         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
2579         (__pthread_initialize_minimal_internal): Register robust_list with
2580         the kernel.
2581         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
2582         Declare __set_robust_list_avail.
2583         * pthread_create.c (start_thread): Register robust_list of new thread.
2584         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
2585         waiters.
2586         * pthread_mutex_destroy.c: For robust mutexes don't look at the
2587         number of users, it's unreliable.
2588         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
2589         set_robust_list syscall is available.
2590         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
2591         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
2592         Set robust_head.list_op_pending before trying to lock a robust mutex.
2593         * pthread_mutex_timedlock.c: Likewise.
2594         * pthread_mutex_trylock.c: Likewise.
2595         * pthread_mutex_unlock.c: Likewise for unlocking.
2596         * Makefile (tests): Add tst-robust8.
2597         * tst-robust8.c: New file.
2599 2006-03-08  Andreas Schwab  <schwab@suse.de>
2601         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
2602         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
2604 2006-03-05  Roland McGrath  <roland@redhat.com>
2606         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
2607         and $config_os doesn't match *linux*.
2609 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
2611         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
2612         Use __syscall_error.
2613         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2614         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
2615         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
2616         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2617         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
2618         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
2620 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
2622         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
2624 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
2626         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
2627         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
2628         mutex.
2629         (__lll_robust_timedlock_wait): Likewise.
2630         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
2631         (__lll_robust_lock_wait): Likewise.
2632         (__lll_robust_timedlock_wait): Likewise.
2633         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
2634         (__lll_robust_lock_wait): Likewise.
2635         (__lll_robust_timedlock_wait): Likewise.
2637 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
2639         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
2640         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2641         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2642         lll_robust_mutex_unlock): Define.
2643         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2645 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
2647         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
2648         instead of <clone.S>.
2650 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
2652         * Makefile (libpthread-routines): Add
2653         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
2654         and pthread_mutex_[sg]etprioceiling.
2655         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
2656         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
2657         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
2658         pthread_mutex_setprioceiling.
2659         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
2660         PTHREAD_PRIO_PROTECT): New enum values.
2661         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
2662         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
2663         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
2664         prototypes.
2665         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
2666         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
2667         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
2668         Define.
2669         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
2670         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
2671         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
2672         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
2673         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
2674         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
2675         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
2676         protocol mutexes.
2677         * pthread_mutex_getprioceiling.c: New file.
2678         * pthread_mutex_setprioceiling.c: New file.
2679         * pthread_mutexattr_getprioceiling.c: New file.
2680         * pthread_mutexattr_setprioceiling.c: New file.
2681         * pthread_mutexattr_getprotocol.c: New file.
2682         * pthread_mutexattr_setprotocol.c: New file.
2684 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
2686         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
2688 2006-02-27  Roland McGrath  <roland@redhat.com>
2690         * sysdeps/pthread/Subdirs: List nptl here too.
2691         * configure (libc_add_on_canonical): New variable.
2693         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
2695         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
2696         self to get main source tree's file.
2697         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
2698         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
2699         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
2700         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
2701         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
2702         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
2703         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
2704         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
2705         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
2706         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
2707         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
2708         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
2709         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
2711         * Makefile: Use $(sysdirs) in vpath directive.
2713         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
2714         (CPPFLAGS-timer_routines.c): Likewise.
2716         * Makeconfig (includes): Variable removed.
2718 2006-02-26  Roland McGrath  <roland@redhat.com>
2720         * sysdeps/generic/pt-raise.c: Moved to ...
2721         * pt-raise.c: ... here.
2722         * sysdeps/generic/lowlevellock.h: Moved to ...
2723         * lowlevellock.h: ... here.
2725 2006-02-23  Roland McGrath  <roland@redhat.com>
2727         * descr.h (struct pthread): Add final member `end_padding'.
2728         (PTHREAD_STRUCT_END_PADDING): Use it.
2730 2006-02-20  Roland McGrath  <roland@redhat.com>
2732         * sysdeps/mips: Directory removed, saved in ports repository.
2733         * sysdeps/unix/sysv/linux/mips: Likewise.
2735 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
2737         * tst-robust1.c: Add second mutex to check that the mutex list is
2738         handled correctly.
2740 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
2742         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
2743         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2744         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2745         lll_robust_mutex_unlock): New macros.
2746         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2747         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2748         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2749         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2750         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
2752 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2754         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
2755         definitions.
2756         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
2758 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
2760         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2761         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
2762         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2763         (lll_robust_mutex_unlock): Likewise.
2765 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
2767         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
2768         Set robust_list.__next rather than robust_list.
2769         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
2770         (__pthread_list_t): New typedef.
2771         (pthread_mutex_t): Replace __next and __prev fields with __list.
2772         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
2773         (__pthread_list_t): New typedef.
2774         (pthread_mutex_t): Replace __next and __prev fields with __list.
2775         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2776         (__pthread_list_t, __pthread_slist_t): New typedefs.
2777         (pthread_mutex_t): Replace __next and __prev fields with __list.
2778         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
2779         (__pthread_list_t, __pthread_slist_t): New typedefs.
2780         (pthread_mutex_t): Replace __next and __prev fields with __list.
2781         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
2782         (__pthread_list_t, __pthread_slist_t): New typedefs.
2783         (pthread_mutex_t): Replace __next and __prev fields with __list.
2784         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
2785         (__pthread_slist_t): New typedef.
2786         (pthread_mutex_t): Replace __next field with __list.
2788 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
2790         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
2791         PTHREAD_MUTEX_OWNERDEAD.
2792         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
2793         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
2794         * Makefile (libpthread-routines): Add lowlevelrobustlock.
2795         * pthread_create.c (start_thread): Very much simplify robust_list loop.
2796         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
2797         to PTHREAD_MUTEX_INCONSISTENT.
2798         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
2799         * pthread_mutex_lock.c: Reimplement robust mutex handling.
2800         * pthread_mutex_trylock.c: Likewise.
2801         * pthread_mutex_timedlock.c: Likewise.
2802         * pthread_mutex_unlock.c: Likewise.
2803         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
2804         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
2805         lowlevelrobustlock.sym.
2806         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
2807         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
2808         definitions.
2809         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2810         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
2811         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
2812         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
2813         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
2815 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
2817         * allocatestack.c (allocate_stack): Initialize robust_list.
2818         * init.c (__pthread_initialize_minimal_internal): Likewise.
2819         * descr.h (struct xid_command): Pretty printing.
2820         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
2821         robust_list.  Adjust macros.
2822         * pthread_create.c (start_thread): Adjust robust_list handling.
2823         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
2824         but the owner for all robust mutex types.
2825         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
2826         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
2827         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2828         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
2830         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
2831         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
2833 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
2835         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
2836         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
2838 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2840         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
2841         Return status.
2842         (lll_futex_timed_wait): Define.
2844 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
2846         * tst-cancel4.c: Test ppoll.
2848 2006-01-18  Andreas Jaeger  <aj@suse.de>
2850         [BZ #2167]
2851         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
2852         (pthread_mutex_t): Follow changes for other archs.  Based on patch
2853         by Jim Gifford <patches@jg555.com>.
2855 2006-01-13  Richard Henderson  <rth@redhat.com>
2857         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
2859 2006-01-10  Roland McGrath  <roland@redhat.com>
2861         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
2862         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
2863         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
2864         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
2865         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
2866         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
2867         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
2868         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
2869         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
2870         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
2872 2006-01-09  Roland McGrath  <roland@redhat.com>
2874         * tst-initializers1-c89.c: New file.
2875         * tst-initializers1-c99.c: New file.
2876         * tst-initializers1-gnu89.c: New file.
2877         * tst-initializers1-gnu99.c: New file.
2878         * Makefile (tests): Add them.
2879         (CFLAGS-tst-initializers1-c89.c): New variable.
2880         (CFLAGS-tst-initializers1-c99.c): New variable.
2881         (CFLAGS-tst-initializers1-gnu89.c): New variable.
2882         (CFLAGS-tst-initializers1-gnu99.c): New variable.
2884         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2885         Use __extension__ on anonymous union definition.
2886         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2887         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2888         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2889         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2890         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2892 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
2894         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
2895         Don't give the union a name because it changes the mangled name.
2896         Instead name the struct for __data.
2897         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
2898         Likewise.
2899         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
2900         Likewise.
2902 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
2904         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
2905         stack bias to mc_ftp field.
2907 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
2909         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
2910         being too clever and reloading the futex value where it shouldn't.
2912 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
2914         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
2915         correct type.
2917 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
2919         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
2920         Add cfi directives.
2922 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
2924         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
2925         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
2926         rename in tcbhead_t.
2928         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2929         Don't give the union a name because it changes the mangled name.
2930         Instead name the struct for __data.
2931         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2932         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2933         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2934         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2935         * pthread_create.c (start_thread): Adjust robust mutex free loop.
2936         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
2938 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
2940         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
2941         Return status.
2942         (lll_futex_timed_wait): Define.
2943         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2944         * sysdeps/pthread/aio_misc.h: New file.
2946 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
2948         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
2950 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
2952         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2953         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
2954         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2956 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
2958         * tst-cancel24.cc: Use C headers instead of C++ headers.
2960 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
2962         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
2963         sparc-linux configured glibc.
2964         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
2965         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
2966         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
2967         atomic_compare_and_exchange_val_24_acq instead of
2968         atomic_compare_and_exchange_val_acq.
2969         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
2970         instead of atomic_exchange_rel.
2971         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
2972         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
2973         file.
2974         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
2975         file.
2976         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
2977         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
2978         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
2979         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
2980         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
2981         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
2982         New file.
2983         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2984         New file.
2985         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
2986         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
2987         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
2988         file.
2989         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
2990         file.
2991         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
2993 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
2995         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
2996         mutex initializers.
2998 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
3000         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
3001         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3002         THREAD_COPY_POINTER_GUARD): Define.
3003         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
3004         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
3006 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
3008         * version.c: Update copyright year.
3010 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3012         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
3013         .eh_frame section, use cfi_* directives.
3014         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
3016 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
3018         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
3019         now.
3021 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
3023         * sysdeps/pthread/sigaction.c: Removed.
3024         * sigaction.c: New file.
3025         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
3027 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
3029         * Makefile (tests): Add tst-signal7.
3030         * tst-signal7.c: New file.
3032 2005-12-27  Roland McGrath  <roland@redhat.com>
3034         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
3035         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
3036         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
3037         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
3038         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
3039         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3040         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3041         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3042         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3043         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
3044         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3046 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
3048         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
3049         and __prev field to pthread_mutex_t.
3050         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3051         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3052         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3053         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3054         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
3055         to pthread_mutex_t.
3057 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
3059         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
3060         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
3061         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
3062         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
3063         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
3064         and PTHREAD_MUTEXATTR_FLAG_BITS.
3065         * descr.h (struct pthread): Add robust_list field and define
3066         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
3067         * pthread_mutexattr_getrobust.c: New file.
3068         * pthread_mutexattr_setrobust.c: New file.
3069         * pthread_mutex_consistent.c: New file.
3070         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
3071         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
3072         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
3073         Adjust pthread_mutex_t initializers.
3074         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
3075         field to pthread_mutex_t.
3076         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
3077         and __prev field to pthread_mutex_t.
3078         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
3079         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
3080         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
3081         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
3082         * pthread_mutexattr_gettype.c: Likewise.
3083         * pthread_mutexattr_setpshared.c: Likewise.
3084         * pthread_mutexattr_settype.c: Likewise.
3085         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
3086         Initialize mutex kind according to robust flag.
3087         * pthread_mutex_lock.c: Implement local robust mutex.
3088         * pthread_mutex_timedlock.c: Likewise.
3089         * pthread_mutex_trylock.c: Likewise.
3090         * pthread_mutex_unlock.c: Likewise.
3091         * pthread_create.c (start_thread): Mark robust mutexes which remained
3092         locked as dead.
3093         * tst-robust1.c: New file.
3094         * tst-robust2.c: New file.
3095         * tst-robust3.c: New file.
3096         * tst-robust4.c: New file.
3097         * tst-robust5.c: New file.
3098         * tst-robust6.c: New file.
3099         * tst-robust7.c: New file.
3100         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
3101         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
3102         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
3103         tst-robust5, tst-robust6, and tst-robust7.
3105         * tst-typesizes.c: New file.
3106         * Makefile (tests): Add tst-typesizes.
3108         * tst-once3.c: More debug output.
3110 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
3112         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
3113         missing after last change.
3115         * version.c: Update copyright year.
3117 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
3119         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
3120         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
3121         * pthread_mutex_trylock.c: Likewise.
3122         * pthread_mutex_timedlock.c: Likewise.
3123         * pthread_mutex_unlock.c: Likewise.
3125 2005-12-22  Roland McGrath  <roland@redhat.com>
3127         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
3128         so that #include_next's search location is not reset to the -I..
3129         directory where <nptl/...> can be found.
3131 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
3133         [BZ #1913]
3134         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3135         Fix unwind info.  Remove useless branch prediction prefix.
3136         * tst-cancel24.cc: New file.
3137         * Makefile: Add rules to build and run tst-cancel24.
3139 2005-12-21  Roland McGrath  <roland@redhat.com>
3141         * libc-cancellation.c: Use <> rather than "" #includes.
3142         * pt-cleanup.c: Likewise.
3143         * pthread_create.c: Likewise.
3144         * pthread_join.c: Likewise.
3145         * pthread_timedjoin.c: Likewise.
3146         * pthread_tryjoin.c: Likewise.
3147         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
3148         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
3149         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
3150         * unwind.c: Likewise.
3152 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3154         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
3155         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
3156         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3157         THREAD_COPY_POINTER_GUARD): Define.
3159 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
3161         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
3162         rather than one.
3163         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3164         THREAD_COPY_POINTER_GUARD): Define.
3165         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
3166         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
3167         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3168         THREAD_COPY_POINTER_GUARD): Define.
3169         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
3170         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
3171         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
3172         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
3173         Use PTR_DEMANGLE for B0 if defined.
3175 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
3177         * pthread_create.c (__pthread_create_2_1): Use
3178         THREAD_COPY_POINTER_GUARD if available.
3179         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
3180         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3181         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
3182         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
3183         * sysdeps/x86_64/tls.h: Likewise.
3185 2005-12-15  Roland McGrath  <roland@redhat.com>
3187         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
3189 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
3191         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
3192         sysdeps/generic.
3193         * errno-loc.c: New file.
3195 2005-12-12  Roland McGrath  <roland@redhat.com>
3197         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
3198         adjustments before choosing stack size.  Update minimum stack size
3199         calculation to match allocate_stack change.
3201 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
3203         * allocatestack.c (allocate_stack): Don't demand that there is an
3204         additional full page available on the stack beside guard, TLS, the
3205         minimum stack.
3207 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
3209         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3210         (__cleanup_fct_attribute): Use __regparm__ not regparm.
3212         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
3213         compiling 32-bit code we must define __cleanup_fct_attribute.
3215 005-11-24  Jakub Jelinek  <jakub@redhat.com>
3217         [BZ #1920]
3218         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
3219         __attribute__ instead of __attribute.
3220         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3221         (__cleanup_fct_attribute): Likewise.
3223 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
3225         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
3226         a write barrier before writing libgcc_s_getcfa.
3228 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
3230         * sysdeps/unix/sysv/linux/configure: Removed.
3232 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
3234         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
3235         optional init_array/fini_array support.
3237 2005-10-24  Roland McGrath  <roland@redhat.com>
3239         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
3240         versioned_symbol use.
3242 2005-10-16  Roland McGrath  <roland@redhat.com>
3244         * init.c (__pthread_initialize_minimal_internal): Even when using a
3245         compile-time default stack size, apply the minimum that allocate_stack
3246         will require, and round up to page size.
3248 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
3250         * Makefile ($(test-modules)): Remove static pattern rule.
3252 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
3253             Ulrich Drepper  <drepper@redhat.com>
3255         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
3256         alignment in callback function.
3257         * Makefile: Add rules to build and run tst-align3.
3258         * tst-align3.c: New file.
3260 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
3262         * allocatestack.c (setxid_signal_thread): Add
3263         INTERNAL_SYSCALL_DECL (err).
3265 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
3267         * allocatestack.c (setxid_signal_thread): Need to use
3268         atomic_compare_and_exchange_bool_acq.
3270 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
3271             Jakub Jelinek  <jakub@redhat.com>
3273         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
3274         CANCEL_RESTMASK.
3275         (struct pthread): Move specific_used field to avoid padding.
3276         Add setxid_futex field.
3277         * init.c (sighandler_setxid): Reset setxid flag and release the
3278         setxid futex.
3279         * allocatestack.c (setxid_signal_thread): New function.  Broken
3280         out of the bodies of the two loops in __nptl_setxid.  For undetached
3281         threads check whether they are exiting and if yes, don't send a signal.
3282         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
3283         * pthread_create.c (start_thread): For undetached threads, check
3284         whether setxid bit is set.  If yes, wait until signal has been
3285         processed.
3287         * allocatestack.c (STACK_VARIABLES): Initialize them.
3288         * pthread_create.c (__pthread_create_2_1): Initialize pd.
3290 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
3292         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
3293         waiters, awake all waiters on the associated mutex.
3295 2005-09-22  Roland McGrath  <roland@redhat.com>
3297         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
3298         ../sysdeps/x86_64/hp-timing.h).
3300 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
3302         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
3303         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3304         (lll_futex_wake_unlock): Define.
3305         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
3306         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3307         (lll_futex_wake_unlock): Define.
3308         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
3309         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3310         (lll_futex_wake_unlock): Define.
3311         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
3312         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3313         (lll_futex_wake_unlock): Define.
3314         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
3315         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3316         (lll_futex_wake_unlock): Define.
3317         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
3318         lll_futex_wake_unlock.
3319         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3320         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3321         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3322         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
3323         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3324         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3326 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3328         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
3329         Fix typo in register name.
3331 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
3333         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3334         Use __sigfillset.  Document that sigfillset does the right thing wrt
3335         to SIGSETXID.
3337 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3339         [BZ #1102]
3340         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
3341         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
3342         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
3343         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
3344         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
3345         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
3346         in the structure.
3347         * Makefile (tests): Add tst-initializers1.
3348         (CFLAGS-tst-initializers1.c): Set.
3349         * tst-initializers1.c: New test.
3351 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3353         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
3354         Make sure __flags are located at offset 48 from the start of the
3355         structure.
3357 2005-07-02  Roland McGrath  <roland@redhat.com>
3359         * Makeconfig: Comment fix.
3361 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
3363         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
3364         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
3365         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
3366         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
3367         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3368         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3369         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
3370         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
3371         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
3372         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3374 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
3376         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
3377         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3378         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
3379         fields.
3380         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3381         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
3382         field.  Put in sysinfo field unconditionally.
3383         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3384         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
3385         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3386         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
3387         fields.
3388         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3389         * pthread_create.c (__pthread_create_2_1): Use
3390         THREAD_COPY_STACK_GUARD macro.
3391         * Makefile: Add rules to build and run tst-stackguard1{,-static}
3392         tests.
3393         * tst-stackguard1.c: New file.
3394         * tst-stackguard1-static.c: New file.
3396 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
3398         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
3399         Invoke CGOTSETUP and CGOTRESTORE.
3400         (CGOTSETUP, CGOTRESTORE): Define.
3402 2005-05-29  Richard Henderson  <rth@redhat.com>
3404         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
3405         (tf_write, tf_writev): Use it.
3406         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
3407         the system minimum.
3409 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
3411         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3412         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
3413         __librt_*_asynccancel@local.
3415 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
3417         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
3418         all occurrences of JUMPTARGET.  Instead append @local to labels.
3420 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
3422         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
3423         size/alignment of struct pthread rather than tcbhead_t.
3424         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3425         Likewise.
3426         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3427         Likewise.
3428         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3429         Likewise.
3431 2005-05-19  Richard Henderson  <rth@redhat.com>
3433         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
3434         __sync_val_compare_and_swap, not explicit _si variant.
3435         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
3437 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
3439         [BZ #915]
3440         * sysdeps/pthread/pthread.h: Avoid empty initializers.
3442 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
3444         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
3445         .eh_frame section, use cfi_* directives.
3447 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
3449         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
3450         of "" includes.
3452 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
3454         [BZ #1075]
3455         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
3456         aio_write blocks.
3458 2005-04-27  Roland McGrath  <roland@redhat.com>
3460         * Makefile (tests): Remove tst-clock2.
3462         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
3463         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
3464         translating to the kernel clockid_t for our own process/thread clock.
3466         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
3468 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
3470         * old_pthread_cond_init.c: Include <errno.h>.
3471         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
3472         process shared or uses clock other than CLOCK_REALTIME.
3473         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
3475 2005-04-13  David S. Miller  <davem@davemloft.net>
3477         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
3478         * sysdeps/sparc/sparc64/clone.S: New file.
3480 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
3482         [BZ #1102]
3483         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
3484         __inline instead of inline.
3485         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
3487 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
3489         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
3490         functionally equivalent, but shorter instructions.
3491         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
3492         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3493         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
3494         Likewise.
3495         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
3496         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3497         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3498         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3499         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3500         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
3501         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3502         Likewise.
3503         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3504         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
3505         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3506         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
3507         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3509 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
3511         * sysdeps/mips/Makefile: New file.
3512         * sysdeps/mips/nptl-sysdep.S: New file.
3513         * sysdeps/mips/tcb-offsets.sym: New file.
3514         * sysdeps/mips/pthread_spin_lock.S: New file.
3515         * sysdeps/mips/pthread_spin_trylock.S: New file.
3516         * sysdeps/mips/pthreaddef.h: New file.
3517         * sysdeps/mips/tls.h: New file.
3518         * sysdeps/mips/jmpbuf-unwind.h: New file.
3519         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
3520         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
3521         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
3522         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
3523         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
3524         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
3525         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
3526         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
3527         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
3528         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
3530 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
3532         [BZ #1112]
3533         * pthread_create.c (__pthread_create_2_1): Rename syscall error
3534         variable to scerr.
3536 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
3538         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
3540 2005-02-25  Roland McGrath  <roland@redhat.com>
3542         * alloca_cutoff.c: Correct license text.
3543         * tst-unload.c: Likewise.
3544         * sysdeps/pthread/allocalim.h: Likewise.
3545         * sysdeps/pthread/pt-initfini.c: Likewise.
3546         * sysdeps/pthread/bits/libc-lock.h: Likewise.
3547         * sysdeps/pthread/bits/sigthread.h: Likewise.
3548         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
3549         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
3551 2005-02-16  Roland McGrath  <roland@redhat.com>
3553         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
3554         Use unsigned int * for ptr_nthreads.
3556 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
3558         [BZ #721]
3559         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
3560         gcc4.
3562 2005-02-07  Richard Henderson  <rth@redhat.com>
3564         [BZ #787]
3565         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
3566         argument.
3568 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
3570         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
3571         order of arguments in invocation of atomic_add_zero.
3573 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
3575         [BZ #737]
3576         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
3577         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
3578         at least gotntpoff relocation and addition.
3579         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
3580         Likewise.
3581         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
3582         Likewise.
3583         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3584         Likewise.
3586 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
3588         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
3589         entry for static tls deallocation fix.
3590         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
3591         also contains information whether the memory pointed to is static
3592         TLS or not.
3593         * sysdeps/i386/tls.h: Likewise.
3594         * sysdeps/ia64/tls.h: Likewise.
3595         * sysdeps/powerpc/tls.h: Likewise.
3596         * sysdeps/s390/tls.h: Likewise.
3597         * sysdeps/sh/tls.h: Likewise.
3598         * sysdeps/sparc/tls.h: Likewise.
3599         * sysdeps/x86_64/tls.h: Likewise.
3601 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
3603         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
3605 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
3607         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
3608         %esp.
3609         * Makefile (tests): Add tst-align2.
3610         * tst-align2.c: New test.
3611         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
3612         -mpreferred-stack-boundary=4.
3614 2004-12-18  Roland McGrath  <roland@redhat.com>
3616         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
3617         New file removed withdrawn for the moment.
3619 2004-12-17  Richard Henderson  <rth@redhat.com>
3621         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
3622         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
3624 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
3626         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
3627         Increased PTHREAD_STACK_MIN.
3629         * tst-context1.c (stacks): Use bigger stack size.
3631 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
3633         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
3634         * sysdeps/sparc/tcb-offsets.sym: Add TID.
3636 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
3638         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
3639         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
3640         * sysdeps/s390/tcb-offsets.sym (TID): Add.
3642 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
3644         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
3646 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
3648         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
3649         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
3651         * tst-getpid1.c: If child crashes, report this first.  Print which
3652         signal.
3654 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
3656         * init.c (__pthread_initialize_minimal_internal): Also unblock
3657         SIGSETXID.
3659 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
3661         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
3662         _POSIX_THREAD_CPUTIME): Define to 0.
3663         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
3664         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
3665         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
3666         __timer_signal_thread_tclk): Remove.
3667         (init_module): Remove their initialization.
3668         (thread_cleanup): Remove their cleanup assertions.
3669         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
3670         __timer_signal_thread_tclk): Remove.
3671         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
3672         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
3673         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
3675 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
3677         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
3678         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
3680         * Makefile (tests): Add tst-getpid2.
3681         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
3682         (do_test): Use it.  Use __clone2 instead of clone on ia64.
3683         * tst-getpid2.c: New test.
3685 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3687         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
3689 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
3691         * Makefile (tests): Add tst-getpid1.
3692         * tst-getpid1.c: New file.
3693         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
3694         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
3696 2004-12-02  Roland McGrath  <roland@redhat.com>
3698         * Makefile (libpthread-nonshared): Variable removed.
3699         ($(objpfx)libpthread_nonshared.a): Target removed.
3700         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
3701         These are now handled by generic magic from
3702         libpthread-static-only-routines being set.
3704 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
3706         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
3707         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
3708         _POSIX_THREAD_PRIO_PROTECT): Define.
3709         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3710         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3711         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3713 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
3715         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
3716         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
3717         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
3718         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
3719         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3720         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3721         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3723 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
3725         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
3727         * Makefile (libpthread-routines): Add pthread_setschedprio.
3728         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
3729         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
3730         * pthread_setschedprio.c: New file.
3732 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
3734         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
3735         * pthread_cancel.c (pthread_create): Likewise.
3737         * Makefile (libpthread-routines): Add vars.
3738         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
3739         * init.c (__default_stacksize, __is_smp): Remove.
3740         * vars.c: New file.
3741         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
3742         and define a wrapper macro.
3743         (PTHREAD_STATIC_FN_REQUIRE): Define.
3744         * allocatestack.c (__find_thread_by_id): Undefine.
3745         * pthread_create (__pthread_keys): Remove.
3746         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
3747         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
3748         PTHREAD_STATIC_FN_REQUIRE.
3750 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3752         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
3753         parameter to REGISTER macro.
3755 2004-11-17  Roland McGrath  <roland@redhat.com>
3757         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
3758         Make sure SIGCANCEL is blocked as well.
3760 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3762         * sysdeps/pthread/setxid.h: New file.
3763         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
3764         (struct xid_command): Add forward decl.
3765         (struct pthread_functions): Change return type of __nptl_setxid hook
3766         to int.
3767         * pthreadP.h (__nptl_setxid): Change return type to int.
3768         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
3769         calling thread, return its return value and set errno on failure.
3770         * descr.h (struct xid_command): Change id type to long array.
3772         * Makefile: Add rules to build and test tst-setuid1 and
3773         tst-setuid1-static.
3774         * tst-setuid1.c: New test.
3775         * tst-setuid1-static.c: New test.
3777 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3779         * Makefile (tests): Add tst-exit3.
3780         * tst-exit3.c: New test.
3782 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
3784         * Makefile (tests): Add tst-exit2.
3785         * tst-exit2.c: New file.
3787 2004-11-09  Roland McGrath  <roland@redhat.com>
3789         [BZ #530]
3790         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
3791         here, before calling clone.
3792         * pthread_create.c (start_thread): Don't do it here.
3794 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
3796         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
3798 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
3800         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
3801         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
3802         assembler warning.
3804 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
3806         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
3807         if sched_priority is not between minprio and maxprio.
3809 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3811         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
3812         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
3814         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3815         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
3817 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
3819         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
3820         not-cancelable I/O functions.
3822 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3824         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3825         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3826         make sure 2 is stored in the futex and we looked at the old value.
3827         Fix a few other problems to return the correct value.
3829 2004-10-14  Richard Henderson  <rth@redhat.com>
3831         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
3832         make gcc4 happy.
3834 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
3836         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
3837         of pthread-functions.h and pthreaddef.h.
3838         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
3840         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
3841         Change __data.__nwaiters from int to unsigned int.
3843         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
3844         sysconf (_SC_THREAD_CPUTIME) returns negative value.
3846         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
3847         before return type.
3849         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
3850         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
3852 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
3854         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
3855         test fails, remove message queue.
3856         (tf_msgsnd): Likewise.
3858 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3860         * tst-clock1.c: Change #ifdef to #if defined.
3861         * tst-clock2.c: Likewise.
3862         * tst-cond11.c: Likewise.
3864         * sysdeps/pthread/timer_create.c (timer_create): Use
3865         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
3866         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
3867         THREAD_CPUTIME.
3869 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3871         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
3872         _POSIX_THREAD_CPUTIME): Define to 0.
3874 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
3876         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
3877         and _POSIX_THREAD_CPUTIME to zero.
3878         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3879         * tst-barrier2.c: Fix testing for POSIX feature.
3880         * tst-clock1.c: Likewise.
3881         * tst-clock2.c: Likewise.
3882         * tst-cond11.c: Likewise.
3883         * tst-cond4.c: Likewise.
3884         * tst-cond6.c: Likewise.
3885         * tst-flock2.c: Likewise.
3886         * tst-mutex4.c: Likewise.
3887         * tst-mutex9.c: Likewise.
3888         * tst-rwlock12.c: Likewise.
3889         * tst-rwlock4.c: Likewise.
3890         * tst-signal1.c: Likewise.
3891         * tst-spin2.c: Likewise.
3892         * sysdeps/pthread/posix-timer.h: Likewise.
3893         * sysdeps/pthread/timer_create.c: Likewise.
3894         * sysdeps/pthread/timer_routines.c: Likewise.
3896 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
3898         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3899         (__lll_mutex_timedlock_wait): Address futex correctly.
3901         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
3902         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3903         make sure 2 is stored in the futex and we looked at the old value.
3904         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3905         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
3906         which might very well made the code not working at all before.
3907         [BZ #417]
3909 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
3911         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
3912         allow SIGSETXID to be sent.
3913         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
3914         for SIGSETXID to be defined.
3915         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
3916         SIGSETXID cannot be blocked.
3918         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3919         Add __extension__ to long long types.
3920         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3921         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3922         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3923         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3924         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
3925         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3926         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3928 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
3930         * descr.h (struct pthread): Add stopped_start field.
3931         * sysdeps/pthread/createthread.c (create_thread): Set
3932         start_stopped flag in descriptor for new thread appropriately.
3933         * pthread_create.c (start_thread): Only take lock to be stopped on
3934         startup if stopped_start flag says so.
3936 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
3938         * pthread_create.c (__pthread_create_2_1): Remember whether thread
3939         is created detached and if yes, do not try to free the stack in case
3940         the thread creation failed.
3941         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
3942         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
3943         case there has been no error.  [BZ #405]
3945         * pthread_create.c (start_thread): Don't wait for scheduler data
3946         etc to be set at the beginning of the function.  The cancellation
3947         infrastructure must have been set up.  And enable async
3948         cancellation before potentially going to sleep.  [BZ #401]
3950 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
3952         * Versions: Remove exports for pthread_set*id_np functions.
3953         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
3954         for now.
3955         * Makefile: Don't build pthread_set*id code for now.
3957 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
3959         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
3960         internal use.
3961         * allocatestack.c (__nptl_setxid): New function.
3962         * descr.h (struct xid_command): Define type.
3963         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
3964         (sighandler_setxid): New function.
3965         (__pthread_initialize_minimal): Register sighandler_setxid for
3966         SIGCANCEL.
3967         * pt-allocrtsig.c: Update comment.
3968         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
3969         Declare __nptl_setxid.
3970         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
3971         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
3972         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
3973         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
3974         and pthread_setresuid_np.
3975         * pthread_setgid_np.c: New file.
3976         * pthread_setuid_np.c: New file.
3977         * pthread_setegid_np.c: New file.
3978         * pthread_seteuid_np.c: New file.
3979         * pthread_setregid_np.c: New file.
3980         * pthread_setreuid_np.c: New file.
3981         * pthread_setresgid_np.c: New file.
3982         * pthread_setresuid_np.c: New file.
3983         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
3984         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
3985         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
3986         and pthread_setresuid_np.
3987         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
3988         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
3989         pthread_setregid, and pthread_setresgid.
3991 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
3993         * allocatestack.c (allocate_stack): Return EAGAIN instead of
3994         ENOMEM when out of memory.
3996 2004-09-10  Roland McGrath  <roland@redhat.com>
3998         [BZ #379]
3999         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
4000         code, since we don't try to use the broken CLONE_STOPPED any more.
4001         * pthread_create.c (start_thread): Likewise.
4003 2004-09-15  Richard Henderson  <rth@redhat.com>
4005         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
4007 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
4009         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
4010         (__libc_unwind_longjmp): Delete macro and declare as function.
4011         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
4012         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
4013         nptl directory.
4014         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
4015         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
4016         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
4018 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
4020         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
4021         for __USE_XOPEN2K.
4022         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
4023         types also for __USE_XOPEN2K.
4024         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4025         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4026         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4027         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4028         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4029         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4030         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4031         [BZ #320]
4033 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
4035         * sysdeps/pthread/pthread.h
4036         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
4037         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
4038         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
4039         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
4040         [BZ #375]
4042 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
4044         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
4045         PSEUDO to be used with . prefix.
4047         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
4048         Use atomic_increment instead of atomic_exchange_and_add.
4049         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
4050         Likewise.
4051         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
4052         Likewise.
4053         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
4054         Likewise.
4056         * allocatestack.c (allocate_stack): Use atomic_increment_val
4057         instead of atomic_exchange_and_add.
4058         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
4059         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
4060         Likewise.
4061         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4062         Likewise.
4064         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
4065         the initialization function might throw.
4067 2005-09-05  Richard Henderson  <rth@redhat.com>
4069         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
4070         Move definition inside libpthread, libc, librt check.  Provide
4071         definition for rtld.
4073 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
4075         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
4076         * sysdeps/i386/jmpbuf-unwind.h: Likewise
4077         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
4078         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
4079         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
4080         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
4081         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
4082         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
4083         * unwind.c: Use it.
4085         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4086         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
4087         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4088         Likewise.
4089         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4090         Decrement __nwaiters.  If pthread_cond_destroy has been called and
4091         this is the last waiter, signal pthread_cond_destroy caller and
4092         avoid using the pthread_cond_t structure after unlock.
4093         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4094         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4095         Read clock type from the least significant bits of __nwaiters instead
4096         of __clock.
4097         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4098         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
4100 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
4102         [BZ #342]
4103         * Makefile (tests): Add tst-cond20 and tst-cond21.
4104         * tst-cond20.c: New test.
4105         * tst-cond21.c: New test.
4106         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
4107         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
4108         it unsigned int.
4109         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4110         Likewise.
4111         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4112         (pthread_cond_t): Likewise.
4113         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4114         Likewise.
4115         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4116         Likewise.
4117         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4118         Likewise.
4119         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
4120         (cond_nwaiters): New.
4121         (clock_bits): New.
4122         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
4123         if there are waiters not signalled yet.
4124         Wait until all already signalled waiters wake up.
4125         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
4126         __nwaiters.  If pthread_cond_destroy has been called and this is the
4127         last waiter, signal pthread_cond_destroy caller and avoid using
4128         the pthread_cond_t structure after unlock.
4129         (__pthread_cond_wait): Increment __nwaiters in the beginning,
4130         decrement it when leaving.  If pthread_cond_destroy has been called
4131         and this is the last waiter, signal pthread_cond_destroy caller.
4132         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4133         Likewise.  Read clock type from the least significant bits of
4134         __nwaiters instead of __clock.
4135         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
4136         whether clock ID can be encoded in COND_CLOCK_BITS bits.
4137         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
4138         clock type just from the last COND_CLOCK_BITS bits of value.
4139         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
4140         instead of __clock, just from second bit of condattr's value.
4142 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
4144         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
4145         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
4146         != 64.
4147         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4149 2004-08-15  Roland McGrath  <roland@frob.com>
4151         * pthread_atfork.c: Update copyright terms including special exception
4152         for these trivial files, which are statically linked into executables
4153         that use dynamic linking for the significant library code.
4155 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
4157         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
4158         pthread_rwlock_rdlock.
4159         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
4160         Decrease __nr_readers_queued after reacquiring lock.
4161         * sysdeps/pthread/pthread_rwlock_timedrdlock
4162         (pthread_rwlock_timedrdlock): Likewise.
4163         Reported by Bob Cook <bobcook47@hotmail.com>.
4165 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
4167         * tst-rwlock14.c (tf): Read main thread handle from *ARG
4168         before pthread_barrier_wait.
4170 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
4172         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
4173         Remove unnecessary exception handling data.
4175 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
4177         [BZ #284]
4178         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
4179         instead of clockid_t.
4181 2004-07-21  Roland McGrath  <roland@redhat.com>
4183         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
4185 2004-07-19  Roland McGrath  <roland@redhat.com>
4187         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
4189 2004-07-02  Roland McGrath  <roland@redhat.com>
4191         * configure: Don't exit.
4193 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4195         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4196         (__pthread_cond_timedwait): Check for invalid nanosecond in
4197         timeout value.
4199 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
4201         * Makefile: Add rules to build and run tst-fini1.
4202         * tst-fini1.c: New file.
4203         * tst-fini1mod.c: New file.
4205 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
4207         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
4208         if no cancellation support is needed.
4209         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
4210         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
4211         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4212         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
4213         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
4214         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
4215         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
4216         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
4217         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
4219         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
4220         only if not already defined.
4222 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
4224         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
4225         constraint "m" instead of "0" for futex.
4227         * shlib-versions: Add powerpc64-.*-linux.*.
4229 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
4231         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
4232         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
4233         for valid tv_nsec.
4234         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
4235         1 billion and 64-bit tv_nsec which is valid when truncated to 32
4236         bits.
4238 2004-06-29  Roland McGrath  <roland@redhat.com>
4240         * Banner: NPTL no longer has its own version number.
4241         * Makefile (nptl-version): Variable removed.
4242         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
4243         using $(version), the glibc version number.
4245 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4247         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4248         Fix branch offset for a PLT entry.
4249         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
4250         Likewise.
4251         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
4252         Likewise.
4253         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
4254         Likewise.
4255         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
4256         Likewise.
4258 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4260         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
4261         unconditionally.
4263 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4265         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
4266         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
4267         instead of tv_sec.
4268         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
4269         (pthread_rwlock_timedrdlock): Likewise.
4271 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
4273         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4274         Set __r7 to val, not mutex.
4276 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
4278         * Makefile: Add rules to build tst-rwlock14.
4279         * tst-rwlock14.c: New file.
4281 2004-06-24  Boris Hu  <boris.hu@intel.com>
4283         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
4284         check.
4285         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
4287 2004-06-19  Andreas Jaeger  <aj@suse.de>
4289         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
4290         assembler in last patch.
4292 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
4294         * sysdeps/pthread/pthread_cond_timedwait.c
4295         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
4296         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4297         (__pthread_cond_timedwait): Check for invalid nanosecond in
4298         timeout value.
4299         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4300         * tst-cond19.c: New file.
4301         * Makefile: Add rules to build and run tst-cond19.
4303 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
4305         * tst-context1.c (GUARD_PATTERN): Defined.
4306         (tst_context_t): Define struct containing ucontext_t & guard words.
4307         (ctx): Declare as an array of tst_context_t.
4308         (fct): Verify uc_link & guard words are still valid.
4309         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
4311 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4313         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4314         Add __data.__futex field, reshuffle __data.__clock.
4315         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
4316         (__pthread_cond_signal): Increment __futex at the same time as
4317         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4318         address of low 32-bits of __wakeup_seq to futex syscall.
4319         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4320         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4321         releasing internal lock to FUTEX_WAIT.
4322         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4323         (__pthread_cond_timedwait): Likewise.
4324         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4325         (FUTEX_CMP_REQUEUE): Define.
4326         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4327         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4328         Pass __futex value from before the unlock and __futex address instead
4329         of address of low 32-bits of __wakeup_seq to futex syscall.
4330         Fallback to FUTEX_WAKE all on any errors.
4332 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
4334         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
4335         comment typo.
4336         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
4337         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
4338         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
4339         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
4340         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
4342 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4344         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
4345         Add memory clobber to inline assembly.
4346         (__lll_mutex_trylock): Likewise.
4347         (__lll_mutex_cond_trylock): Likewise.
4349 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4351         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4352         Pass val argument as 6th system call argument in %r7.
4354 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4356         * Makefile (tests): Add tst-cond16.
4357         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
4358         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
4359         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4360         Add __data.__futex field, reshuffle __data.__clock.
4361         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
4362         (__pthread_cond_signal): Increment __futex at the same time as
4363         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4364         address of low 32-bits of __wakeup_seq to futex syscall.
4365         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
4366         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4367         releasing internal lock to FUTEX_WAIT.
4368         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
4369         (__pthread_cond_timedwait): Likewise.
4370         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
4371         (FUTEX_CMP_REQUEUE): Define.
4372         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4373         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4374         Pass __futex value from before the unlock and __futex address instead
4375         of address of low 32-bits of __wakeup_seq to futex syscall.
4376         Fallback to FUTEX_WAKE all on any errors.
4377         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
4378         Define.
4379         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4380         internally.  Return non-zero if error, zero if success.
4381         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4382         Add __data.__futex field, reshuffle __data.__clock.
4383         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
4384         Define.
4385         (lll_futex_requeue): Add val argument, return 1 unconditionally
4386         for the time being.
4387         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4388         Add __data.__futex field, reshuffle __data.__clock.
4389         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4390         Define.
4391         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4392         internally.  Return non-zero if error, zero if success.
4393         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4394         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
4395         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4396         Define.
4397         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4398         internally.  Return non-zero if error, zero if success.
4399         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4400         Add __data.__futex field, reshuffle __data.__clock.
4401         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
4402         Define.
4403         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4404         internally.  Return non-zero if error, zero if success.
4405         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4406         Add __data.__futex field, reshuffle __data.__clock.
4407         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4408         Add __data.__futex field, reshuffle __data.__clock.
4409         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
4410         Increment __futex at the same time as __wakeup_seq or __total_seq.
4411         Pass address of __futex instead of address of low 32-bits of
4412         __wakeup_seq to futex syscall.
4413         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4414         Pass __futex value from before releasing internal lock
4415         to FUTEX_WAIT.
4416         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4417         Likewise.  Avoid unnecessary shadowing of variables.
4418         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
4419         Set __futex to 2 * __total_seq.  Pass __futex value from before the
4420         unlock and __futex address instead of address of low 32-bits of
4421         __wakeup_seq to futex_requeue macro, adjust for new return value
4422         meaning.
4423         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
4424         (__pthread_cond_signal): Increment __futex at the same time as
4425         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4426         address of low 32-bits of __wakeup_seq to futex syscall.
4427         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
4428         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4429         releasing internal lock to FUTEX_WAIT.
4430         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4431         (__pthread_cond_timedwait): Likewise.
4432         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4433         (FUTEX_CMP_REQUEUE): Define.
4434         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4435         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4436         Pass __futex value from before the unlock and __futex address instead
4437         of address of low 32-bits of __wakeup_seq to futex syscall.
4438         Fallback to FUTEX_WAKE all on any errors.
4440 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4442         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
4443         Add nop to align the end of critical section.
4444         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
4446 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4448         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4449         Add __broadcast_seq field.
4450         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
4451         all waiters as woken with woken_seq and bump broadcast counter.
4452         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
4453         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
4454         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4455         Comment typo fixes.  Avoid returning -ETIMEDOUT.
4457 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
4459         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4460         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
4461         Reported by Kaz Kojima.
4463 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
4465         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
4467 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4469         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
4470         __broadcast_seq with bc_seq after acquiring internal lock instead of
4471         before it.
4473 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
4475         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
4476         compilation.
4477         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4478         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
4479         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4480         (pthread_cond_t): Add __data.__broadcast_seq field.
4481         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4482         (FRAME_SIZE): Define.
4483         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
4484         Comment typo fixes.
4485         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
4486         Define.
4487         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
4488         typo fixes.
4489         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4490         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
4491         fixes.
4493 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
4495         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
4496         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4497         Add __broadcast_seq field.
4498         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4499         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4500         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4501         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4502         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4503         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
4504         all waiters as woken with woken_seq and bump broadcast counter.
4505         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
4506         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
4507         __broadcast_seq field.
4508         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4509         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4510         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
4511         * pthread_cond_init.c: Initialize __broadcast_seq field.
4512         * Makefile (tests): Add tst-cond17 and tst-cond18.
4513         Add .NOTPARALLEL goal.
4514         * tst-cond16.c: New file.  From Jakub.
4515         * tst-cond17.c: New file.  From Jakub.
4516         * tst-cond18.c: New file.  From Jakub.
4518 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
4520         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
4521         unwind info.
4523         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4524         Parametrize frame size.  Correct some unwind info.
4525         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4527 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4529         * tst-stack3.c: Note testing functionality beyond POSIX.
4531 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4533         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
4534         Change conditional from ifdef to if.
4536 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
4538         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
4539         SYSDEP_CANCEL_ERROR): Define.
4540         (PSEUDO): Use it.
4542 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
4544         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
4546 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
4548         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
4550 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4552         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
4553         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4554         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
4555         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4557 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
4559         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
4560         thread has all signals blocked.
4562 2004-04-18  Andreas Jaeger  <aj@suse.de>
4564         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
4565         (SEM_VALUE_MAX): Add missing brace.
4567 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4569         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
4570         in rt subdir.
4571         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
4572         * sysdeps/pthread/tst-mqueue8x.c: New test.
4573         * tst-cancel4.c: Update comment about message queues.
4575         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
4576         return it_value { 0, 0 }.
4577         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
4578         like SIGEV_SIGNAL.
4579         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
4580         assertion for SIGEV_NONE.
4581         (thread_attr_compare): Compare all attributes, not just a partial
4582         subset.
4584 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4586         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
4588 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
4590         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
4591         Just use a plain number.
4592         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
4593         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
4594         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
4595         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
4596         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
4597         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
4598         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4600 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4602         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
4603         frame info.
4604         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4606 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
4608         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
4609         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
4610         of calling sigwaitinfo.
4612 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
4614         * allocatestack.c (allocate_stack): Set reported_guardsize
4615         unconditionally.
4616         * pthread_getattr_np.c (pthread_getattr_np): Use
4617         reported_guardsize instead of guardsize.
4618         * descr.h (struct pthread): Add reported_guardsize field.
4620 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
4622         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
4624 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
4626         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
4628 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
4630         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
4631         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
4632         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
4633         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
4634         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
4635         Define.
4636         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
4637         (_POSIX_MESSAGE_PASSING): Define.
4638         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
4639         (_POSIX_MESSAGE_PASSING): Define.
4640         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
4641         (_POSIX_MESSAGE_PASSING): Define.
4643 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
4645         * tst-context1.c (fct): Check whether correct stack is used.
4647 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
4649         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
4650         matching constraints for asm mem parameters.
4652         * tst-clock2.c (tf): Don't define unless needed.
4654 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
4656         * Makefile (link-libc-static): Use $(static-gnulib) instead of
4657         $(gnulib).
4659 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
4661         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
4662         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
4663         * pthreadP.h: Declare __nptl_deallocate_tsd.
4664         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
4665         Adjust caller.
4667         * Makefile (tests): Add tst-tsd5.
4668         * tst-tsd5.c: New file.
4670 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
4672         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4673         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
4674         is SHLIB_COMPAT check.
4675         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
4676         (__pthread_attr_getaffinity_old): Likewise.
4677         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4678         (__pthread_getaffinity_old): Likewise.
4679         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4680         (__pthread_setaffinity_old): Likewise.
4682 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
4684         * allocatestack.c (_make_stacks_executable): Call
4685         _dl_make_stack_executable first.
4687 2004-03-24  Roland McGrath  <roland@redhat.com>
4689         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
4690         constraint instead of "0".
4692 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
4694         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4695         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
4697         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
4698         code to avoid warning.
4700 2004-03-24  Andreas Jaeger  <aj@suse.de>
4702         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4703         (__pthread_attr_setaffinity_old): Remove const.
4705 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
4707         * sysdeps/unix/sysv/linux/smp.h: New file.
4708         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
4709         * init.c: Define __is_smp.
4710         (__pthread_initialize_minimal_internal): Call is_smp_system to
4711         initialize __is_smp.
4712         * pthreadP.h: Declare __is_smp.
4713         Define MAX_ADAPTIVE_COUNT is necessary.
4714         * pthread_mutex_init.c: Add comment regarding __spins field.
4715         * pthread_mutex_lock.c: Implement adaptive mutex type.
4716         * pthread_mutex_timedlock.c: Likewise.
4717         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
4718         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
4719         Add __spins field.
4720         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4721         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4722         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4723         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4724         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4725         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4726         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4727         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
4728         lll_mutex_cond_trylock.
4729         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4730         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4731         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4732         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4733         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4734         Define BUSY_WAIT_NOP.
4735         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4736         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4738         * tst-mutex5.c: Add support for testing adaptive mutexes.
4739         * tst-mutex7.c: Likewise.
4740         * tst-mutex5a.c: New file.
4741         * tst-mutex7a.c: New file.
4742         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
4744         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4745         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
4746         vgettimeofday call might destroy the content.
4748         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
4749         @pause in the loop.
4751         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4752         No need to restrict type of ret.  Make it int.  Add comment.
4754         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4755         Remove unnecessary setne instruction.
4757 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
4759         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4760         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
4761         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
4762         If realloc fails, break out of the loop.
4764 2004-03-20  Andreas Jaeger  <aj@suse.de>
4766         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4767         (__pthread_setaffinity_old): Fix interface.
4768         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4769         (__pthread_getaffinity_old): Likewise.
4771         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4772         (__pthread_setaffinity_new): Remove duplicate declaration.
4774 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4776         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
4777         the return value to a safe register.
4778         (CDISABLE): Set the function argument correctly.
4780 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4782         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
4783         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
4784         Rewrite so that only one locked memory operation per round is needed.
4785         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
4786         (pthread_barrier_wait): After wakeup, release lock only when the
4787         last thread stopped using the barrier object.
4788         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4789         (__pthread_cond_wait): Don't store mutex address if the current
4790         value is ~0l.  Add correct cleanup support and unwind info.
4791         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4792         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4793         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
4794         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
4795         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4796         Add correct cleanup support and unwind info.
4797         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
4798         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
4799         information for syscall wrappers.
4801 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
4803         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
4804         cpusetsize field, remove next.
4805         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
4806         parameter for size of the CPU set.
4807         (pthread_setaffinity_np): Likewise.
4808         (pthread_attr_getaffinity_np): Likewise.
4809         (pthread_attr_setaffinity_np): Likewise.
4810         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
4811         interface change, keep compatibility code.
4812         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
4813         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
4814         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
4815         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
4816         __pthread_getaffinity_np.
4817         * Versions: Add version for changed interfaces.
4818         * tst-attr3.c: Adjust test for interface change.
4819         * pthread_getattr_np.c: Query the kernel about the affinity mask with
4820         increasing buffer sizes.
4821         * pthread_attr_destroy.c: Remove unused list handling.
4822         * pthread_attr_init.c: Likewise.
4824 2004-03-17  Roland McGrath  <roland@redhat.com>
4826         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
4827         first argument to clock_getres so we ever enable kernel timers.
4829 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
4831         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
4833 2004-03-12  Richard Henderson  <rth@redhat.com>
4835         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
4836         oldvalue from CENABLE to CDISABLE.
4838 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
4840         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
4841         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
4842         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
4843         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
4845 2004-03-11  Richard Henderson  <rth@redhat.com>
4847         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
4848         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
4849         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
4851 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4853         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
4854         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
4855         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
4857 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4859         * forward.c (__pthread_cond_broadcast_2_0,
4860         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
4861         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
4862         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
4864 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4866         * sysdeps/sh/tcb-offsets.sym: Add PID.
4867         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
4868         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
4870 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
4872         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
4873         include <sysdep-cancel.h>, vfork is no cancellation point.
4874         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
4875         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
4876         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
4878 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
4880         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
4881         libc_hidden_def.
4882         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
4883         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
4884         Likewise.
4885         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
4886         Likewise.
4887         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
4888         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
4889         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
4890         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
4891         of DO_CALL_VIA_BREAK.  Work around a gas problem.
4893         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
4894         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
4895         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
4896         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
4897         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
4898         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
4900         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
4901         a local register for saving old PID.  Negate PID in parent upon exit.
4903         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
4904         tcb-offsets.h.
4905         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
4906         before syscall, set to the old value in the parent afterwards.
4907         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
4908         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
4909         tcb-offsets.h.
4910         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
4911         before syscall, set to the old value in the parent afterwards.
4912         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
4913         * sysdeps/s390/tcb-offsets.sym: Add PID.
4915         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
4916         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
4917         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
4918         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
4919         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
4920         * sysdeps/sparc/tcb-offsets.sym: Add PID.
4922 2004-03-10  Andreas Schwab  <schwab@suse.de>
4924         * sysdeps/ia64/tcb-offsets.sym: Add PID.
4925         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
4926         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
4928 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
4930         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
4931         * tst-cancel21.c (do_one_test): Likewise.
4932         Reported by Gordon Jin <gordon.jin@intel.com>.
4934 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
4936         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
4937         if non-zero and set to INT_MIN if zero.
4938         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
4939         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
4940         (SAVE_PID, RESTORE_PID): Define.
4941         (__vfork): Use it.
4942         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
4943         Use relative path to avoid including NPTL i386/vfork.S.
4944         (SAVE_PID, RESTORE_PID): Define.
4945         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
4946         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
4947         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
4948         tst-vfork2x.
4949         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
4950         * tst-vfork1.c: New test.
4951         * tst-vfork2.c: New test.
4952         * tst-vfork1x.c: New test.
4953         * tst-vfork2x.c: New test.
4955 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
4957         * sysdeps/i386/tcb-offsets.sym: Add PID.
4958         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4959         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
4960         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
4962 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
4964         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
4966 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
4968         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
4969         _rtld_global_ro.
4971 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
4973         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
4974         _rtld_global_ro.
4976         * tst-once4.c: Remove unnecessary macro definition.
4978         * tst-mutex7.c (do_test): Limit thread stack size.
4979         * tst-once2.c (do_test): Likewise.
4980         * tst-tls3.c (do_test): Likewise.
4981         * tst-tls1.c (do_test): Likewise.
4982         * tst-signal3.c (do_test): Likewise.
4983         * tst-kill6.c (do_test): Likewise.
4984         * tst-key4.c (do_test): Likewise.
4985         * tst-join4.c (do_test): Likewise.
4986         * tst-fork1.c (do_test): Likewise.
4987         * tst-context1.c (do_test): Likewise.
4988         * tst-cond2.c (do_test): Likewise.
4989         * tst-cond10.c (do_test): Likewise.
4990         * tst-clock2.c (do_test): Likewise.
4991         * tst-cancel10.c (do_test): Likewise.
4992         * tst-basic2.c (do_test): Likewise.
4993         * tst-barrier4.c (do_test): Likewise.
4995 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
4997         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
4999 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
5001         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5002         (__pthread_cond_timedwait): Optimize wakeup test.
5003         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5004         (__pthread_cond_wait): Likewise.
5005         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
5006         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5007         Likewise.
5009 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
5011         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5012         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
5013         the atomic instruction needed.
5014         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5015         (__lll_mutex_lock_wait): Likewise.
5017 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
5019         * Makefile (tests): Add tst-cond14 and tst-cond15.
5020         * tst-cond14.c: New file.
5021         * tst-cond15.c: New file.
5023 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
5025         * sysdeps/pthread/createthread.c (create_thread): Remove use of
5026         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
5027         needs to be implemented differently to be useful.
5029 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
5031         * pthread_attr_setschedparam.c: Don't test priority against limits
5032         here.  Set ATTR_FLAG_SCHED_SET flag.
5033         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
5034         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
5035         from parent thread to child.  If attribute is used and scheduling
5036         parameters are not inherited, copy parameters from attribute or
5037         compute them.  Check priority value.
5038         * pthread_getschedparam.c: If the parameters aren't known yet get
5039         them from the kernel.
5040         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
5041         ATTR_FLAG_POLICY_SET flag for thread.
5042         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
5043         and ATTR_FLAG_POLICY_SET.
5045         * sysdeps/pthread/createthread.c: Use tgkill if possible.
5047         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
5048         fail if stack address hasn't been set.  Just return 0.
5050 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
5052         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
5053         libpthread for the files in this list.
5054         (CFLAGS-tst-unload): Removed.
5055         * tst-unload.c (do_test): Don't use complete path for
5056         LIBPHREAD_SO.
5058         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
5059         tst-_res1mod2.
5061 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
5063         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5064         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
5065         operation per round is needed.
5066         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5067         (__lll_mutex_lock_wait): Likewise.
5069 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
5071         * tst-cancel9.c (cleanup): Don't print to stderr.
5073 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5075         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
5077 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
5079         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
5080         (__syscall_error_handler2): Call CDISABLE.
5081         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
5082         (__syscall_error_handler2): Call CDISABLE.
5084         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5085         Release lock before the loop, don't reacquire it.
5087         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
5089 2004-02-19  Andreas Schwab  <schwab@suse.de>
5091         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5092         Fix last change.
5094 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
5096         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
5097         (pthread_barrier_wait): After wakeup, release lock only when the
5098         last thread stopped using the barrier object.
5099         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
5100         (pthread_barrier_wait): Likewise.
5101         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5102         Likewise.
5103         * Makefile (tests): Add tst-barrier4.
5104         * tst-barrier4.c: New file.
5106         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5107         (__pthread_cond_timedwait): Perform timeout test while holding
5108         internal lock to prevent wakeup race.
5109         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
5110         * sysdeps/pthread/pthread_cond_timedwait.c
5111         (__pthread_cond_timedwait): Likewise.
5112         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5113         (__pthread_cond_timedwait): Likewise.
5115 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
5117         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
5118         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
5119         * Makefile (tests): Add tst-rwlock13.
5120         * tst-rwlock13.c: New test.
5122 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
5124         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5125         (__condvar_tw_cleanup): Little optimization.
5126         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
5128 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
5130         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
5131         libpthread as "lib" parameter to SHLIB_COMPAT.
5132         (__novmx_siglongjmp): Fix typo in function name.
5133         (__novmx_longjmp): Fix typo in function name.
5135 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
5137         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
5138         __builtin_expect.
5140         * sysdeps/generic/pt-longjmp.c: Moved to...
5141         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
5143 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
5145         * Makefile (libpthread-routines): Add pt-cleanup.
5146         * pt-longjmp.c: Removed.
5147         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
5148         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
5149         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
5150         Version longjmp, siglongjmp for GLIBC_2.3.4.
5151         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
5153 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
5155         * sysdeps/pthread/pthread_cond_timedwait.c
5156         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
5157         Reuse code.  Add __builtin_expects.
5159         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5160         (__pthread_cond_timedwait): Get internal lock in case timeout has
5161         passed before the futex syscall.
5162         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5164 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
5166         * allocatestack.c: Pretty printing.
5168         * sysdeps/pthread/createthread.c (create_thread): Don't add
5169         CLONE_DETACHED bit if it is not necessary.
5171 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
5173         * pthread_getattr_np.c: Include ldsodefs.h.
5175 2004-01-16  Richard Henderson  <rth@redhat.com>
5177         * allocatestack.c: Don't declare __libc_stack_end.
5178         * init.c (__pthread_initialize_minimal_internal): Likewise.
5179         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
5181 2004-01-15  Richard Henderson  <rth@redhat.com>
5183         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
5184         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
5185         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
5186         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
5187         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
5188         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
5189         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
5190         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
5192 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
5194         * init.c (pthread_functions): Make array const.
5196 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
5198         * allocatestack.c (__make_stacks_executable): Change interface.
5199         Check parameters.  Pass parameter on to libc counterpart.
5200         * pthreadP.h: Change declaration.
5202 2004-01-13  Richard Henderson  <rth@redhat.com>
5204         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
5205         prototype form.
5206         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
5207         Likewise.
5209         * sysdeps/alpha/Makefile: New file.
5210         * sysdeps/alpha/tcb-offsets.sym: New file.
5211         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
5212         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
5214         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
5215         on powerpc version.
5217 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
5219         * Makefile (tests): Add tst-backtrace1.
5220         * tst-backtrace1.c: New test.
5222 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
5224         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
5225         register as second parameter to the REGISTER macro.
5226         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
5227         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
5228         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
5229         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
5230         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
5231         of thread register as second parameter to REGISTER macro in 64 case.
5233 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
5235         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
5236         (CFLAGS-getpid.o): Defined.
5237         (CFLAGS-getpid.os): Defined.
5239 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
5241         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
5242         returned for main thread does not overlap with any other VMA.
5243         Patch by Jakub Jelinek.
5245 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
5247         * tst-raise1.c: Include stdio.h.
5249 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
5251         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
5252         setting with __ASSUME_TGKILL || defined __NR_tgkill.
5253         If pid is 0, set it to selftid.
5254         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
5255         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
5256         != 0, return self->tid without doing a syscall.
5257         * descr.h (struct pthread): Move pid field after tid.
5259         * Makefile (tests): Add tst-raise1.
5260         * tst-raise1.c: New file.
5262 2003-12-23  Roland McGrath  <roland@redhat.com>
5264         * tst-oddstacklimit.c: New file.
5265         * Makefile (tests): Add it.
5266         (tst-oddstacklimit-ENV): New variable.
5268         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
5269         value up to page size for __default_stacksize.
5271 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
5273         * Makefile (tests): Add tst-eintr5.
5274         * tst-eintr5.c: New file.
5276         * eintr.c (eintr_source): Prevent sending signal to self.
5278         * tst-eintr2.c (tf1): Improve error message.
5280 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
5282         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
5283         * sysdeps/unix/sysv/linux/getpid.c: New file.
5284         * pthread_cancel.c: Add comment explaining use of PID field.
5285         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
5286         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
5287         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
5288         temporarily to signal the field must not be relied on and updated
5289         by getpid().
5290         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
5291         temporarily negative.
5292         * sysdeps/unix/sysv/linux/raise.c: Likewise.
5294 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
5296         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
5297         (eintr_source): If ARG != NULL, use pthread_kill.
5298         * tst-eintr1.c: Adjust for this change.
5299         * tst-eintr2.c: Likewise.
5300         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
5301         * tst-eintr3.c: New file.
5302         * tst-eintr4.c: New file.
5304 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
5306         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
5307         if CANCELSTATE_BITMASK is set.
5308         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
5309         Likewise.
5311         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
5312         (tests-reverse): Add tst-cancel23.
5313         * tst-cancel22.c: New test.
5314         * tst-cancel23.c: New test.
5316 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
5318         * tst-eintr1.c: Better error messages.
5320         * Makefile (tests): Add tst-eintr2.
5321         * tst-eintr2.c: New file.
5323 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
5325         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
5326         (CFLAGS-tst-cancelx21.c): Set.
5327         * tst-cancel21.c: New test.
5328         * tst-cancelx21.c: New test.
5330         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
5331         comparison operand.
5332         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
5333         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
5334         * pt-longjmp.c: Include jmpbuf-unwind.h.
5335         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
5336         _JMPBUF_UNWINDS.  Adjust compared pointers.
5337         * init.c (__pthread_initialize_minimal_internal): Initialize
5338         pd->stackblock_size.
5339         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
5340         * sysdeps/alpha/jmpbuf-unwind.h: New file.
5341         * sysdeps/i386/jmpbuf-unwind.h: New file.
5342         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
5343         * sysdeps/s390/jmpbuf-unwind.h: New file.
5344         * sysdeps/sh/jmpbuf-unwind.h: New file.
5345         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
5346         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
5347         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
5348         (_JMPBUF_CFA_UNWINDS): Remove.
5349         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
5351 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
5353         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
5354         (CFLAGS-tst-cancelx20.c): Set.
5355         * tst-cancel20.c: New test.
5356         * tst-cancelx20.c: New test.
5358 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
5360         * init.c (__pthread_initialize_minimal_internal): Don't treat
5361         architectures with separate register stack special here when
5362         computing default stack size.
5364 2003-12-17  Roland McGrath  <roland@redhat.com>
5366         * Makefile (tst-cancelx7-ARGS): New variable.
5367         Reportd by Greg Schafer <gschafer@zip.com.au>.
5369 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
5371         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
5372         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
5373         (tst-stack3-ENV): Set.
5374         ($(objpfx)tst-stack3-mem): New.
5375         * tst-stack3.c: New test.
5377 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
5379         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
5380         Add unwind directives.  Drop unused .regstk directive.
5381         (_fini_EPILOG_BEGINS): Add unwind directives.
5383 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
5385         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
5386         Assume parameter is a pointer.
5387         (lll_futex_wake): Likewise.
5388         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
5389         Likewise.
5390         (lll_futex_wake): Likewise.
5391         Reported by Boris Hu.
5392         * sysdeps/unix/sysv/linux/unregister-atfork.c
5393         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
5395         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
5397 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
5399         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
5400         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
5401         __rtld_lock_initialize for ld.so lock.
5402         Patch in part by Adam Li <adam.li@intel.com>.
5404 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
5406         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
5407         in $(gnulib).  Also, remove stale comment.
5409 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
5411         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
5412         advantage of new syscall stub and optimize accordingly.
5414         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
5415         from SYS_futex, to match expectations of
5416         sysdep.h:DO_INLINE_SYSCALL.
5417         (lll_futex_clobbers): Remove.
5418         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
5419         (lll_futex_wake): Likewise.
5420         (lll_futex_requeue): Likewise.
5421         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
5422         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
5423         Jelinek).
5424         (__lll_mutex_lock): Likewise.
5425         (__lll_mutex_cond_lock): Likewise.
5426         (__lll_mutex_timed_lock): Likewise.
5427         (__lll_mutex_unlock): Likewise.
5428         (__lll_mutex_unlock_force): Likewise.
5430         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
5431         comes before the include of <sysdep.h>.
5432         (THREAD_SELF_SYSINFO): New macro.
5433         (THREAD_SYSINFO): Likewise.
5434         (INIT_SYSINFO): New macro.
5435         (TLS_INIT_TP): Call INIT_SYSINFO.
5437         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
5439         * sysdeps/pthread/createthread.c (create_thread): Use
5440         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
5441         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
5442         THREAD_SELF_SYSINFO instead of open code.
5443         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
5444         (THREAD_SYSINFO): Likewise.
5446         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
5448         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
5450 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
5452         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
5453         instead of .init.  Patch by David Mosberger.
5455 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
5457         * sysdeps/pthread/configure.in: Remove broken declaration in C
5458         cleanup handling check.
5460 2003-11-30  Andreas Jaeger  <aj@suse.de>
5462         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
5463         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
5464         Likewise.
5466 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
5468         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
5469         * pthread_attr_destroy.c: Include shlib-compat.h.
5470         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
5471         is set in iattr->flags.
5472         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
5474 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
5476         * Makefile (distribute): Add tst-cleanup4aux.c.
5478         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
5479         include.
5481 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
5483         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
5484         pthread_cond_signal.
5486         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
5487         store mutex address if the current value is ~0l.
5488         * sysdeps/pthread/pthread_cond_timedwait.c
5489         (__pthread_cond_timedwait): Likewise.
5490         * sysdeps/pthread/pthread_cond_broadcast.c
5491         (__pthread_cond_broadcast): Don't use requeue for pshared
5492         condvars.
5494         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5495         (__pthread_cond_wait): Don't store mutex address if the current
5496         value is ~0l.
5497         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5498         (__pthread_cond_timedwait): Likewise.
5499         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5500         (__pthread_cond_broadcast): Don't use requeue for pshared
5501         condvars.
5503         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
5504         element with ~0l for pshared condvars, with NULL otherwise.
5506         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5507         (__pthread_cond_wait): Don't store mutex address if the current
5508         value is ~0l.
5509         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5510         (__pthread_cond_timedwait): Likewise.
5511         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
5512         (__pthread_cond_broadcast): Don't use requeue for pshared
5513         condvars.
5515         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
5516         * tst-cond12.c: New file.
5517         * tst-cond13.c: New file.
5519 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
5521         * sysdeps/pthread/configure.in: Make missing forced unwind support
5522         fatal.
5524 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
5526         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
5528 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
5530         * Makefile: Add magic to clean up correctly.
5532 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
5534         * unwind.c (FRAME_LEFT): Define.
5535         (unwind_stop): Handle old style cleanups here.
5536         (__pthread_unwind): Handle old style cleanups only if
5537         !HAVE_FORCED_UNWIND.
5538         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
5539         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
5540         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
5541         ($(objpfx)tst-cleanupx4): Likewise.
5542         * tst-cleanup4.c: New test.
5543         * tst-cleanup4aux.c: New.
5544         * tst-cleanupx4.c: New test.
5546 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
5548         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
5549         lll_mutex_*lock macros to skip atomic operations on some archs.
5551 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
5553         * sysdeps/pthread/tst-timer.c (main): Initialize
5554         sigev2.sigev_value as well.
5556 2003-10-15  Roland McGrath  <roland@redhat.com>
5558         * sysdeps/pthread/configure.in: Barf if visibility attribute support
5559         is missing.
5560         * sysdeps/pthread/configure: Regenerated.
5562 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5564         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
5565         locking macros.  No distinction between normal and mutex locking
5566         anymore.
5567         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
5568         Merge bits from lowlevelmutex.S we still need.
5569         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
5570         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
5571         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
5572         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
5573         new mutex implementation.
5574         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
5575         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
5576         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5577         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
5578         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
5579         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
5580         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
5581         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
5582         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5583         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
5584         symbol for entry point to avoid cancellation.
5586 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
5588         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
5589         changes.
5590         (SAVE_OLDTYPE_0): Fix a typo.
5592 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
5594         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
5595         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
5597 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5599         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
5600         correct offset.
5602 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
5604         * Makefile (tests): Add tst-cancel19.
5605         * tst-cancel19.c: New test.
5607 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5609         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
5610         restoring of the old cancellation type.
5612 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
5614         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
5616 2003-09-27  Wolfram Gloger  <wg@malloc.de>
5618         * sysdeps/pthread/malloc-machine.h: New file
5620 2003-09-24  Roland McGrath  <roland@redhat.com>
5622         * allocatestack.c (__make_stacks_executable): Don't ignore return
5623         value from _dl_make_stack_executable.
5625 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
5627         * allocatestack.c (__make_stacks_executable): Also change
5628         permission of the currently unused stacks.
5630         * allocatestack.c (change_stack_perm): Split out from
5631         __make_stacks_executable.
5632         (allocate_stack): If the required permission changed between the time
5633         we started preparing the stack and queueing it, change the permission.
5634         (__make_stacks_executable): Call change_stack_perm.
5636         * Makefile: Build tst-execstack-mod locally.
5637         * tst-execstack-mod.c: New file.
5639 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
5641         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
5643 2003-09-23  Roland McGrath  <roland@redhat.com>
5645         * tst-execstack.c: New file.
5646         * Makefile (tests): Add it.
5647         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
5648         (LDFLAGS-tst-execstack): New variable.
5650         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
5651         whether to use PROT_EXEC for stack mmap.
5652         (__make_stacks_executable): New function.
5653         * pthreadP.h: Declare it.
5654         * init.c (__pthread_initialize_minimal_internal): Set
5655         GL(dl_make_stack_executable_hook) to that.
5657 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5659         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
5660         recommendation from AMD re avoidance of lock prefix.
5662 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
5664         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
5665         lll_futex_timed_wait instead of lll_futex_wait.
5666         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
5667         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
5668         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
5669         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
5670         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
5671         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
5672         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
5673         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
5674         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
5675         Completely revamp the locking macros.  No distinction between
5676         normal and mutex locking anymore.
5677         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
5678         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
5679         __lll_lock_timedwait): Fix prototypes.
5680         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
5681         __lll_lock_timedwait): Likewise.
5682         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
5683         macros, add __builtin_expect.
5684         (lll_mutex_timedlock): Likewise.  Fix return value.
5685         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
5686         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
5687         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
5688         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
5689         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
5690         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
5691         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
5692         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
5694 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5696         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5697         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
5698         operation if possible.
5700         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
5701         like jumping over the lock prefix.
5703 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
5705         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
5706         locking macros.  No distinction between normal and mutex locking
5707         anymore.
5708         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
5709         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
5710         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
5711         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
5712         locking.  Merge bits from lowlevelmutex.S we still need.
5713         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
5714         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
5715         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
5716         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
5717         * Makefile (routines): Remove libc-lowlevelmutex.
5718         (libpthread-rountines): Remove lowlevelmutex.
5719         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
5720         for new mutex implementation.
5721         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5722         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5723         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5724         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5725         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5726         Likewise.
5727         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5728         Likewise.
5729         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
5730         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5731         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
5732         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
5733         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5734         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5735         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
5736         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
5737         Likewise.
5738         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
5739         Likewise.
5740         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
5741         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
5742         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5743         Don't use requeue.
5744         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
5745         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
5747 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
5749         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
5750         in parameters of asm with output parameters.
5752         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
5753         type of DECR parameter to int.
5754         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
5756 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
5758         * tst-attr3.c (tf, do_test): Print stack start/end/size and
5759         guardsize for each thread.
5761 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5763         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
5764         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5765         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
5767         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
5768         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
5769         NULL.
5770         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
5771         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
5772         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5773         (pthread_getaffinity_np): Add hidden_def.
5775         * Makefile (tests): Add tst-attr3.
5776         * tst-attr3.c: New test.
5778         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
5780 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5782         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
5783         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
5785 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5787         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
5788         * tst-align.c: Include tst-stack-align.h.
5789         (tf, do_test): Use TEST_STACK_ALIGN macro.
5791 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
5793         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
5794         variable.
5796 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
5798         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
5799         stack-related values for the initial thread.
5801 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5803         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
5805 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
5807         * pthread_mutex_lock.c: Minor code rearrangements.
5809 2003-09-05  Roland McGrath  <roland@redhat.com>
5811         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
5812         Instead, include ../nptl_db/db_info.c to do its magic.
5813         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
5814         (__pthread_pthread_key_2ndlevel_size): Likewise.
5815         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
5816         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
5817         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
5818         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
5819         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
5820         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
5821         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
5822         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
5823         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
5824         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
5825         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
5826         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
5827         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
5828         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
5829         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
5830         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
5831         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
5833 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
5835         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
5836         of pthread_t to be compatible with LT.
5837         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5838         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5839         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5840         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5841         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
5842         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5843         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5845 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
5847         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
5849 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
5851         * unwind-forcedunwind.c: Move to...
5852         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
5853         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
5854         * sysdeps/pthread/jmpbuf-unwind.h: New file.
5855         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
5856         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
5857         * unwind.c: Include jmpbuf-unwind.h.
5858         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
5860 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
5862         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
5863         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
5864         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
5865         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
5866         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
5867         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
5868         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
5869         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
5870         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
5871         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
5872         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
5873         function.
5874         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
5875         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
5876         * Makefile (tests): Add tst-stack2.
5877         * tst-stack2.c: New test.
5878         * tst-stack1.c: Include limits.h and sys/param.h.
5879         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
5881         * pthread_condattr_setpshared.c: Include errno.h.
5882         (pthread_condattr_setpshared): Return EINVAL if pshared
5883         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
5885         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
5886         defined symbol for entry point to avoid cancellation.
5887         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
5888         Likewise.
5889         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
5890         Likewise.
5891         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
5892         Likewise.
5893         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
5894         Likewise.
5895         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
5896         Likewise.
5897         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
5898         __close_nocancel, __read_nocancel, __write_nocancel,
5899         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
5900         libpthread.so or librt.so, define to corresponding function
5901         without _nocancel suffix.
5902         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
5903         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
5904         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
5906         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
5908 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
5910         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
5911         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
5913         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
5914         in subsections has a symbol associated with it.
5916         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
5917         defined symbol for entry point to avoid cancellation.
5918         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
5920 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
5922         * Makefile (tests): Add tst-tls5.
5923         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
5924         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
5925         ($(objpfx)tst-tls5): New.
5926         ($(objpfx)tst-tls6.out): Likewise.
5927         (tests): Depend on $(objpfx)tst-tls6.out.
5928         * tst-tls3.c: Include stdint.h and pthreaddef.h.
5929         (do_test): Check pthread_self () return value alignment.
5930         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
5931         (tf): Check pthread_self () return value alignment.
5932         * tst-tls5.c: New test.
5933         * tst-tls5.h: New.
5934         * tst-tls5mod.c: New.
5935         * tst-tls5moda.c: New.
5936         * tst-tls5modb.c: New.
5937         * tst-tls5modc.c: New.
5938         * tst-tls5modd.c: New.
5939         * tst-tls5mode.c: New.
5940         * tst-tls5modf.c: New.
5941         * tst-tls6.sh: New test.
5943         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
5944         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
5945         * init.c (pthread_functions): Initialize them.
5946         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
5947         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
5948         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
5949         pthread_cond_timedwait@@GLIBC_2.3.2.
5951 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
5953         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
5954         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
5955         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
5956         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
5957         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
5958         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
5960         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
5962         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
5963         _POSIX_THREAD_PRIORITY_SCHEDULING.
5964         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
5966 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
5968         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
5969         nested function, use static inline function from libio.h.
5970         Code by Richard Henderson.
5972         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
5973         weak.
5975 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
5977         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
5978         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
5979         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
5980         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
5981         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
5982         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
5983         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
5984         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
5985         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
5986         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
5987         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
5988         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
5989         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
5990         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
5991         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
5992         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
5993         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
5994         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
5995         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
5996         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
5997         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
5998         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
5999         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
6000         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
6001         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
6002         * sysdeps/sparc/tls.h: New file.
6003         * sysdeps/sparc/tcb-offsets.sym: New file.
6004         * sysdeps/sparc/Makefile: New file.
6005         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
6006         * init.c [__sparc__] (__NR_set_tid_address): Define.
6008 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
6010         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
6011         _IO_release_lock): Define.
6013 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
6015         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
6016         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
6018 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
6020         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
6021         (__pthread_cleanup_class): Add missing return types of member
6022         functions.
6024 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
6026         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6027         (lll_mutex_unlock_force): Add memory barrier between store and futex
6028         syscall.
6030 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
6032         * tst-cancel4.c (do_test): Also unlink tempfname and remove
6033         tempmsg in first loop.
6035 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
6037         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
6038         _POSIX_THREAD_PRIORITY_SCHEDULING.
6039         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
6041 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
6043         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
6044         (__rtld_lock_default_lock_recursive,
6045         __rtld_lock_default_unlock_recursive): Define.
6046         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
6047         __rtld_lock_unlock_recursive): Define using
6048         GL(_dl_rtld_*lock_recursive).
6049         * init.c (__pthread_initialize_minimal_internal): Initialize
6050         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
6051         Lock GL(_dl_load_lock) the same number of times as
6052         GL(_dl_load_lock) using non-mt implementation was nested.
6054         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
6055         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
6057 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
6059         * tst-cancel17.c (do_test): Make len2 maximum of page size and
6060         PIPE_BUF.
6062 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
6064         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
6066 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
6068         * sysdeps/pthread/createthread.c (do_clone): Move error handling
6069         to first syscall error check.  Move syscall error check for tkill
6070         into __ASSUME_CLONE_STOPPED #ifdef.
6072 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
6074         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
6075         is not defined, do explicit synchronization.
6076         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
6077         is not defined also unlock pd->lock for non-debugging case in case
6078         it is necessary.
6079         * pthread_create.c (start_thread): Always get and release pd->lock
6080         if __ASSUME_CLONE_STOPPED is not defined.
6081         (start_thread_debug): Removed.  Adjust users.
6082         * allocatestack.c (allocate_stack): Always initialize lock if
6083         __ASSUME_CLONE_STOPPED is not defined.
6084         * Makefile (tests): Add tst-sched1.
6085         * tst-sched1.c: New file.
6087         * sysdeps/pthread/createthread.c (do_clone): Only use
6088         sched_setschduler and pass correct parameters.
6090 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6092         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
6093         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
6094         PTHREAD_STACK_MIN in comments.
6096 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6098         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
6099         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
6100         argument.
6101         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
6102         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
6103         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
6104         (__pthread_cleanup_upto): Fix prototype.
6105         (_longjmp_unwind): Adjust caller.
6106         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
6107         Change second argument to const struct pointer.
6108         * tst-sem8.c (main): Remove unused s2 and s3 variables.
6109         * tst-sem9.c (main): Likewise.
6110         * unwind.c: Include string.h for strlen prototype.
6112 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
6114         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6115         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
6116         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
6117         Define HAVE_CMOV.
6118         Patch by Nicholas Miell <nmiell@attbi.com>.
6120 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
6122         * init.c (__pthread_initialize_minimal_internal): Initialize
6123         GL(dl_init_static_tls).
6124         * pthreadP.h (__pthread_init_static_tls): New prototype.
6125         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
6126         New functions.
6127         * Makefile (tests): Add tst-tls4.
6128         (modules-names): Add tst-tls4moda and tst-tls4modb.
6129         ($(objpfx)tst-tls4): Link against libdl and libpthread.
6130         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
6131         tst-tls4modb.so.
6132         * tst-tls4.c: New file.
6133         * tst-tls4moda.c: New file.
6134         * tst-tls4modb.c: New file.
6136 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
6138         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
6139         before __timer_dealloc.
6140         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
6141         Don't call list_unlink.
6143 2003-07-29  Roland McGrath  <roland@redhat.com>
6145         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
6147 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
6149         * tst-cancel17.c (do_test): Check if aio_cancel failed.
6150         Don't reuse struct aiocb A if it failed.
6151         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
6152         not just one byte, as that does not block.
6154 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
6156         * sysdeps/pthread/unwind-resume.c: New file.
6157         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
6158         unwind-resume in csu subdir.
6159         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
6160         exceptions.
6161         (librt-sysdep_routines, librt-shared-only-routines): Add
6162         rt-unwind-resume.
6163         * sysdeps/pthread/rt-unwind-resume.c: New file.
6164         * unwind-forcedunwind.c: New file.
6165         * Makefile (libpthread-routines): Add unwind-forcedunwind.
6166         (libpthread-shared-only-routines): Likewise.
6167         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
6168         * pthreadP.h (pthread_cancel_init): New prototype.
6169         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
6171         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
6172         attr argument const struct pthread_attr *.
6174         * res.c (__res_state): Return __resp.
6175         * descr.h: Include resolv.h.
6176         (struct pthread): Add res field.
6177         * pthread_create.c: Include resolv.h.
6178         (start_thread): Initialize __resp.
6179         * Makefile (tests): Add tst-_res1.
6180         (module-names): Add tst-_res1mod1, tst-_res1mod2.
6181         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
6182         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
6183         libpthread.
6184         * tst-_res1.c: New file.
6185         * tst-_res1mod1.c: New file.
6186         * tst-_res1mod2.c: New file.
6188 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
6190         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
6192         * Makefile: Define various *-no-z-defs variables for test DSOs
6193         which has undefined symbols.
6195 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
6197         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
6198         Retry if the stwcx fails to store once_control.
6200 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
6202         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
6203         pthread_attr_setaffinity.
6204         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
6205         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
6206         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
6207         * pthread_attr_destroy.c: Free cpuset element if allocated.
6208         * pthread_create.c: Pass iattr as additional parameter to
6209         create_thread.
6210         * sysdeps/pthread/createthread.c: If attribute is provided and
6211         a new thread is created with affinity set or scheduling parameters,
6212         start thread with CLONE_STOPPED.
6213         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
6214         pthread_attr_setaffinity.
6215         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
6216         cpuset element.
6218 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
6220         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
6222 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
6224         * sysdeps/pthread/configure.in: Require CFI directives also for
6225         ppc and s390.
6227 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
6229         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
6230         Add cfi directives.
6232 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6234         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
6235         CLEANUP_JMP_BUF.
6236         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
6237         registers as variables.  Call __pthread_mutex_unlock_usercnt.
6238         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6239         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
6240         not self pointer in __writer.  Compare with TID to determine
6241         deadlocks.
6242         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6243         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
6244         Likewise.
6245         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
6246         Likewise.
6247         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
6248         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
6249         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
6250         macros also when compiling librt.
6252 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
6254         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
6255         -fasynchronous-unwind-tables.
6256         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
6257         (PSEUDO): Add cfi directives.
6258         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
6259         Likewise.
6260         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
6261         Likewise.
6263 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
6265         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
6266         __pthread_unregister_cancel): Add prototypes and hidden_proto.
6267         * unwind.c (__pthread_unwind_next): Add hidden_def.
6268         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
6269         Likewise.
6270         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
6271         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
6272         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
6273         Likewise.
6274         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
6275         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
6276         Likewise.
6277         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
6278         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
6279         __pthread_unregister_cancel and __pthread_unwind_next.
6281 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
6283         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
6284         different symbol for the cancellation syscall wrapper and
6285         non-cancellation syscall wrapper.
6286         (PSEUDO_END): Define.
6288 2003-07-05  Richard Henderson  <rth@redhat.com>
6290         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
6291         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
6292         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6293         return actual return value from the syscall, not 0.
6295 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
6297         * descr.h (struct pthread): Add pid field.
6298         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
6299         (__reclaim_stacks): Likewise.
6300         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
6301         also check for PID of the signal source.
6302         (__pthread_initialize_minimal_internal): Also initialize pid field
6303         of initial thread's descriptor.
6304         * pthread_cancel.c: Use tgkill instead of tkill if possible.
6305         * sysdeps/unix/sysv/linux/fork.c: Likewise.
6306         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
6307         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
6308         * sysdeps/unix/sysv/linux/raise.c: Likewise.
6310 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
6312         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
6313         Fix use of parameter.
6314         (__libc_cleanup_pop): Likewise.
6316 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
6318         * init.c (sigcancel_handler): Change parameters to match handler
6319         for SA_SIGACTION.  Check signal number and code to recognize
6320         invalid invocations.
6322 2003-07-03  Roland McGrath  <roland@redhat.com>
6324         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
6325         Apply sizeof (struct pthread) bias to r13 value.
6327 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
6329         * sysdeps/pthread/configure.in: Require CFI directives.
6331         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
6332         definition.
6333         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
6334         libpthread compilation.
6335         * unwind.c (__pthread_unwind): Add hidden_def.
6336         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
6338 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6340         * libc-cancellation.c (__libc_cleanup_routine): Define.
6341         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
6342         (__pthread_cleanup_pop): Define.
6344 2003-07-01  Richard Henderson  <rth@redhat.com>
6346         * sysdeps/alpha/elf/pt-initfini.c: New file.
6347         * sysdeps/alpha/pthread_spin_lock.S: New file.
6348         * sysdeps/alpha/pthread_spin_trylock.S: New file.
6349         * sysdeps/alpha/pthreaddef.h: New file.
6350         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
6351         * sysdeps/alpha/tls.h: New file.
6352         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
6353         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
6354         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
6355         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
6356         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
6357         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
6358         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
6359         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
6360         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
6361         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
6363 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6365         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
6366         cleanup support and unwind info.
6368 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
6370         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
6371         Use correct cleanup handler registration.  Add unwind info.
6372         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
6373         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
6374         * tst-once3.c: Add cleanup handler and check it is called.
6375         * tst-once4.c: Likewise.
6376         * tst-oncex3.c: New file.
6377         * tst-oncex4.c: New file.
6378         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
6380 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
6382         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
6384 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
6386         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
6387         (tf_msgsnd): Likewise.
6389         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
6390         premature returns a bit more.
6392 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
6394         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
6395         definition to the front.
6397         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
6398         the cleanup functions to make the names unique.  Fix dwarf opcode
6399         un unwind table.
6400         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
6401         functions to make the names unique.  Fix CFA offset for two blocks.
6403 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
6405         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
6406         missing closing braces.
6407         Patch by Christophe Saout <christophe@saout.de>.
6409 2003-06-24  Roland McGrath  <roland@redhat.com>
6411         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
6413 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
6415         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
6416         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
6418         * pthreadP.h: Declare __find_thread_by_id.
6419         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
6420         * pthread_clock_gettime.c: Allow using other thread's clock.
6421         * pthread_clock_settime.c: Likewise.
6422         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
6423         * Makefile: Add rules to build and run tst-clock2.
6424         * tst-clock2.c: New file.
6426 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
6428         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
6429         to use exception-based cleanup handler.
6430         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6432         * tst-cond8.c (ch): Announce that we are done.
6434         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
6436         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
6437         Also test aio_suspend with timeout value.
6439 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
6441         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
6442         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
6443         attribute_hidden.
6445         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
6446         (__pthread_mutex_lock_internal): Likewise.
6447         (__pthread_mutex_unlock_internal): Likewise.
6448         (__pthread_mutex_unlock_usercnt): Declare.
6449         * pthread_mutex_destroy.c: Always fail if used in any way.
6450         * pthread_mutex_init.c: Update comment.
6451         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
6452         * pthread_mutex_timedlock.c: Adjust __nusers.
6453         * pthread_mutex_trylock.c: Adjust __nusers.
6454         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
6455         and public interfaces are wrapper with pass additional parameter.
6456         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
6457         parameter zero.
6458         * tst-mutex8.c: New file.
6459         * Makefile (tests): Add tst-mutex8.
6460         * sysdeps/pthread/pthread_cond_timedwait.c: Call
6461         __pthread_mutex_unlock_usercnt.
6462         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6463         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6464         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6465         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6466         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6467         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
6468         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6469         Add __nusers.
6470         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6471         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6472         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6473         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6474         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6476         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
6477         * pthread_mutex_timedlock.c: Likewise.
6478         * pthread_mutex_trylock.c: Adjust __nusers.
6479         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
6480         * tst-mutex9.c: New file.
6481         * Makefile (tests): Add tst-mutex9.
6482         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
6483         * sysdeps/ia64/tls.h: Likewise.
6484         * sysdeps/powerpc/tls.h: Likewise.
6485         * sysdeps/s390/tls.h: Likewise.
6486         * sysdeps/sh/tls.h: Likewise.
6487         * sysdeps/x86_64/tls.h: Likewise.
6488         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6489         Change type of __owner.
6490         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6491         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6492         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6493         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6494         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6496 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
6498         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
6499         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
6501         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
6502         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
6503         instead of nr to lll_futex_wake.  Only set errno and return -1
6504         if err < 0.
6506         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
6507         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6508         return actual return value from the syscall, not 0.
6510 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
6512         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
6513         find a random value.
6514         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
6515         errno==EIDRM.
6517         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
6518         compat_timer_settime.
6519         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
6520         compat_timer_gettime.
6521         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
6522         compat_timer_getoverrun.
6523         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
6524         compat_timer_delete.
6526         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
6527         error-checking mutex detect busy mutexes.
6529 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6531         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
6532         Add ax to clobber list.
6533         (lll_mutex_cond_lock): Likewise.
6534         (lll_mutex_unlock): Likewise.
6535         (lll_lock): Likewise.
6536         (lll_unlock): Likewise.
6538         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
6539         * tst-cancel18.c: New file.
6540         * tst-cancelx18.c: New file.
6542         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
6543         and tcdrain.
6545         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
6546         * tst-cancel17.c: New file.
6547         * tst-cancelx17.c: New file.
6549         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
6550         * sysdeps/unix/sysv/linux/sigwait.c: New file.
6551         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
6553         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
6555 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
6557         * sysdeps/pthread/createthread.c (create_thread): Set
6558         header.multiple_threads unconditionally.
6559         * allocatestack.c (allocate_stack): Likewise.
6560         * descr.h (struct pthread): Add header.multiple_threads
6561         unconditionally.
6562         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
6563         Define for librt.  #error if neither libpthread, libc nor librt.
6564         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
6565         Likewise.
6566         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
6567         CDISABLE): Likewise.
6568         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
6569         CDISABLE): Likewise.
6570         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
6571         CDISABLE): Likewise.
6572         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
6573         CDISABLE): Likewise.  Access header.multiple_threads outside of
6574         libc and libpthread.
6575         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
6576         Likewise.
6577         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
6578         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
6580 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6582         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
6583         Also test early cancellation before the thread reaches the cancellation
6584         point.
6586         * Makefile: Compile forward.c with exceptions.
6588         * sysdeps/unix/sysv/linux/sleep.c: New file.
6590 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
6592         * Makefile: Add CFLAGS definition to compile function wrappers
6593         duplicated from libc with exceptions.
6594         * tst-cancel4.c: Also check cancellation handlers.
6596         * Makefile: Add rules to build and run tst-cancel16 and
6597         tst-cancelx16.  Add missing CFLAGS definitions.
6598         * tst-cancel16.c: New file.
6599         * tst-cancelx16.c: New file.
6601 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
6603         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6604         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
6605         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
6606         (DL_SYSINFO_IMPLEMENTATION): Likewise.
6608         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
6609         (LIBC_CANCEL_RESET): Likewise.
6610         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
6611         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
6612         librt-cancellation.
6613         (CFLAGS-libcrt-cancellation.c): Define.
6614         * sysdeps/pthread/librt-cancellation.c: New file.
6615         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
6616         macros also when compiling librt.
6617         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
6618         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
6619         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
6620         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
6621         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
6622         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
6623         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
6625         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
6626         compat_timer_create.
6628 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
6630         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
6632         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
6633         __register_atfork.
6634         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
6635         Add libc_hidden_def.
6637 2003-06-13  Roland McGrath  <roland@redhat.com>
6639         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
6640         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
6642 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
6644         * allocatestack.c (queue_stack): Always inline.
6645         * ptreadhP.h (__do_cancel): Likewise.
6647 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
6649         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
6650         a typo.
6652 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
6654         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6655         (__pthread_cond_signal): Remove incorrect second addition for
6656         cond_lock!=0.
6658 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
6660         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6661         (__pthread_cond_signal): Use correct futex pointer in
6662         __lll_mutex_lock_wait call.
6664         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6665         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
6667 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
6669         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
6670         cancelable.
6671         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6672         Likewise.
6674         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
6675         hand-written CFI generation code.  Since ENTRY/END also initiated
6676         CFI frames this caused two CFI sets to be generated.
6678 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
6680         * cleanup_routine.c: New file.
6681         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
6682         * sysdeps/pthread/pthread.h: Add support for fully exception-based
6683         cleanup handling.
6684         * Makefile (libpthread-routines): Add cleanup_routine.
6685         Add more CFLAGS variables to compile with exceptions.  Add comments
6686         why which file needs unwind tables.
6687         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
6688         tests.
6689         * tst-cancelx1.c: New file.
6690         * tst-cancelx2.c: New file.
6691         * tst-cancelx3.c: New file.
6692         * tst-cancelx4.c: New file.
6693         * tst-cancelx5.c: New file.
6694         * tst-cancelx6.c: New file.
6695         * tst-cancelx7.c: New file.
6696         * tst-cancelx8.c: New file.
6697         * tst-cancelx9.c: New file.
6698         * tst-cancelx10.c: New file.
6699         * tst-cancelx11.c: New file.
6700         * tst-cancelx12.c: New file.
6701         * tst-cancelx13.c: New file.
6702         * tst-cancelx14.c: New file.
6703         * tst-cancelx15.c: New file.
6704         * tst-cleanupx0.c: New file.
6705         * tst-cleanupx0.expect: New file.
6706         * tst-cleanupx1.c: New file.
6707         * tst-cleanupx2.c: New file.
6708         * tst-cleanupx3.c: New file.
6710         * tst-cleanup0.c: Make standard compliant.
6711         * tst-cleanup1.c: Likewise.
6713         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
6714         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
6715         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
6716         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
6717         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
6718         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
6719         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
6720         CLEANUP_JMP_BUF.
6721         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6722         * tst-cancel12.c: New file.
6723         * tst-cancel13.c: New file.
6724         * tst-cancel14.c: New file.
6725         * tst-cancel15.c: New file.
6726         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
6727         and tst-cancel15.
6729         * tst-cancel1.c: Add some comments.
6731         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
6732         timeout correctly.
6734 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
6736         * Makefile (CFLAGS-pthread_cancel.c): Define.
6738 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
6740         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
6741         Change type of __writer element to int.
6742         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6743         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6744         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6745         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6746         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6747         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
6748         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6749         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
6750         Compare with TID to determine deadlocks.
6751         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
6752         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6753         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
6754         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6755         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6756         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6757         Likewise.
6758         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6759         Likewise.
6760         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6761         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
6762         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
6763         Likewise.
6764         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
6765         Likewise.
6766         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
6767         * Makefile (tests): Add tst-rwlock12.
6768         * tst-rwlock12.c: New file.
6770 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
6772         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
6773         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
6774         Remove bogus hidden_proto.
6775         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
6776         Likewise.
6777         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
6778         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
6779         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
6780         ___lll_mutex_timedlock): Likewise.
6782 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
6784         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6785         (__pthread_cond_signal): Add some code to eventually handle
6786         cond_lock!=0.
6788 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
6790         * Makefile (tests): Add tst-exec4.
6791         (tst-exec4-ARGS): Define.
6792         * tst-exec4.c: New file.
6794 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
6796         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
6797         Also fail if tv_nsec < 0.
6798         (__lll_timedwait_tid): Likewise.
6799         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
6800         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
6801         Likewise.
6802         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
6803         Likewise.
6804         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
6805         Likewise.
6806         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6807         Likewise.
6808         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
6809         Likewise.
6810         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
6811         Likewise.
6813         * Makefile (tests): Add tst-sem8 and tst-sem9.
6814         * tst-sem8.c: New file.
6815         * tst-sem9.c: New file.
6816         * sem_open.c: Fix creation of in_use record if the file exists but
6817         no internal record.
6819         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
6820         definitions.
6822         * sysdeps/pthread/timer_create.c (timer_create): In case
6823         evp==NULL, assign timer ID to sival_ptr.
6825         * descr.h (struct pthread_unwind_buf): Change type of prev element to
6826         struct pthread_unwind_buf *.
6827         (struct pthread): Likewise for cleanup_jmp_buf element.
6829         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
6830         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
6831         * unwind.c (__pthread_unwind_next): Likewise.
6833 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
6835         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6836         (lll_futex_timed_wait): Use int for futex value parameter.
6837         (lll_futex_wake): Likewise.
6838         (lll_futex_requeue): Likewise.
6840         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
6841         Replace one memory operation with one register operation.
6843         * tst-join4.c (do_test): Fix error message.
6845         * tst-rwlock6.c (do_test): Use correct format specifier.
6847         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
6848         (__lll_mutex_lock_wait): Replace one memory operation with one
6849         register operation.
6850         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
6851         (__lll_mutex_lock_wait): Likewise.
6853         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6854         (__lll_mutex_cond_lock): Add one to value parameter of
6855         __lll_lock_wait to reflect reality in the futex syscall.
6856         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6857         (lll_mutex_cond_lock): Likewise.
6859 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
6861         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
6862         New function.
6863         (lll_mutex_cond_lock): Define.
6865 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
6867         * Makefile (tests): Add tst-signal6.
6868         * tst-signal6.c: New file.
6870         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
6871         (__lll_mutex_unlock_force): New function
6872         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
6874         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6875         (__lll_mutex_unlock_force): New function.
6876         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
6878         * tst-rwlock7.c (do_test): Use correct format specifier.
6880         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
6881         Find break parameter in correct asm argument.
6883 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
6885         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
6886         Remove out4.
6887         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
6888         error occured.
6889         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
6890         Add __mutex.
6891         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
6892         lll_futex_requeue, lll_mutex_unlock_force): Define.
6894 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
6896         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6897         (pthread_cond_t): Add __mutex.
6898         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
6899         lll_futex_requeue, lll_mutex_unlock_force): Define.
6901 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6903         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
6904         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
6905         Add __mutex field.
6906         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
6907         Define.
6908         (lll_futex_wait, lll_futex_wake): Define.
6909         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
6910         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
6911         FUTEX_REQUEUE instead of FUTEX_WAIT.
6912         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
6913         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
6914         mutex which was used in condvar structure.  Call
6915         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
6916         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
6918         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
6919         include tcb-offsets.h.  Read wakeup value in locked region.
6920         Use the value of gbr register as THREAD_ID.
6921         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6922         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
6923         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
6925         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
6926         macros.
6928 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
6930         * sysdeps/pthread/pthread_cond_broadcast.c
6931         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
6933 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
6935         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
6936         typo in register name.
6937         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
6938         correctly.  Actually use requeue.  Little optimization.
6939         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
6940         mutex address early.  Handle cancellation state as 32-bit value.
6941         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6942         Remove unnecessary label.
6944 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
6946         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
6947         instead of FUTEX_WAIT.
6948         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
6949         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6950         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6951         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
6952         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
6953         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
6954         used in condvar structure.  Call __pthread_mutex_cond_lock instead
6955         of __pthread_mutex_lock_internal.
6956         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6957         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6958         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6959         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
6960         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6961         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6962         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
6963         Add pthread_mutex_cond_lock.
6964         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
6965         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
6966         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
6967         lll_mutex_cond_lock.
6968         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
6969         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6970         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
6971         Add __mutex field.
6972         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6973         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6975         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
6976         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6978         * pthreadP.h: Declare __pthread_mutex_cond_lock.
6979         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
6980         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
6981         macro don't define aliases.
6983         * cancellation.c: Remove __pthread_enable_asynccancel_2.
6984         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
6985         * sysdeps/pthread/pthread_cond_timedwait.c: Use
6986         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
6987         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6988         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6989         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6990         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6991         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6993 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
6995         * sem_open.c: Fix one endless loop.  Implement correct semantics
6996         wrt opening the same semaphore more then once.
6997         * sem_close.c: Adjust for sem_open change.
6998         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
6999         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
7000         * Makefile (tests): Add tst-sem7.
7001         * tst-sem7.c: New file.
7003 2003-05-16  Roland McGrath  <roland@redhat.com>
7005         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
7006         uninitialized variable braino.
7008 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
7010         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
7011         test for syscall availability.
7013         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
7014         __no_posix_timers to -1 if the syscalls don't exist.
7016         * pthread_join.c (pthread_join): Set tid field of the joined
7017         thread to -1.  This isn't necessary but helps to recognize some
7018         error conditions with almost no cost.
7020         * allocatestack.c (FREE_P): Also negative values indicate an
7021         unused stack.
7023         * unwind.c: Include <unistd.h>.
7025 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
7027         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
7029 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
7031         * Makefile (crti-objs, crtn-objs): New variables.
7032         (omit-deps, extra-objs): Add crtn.
7033         ($(objpfx)libpthread.so): Depend on both crti and crtn
7034         and links to them in multidir.
7035         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
7037 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
7039         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
7040         (lll_mutex_unlock): Use atomic_exchange_rel.
7042 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
7044         * cond-perf.c (cons): Add missing locking around setting of alldone.
7046 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
7048         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
7049         related macros.
7050         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7052 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
7054         * tst-sem6.c: New file.
7055         * Makefile (tests): Add tst-sem6.
7057         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
7058         Use atomic_exchange_rel instead of atomic_exchange.
7059         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
7060         Likewise.
7062         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
7063         code for lll_futex_wait and lll_futex_wake in static apps.  Use
7064         vsyscall is possible.
7066         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
7067         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
7068         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
7069         pthread_setaffinity_np.
7070         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
7071         and pthread_setaffinity_np.
7072         * Makefile (libpthread-routines): Add pthread_getaffinity and
7073         pthread_setaffinity.
7075         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
7076         use it in case mmap to allocate the stack fails.
7077         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
7078         ARCH_MAP_FLAGS here.
7079         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
7080         ARCH_RETRY_MMAP.
7082 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
7084         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
7085         handler implementation.  It is now lockless in fork().
7086         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
7087         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
7088         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
7089         declare the __fork_*_lists.
7090         (struct fork_handler): Include pointers to all three functions.
7091         Add next, refcntr and need_signal elements.
7092         (__fork_handlers): New declaration.
7093         (__register_atfork_malloc): Remove declaration.
7094         (HAVE_register_atfork_malloc): Remove definition.
7095         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
7096         __pthread_child_handler variable.
7097         (__libc_pthread_init): Use __register_atfork instead of explicitly
7098         adding to the list.
7099         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
7100         and lll_futex_wake.
7101         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7103         * unwind.c (unwind_cleanup): Print error message and then abort.  This
7104         function must never be reached.
7106         * cond-perf.c: New file.
7108 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
7110         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
7112 2003-05-04  Roland McGrath  <roland@redhat.com>
7114         * Makefile ($(objpfx)../libc.so): New target.
7116 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
7118         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7119         (pthread_condattr_t): Size is only an int, don't use long for
7120         alignment.
7121         (pthread_mutexattr_t): Likewise.
7122         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7123         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7124         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7126 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
7128         * sysdeps/i386/tls.h: Define THREAD_ID.
7129         * sysdeps/ia64/tls.h: Likewise.
7130         * sysdeps/powerpc/tls.h: Likewise.
7131         * sysdeps/s390/tls.h: Likewise.
7132         * sysdeps/sh/tls.h: Likewise.
7133         * sysdeps/x86_64/tls.h: Likewise.
7134         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
7135         record ownership.
7136         * pthread_mutex_timedlock.c: Likewise.
7137         * pthread_mutex_trylock.c: Likewise.
7138         * pthread_mutex_unlock.c: Likewise.
7139         * pthread_rwlock_trywrlock.c: Likewise.
7140         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
7141         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
7142         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
7143         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
7145         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
7146         flag.
7148 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
7150         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7151         (__SIZEOF_PTHREAD_COND_T): Define to 48.
7152         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
7153         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
7154         Make __align long long instead of long.
7155         (pthread_rwlock_t): Formatting.
7156         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
7157         (pthread_rwlock_t): Formatting.
7158         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7159         (pthread_cond_t): Make __align long long instead of long.
7160         (pthread_rwlock_t): Move __flags field to the same position as in
7161         linuxthreads.
7163 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
7165         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
7166         * tst-rwlock7.c (do_test): Likewise.
7168 2003-04-26  Roland McGrath  <roland@redhat.com>
7170         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
7172 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
7174         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
7175         sizeof (struct pthread).
7176         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
7177         1 struct pthread.
7178         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
7179         to 0.
7180         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
7181         struct pthread.
7182         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
7183         to 32-bit bytes.
7184         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
7185         tcbp.
7186         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
7187         unneccessarily.
7188         (NO_TLS_OFFSET): Define.
7189         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
7190         add TLS_TCB_SIZE unnecessarily.
7192 2003-04-22  Roland McGrath  <roland@redhat.com>
7194         * Makeconfig (shared-thread-library): Reverse link order to work
7195         around linker bug.
7197 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
7199         * semaphore.h: Fix typo in comment.
7201 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
7203         * sysdeps/pthread/sigfillset.c: New file.
7205         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
7206         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
7207         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
7208         * sysdeps/pthread/sigaction.c: Likewise.
7209         * sysdeps/pthread/sigprocmask.c: New file.
7210         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
7211         __SIGRTMIN+1.
7212         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7213         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
7214         in this case.
7216 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
7218         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
7219         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
7221         * sysdeps/unix/sysv/linux/unregister-atfork.c
7222         (__unregister_atfork): Don't free memory not allocated dynamically.
7224         * semaphore.h: Remove __THROW marker from cancellation points.
7225         * nptl/sysdeps/pthread/pthread.h: Likewise.
7227 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
7229         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
7230         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
7231         __THROW.
7233 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
7235         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
7237 2003-04-15  Roland McGrath  <roland@redhat.com>
7239         * forward.c (__pthread_unwind): Tweak to avoid warning.
7241 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
7243         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
7245 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
7247         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
7248         overflow CFA advance instructions.
7249         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7251 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
7253         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
7254         * sysdeps/i386/pthread_spin_lock.c: Likewise.
7255         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
7256         defined.
7258         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
7259         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
7260         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
7261         DW_CFA_advance_loc for .Laddl-.Lsubl.
7263 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
7265         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
7266         position-independent unwind data for static libraries.
7267         Add missing unwind info.  Add comments.
7269         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
7270         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7271         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7272         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7274 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
7276         * Makefile: Make sure all cancellation points are compiled with
7277         exception and asynchronous unwind tables.
7279         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
7280         which mishandles loading of global object addresses in PIC.
7281         (THREAD_SETMEM_NC): Likewise.
7283 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7285         * pthread.h: Define new data structure for cleanup buffer.  Declare
7286         new cleanup handler interfaces.
7287         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
7288         (struct pthread): Add cleanup_jmp_buf pointer.  Define
7289         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
7290         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
7291         it.  Declare old cleanup handler installation functions.
7292         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
7293         handling.
7294         * cleanup_defer.c: Likewise.
7295         * cleanup_compat.c: New file.  Old cleanup code.
7296         * cleanup_def_compat.c: New file.  Old cleanup code.
7297         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
7298         if own thread descriptor.
7299         * unwind.c: New file.
7300         * forward.c: Add __pthread_unwind.
7301         * init.c (pthread_functions): Add __pthread_unwind.
7302         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
7303         Add ptr___pthread_unwind.
7304         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
7305         and unwind function.
7306         * Makefile (libpthread-routines): Add cleanup_compat,
7307         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
7308         table generation if necessary.
7309         * version.c: Record whether unwind support is compiled in.
7310         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
7311         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
7312         handler interfaces.
7313         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
7314         complication to generate unwind information for syscall wrappers.
7315         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
7316         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
7317         __cleanup_fct_attribute.
7319         * Makefile: Add rules to build and run tst-cleanup0.
7320         * tst-cleanup0.c: New file.
7321         * tst-cleanup0.expect: New file.
7323         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
7324         caller.  Optimize to avoid often unecessary local variable.
7326 2003-04-11  Roland McGrath  <roland@redhat.com>
7328         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
7329         sets variable `multidir'; include that.
7330         (generated): Add it.
7331         ($(objpfx)$(multidir)/crti.o): New target.
7332         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
7334 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7336         * tst-attr2.c (do_test): Add cast to avoid warning.
7337         * tst-mutex4.c (do_test): Likewise.
7339 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
7341         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
7342         in child.
7344 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
7346         * Makefile (tests): Add tst-detach1.
7347         * tst-detach1.c: New file.
7349 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
7351         * sysdeps/pthread/pthread.h: Remove duplicate
7352         pthread_cleanup_{push,pop} definitions.
7354         * tst-barrier2.c: Eliminate warnings.
7355         * tst-cancel4.c: Likewise.
7356         * tst-cond4.c: Likewise.
7357         * tst-cond6.c: Likewise.
7358         * tst-detach1.c: Likewise.
7359         * tst-rwlock4.c: Likewise.
7360         * tst-rwlock6.c: Likewise.
7361         * tst-rwlock7.c: Likewise.
7362         * tst-sem3.c: Likewise.
7363         * tst-spin2.c: Likewise.
7364         * tst-umask1.c: Likewise.
7366 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
7368         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
7370 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
7372         * descr.h (struct pthread): Move cancelhandling member to the front.
7374 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
7376         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
7377         malloc_parent, and malloc_child statically.
7378         (__register_atfork_malloc): New function.
7379         (free_mem): Don't free any of the malloc_* variables on the list.
7380         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
7381         Define HAVE_register_atfork_malloc.
7383 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
7385         * sysdeps/pthread/createthread.c (create_thread): Add some more
7386         comments explaining when to set multiple_threads and when not.
7388         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7389         THREAD_ATOMIC_BIT_SET if not already defined.
7390         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7391         THREAD_ATOMIC_BIT_SET:
7392         * sysdeps/x86_64/tls.h: Likewise.
7393         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
7394         THREAD_ATOMIC_CMPXCHG_VAL.
7395         (_pthread_cleanup_pop_restore): Likewise.
7396         * cancellation.c (__pthread_enable_asynccancel): Likewise.
7397         (__pthread_enable_asynccancel_2): Likewise.
7398         (__pthread_disable_asynccancel): Likewise.
7399         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7400         (__libc_disable_asynccancel): Likewise.
7401         * init.c (sigcancel_handler): Likewise.
7402         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
7403         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
7405 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
7407         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
7408         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7409         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
7410         * Makefile (tests): Add tst-cancel11.
7411         * tst-cancel11.c: New file.
7413 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
7415         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
7416         round, not the first.  Use specific_used flag instead of local
7417         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
7418         (__free_tcb): Don't call deallocate_tsd here.
7419         (start_thread): Call deallocate_tsd here.
7420         * pthread_setspecific.c: Set specific_used flag really only when
7421         needed.
7422         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
7423         * tst-tsd3.c: New file.
7424         * tst-tsd4.c: New file.
7426 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7428         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
7429         Use atomic_exchange_and_add instead of __lll_add.
7430         (__lll_mutex_timedlock): Likewise.
7431         Patch by Ian Wienand.
7433 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
7435         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7436         (SINGLE_THREAD_P): Fix typo.
7437         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
7439 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7441         * Makefile (tests): Add tst-align.
7442         * tst-align.c: New file.
7443         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
7445         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
7446         function correctly.
7448         * tst-tsd2.c: Add casts to avoid warnings.
7450 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
7452         * descr.h (struct pthread): Move most often used elements to the front.
7454 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
7456         * Makefile (libpthread-routines): Add pthread_atfork.
7457         (libpthread-static-only-routines): Add pthread_atfork.
7459 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7461         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
7462         of TLS_DTV_AT_TP.
7463         (INSTALL_DTV): Add parens.
7464         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
7465         Use passed descr instead of THREAD_SELF.
7466         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
7467         (__lll_mutex_timedlock_wait): Correct expected value after
7468         spurious wakeup.
7469         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
7470         Release lock before waking up the waiters.
7471         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
7472         criteria.  Reorderstruct passed to cleanup handler.  Fix
7473         handling of cancellation and failung pthread_mutex_unlock call.
7474         Use __pthread_enable_asynccancel_2 instead of
7475         __pthread_enable_asynccancel.
7476         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7477         Return result of lock re-get if it fails.
7478         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
7479         for __pthread_cleanup_push.
7480         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
7481         completely broken rwlock implementation.
7482         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7483         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7484         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7485         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
7486         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7487         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
7488         versioned_symbol macro.
7489         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
7490         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
7492 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
7494         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
7495         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
7496         and __helper_tid.
7497         (struct timer): Remove th and bar field.
7498         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
7499         debugging code.  Create only one helper thread.
7500         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
7501         helper thread.
7502         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7503         Renamed.  Define statically.  Use thread info from siginfo.
7504         (__helper_once): New variable.
7505         (__helper_tid): New variable.
7506         (__reset_helper_control): New function.
7507         (__start_helper_thread): New function.
7509         * pthread_create.c (start_thread): Don't use setjmp inside
7510         __builtin_expect to work around gcc bug.
7512         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
7513         timer_delete syscall fails, but not with ENOSYS, set
7514         __no_posix_timers.
7516         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
7517         (timer_settime): Fix typo.
7518         * sysdeps/unix/sysv/linux/timer_getoverr.c
7519         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
7521 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
7523         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
7524         offset of cleanupbuf.__prev.
7526 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
7528         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
7529         of included file.
7531 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
7533         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
7534         NULL provide default definition to syscall.
7536 2003-03-25  Roland McGrath  <roland@redhat.com>
7538         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
7539         (timer_id2ptr): Fix typo.
7541 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
7543         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
7544         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
7545         * sysdeps/ia64/pthreaddef.h: Likewise.
7546         * sysdeps/powerpc/pthreaddef.h: Likewise.
7547         * sysdeps/s390/pthreaddef.h: Likewise.
7548         * sysdeps/sh/pthreaddef.h: Likewise.
7549         * sysdeps/x86_64/pthreaddef.h: Likewise.
7550         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
7551         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
7552         being changed.
7553         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
7554         SIGTIMER is not unblocked.
7555         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
7556         RT signal taken.
7557         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
7558         be send.
7559         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
7560         pass pointer through as ID.
7561         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
7562         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
7563         * sysdeps/unix/sysv/linux/timer_create.c: New file.
7564         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
7565         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
7566         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
7567         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
7568         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
7569         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
7570         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
7571         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
7572         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
7573         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
7574         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
7575         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
7576         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
7577         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
7578         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
7579         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
7580         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
7581         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
7582         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
7583         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
7584         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
7585         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
7586         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
7587         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
7588         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
7589         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
7590         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
7591         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
7592         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
7593         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
7595         * pthreadP.h: Remove FRAME_LEFT definition.
7596         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
7597         already left frame.  Programs which have this problem are not POSIX
7598         compliant.
7599         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
7601 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
7603         * sysdeps/pthread/tst-timer.c: Check return values of the
7604         functions we test.
7606 2003-03-23  Roland McGrath  <roland@redhat.com>
7608         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
7609         * tst-tls3mod.c: Likewise.
7610         * tst-tls1.c: Likewise.
7611         * tst-tls2.c: Likewise.
7613         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
7614         undefined behavior.
7616         * tst-join5.c (tf1, tf2): Add a cast.
7618         * Makeconfig (includes): Append -I$(..)nptl to this variable.
7620         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
7621         Don't test anything.
7622         * tst-cond4.c: Likewise.
7623         * tst-cond6.c: Likewise.
7624         * tst-flock2.c: Likewise.
7625         * tst-mutex4.c: Likewise.
7626         * tst-rwlock4.c: Likewise.
7627         * tst-signal1.c: Likewise.
7628         * tst-spin2.c: Likewise.
7629         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
7631         * tst-mutex4.c: Use test-skeleton.c.
7632         * tst-spin2.c: Likewise.
7633         * tst-sysconf.c: Likewise.
7634         * tst-barrier2.c: Likewise.
7635         * tst-cond4.c: Likewise.
7636         * tst-cond6.c: Likewise.
7637         * tst-rwlock4.c: Likewise.
7638         * tst-unload.c: Likewise.
7639         * tst-flock2.c (do_test): Use return instead of exit.
7641 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
7643         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
7645 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
7647         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7648         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
7649         instead of __lll_compare_and_swap.
7650         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
7651         Likewise.
7652         Removed definition if __lll_compare_and_swap.
7654         * cancellation.c: Adjust for new form of compare&exchange macros.
7655         * cleanup_defer.c: Likewise.
7656         * init.c: Likewise.
7657         * libc-cancellation.c: Likewise.
7658         * old_pthread_cond_broadcast.c: Likewise.
7659         * old_pthread_cond_signal.c: Likewise.
7660         * old_pthread_cond_timedwait.c: Likewise.
7661         * old_pthread_cond_wait.c: Likewise.
7662         * pthread_cancel.c: Likewise.
7663         * pthread_create.c: Likewise.
7664         * pthread_detach.c: Likewise.
7665         * pthread_join.c: Likewise.
7666         * pthread_key_delete.c: Likewise.
7667         * pthread_setcancelstate.c: Likewise.
7668         * pthread_setcanceltype.c: Likewise.
7669         * pthread_timedjoin.c: Likewise.
7670         * pthread_tryjoin.c: Likewise.
7671         * sysdeps/pthread/createthread.c: Likewise.
7673 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
7675         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
7676         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
7677         definitions.  Replace uses with calls to atomic_* functions.
7678         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
7679         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
7680         __lll_test_and_set calls with atomic_exchange_and_add and
7681         atomic_exchange calls respectively.
7682         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
7683         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
7684         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
7685         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
7686         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
7687         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
7688         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
7690         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
7691         returns the old value.
7693 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
7695         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
7696         int for variable OLDVAL and correct inline assembler contraint.
7697         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
7698         type int for variable OLD.
7700         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
7701         only for s390-32.
7702         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7703         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
7704         instead of multiple_threads field in the TCB.
7706 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
7708         * sysdeps/i386/i686/bits/atomic.h: Removed.
7709         * sysdeps/i386/i586/bits/atomic.h: Removed.
7710         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
7711         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
7712         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
7713         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
7714         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
7715         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
7716         * atomic.h: Removed.  Moved to glibc.
7718         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
7719         support for clock selection.
7721         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
7722         signalling waiters.
7724 2003-03-18  Roland McGrath  <roland@redhat.com>
7726         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7727         Add __lll_rel_instr first.  Add memory clobber.
7728         (lll_mutex_unlock): Use __lll_test_and_set.
7729         From Paul Mackerras <paulus@samba.org>.
7731         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
7732         unconditionally.
7733         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7734         (SINGLE_THREAD_P):  Add `header.' prefix.
7735         From Paul Mackerras <paulus@samba.org>.
7737         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
7738         pthread_timedjoin_np to ...
7739         (libpthread: GLIBC_2.3.3): ... here.
7740         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
7742         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
7743         Avoid shadowing VAL variable.
7745         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7746         New macro.
7748 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
7750         * Makefile (tests): Add tst-cond11.
7751         * tst-cond11.c: New file.
7753         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
7754         struct passed to cleanup handler to eliminate one more
7755         instruction.
7756         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7758         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7759         (pthrad_cond_t): Replace __unused field with __clock.
7761         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
7762         waken all waiters in cleanup handler.
7763         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7764         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7766         * pthread_condattr_getclock.c: New file.
7767         * pthread_condattr_setclock.c: New file.
7768         * sysdeps/pthread/pthread.h: Declare these new functions.
7769         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
7770         * Makefile (libpthread-routines): Add the new functions.
7771         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
7772         Renamed field to value.  Document use of the bits.
7773         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
7774         change.
7775         * pthread_condattr_setpshared.c: Likewise.
7776         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
7777         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
7778         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
7779         Add __clock field.
7780         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7781         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7782         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7783         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7784         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
7785         Implement clock selection.
7786         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7787         * pthread-errnos.sym: Add ENOSYS.
7788         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
7789         _POSIX_CLOCK_SELECTION.
7790         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
7792         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
7793         invalid .size directive.
7795 2003-03-17  Roland McGrath  <roland@redhat.com>
7797         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
7798         Formatting tweaks.
7800 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7802         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
7803         Use __lll_add instead of spelling it out.  Use protected symbol names.
7804         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
7805         Use __lll_add.
7806         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
7807         Renamed from lll_compare_and_swap.  Use new name where necessary.
7808         (__lll_add): Defined.
7809         (__lll_dec_if_positive): Defined.
7810         (__lll_test_and_set): Defined.
7811         * sysdeps/ia64/pthread_spin_init.c: Removed.
7812         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
7813         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
7814         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
7815         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
7816         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
7817         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
7818         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
7819         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
7820         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
7821         __sync_lock_release_si.
7822         Patch by Jakub Jelinek.
7824         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
7825         Fix timeout handling.
7826         (__lll_timedwait_tid): Likewise.
7827         (lll_unlock_wake_cb): Wake up other waiters if necessary.
7828         Patch by Jakub Jelinek.
7830         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
7832 2003-03-17  Roland McGrath  <roland@redhat.com>
7834         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
7835         * sysdeps/pthread/pthread_spin_init.c: New file.
7836         * sysdeps/pthread/pthread_spin_unlock.c: New file.
7837         * sysdeps/powerpc/Makefile: New file.
7838         * sysdeps/powerpc/pthread_spin_lock.c: New file.
7839         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
7840         * sysdeps/powerpc/pthreaddef.h: New file.
7841         * sysdeps/powerpc/tcb-offsets.sym: New file.
7842         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
7843         * sysdeps/powerpc/tls.h: New file.
7844         * sysdeps/powerpc/bits/atomic.h: New file.
7845         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
7846         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
7847         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
7849         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
7850         * sysdeps/unix/sysv/linux/sem_post.c: New file.
7851         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
7852         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
7853         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
7854         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
7855         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
7856         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
7857         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
7858         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
7859         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
7860         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
7861         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
7862         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
7863         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
7865         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
7866         not gettimeofday.
7867         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
7868         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
7869         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
7870         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
7871         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
7873 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7875         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
7876         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7877         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7878         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7879         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
7881 2003-03-16  Roland McGrath  <roland@redhat.com>
7883         * tst-fork4.c: Include <string.h>.
7884         * tst-signal2.c: Likewise.
7885         * tst-mutex5.c (do_test): exit -> return.
7886         * tst-mutex2.c: Include <stdlib.h>.
7888 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
7890         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
7891         (__lll_mutex_timedlock_wait): Correct expected value after
7892         spurious wakeup.  Otherwise we would never wait again.
7894         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
7895         zone versus inline asm stupidity.  Use correct instructions.
7897         * tst-rwlock6.c: Add some more status output.
7899 2003-03-15  Roland McGrath  <roland@redhat.com>
7901         * sysdeps/pthread/configure.in: New file.
7902         * sysdeps/pthread/configure: New file (generated).
7904 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
7906         * allocatestack.c (allocate_stack): Store the exact stack size of
7907         user allocated stacks.
7909 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
7911         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
7912         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
7913         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
7914         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
7915         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
7916         Use `header.' prefix.
7917         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
7919 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
7921         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
7922         __builtin_frame_address, use stack pointer.
7924         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
7925         instead of __builtin_frame_pointer.
7927 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
7929         * tst-basic1.c (do_test): Add cast to avoid warning.
7930         * tst-basic2.c (do_test): Likewise.
7932         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
7933         amount of stack correction.
7935         * tst-fork4.c: Use test-skeleton.c.
7937 2003-03-14  Roland McGrath  <roland@redhat.com>
7939         * init.c: Fix typo "#eli" for "#else".
7941 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
7943         * allocatestack.c (__stack_user): Use hidden_data_def.
7944         * pthread_create.c (__pthread_keys): Likewise.
7946         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
7948 2003-03-14  Roland McGrath  <roland@redhat.com>
7950         * tst-fork4.c: New file.
7951         * Makefile (tests): Add it.
7953         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
7954         we always define the padding space.
7955         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
7956         stopped supporting its own extensions fully.
7957         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
7958         struct also called `header', so `header.multiple_threads' is the field
7959         name to use on all machines.
7960         * allocatestack.c (allocate_stack): Use `header.' prefix.
7961         * sysdeps/pthread/createthread.c (create_thread): Likewise.
7962         * pthread_create.c (__pthread_create_2_1): Likewise.
7963         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
7964         (THREAD_SELF): Likewise.
7965         * sysdeps/x86_64/tls.h: Likewise.
7966         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
7967         (SINGLE_THREAD_P): Likewise.
7968         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
7969         (SINGLE_THREAD_P): Likewise.
7970         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7971         (SINGLE_THREAD_P): Likewise.
7973         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
7974         value directly.
7976 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
7978         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
7979         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
7981         * pthread_create.c (start_thread): setjmp is expected to return 0.
7983         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
7984         (THREAD_GETMEM_NC): Likewise.
7986 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
7988         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
7989         and the size of the stack which must be allocated is a multiple,
7990         allocate one more page.
7991         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
7992         MULTI_PAGE_ALIASING.
7994 2003-03-13  Roland McGrath  <roland@redhat.com>
7996         * pthread_create.c (start_thread): Set EXITING_BIT after the
7997         event-reporting (and destructors), not before.
7999 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
8001         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
8002         lll_futex_wake): Declare register variables as long int instead of
8003         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
8004         Make syscall arguments clobbered by the syscall.
8005         (lll_futex_wait): Define using lll_futex_timed_wait.
8007         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
8008         to void *.
8010         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
8011         PPID if [! NDEBUG].
8013         * allocatestack.c (nptl_ncreated): Only declare if
8014         COLORING_INCREMENT != 0.
8016         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
8017         (__libc_enable_asynccancel_2): Remove prototype.
8019         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
8020         ctid to match kernel.
8022 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
8024         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
8025         libc_multiple_threads.
8026         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
8027         __libc_multiple_threads to...
8028         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
8030         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
8031         versioning.
8032         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8033         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8035         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
8036         (__pthread_once_internal): Define.
8038         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
8039         macros instead of .symver directly.
8040         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
8041         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
8043         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
8044         * sysdeps/x86_64/tcb-offsets.sym: New file.
8045         * sysdeps/x86_64/Makefile: New file.
8047         * sysdeps/i386/tcb-offsets.sym: Add SELF.
8048         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
8049         to access own pthread_t in TCB.
8050         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8051         Likewise.
8052         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8053         Likewise.
8054         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8056 2003-03-12  Roland McGrath  <roland@redhat.com>
8058         * pthread-errnos.sym: New file.
8059         * Makefile (gen-as-const-headers): New variable, list that file.
8060         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
8061         header <pthread-errnos.h> instead of defining errno values here.
8062         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
8063         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8064         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8065         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8066         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8067         Likewise.
8068         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8069         Likewise.
8070         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8071         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8072         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8073         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8074         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8075         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8076         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
8077         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
8078         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
8079         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
8080         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
8081         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
8082         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
8083         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
8084         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
8085         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8086         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
8087         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
8088         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
8089         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
8090         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8091         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
8092         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
8093         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
8094         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
8095         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
8096         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
8098         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
8099         CLONE_CHILD_SETTID worked.
8101 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
8103         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
8104         file.
8105         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
8106         file.
8108         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
8109         (pthread_cond_t): Add padding.
8111         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
8112         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
8113         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
8115         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
8116         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
8117         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
8118         (__pthread_rwlock_timedrdlock): Likewise.
8119         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
8120         (__pthread_rwlock_wrlock): Likewise.
8121         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
8122         (__pthread_rwlock_rdlock): Likewise.
8124         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
8126         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
8127         result of lock re-get if it fails.
8129 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8131         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
8132         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
8133         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
8134         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
8135         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
8136         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
8137         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
8138         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
8139         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8140         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8142         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
8143         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
8145         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
8146         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
8147         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
8148         (create_thread): Likewise.
8149         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
8150         * init.c (__pthread_initialize_minimal_internal): Initialize
8151         __libc_multiple_threads_ptr if necessary.
8152         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
8153         __pthread_multiple_threads and __libc_multiple_threads_ptr.
8154         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
8155         __libc_multiple_threads.
8156         (__libc_pthread_init): Return pointer to __libc_pthread_init if
8157         necessary.
8159         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
8160         (THREAD_SETMEM_NC): Likewise.
8162         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
8163         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
8164         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
8165         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
8167         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
8168         Eliminate one entire instruction.
8170         * cancellation.c (__pthread_enable_asynccancel_2): New function.
8171         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
8172         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
8173         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
8174         instead of __pthread_enable_asynccancel.
8175         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8176         (__pthread_cond_wait): Likewise.
8177         * sysdeps/pthread/pthread_cond_timedwait.c
8178         (__pthread_cond_timedwait): Likewise.
8179         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
8181         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8182         (__condvar_cleanup): Wake up all waiters in case we got signaled
8183         after being woken up but before disabling asynchronous
8184         cancellation.
8185         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8186         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
8187         (__condvar_cleanup): Likewise.
8189         * init.c (__NR_set_tid_address): If already defined, don't redefine.
8190         Make it an error if architecture has no #if case.  Add x86-64.
8192         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
8193         pt-initfini.s generation.
8195         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
8196         (TLS_INIT_TP): Fix typo.
8198 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8200         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
8201         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
8203         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
8204         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
8205         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
8206         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
8207         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
8208         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8209         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8210         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8212 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8214         * sysdeps/pthread/pthread_cond_timedwait.c
8215         (__pthread_cond_timedwait): Return the result of the final
8216         locking.  If it succeeds, the regular function return value.
8218         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
8219         Return result of the final locking.
8220         * version.c (__nptl_main): Work around problems with the strange
8221         INTERNAL_SYSCALL macro on ppc32.
8222         * init.c (__pthread_initialize_minimal_internal): Unblock
8223         SIGCANCEL in case the parent blocked it.
8224         Reported by Paul Mackerras <paulus@samba.org>.
8226         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
8227         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
8228         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
8230 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8232         * sysdeps/pthread/pthread_cond_timedwait.c
8233         (__pthread_cond_timedwait): Unlock and fail if
8234         __pthread_mutex_unlock_internal failed.
8236         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
8237         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
8238         Use ARCH_CLONE.
8239         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
8240         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
8241         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
8242         ALLOCATE_STACK): New macros.
8243         (TLS_TPADJ): New macro.
8244         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
8245         (allocate_stack): Handle TLS_DTV_AT_TP and
8246         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
8247         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
8248         Don't set PD->self.
8249         * init.c [__ia64__] (__NR_set_tid_address): Define.
8251         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
8252         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
8253         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
8254         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
8255         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
8256         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
8257         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
8258         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
8259         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
8260         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
8261         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
8262         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
8263         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
8264         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
8265         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
8266         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
8267         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
8268         * sysdeps/ia64/bits/atomic.h: New file.
8269         * sysdeps/ia64/Makefile: New file.
8270         * sysdeps/ia64/pthread_spin_init.c: New file.
8271         * sysdeps/ia64/pthread_spin_lock.c: New file.
8272         * sysdeps/ia64/pthread_spin_trylock.c: New file.
8273         * sysdeps/ia64/pthread_spin_unlock.c: New file.
8274         * sysdeps/ia64/pthreaddef.h: New file.
8275         * sysdeps/ia64/tcb-offsets.sym: New file.
8276         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
8277         * sysdeps/ia64/tls.h: New file.
8279         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
8280         to syscall instead of no arguments.
8282 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
8284         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
8285         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
8286         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
8287         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
8289         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
8290         unused code.
8292         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
8294         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8295         lowlevelbarrier.sym.
8296         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
8297         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
8298         Include lowlevelbarrier.h and don't define offsets locally.
8299         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
8301         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
8302         (__lll_mutex_lock_wait): Reverse order of first two parameters.
8303         (__lll_mutex_timedlock_wait): Likewise.
8304         (lll_mutex_lock): Adjust asm for that.
8305         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
8306         (lll_lock): Adjust asm for operand order change.
8307         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
8308         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
8310         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
8311         Reverse order of parameters.
8312         (__lll_timedwait_tid): Remove regparms attribute.
8313         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
8314         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
8316         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8317         (__lll_timedwait_tid): Remove one unnecessary instruction.
8319         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
8320         __lll_mutex_timedlock_wait only for NOT_IN_libc.
8321         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
8322         lowlevelmutex.S.
8324         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
8325         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
8326         for NOT_IN_libc.
8327         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
8328         lowlevellock.S.
8330         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
8331         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
8332         for libc.so.
8333         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
8334         define LOCK here (if UP is not defined).  The actual code is in
8335         lowlevelmutex.S.
8337         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
8338         LOCK is already defined.  Don't define lll_unlock_wake_cb and
8339         __lll_timedwait_tid for libc.so.
8340         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
8341         define LOCK here (if UP is not defined).  The actual code is in
8342         lowlevellock.S.
8344         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
8345         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
8346         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
8347         instead of lowlevelsem.h.
8348         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8349         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8350         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8352         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8353         lowlevelrwlock.sym.
8354         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
8355         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
8356         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
8358         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
8359         register loading.
8360         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
8361         last changed.  D'oh.
8363         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
8365         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
8366         of __libc_locking_needed.
8367         (lll_trylock): Initialize %eax to zero.
8369         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
8370         pthread_cond_t definition.
8372 2003-03-10  Roland McGrath  <roland@redhat.com>
8374         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
8375         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
8376         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
8377         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
8378         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
8380         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
8381         Instead of setting PD->multiple_threads, set globals
8382         __pthread_multiple_threads and __libc_multiple_threads.
8383         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8384         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
8385         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
8387         * descr.h (struct pthread): Conditionalize first member on
8388         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
8389         containing an anonymous tcbhead_t.  Move `list' member out.
8390         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
8391         * allocatestack.c: Remove use of `header.data.' prefix.
8392         * pthread_create.c: Likewise.
8393         * init.c (__pthread_initialize_minimal_internal): Likewise.
8394         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8395         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
8396         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
8397         * sysdeps/x86_64/tls.h: Likewise.
8398         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
8399         (SINGLE_THREAD_P): Likewise.
8400         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
8401         (SINGLE_THREAD_P): Likewise.
8402         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
8403         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
8405 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
8407         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
8409         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
8410         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8412         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
8413         leftovers from the ia32 code.
8415         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
8416         memory load.
8417         (clear_once_control): Don't load %esi.
8419         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
8420         handling.
8422         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8424         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
8425         * sysdeps/unix/sysv/linux/createthread.c: ...here.
8427         * Makefile (tests): Add tst-cond10.
8428         * tst-cond10.c: New file.
8430 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
8432         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
8433         * tst-signal3.c (do_test): Likewise.
8434         * tst-sem5.c (do_test): Likewise.
8435         * tst-kill6.c (do_test): Likewise.
8436         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
8438         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
8439         of inc/dec.
8440         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
8441         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
8442         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8443         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8444         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8445         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8446         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8447         Likewise.
8448         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8449         Likewise.
8450         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8451         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8452         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8453         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
8454         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
8455         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
8456         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8457         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8459         * allocatestack.c (allocate_stack): If mprotect() fails free the
8460         TLS memory.
8462 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
8464         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
8466         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
8467         lll_wake_tid.  This was used only to work around kernel limits in
8468         the early days.
8469         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
8470         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
8471         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8472         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
8474         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
8475         (__pthread_initialize_minimal_internal): Change initialization of
8476         __static_tls_align_m1 appropriately.
8477         * pthreadP.h (__static_tls_align_m1): Renamed from
8478         __static_tls_align.
8479         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
8480         instead of __static_tls_align-1.
8482 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
8484         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
8486         * pthread_create.c: Define __pthread_keys using nocommon
8487         attribute, not by placing it explicitly in bss.
8488         Remove DEFINE_DEALLOC definition.  Not needed anymore.
8490         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
8491         Use it in mmap call to allocate stacks.
8493         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
8495         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
8496         result of the thread function.
8498 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
8500         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
8501         version is just fine.
8503         * sysdeps/unix/sysv/linux/libc_pthread_init.c
8504         (__pthread_child_handler): Renamed from pthread_child_handler,
8505         exported, and marked hidden.  Change all users.
8506         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
8507         free __pthread_child_handler from child list.
8509 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8511         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
8513         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
8514         Fix handling of cancellation and failing pthread_mutex_unlock call.
8515         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8516         (__pthread_cond_wait): Likewise.
8518         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
8519         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
8520         lll_futex_timed_wait call.
8521         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
8522         (pthread_rwlock_timedwrlock): Likewise.
8524         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
8525         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
8526         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
8528         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
8529         check of lll_futex_wake return value.
8531 2003-03-03  Roland McGrath  <roland@redhat.com>
8533         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
8535         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8536         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
8537         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
8539 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
8541         * sysdeps/pthread/timer_create.c (timer_create): Return correct
8542         error for CPU clocks.
8544         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
8545         _POSIX_MONOTONIC_CLOCK.
8546         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
8548         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
8549         recent kernels.
8551 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8553         * descr.h (struct pthread): Move cleanup field to the front.
8555 2003-03-01  Roland McGrath  <roland@redhat.com>
8557         * sem_open.c (sem_open): Braino fix.
8559 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8561         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
8562         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
8563         __pthread_cleanup_pop functionality.
8564         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8566         * descr.h (struct pthread): Move tid field to the front now that
8567         it is often used.
8569         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
8570         (__lll_mutex_timedlock_wait): Remove.
8571         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8572         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
8573         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8574         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8575         (lll_unlock_wake_cb): Don't save and restore %esi.
8576         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8577         %esi.
8578         (__lll_timedwait_tid): Add alignment.
8579         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
8580         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8581         %esi.
8582         (__lll_timedwait_tid): Removed.
8583         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
8584         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
8585         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
8586         (pthread_barrier_wait): Don't save, load, and restore %esi for
8587         last thread.
8588         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
8589         (__pthread_cond_signal): Don't save, load, and restore %esi.
8590         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
8591         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
8592         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
8593         Don't save, load, and restore %esi.
8595 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
8597         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
8598         Release lock before waking up the waiters.
8600         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
8602         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
8603         (reader_thread): Likewise.
8605         * sysdeps/pthread/pthread_rwlock_unlock.c
8606         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
8607         to wake up readers if there are none.
8609         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
8610         Release internal lock before wake threads.
8612 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
8614         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
8615         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
8616         predefined.
8617         * tst-rwlock9.c: Likewise.
8618         * tst-rwlock10.c: New file.
8619         * tst-rwlock11.c: New file.
8621         * Makefile (tests): Add tst-dlsym1.
8622         * tst-dlsym1.c: New file.
8624         * init.c (__pthread_initialize_minimal_internal): Set
8625         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
8626         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
8628 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
8630         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
8632         * tst-cond2.c: Fix sychronization with child.
8634         * tst-rwlock8.c (reader_thread): Remove unused variable.
8636         * Makefile: Add rules to build and run tst-tls3.
8637         * tst-tls3.c: New file.
8638         * tst-tls3mod.c: New file.
8640         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
8641         * tst-rwlock8.c: New file.
8642         * tst-rwlock9.c: New file.
8643         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
8644         complete broken rwlock implementation.
8645         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8646         Likewise.
8647         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8648         Likewise.
8649         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8650         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8651         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
8652         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
8653         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
8654         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
8655         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
8657 2003-02-23  Roland McGrath  <roland@redhat.com>
8659         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
8661 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
8663         * Makefile (tests): Add tst-context1.
8664         * tst-context1.c: New file.
8666         * Makefile (tests): Add tst-tls1 and tst-tls2.
8667         * tst-tls1.c: New file.
8668         * tst-tls2.c: New file.
8670         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
8671         for failed cmpxchg.
8673         * pthread_create.c (start_thread): Set EXITING_BIT early.
8675         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
8676         (THREAD_GETMEM_NC): Likewise.
8678 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
8680         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
8681         off 3 more bytes by using offset-less instructions when possible.
8683         * Makefile: Add dependency for $(objpfx)version.d.
8685         * eintr.c (eintr_source): Add unnecessary return but the compiler
8686         insists.
8688         * tst-kill3.c: Include <unistd.h>.
8690 2003-02-21  Roland McGrath  <roland@redhat.com>
8692         * pthread_create.c (start_thread): Call __libc_thread_freeres.
8694 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8696         * Makefile (tests): Add tst-eintr1.
8697         (distribute): Add eintr.c.
8698         * tst-eintr1.c: New file.
8699         * eintr.c: New file.
8701         * pthread_cancel.c (pthread_cancel): Use tkill directly.
8703         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
8704         Disallow sending SIGCANCEL.
8706         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
8707         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
8708         * tst-kill1.c: New file.
8709         * tst-kill2.c: New file.
8710         * tst-kill3.c: New file.
8711         * tst-kill5.c: New file.
8712         * tst-kill6.c: New file.
8713         * tst-basic7.c: Renamed to...
8714         * tst-kill4.c: ...this.
8716 2003-02-21  Roland McGrath  <roland@redhat.com>
8718         * Makefile (install-lib-ldscripts): New variable.
8720 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8722         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
8723         * pthread_cancel.c: Use INVALID_TD_P.
8724         * pthread_detach.c: Likewise.
8725         * pthread_getschedparam.c: Likewise.
8726         * pthread_setschedparam.c: Likewise.
8727         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
8728         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
8729         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
8730         * pthread_timedjoin.c: Likewise.
8732         * tst-basic7.c: Include <signal.h>.
8734         * pthread_join.c (pthread_join): Limited checking for invalid
8735         descriptors.
8736         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
8738 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
8740         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
8741         beginning of the loop.  Clear the entire first block of TSD.
8742         * Makefile (tests): Add tst-key4.
8743         * tst-key4.c: New file.
8745 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
8747         * Makefile (tests): Add tst-basic7.
8748         * tst-basic7.c: New file.
8750         * pthread_create.c (deallocate_tsd): Mark as internal_function.
8751         Add some more __builtin_expect.
8753         * pthreadP.h: Define dummy version of DEBUGGING_P.
8755 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
8757         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
8758         _POSIX_THREAD_PRIORITY_SCHEDULING.
8759         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
8760         _XOPEN_REALTIME_THREADS.
8761         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
8763         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
8764         kernel returns EINVAL for PID <= 0, work around it.
8766         * Makefile (tests): Add tst-signal5.
8767         * tst-signal5.c: New file.
8769         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
8770         and LOGIN_NAME_MAX.
8772         * tst-cancel1.c (tf): Block all signals.
8774         * Makefile (tests): Add tst-basic6.
8775         * tst-basic6.c: New file.
8777         * tst-basic1.c: Add test for process ID.
8779         * Makefile (tests): Add tst-cancel10.
8780         * tst-cancel10.c: New file.
8782         * Makefile (tests): Add tst-signal4.
8783         * tst-signal4.c: New file.
8785         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
8786         __sigismember instead of sigismember.  Add __builtin_expect.
8788 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
8790         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
8791         pthread_setcancelstate, and pthread_rwlock_setpshared.
8793         * tst-cancel7.c (do_test): Make sure the pid file exists before
8794         canceling the thread.
8796         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
8797         pthread_rwlock_timedrdlock tests.
8798         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
8799         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8800         Check for invalid tv_nsec field.
8801         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8802         Likewise.
8804         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
8805         recursive mutex of overflow.
8807         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
8809         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
8810         going into an endless loop.
8811         * Makefile (tests): Add tst-cancel9.
8812         * tst-cancel9.c: New file.
8814         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
8816 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
8818         * tst-mutex5.c (do_test): Add more timedlock tests.
8820         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
8821         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
8823         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
8824         use INLINE_SYSCALL.  Error number is returned, not -1.
8826         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
8827         and __deallocate_stack with internal_function.
8828         * pthread_create.c: Adjust definitions appropriately.
8829         * allocatestack.c: Likewise.
8831         * pthread_join.c: Add one more __builtin_expect.
8832         * pthread_timedjoin.c: Likewise.
8834         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
8835         not data of sequence number does not match.
8836         Add one __builtin_expect.
8838         * Makefile (tests): Add tst-clock1.
8839         * tst-clock1.c: New file.
8841         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
8842         negative arguments.
8843         * Makefile (tests): Add tst-basic5.
8844         * tst-basic5.c: New file.
8846 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
8848         * Makefile (tests): Add tst-basic4.
8849         * tst-basic4.c: New file.
8851         * pthreadP.h: Add declaraction for __nptl_nthreads.
8852         * pthread_create.c: Define __nptl_nthreads
8853         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
8854         after thread is done.  If then zero, call exit(0).
8855         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8856         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
8857         * init.c (pthread_functions): Initialize ptr_nthreads.
8858         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
8859         (__reclaim_stacks): Decrement __nptl_nthreads.
8860         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
8861         Define.
8862         * Makefile (tests): Add tst-basic3.
8863         * tst-basic3.c: New file.
8865         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
8866         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
8867         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
8868         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
8869         if asynchronous canceling is enabled.
8870         * pthread_join.c (pthread_join): When recognizing circular joins,
8871         take into account the other thread might be already canceled.
8872         * Makefile (tests): Add tst-join5.
8873         * tst-join5.c: New file.
8875         * Makefile (tests): Add tst-join4.
8876         * tst-join4.c: New file.
8878 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
8880         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
8882 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8884         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
8885         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
8886         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
8887         warning.
8888         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
8889         to avoid warning.
8890         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
8891         error if lll_futex_wake failed.
8893 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
8895         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
8896         handling of cancellation and failung pthread_mutex_unlock call.
8897         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8898         * Makefile (tests): Add tst-cond8 and tst-cond9.
8899         * tst-cond8.c: New file.
8900         * tst-cond9.c: New file.
8902         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
8904         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
8905         non-standard initializers with __USE_GNU.
8907         * Makefile (tests): Add tst-cleanup3.
8908         * tst-cleanup3.c: New file.
8910 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
8912         * Makefile (tests): Add tst-attr1 and tst-attr2.
8913         * tst-attr1.c: New file.
8914         * tst-attr2.c: New file.
8916         * Makefile: Add rules to build and run tst-atfork2 test.
8917         * tst-atfork2.c: New file.
8918         * tst-atfork2mod.c: New file.
8920         * sysdeps/unix/sysv/linux/unregister-atfork.c
8921         (__unregister_atfork): Free the memory allocated for the handlers
8922         after removing them from the lists.
8924         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
8925         cleanup function.
8927         * tst-atfork1.c (do_test): Wait for the child we forked.
8928         Report error in child.
8930         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
8932         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
8934 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
8936         * Makefile (tests): Add tst-cancel8.
8937         * tst-cancel8.c: New file.
8939         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
8940         clearing of control variable.
8941         * Makefile (tests): Add tst-once3 and tst-once4.
8942         * tst-once3.c: New file.
8943         * tst-once4.c: New file.
8945 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
8947         * sysdeps/sh/Makefile: New file.
8948         * sysdeps/sh/bits/atomic.h: New file.
8949         * sysdeps/sh/pthread_spin_init.c: New file.
8950         * sysdeps/sh/pthread_spin_lock.c: New file.
8951         * sysdeps/sh/pthread_spin_trylock.S: New file.
8952         * sysdeps/sh/pthread_spin_unlock.S: New file.
8953         * sysdeps/sh/pthreaddef.h: New file.
8954         * sysdeps/sh/tcb-offsets.sym: New file.
8955         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
8956         * sysdeps/sh/tls.h: New file.
8957         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
8958         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
8959         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
8960         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
8961         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
8962         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
8963         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
8964         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
8965         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
8966         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
8967         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
8968         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
8969         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
8970         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
8971         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
8972         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
8973         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
8974         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
8975         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
8976         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
8977         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
8978         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
8979         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
8980         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
8981         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
8982         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
8983         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
8984         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
8985         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
8986         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
8988 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
8990         * tst-cond2.c: Rearrange code to not rely on behavior undefined
8991         according to POSIX.
8993         * tst-basic2.c (do_test): Lock mutex before creating the thread.
8995 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
8997         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
8998         (TLS_GET_FS): New #define.
8999         (TLS_SET_FS): New #define.
9000         Correct value of __NR_set_thread_area.
9002         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
9004 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
9006         * Makefile (tests): Add tst-popen1.
9007         * tst-popen1.c: New file.
9009         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
9010         but inactive generalization.
9011         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9012         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
9013         Minor optimization, remove one instruction.
9014         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
9016 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9018         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
9020 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9022         * init.c (__NR_set_tid_address): Add #ifdef for s390.
9023         * sysdeps/pthread/pthread_barrier_wait.c: New file.
9024         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
9025         * sysdeps/pthread/pthread_cond_signal.c: New file.
9026         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
9027         * sysdeps/pthread/pthread_cond_wait.c: New file.
9028         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
9029         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
9030         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
9031         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
9032         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
9033         * sysdeps/s390/Makefile: New file.
9034         * sysdeps/s390/bits/atomic.h: New file.
9035         * sysdeps/s390/pthread_spin_init.c: New file.
9036         * sysdeps/s390/pthread_spin_lock.c: New file.
9037         * sysdeps/s390/pthread_spin_trylock.c: New file.
9038         * sysdeps/s390/pthread_spin_unlock.c: New file.
9039         * sysdeps/s390/pthreaddef.h: New file.
9040         * sysdeps/s390/tcb-offsets.sym: New file.
9041         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
9042         * sysdeps/s390/tls.h: New file.
9043         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
9044         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
9045         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
9046         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
9047         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
9048         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
9049         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
9050         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
9051         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
9052         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
9053         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
9054         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
9055         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
9056         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
9057         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
9058         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
9059         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
9060         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
9061         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
9062         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
9063         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
9064         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
9065         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
9067 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
9069         * atomic.h: Add a couple more default implementations.
9070         (atomic_compare_and_exchange_acq): Use
9071         __arch_compare_and_exchange_32_acq in return value definition.  It
9072         always exists.
9073         (atomic_bit_set): Renamed from atomic_set_bit.
9074         Add missing atomic_ prefixes.
9076         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
9077         thread library is available, use correct value to mark initialized
9078         once variable.
9080 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
9082         * allocatestack.c (allocate_stack): Use __getpagesize instead of
9083         __sysconf to determine pagesize.
9085         * pthread_create.c: Include <atomic.h>.
9086         * allocatestack.c (allocate_stack): Implement coloring of the
9087         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
9088         size minus one.  Adjust users.
9089         * sysdeps/i386/i686/Makefile: New file.
9091 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
9093         * allocatestack.c: Improve comment throughout the file.
9095         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9096         (__lll_lock_wait): Add branch prediction.
9097         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
9098         (__lll_lock_wait): Likewise.
9099         (lll_unlock_wake_cb): Removed.
9101 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
9103         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
9104         _POSIX_THREAD_PRIORITY_SCHEDULING.
9106 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
9108         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9109         Fix return type of ptr___pthread_getspecific.
9111 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
9113         * Makefile (tests): Add tst-umask1.
9114         (tst-umask1-ARGS): Define.
9115         * tst-umask1.c: New file.
9117 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
9119         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
9120         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
9121         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
9122         pthread_rwlock_unlock.
9123         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
9124         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
9125         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
9126         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
9127         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9128         New file.
9129         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
9130         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9131         New file.
9132         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
9133         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
9134         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
9135         New file.
9136         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
9137         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
9138         New file.
9139         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
9140         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
9141         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
9142         New file.
9143         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
9144         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
9145         New file.
9146         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
9148         * Makefile (libpthread-routines): Remove lowlevelcond and
9149         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
9150         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
9151         and pthread_cond_broadcast.
9152         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
9153         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
9154         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
9155         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
9156         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
9157         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
9158         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
9159         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
9160         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
9161         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
9162         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
9163         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
9164         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
9165         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
9166         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
9167         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
9168         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
9169         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
9170         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
9171         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
9172         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
9173         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
9174         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
9175         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
9176         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
9177         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
9178         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
9179         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
9180         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
9181         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
9182         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
9184         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
9185         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
9186         of the code is moved to ...
9187         * sysdeps/pthread/createthread.c: ...here.  New file.
9189 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
9191         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
9192         (__new_sem_post): Clear %eax before returning.
9193         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
9195         * Makefile (tests): Add tst-cleanup2.
9196         * tst-cleanup2.c: New file.
9198         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
9199         Interpret first parameter correctly.
9201 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
9203         * Makefile (headers): Add bits/semaphore.h.
9205 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
9207         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
9208         if not SHARED.
9210 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
9212         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
9213         must be used and mapping failed.
9214         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
9216         * Makefile (CFLAGS-pthread_self.os): Define this, not
9217         CFLAGS-pthread_self.c.
9219 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9221         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
9222         lll_unlock_wake_cb.
9224         * Makefile (libpthread-routines): Add version.  Add rules to build
9225         version.os and banner.h.
9226         * version.c: New file.
9228 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
9230         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
9231         the alias unconditional.
9232         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
9234 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9236         * Makefile (CFLAGS-pthread_self.c): New definition.
9238 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9240         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
9241         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
9242         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
9243         * init.c (__pthread_initialize_minimal_internal): Likewise.
9245 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
9247         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
9249         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
9250         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9251         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9252         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
9253         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9254         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9256 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9258         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
9259         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
9260         * tst-cancel-wrappers.sh: Remove all exceptions.
9262 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
9264         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
9265         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
9267         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
9268         Use __libc_pthread_functions array if SHARED.
9270         * pthreadP.h: Move pthread_cond_2_0_t definition to...
9271         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
9273         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
9274         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
9275         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
9276         __libc_ptf_call instead of __libc_maybe_call.
9277         (PTF): New #define.
9278         (__libc_cleanup_region_start): Wrap function name with PTF call.
9279         (__libc_cleanup_region_end): Likewise.
9280         (__libc_cleanup_end): Likewise.
9282         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
9283         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
9284         * pthread_key_create.c: Add __pthread_key_create_internal alias.
9285         * pthreadP.h: Add prototypes.
9287         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
9288         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
9289         __pthread_rwlock_unlock aliases.
9290         * pthreadP.h: Add prototypes for new aliases.
9292         * pthreadP.h (struct pthead_functions): Moved to...
9293         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
9294         * init.c (pthread_functions): Add initializers for new elements.
9296         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
9297         __pthread_cleanup_pop_restore aliases.
9298         * pthreadP.h: Add prototypes.
9300         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
9301         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
9302         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
9303         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
9304         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
9305         * pthreadP.h: Adjust prototypes and callers.
9307 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
9309         * Makefile (tests): Add tst-cancel7.
9310         (tst-cancel7-ARGS): New variable.
9311         * tst-cancel7.c: New file.
9313         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
9314         around gcc defficiencies.
9315         * old_pthread_cond_signal.c: Likewise.
9316         * old_pthread_cond_timedwait.c: Likewise.
9317         * old_pthread_cond_wait.c: Likewise.
9319         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
9321 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9323         * Makefile (tests): Add tst-cond7.
9324         * tst-cond7.c: New file.
9326         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9327         (condvar_cleanup): Get condvar address from the right place.
9329         * atomic.h: Correct definitions of atomic_full_barrier,
9330         atomic_read_barrier, atomic_write_barrier.
9332         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
9333         race-free.
9334         * old_pthread_cond_signal.c: Likewise.
9335         * old_pthread_cond_timedwait.c: Likewise.
9336         * old_pthread_cond_wait.c: Likewise.
9338 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
9340         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
9342 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9344         * pthreadP.h (pthread_cond_2_0_t): New type.
9345         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
9346         Use new type for the 2.0 condvar function prototypes.
9347         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
9348         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
9349         parameter.
9350         * old_pthread_cond_destroy.c: Likewise.
9351         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
9352         * old_pthread_cond_signal.c: Likewise.
9353         * old_pthread_cond_timedwait.c: Likewise.
9354         * old_pthread_cond_wait.c: Likewise.
9356         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9357         (__pthread_cond_wait): Don't save cancellation mode and seq value
9358         in same location.
9360         * herrno.c (__h_errno_location): Don't define as weak.
9362 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9364         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
9365         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
9366         and pthread_cond_wait.
9367         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
9368         Renamed to...
9369         (__pthread_cond_broadcast_2_0): ... this.
9370         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
9371         Renamed to...
9372         (__pthread_cond_destroy_2_0): ... this.
9373         * old_pthread_cond_init.c (__old_pthread_cond_init):
9374         Renamed to...
9375         (__pthread_cond_init_2_0): ... this.
9376         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
9377         Renamed to...
9378         (__pthread_cond_signal_2_0): ... this.
9379         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
9380         Renamed to...
9381         (__pthread_cond_wait_2_0): ... this.
9382         * pthread_cond_destroy.c: Include shlib-compat.h.
9383         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
9384         * pthread_cond_init.c: Include shlib-compat.h.
9385         (pthread_cond_init): Change strong_alias into versioned_symbol.
9386         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
9387         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
9388         fields.
9389         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
9390         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
9391         __pthread_cond_wait_2_0): New prototypes.
9392         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
9393         __old_pthread_cond_init, __old_pthread_cond_signal,
9394         __old_pthread_cond_wait): Removed.
9395         * init.c: Include shlib-compat.h.
9396         (pthread_functions): Guard ptr___pthread_attr_init_2_0
9397         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
9398         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
9399         ptr___pthread_cond_*_2_0 fields.
9400         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
9401         pthread_cond_*@GLIBC_2.0 compatibility symbols.
9403         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
9404         LIBC_SIGACTION was not yet defined.
9405         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
9406         [!defined LIBC_SIGACTION] (__sigaction): New function and
9407         libc_hidden_weak.
9408         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
9409         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
9411 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9413         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
9415 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
9417         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
9418         New, larger type definition.
9419         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
9420         implementation.
9421         * Versions [libpthread]: Add definitions for new pthread_cond_*
9422         interfaces for version GLIBC_2.3.2.
9423         * pthread_cond_init.c: Update initialization for new type definition.
9424         * Makefile (libpthread-routines): Remove pthread_cond_wait,
9425         pthread_cond_timedwait, pthread_cond_signal, and
9426         pthread_cond_broadcast.  Add old_pthread_cond_init,
9427         old_pthread_cond_destroy, old_pthread_cond_wait,
9428         old_pthread_cond_timedwait, old_pthread_cond_signal, and
9429         old_pthread_cond_broadcast.
9430         * old_pthread_cond_broadcast.c: New file.
9431         * old_pthread_cond_destroy.c: New file.
9432         * old_pthread_cond_init.c: New file.
9433         * old_pthread_cond_signal.c: New file.
9434         * old_pthread_cond_timedwait.c: New file.
9435         * old_pthread_cond_wait.c: New file.
9436         * pthreadP.h: Add prototypes for the compatibility interfaces.
9438         * pthread_cond_destroy.c: Don't include <errno.h>.
9440 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
9442         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
9443         unnecessary zero offset when addressing MUTEX.
9445 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9447         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
9448         __register_atfork.
9449         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
9450         for __register_atfork.
9452 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9454         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
9455         instead of ASSEMBLER test macro.
9457         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
9458         __libc_current_sigrtmax): Add libc_hidden_def.
9460         * sysdeps/pthread/list.h: Remove assert.h include.
9462 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9464         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
9465         __pthread_initialize_minimal_internal not
9466         __pthread_initialize_minimal.
9468 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
9470         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
9471         __pthread_initialize_minimal as hidden.
9473         * init.c (__pthread_initialize_minimal_internal): Don't mark as
9474         constructor.
9476 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9478         * Makefile ($(inst_libdir)/libpthread.so): Depend on
9479         $(common-objpfx)format.lds, include that into the output script.
9480         Fix comment.
9481         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
9483 2002-12-28  Andreas Jaeger  <aj@suse.de>
9485         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
9486         nsec resolution changes.
9487         (xstat64_conv): Likewise.
9488         (xstat32_conv): Likewise.
9489         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
9490         struct kernel_stat.
9491         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
9492         structs stat and stat64.
9493         * time/time.h (__timespec_defined): Define for __USE_MISC.
9494         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
9496 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
9498         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
9499         argument.
9500         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
9501         (pthread_exit): Use strong_alias to avoid warnings.
9502         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
9503         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
9504         ptr___pthread_attr_init_2_*.
9505         * init.c (pthread_functions): Adjust.
9507 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
9509         * forward.c: Make all functions available by default again.  It
9510         caused too much trouble.
9512         * pt-siglongjmp.c: Removed.
9514 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
9516         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
9517         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
9518         * sysdeps/i386/Makefile: New file.
9519         * sysdeps/i386/tcb-offsets.sym: New file.
9520         * sysdeps/pthread/tcb-offsets.h: New file.
9521         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9522         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
9524         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
9525         __register_atfork...
9526         (GLIBC_2.3.2): ...here.
9528 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9530         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
9531         pthread_attr_setstackaddr with __attribute_deprecated__.
9533 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9535         * pt-system.c (system): Remove cancellation handling.
9536         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
9537         cancellation routines.
9539 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9541         * descr.h: Include <dl-sysdep.h>.
9542         (struct pthread): Move header.data.list to the back of the struct.
9543         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
9544         (MULTIPLE_THREADS_OFFSET): Adjust offset.
9545         (SYSINFO_OFFSEET): Likewise.
9547 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9549         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
9550         Define.
9551         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
9552         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
9553         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
9554         (USE_DL_SYSINFO): Undef.
9556 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
9558         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
9559         $(common-objpfx)libc.so.
9560         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
9561         it is bigger than pipe buffer size even on arches with bigger
9562         page size.
9563         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
9565 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
9567         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
9568         correct errno access for case that USE___THREAD is not defined.
9570 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
9572         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
9573         Patch by Marijn Ros <marijn@mad.scientist.com>.
9575 2002-12-22  Roland McGrath  <roland@redhat.com>
9577         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
9579 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
9581         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
9583 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
9585         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
9586         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
9587         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
9589         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
9590         of int $0x80.
9591         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9592         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
9593         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
9594         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
9595         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
9596         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
9597         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
9598         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
9600         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
9601         sysenter.
9602         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
9604         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
9606         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
9607         in new TCB.
9608         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
9609         that sysinfo is properly initialized.
9610         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
9611         to 1 only for ld.so.
9613         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
9614         RTLD_CORRECT_DYNAMIC_WEAK.
9616 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
9618         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
9619         Use return 0 as 6th argument to FORWARD4.
9620         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
9622 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9624         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
9625         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
9626         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
9627         (INIT_SYSINFO): New #define.
9628         (TLS_TP_INIT): Use INIT_SYSINFO.
9629         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9630         At test to make sure SYSINFO_OFFSET value is correct.
9631         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
9633 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
9635         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
9636         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
9637         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
9638         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
9639         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
9640         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
9641         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
9643 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9645         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
9646         macro instead of using int $0x80 directly.
9648         * sysdeps/pthread/bits/stdio-lock.h: New file.
9649         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
9650         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
9651         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
9652         * Makefile (routines): Add libc-lowlevelmutex.
9654         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
9655         __i686.get_pc_thunk.dx.
9657 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9659         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
9660         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
9661         ($(objpfx)tst-cancel-wrappers.out): New rule.
9662         * tst-cancel-wrappers.sh: New test.
9663         * tst-locale1.c: Include signal.h.
9664         (uselocale): Test static linking of __libc_current_sigrt*.
9666 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
9668         * Makefile (tests): Add tst-cancel6.
9669         * tst-cancel6.c: New file
9671 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9673         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
9674         Define meaningfully for assembler as well.
9675         * pthreadP.h (struct pthread_functions): Remove
9676         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
9677         and ptr_pthread_attr_init_2_1 fields.
9678         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
9679         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
9680         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
9681         (FORWARD3): Define using FORWARD4.
9682         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
9683         versions.
9684         * pt-system.c: Remove duplicate stdlib.h include.
9686 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
9688         * sem_init.c: Define sem_init@GLIBC_2.0.
9689         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
9690         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
9692         * flockfile.c: Moved to...
9693         * sysdeps/pthread/flockfile.c: ...here.  New file.
9694         * funlockfile.c: Moved to...
9695         * sysdeps/pthread/funlockfile.c: ...here.  New file.
9696         * ftrylockfile.c: Moved to...
9697         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
9699 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
9701         * libc-cancellation.c: Guard both function with
9702         #if !defined NOT_IN_libc.
9703         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
9704         automatically provided pthread wrappers.
9705         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
9706         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
9707         nor in libpthread.
9708         * pt-open.c: Removed.
9709         * pt-fcntl.c: Removed.
9710         * pt-fsync.c: Removed.
9711         * pt-lseek.c: Removed.
9712         * pt-msgrcv.c: Removed.
9713         * pt-msgsnd.c: Removed.
9714         * pt-msync.c: Removed.
9715         * pt-nanosleep.c: Removed.
9716         * pt-open64.c: Removed.
9717         * pt-pause.c: Removed.
9718         * pt-pread.c: Removed.
9719         * pt-pread64.c: Removed.
9720         * pt-pwrite.c: Removed.
9721         * pt-pwrite64.c: Removed.
9722         * pt-read.c: Removed.
9723         * pt-recv.c: Removed.
9724         * pt-recvfrom.c: Removed.
9725         * pt-recvmsg.c: Removed.
9726         * pt-send.c: Removed.
9727         * pt-sendto.c: Removed.
9728         * pt-sigtimedwait.c: Removed.
9729         * pt-sigwait.c: Removed.
9730         * pt-wait.c: Removed.
9731         * pt-waitpid.c: Removed.
9732         * pt-write.c: Removed.
9733         * pt-accept.c: Removed.
9734         * pt-close.c: Removed.
9735         * pt-connect.c: Removed.
9736         * pt-lseek64.c: Removed.
9737         * pt-sendmsg.c: Removed.
9738         * pt-tcdrain.c: Removed.
9740 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
9742         * init.c (__pthread_initialize_minimal_internal): Renamed from
9743         __pthread_initialize_minimal.  Make old name an alias.  This
9744         converts a normal relocation into a relative relocation.
9746         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
9748         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
9749         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
9750         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
9751         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
9752         pt-sigwaitinfo, pt-waitid, and pt-writev.
9753         * pt-creat.c: Removed.
9754         * pt-poll.c: Removed.
9755         * pt-pselect.c: Removed.
9756         * pt-readv.c: Removed.
9757         * pt-select.c: Removed.
9758         * pt-sigpause.c: Removed.
9759         * pt-sigsuspend.c: Removed.
9760         * pt-sigwaitinfo.c: Removed.
9761         * pt-waitid.c: Removed.
9762         * pt-writev.c: Removed.
9764         * init.c (pthread_functions): New variable.
9765         (__pthread_initialize_minimal): Pass pointer to pthread_functions
9766         (or NULL) to __libc_pthread_init.
9767         * forward.c: Rewrite to use __libc:pthread_functions array to get
9768         function addresses.
9769         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
9770         prototype.
9771         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9772         Take new parameter.  Copy content of variable pointed to by it
9773         to __libc_pthread_init.
9775         * pthreadP.h (struct pthread_functions): New type.
9776         (__libc_pthread_init): Declare.
9778         * pthread_attr_destroy.c: Add namespace protected alias.
9779         * pthread_attr_getdetachstate.c: Likewise.
9780         * pthread_attr_getinheritsched.c: Likewise.
9781         * pthread_attr_getschedparam.c: Likewise.
9782         * pthread_attr_getschedpolicy.c: Likewise.
9783         * pthread_attr_getscope.c: Likewise.
9784         * pthread_attr_setdetachstate.c: Likewise.
9785         * pthread_attr_setinheritsched.c: Likewise.
9786         * pthread_attr_setschedparam.c: Likewise.
9787         * pthread_attr_setschedpolicy.c: Likewise.
9788         * pthread_attr_setscope.c: Likewise.
9789         * pthread_cond_broadcast.c: Likewise.
9790         * pthread_cond_destroy.c: Likewise.
9791         * pthread_cond_init.c: Likewise.
9792         * pthread_cond_signal.c: Likewise.
9793         * pthread_cond_wait.c: Likewise.
9794         * pthread_condattr_destroy.c: Likewise.
9795         * pthread_condattr_init.c: Likewise.
9796         * pthread_equal.c: Likewise.
9797         * pthread_exit.c: Likewise.
9798         * pthread_getschedparam.c: Likewise.
9799         * pthread_self.c: Likewise.
9800         * pthread_setcancelstate.c: Likewise.
9801         * pthread_setschedparam.c: Likewise.
9802         * pthread_mutex_destroy.c: Likewise.
9803         * pthread_mutex_init.c: Likewise.
9804         * pthreadP.h: Add prototypes for the aliases.
9806         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
9807         multiple_threads member in correct TCB to 1.
9809         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
9810         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
9811         member of thread decriptor, otherwise return unconditionally 1.
9813 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9815         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
9816         regular Linux version.  Remove file.
9817         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
9818         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
9819         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
9820         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
9821         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
9822         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
9823         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
9824         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
9825         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
9826         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
9827         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
9828         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
9829         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
9830         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
9831         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
9832         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
9833         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
9834         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
9835         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
9836         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
9837         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
9838         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
9839         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
9840         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
9841         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
9842         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
9843         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
9844         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
9845         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
9846         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
9848 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9850         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
9851         * sysdeps/unix/sysv/linux/open.c: Removed.
9852         * sysdeps/unix/sysv/linux/fsync.c: Removed.
9853         * sysdeps/unix/sysv/linux/lseek.c: Removed.
9854         * sysdeps/unix/sysv/linux/msync.c: Removed.
9855         * sysdeps/unix/sysv/linux/read.c: Removed.
9856         * sysdeps/unix/sysv/linux/close.c: Removed.
9857         * sysdeps/unix/sysv/linux/creat.c: Removed.
9858         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
9859         * sysdeps/unix/sysv/linux/pause.c: Removed.
9860         * sysdeps/unix/sysv/linux/select.c: Removed.
9861         * sysdeps/unix/sysv/linux/write.c: Removed.
9863 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9865         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
9866         element in TCB to see whether locking is needed.
9868         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
9869         MULTIPLE_THREADS_OFFSET value is correct.
9871         * sysdeps/unix/sysv/linux/close.c: New file.
9872         * sysdeps/unix/sysv/linux/connect.S: New file.
9873         * sysdeps/unix/sysv/linux/creat.c: New file.
9874         * sysdeps/unix/sysv/linux/fsync.c: New file.
9875         * sysdeps/unix/sysv/linux/llseek.c: New file.
9876         * sysdeps/unix/sysv/linux/lseek.c: New file.
9877         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
9878         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
9879         * sysdeps/unix/sysv/linux/msync.c: New file.
9880         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
9881         * sysdeps/unix/sysv/linux/open.c: New file.
9882         * sysdeps/unix/sysv/linux/open64.c: New file.
9883         * sysdeps/unix/sysv/linux/pause.c: New file.
9884         * sysdeps/unix/sysv/linux/poll.c: New file.
9885         * sysdeps/unix/sysv/linux/pread.c: New file.
9886         * sysdeps/unix/sysv/linux/pread64.c: New file.
9887         * sysdeps/unix/sysv/linux/pselect.c: New file.
9888         * sysdeps/unix/sysv/linux/pwrite.c: New file.
9889         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
9890         * sysdeps/unix/sysv/linux/readv.c: New file.
9891         * sysdeps/unix/sysv/linux/recv.S: New file.
9892         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
9893         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
9894         * sysdeps/unix/sysv/linux/select.c: New file.
9895         * sysdeps/unix/sysv/linux/send.S: New file.
9896         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
9897         * sysdeps/unix/sysv/linux/sendto.S: New file.
9898         * sysdeps/unix/sysv/linux/sigpause.c: New file.
9899         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
9900         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
9901         * sysdeps/unix/sysv/linux/sigwait.c: New file.
9902         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
9903         * sysdeps/unix/sysv/linux/system.c: New file.
9904         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
9905         * sysdeps/unix/sysv/linux/wait.c: New file.
9906         * sysdeps/unix/sysv/linux/waitid.c: New file.
9907         * sysdeps/unix/sysv/linux/waitpid.c: New file.
9908         * sysdeps/unix/sysv/linux/writev.c: New file.
9909         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
9911         * pt-readv.c: Fix comment.
9913 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9915         * tst-cleanup1.c: Include stdlib.h.
9917         * tst-cancel5.c: New test.
9918         * Makefile (tests): Add tst-cancel5.
9919         (tst-cancel5): Link against libc.so libpthread.so in that order.
9921 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
9923         * forward.c (test_loaded): Prevent recursive calls.
9925         * Makefile (routines): Add libc-cancellation.
9926         * libc-cancellation.c: New file.
9927         * descr.h (struct pthread): Add multiple_threads field.
9928         * allocatestack.c (allocate_stack): Initialize multiple_header field of
9929         new thread descriptor to 1.
9930         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
9931         Initialize multiple_thread field after successful thread creation.
9932         * cancellation.c (__do_cancel): Move to pthreadP.h.
9933         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
9934         (__pthread_disable_asynccancel): Add internal_function attribute.
9935         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
9936         * pthread_setcancelstate.c: Likewise.
9937         * pthread_setcanceltype.c: Likewise.
9938         * pthread_exit.c: Likewise.
9939         * pthreadP.h (CANCELLATION_P): Likewise.
9940         (__do_cancel): Define as static inline.
9941         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
9942         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
9943         declarations.
9944         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
9945         fields.  Define MULTIPLE_THREADS_OFFSET.
9946         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
9947         declaration.
9948         * sysdeps/unix/sysv/linux/accept.S: New file.
9949         * sysdeps/unix/sysv/linux/read.c: New file.
9950         * sysdeps/unix/sysv/linux/write.c: New file.
9951         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
9952         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
9953         initialization of __libc_locking_needed.
9954         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
9955         __libc_locking_needed, use multiple_threads field in TCB.
9956         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9958 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
9960         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
9961         version.
9962         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
9964         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
9965         access to __libc_locking_needed for PIC.
9967 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
9969         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
9970         declare for libc.so.
9971         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
9972         expression.
9973         (__libc_lock_lock): Put into statement expression.
9974         (__libc_lock_unlock): Remove trailing semicolon.
9975         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
9977 2002-12-12  Roland McGrath  <roland@redhat.com>
9979         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
9980         "m" constraint to refer to __libc_locking_needed.  Declare it here.
9982 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
9984         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
9985         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
9986         Initialize __libc_locking_needed.
9987         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
9988         instead of __register_pthread_fork_handler.
9989         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
9990         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
9991         fork-gen with libc_pthread_init.
9992         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
9993         of __register_pthread_fork_handler.
9994         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
9995         of __register_pthread_fork_handler.
9996         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
9997         __libc_locking_needed to determine whether lock prefix can be avoided.
9998         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10000 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
10002         * Makefile (tests): Add tst-cleanup1.
10003         * tst-cleanup1.c: New file.
10004         * cancellation.c (__cleanup_thread): Removed.
10005         (__do_cancel): Remove call to __cleanup_thread.
10006         * pthreadP.h: Remove __cleanup_thread prorotype.
10008         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
10009         Remember function and argument even if cancellation handler
10010         function is not available.
10011         (__libc_cleanup_region_end): Execute registered function directly if
10012         pthread functions are not available.
10013         (__libc_cleanup_end): Likewise.
10015         * init.c (__pthread_initialize_minimal): Fix initialization in
10016         static lib by preventing gcc from being too clever.
10018 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
10020         * init.c (__pthread_initialize_minimal): Remove unneccesary
10021         sigaddset call.
10023         * Makefile (tests): We can run tst-locale2 now.
10025 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
10027         * Versions: Remove duplicated sigwait entry.
10029 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
10031         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
10032         inside libpthread.
10034         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
10036         * pthreadP.h: Declare __pthread_enable_asynccancel and
10037         __pthread_disable_asynccancel.
10038         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
10039         (CANCEL_RESET): Use __pthread_disable_asynccancel.
10040         * cancellation.c (__pthread_enable_asynccancel): New function.
10041         (__pthread_disable_asynccancel): New function.
10042         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
10043         * pt-close.c: Likewise.
10044         * pt-connect.c: Likewise.
10045         * pt-creat.c: Likewise.
10046         * pt-fcntl.c: Likewise.
10047         * pt-fsync.c: Likewise.
10048         * pt-lseek.c: Likewise.
10049         * pt-lseek64.c: Likewise.
10050         * pt-msgrcv.c: Likewise.
10051         * pt-msgsnd.c: Likewise.
10052         * pt-msync.c: Likewise.
10053         * pt-nanosleep.c: Likewise.
10054         * pt-open.c: Likewise.
10055         * pt-open64.c: Likewise.
10056         * pt-pause.c: Likewise.
10057         * pt-poll.c: Likewise.
10058         * pt-pread.c: Likewise.
10059         * pt-pread64.c: Likewise.
10060         * pt-pselect.c: Likewise.
10061         * pt-pwrite.c: Likewise.
10062         * pt-pwrite64.c: Likewise.
10063         * pt-read.c: Likewise.
10064         * pt-readv.c: Likewise.
10065         * pt-recv.c: Likewise.
10066         * pt-recvfrom.c: Likewise.
10067         * pt-recvmsg.c: Likewise.
10068         * pt-select.c: Likewise.
10069         * pt-send.c: Likewise.
10070         * pt-sendmsg.c: Likewise.
10071         * pt-sendto.c: Likewise.
10072         * pt-sigpause.c: Likewise.
10073         * pt-sigsuspend.c: Likewise.
10074         * pt-sigtimedwait.c: Likewise.
10075         * pt-sigwait.c: Likewise.
10076         * pt-sigwaitinfo.c: Likewise.
10077         * pt-system.c: Likewise.
10078         * pt-tcdrain.c: Likewise.
10079         * pt-wait.c: Likewise.
10080         * pt-waitid.c: Likewise.
10081         * pt-waitpid.c: Likewise.
10082         * pt-write.c: Likewise.
10083         * pt-writev.c: Likewise.
10084         * pthread_join.c: Likewise.
10085         * pthread_timedjoin.c: Likewise.
10087         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
10088         (__xpg_sigpause): New function.
10089         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
10091 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
10093         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
10095         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
10096         _GI_pthread_cleanup_pop to pthreadP.h.
10098         * ftrylockfile.c: Use _IO_lock_trylock instead of
10099         pthread_mutex_trylock.
10101         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
10102         (CANCEL_RESET): Likewise.
10103         (__pthread_setcanceltype_): Declare.
10104         (__pthread_mutex_lock_internal): Declare.
10105         (__pthread_mutex_unlock_internal): Declare.
10106         (__pthread_once_internal): Declare.
10107         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
10108         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
10110         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
10111         and pthread_mutex_unlock.
10112         * pthread_cond_wait.c: Likewise.
10113         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
10114         * pthread_mutex_unlock.c: Likewise.
10116         * pthread_setcanceltype.c: Add additional alias
10117         __pthread_setcanceltype.
10119         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
10120         * sem_open.c (sem_open): Likewise.
10121         Use __libc_open, __libc_write, and __libc_close instead of
10122         open, write, and close respectively.
10124         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
10125         Rewrite as statement expression since it must return a value.
10127         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
10128         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
10129         __pthread_kill.
10131         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
10132         alias __pthread_once_internal.
10134         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
10136 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
10138         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
10139         * tst-stdio1.c: New file.
10140         * tst-stdio2.c: New file.
10142         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
10144         * Makefile (tests): Comment out tst-locale2 for now.
10145         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
10147         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
10148         -D_IO_MTSAFE_IO.
10149         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
10150         Use _IO_lock_init instead of explicit assignment.
10152         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
10153         Define __libc_lock_* and __libc_lock_recursive macros with
10154         lowlevellock macros, not pthread mutexes.
10156         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
10157         of pthread_mutex_lock.
10158         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
10159         instead of pthread_mutex_unlock.
10161 2002-12-06  Roland McGrath  <roland@redhat.com>
10163         * allocatestack.c (__stack_user): Use uninitialized defn.
10164         * init.c (__pthread_initialize_minimal): Initialize it here.
10166 2002-12-05  Roland McGrath  <roland@redhat.com>
10168         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
10169         string.
10170         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
10172         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
10173         missing & here too.
10175 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
10177         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10178         lowlevellock.
10179         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
10180         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
10181         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
10182         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
10183         for __libc_lock_* macros.
10184         * Makefile (routines): Add libc-lowlevellock.
10186 2002-10-09  Roland McGrath  <roland@redhat.com>
10188         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
10189         Under [__PIC__], call the function via the pointer fetched for
10190         comparison rather than a call by name that uses the PLT.
10191         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
10192         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
10193         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
10194         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
10195         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
10197 2002-12-04  Roland McGrath  <roland@redhat.com>
10199         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
10201         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
10202         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
10204         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
10206 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10208         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
10209         a completely opaque, non-integer type.
10210         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
10212 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
10214         * sysdeps/i386/tls.h: Include stdlib.h.
10215         * sysdeps/x86_64/tls.h: Likewise.
10217 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10219         * Makefile (tests): Add tst-locale2.
10220         (tests-static): Likewise.
10221         * tst-locale2.c: New file.
10223         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
10224         volatile and add memory clobbers to lock operations.
10226 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
10228         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
10229         * sysdeps/i386/i486/bits/atomic.h: New file.
10230         * sysdeps/i386/i586/bits/atomic.h: New file.
10231         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
10232         include i486 version.
10233         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
10234         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
10235         Patch by Marijn Ros <marijn@mad.scientist.com>.
10237         * allocatestack.c (get_cached_stack): Don't crash if we first
10238         found a stack with a larger size then needed.
10239         Reported by Hui Huang <hui.huang@sun.com>.
10241         * Makefile (tests): Add tst-sysconf.
10242         * tst-sysconf.c: New file.
10244         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
10245         PTHREAD_THREADS_MAX.
10247 2002-12-02  Roland McGrath  <roland@redhat.com>
10249         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
10250         Declare using hidden_proto instead of attribute_hidden, so there are
10251         non-.hidden static symbols for gdb to find.
10252         (__pthread_keys): Likewise.
10253         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
10254         * allocatestack.c (__stack_user): Likewise.
10255         * pthread_create.c (__pthread_keys): Likewise.
10256         (__nptl_threads_events, __nptl_last_event): Make these static instead
10257         of hidden.
10258         * pthread_key_create.c (__pthread_pthread_keys_max,
10259         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
10261 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
10263         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
10264         statically.
10265         * tst-locale1.c: New file.
10267         * pthread_cond_timedwait.c: Include <stdlib.h>.
10269         * Makefile (tests): Add tst-fork2 and tst-fork3.
10270         * tst-fork2.c: New file.
10271         * tst-fork3.c: New file.
10273 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
10275         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
10277         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
10278         require it to 200112L.
10280         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
10281         instruction only if HAVE_CMOV is defined.
10282         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
10284         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
10286         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
10288         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
10290         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
10292 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
10294         * sysdeps/x86_64/bits/atomic.h: New file.
10296         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
10297         16-bit operations.
10299         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
10300         possible since gettid cannot fail.
10302         * sysdeps/x86_64/pthreaddef.h: New file.
10304         * sysdeps/i386/pthreaddef.h (gettid): Removed.
10306         * sysdeps/x86_64/pthread_spin_init.c: New file.
10307         * sysdeps/x86_64/pthread_spin_lock.c: New file.
10308         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
10309         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
10311         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
10312         Add missing lock prefix.  Minute optimization.
10314         * tst-spin2.c (main): Also check successful trylock call.
10316         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
10317         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
10319         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
10320         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
10322         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
10323         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
10324         value in case of an error.  Add support for INTERNAL_SYSCALL.
10326         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
10327         value in case of an error.
10329         * sysdeps/x86_64/tls.h: New file.
10331 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10333         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
10334         takes the array member name and the index as parameters.
10335         (THREAD_SETMEM_NC): Likewise.
10336         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
10337         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
10338         interfaces.
10340         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
10341         to decide which code to use.
10342         (THREAD_SETMEM_NC): Likewise.
10344         * allocatestack.c (queue_stack): Don't remove stack from list here.
10345         Do it in the caller.  Correct condition to prematurely terminate
10346         loop to free stacks.
10347         (__deallocate_stack): Remove stack from list here.
10349 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10351         * Makefile (tests): Add tst-stack1.
10352         * tst-stack1.c: New file.
10354         * allocatestack.c (allocate_stack): Initialize the TCB on a user
10355         provided stack.
10357         * pthread_attr_getstack.c: Return bottom of the thread area.
10359 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
10361         * Makefile (libpthread-routines): Add pt-allocrtsig and
10362         pthread_kill_other_threads.
10363         * pt-allocrtsig.c: New file.
10364         * pthread_kill_other_threads.c: New file.
10365         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
10366         all three functions.
10367         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10368         allocrtsig.
10369         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
10370         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
10371         and __libc_allocate_rtsig_private.
10372         * Versions (libpthread): Export pthread_kill_other_threads_np,
10373         __libc_current_sigrtmin, and __libc_current_sigrtmax.
10375 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
10377         * allocatestack.c (allocate_stack): stackaddr in attribute points to
10378         the end of the stack.  Adjust computations.
10379         When mprotect call fails dequeue stack and free it.
10380         * pthread_attr_setstack.c: Store top of the stack in stackaddr
10381         attribute.
10382         * pthread_getattr_np.c: Likewise.
10384         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
10385         surprises.
10387 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
10389         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
10390         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10392 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
10394         * pthread_getspecific.c: Optimize access to first 2nd-level array.
10395         * pthread_setspecific.c: Likewise.
10397 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
10399         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
10400         definitions.  Get them from the official place.
10401         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
10403         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
10404         Use new CLONE_ flags in clone() calls.
10406         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
10407         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
10409         * Versions: Add pthread_* functions for libc.
10410         * forward.c: New file.
10412         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
10413         errno-loc.
10414         * herrno.c: New file.
10415         * res.c: New file.
10417         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
10418         sem_trywait, and sem_timedwait.  Add herrno and res.
10419         * sem_init.c: Don't initialize lock and waiters members.
10420         * sem_open.c: Likewise.
10421         * sem_post.c: Removed.
10422         * sem_wait.c: Removed.
10423         * sem_trywait.c: Removed.
10424         * sem_timedwait.c: Removed.
10425         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
10426         Includes full implementations of sem_post, sem_wait, sem_trywait,
10427         and sem_timedwait.
10428         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
10429         for new implementation.
10430         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
10431         and waiters fields.
10433         * tst-sem3.c: Improve error message.
10434         * tst-signal3.c: Likewise.
10436         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
10437         to tell the kernel about the termination futex and to initialize tid
10438         member.  Don't initialize main_thread.
10439         * descr.h (struct pthread): Remove main_thread member.
10440         * cancelllation.c (__do_cancel): Remove code handling main thread.
10441         The main thread is not special anymore.
10443         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
10444         size of the stacks to stack_cache_actsize.
10446         * pt-readv.c: Add missing "defined".
10447         * pt-sigwait.c: Likewise.
10448         * pt-writev.c: Likewise.
10450 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
10452         * Versions: Export __connect from libpthread.
10453         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10455         * Makefile (libpthread-routines): Add pt-raise.
10456         * sysdeps/unix/sysv/linux/raise.c: New file.
10457         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
10458         * sysdeps/generic/pt-raise.c: New file.
10460         * pthread_cond_init.c: Initialize all data elements of the condvar
10461         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10463         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
10464         * pthread_create.c: Likewise.
10466         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
10467         * tst-key1.c: New file.
10468         * tst-key2.c: New file.
10469         * tst-key3.c: New file.
10471         * Versions: Export pthread_detach for version GLIBC_2.0.
10472         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
10474 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
10476         * pthread_key_create.c: Terminate search after an unused key was found.
10477         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10479         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
10480         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10482 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
10484         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
10485         dynamic lookup for errno in PIC.
10487         * allocatestack.c (get_cached_stack): Rearrange code slightly to
10488         release the stack lock as soon as possible.
10489         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
10490         the static TLS block.
10491         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
10493         * cancellation.c: Renamed from cancelation.c.
10494         * Makefile: Adjust accordingly.
10495         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
10496         * cleanup_defer.c: Use CANCELLATION_P.
10497         * pthread_testcancel.c: Likewise.
10498         * descr.h: Fix spelling in comments.
10499         * init.c: Likewise.
10500         * pthread_getattr_np.c: Likewise.
10501         * pthread_getschedparam.c: Likewise.
10502         * pthread_setschedparam.c: Likewise.
10503         * Versions: Likewise.
10505         * pt-pselect.c: New file.
10506         * Makefile (libpthread-routines): Add pt-pselect.
10507         * Versions: Add pselect.
10509         * tst-cancel4.c: New file.
10510         * Makefile (tests): Add tst-cancel4.
10512 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
10514         * pthread_mutex_lock.c: Always record lock ownership.
10515         * pthread_mutex_timedlock.c: Likewise.
10516         * pthread_mutex_trylock.c: Likewise.
10518         * pt-readv.c: New file.
10519         * pt-writev.c: New file.
10520         * pt-creat.c: New file.
10521         * pt-msgrcv.c: New file.
10522         * pt-msgsnd.c: New file.
10523         * pt-poll.c: New file.
10524         * pt-select.c: New file.
10525         * pt-sigpause.c: New file.
10526         * pt-sigsuspend.c: New file.
10527         * pt-sigwait.c: New file.
10528         * pt-sigwaitinfo.c: New file.
10529         * pt-waitid.c: New file.
10530         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
10531         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
10532         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
10533         * Versions: Add all the new functions.
10535         * tst-exit1.c: New file.
10536         * Makefile (tests): Add tst-exit1.
10538         * sem_timedwait.c: Minor optimization for more optimal fastpath.
10540 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
10542         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
10544         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
10545         call.  pthread_join is an official cancellation point.
10546         * pthread_timedjoin.c: Likewise.
10548         * pthread_cond_wait.c: Revert order in which internal lock are dropped
10549         and the condvar's mutex are retrieved.
10550         * pthread_cond_timedwait.c: Likewise.
10551         Reported by dice@saros.East.Sun.COM.
10553 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
10555         * pthreadP.h: Cut out all type definitions and move them...
10556         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
10557         * pthreadP.h: Include <internaltypes.h>.
10559         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
10560         performance tweaks.
10562         * sem_trywait.c: Shuffle #includes around to get right order.
10563         * sem_timedwait.c: Likewise.
10564         * sem_post.c: Likewise.
10565         * sem_wait.c: Likewise.
10567         * nptl 0.3 released.
10569         * Makefile (tests): Add tst-signal3.
10570         * tst-signal3.c: New file.
10572 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
10574         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
10575         the asms modify the sem object.
10576         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
10578         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
10579         the actual members.
10580         * pthreadP.h (struct sem): New type.  Actual semaphore type.
10581         * semaphoreP.h: Include pthreadP.h.
10582         * sem_getvalue.c: Adjust to sem_t change.
10583         * sem_init.c: Likewise.
10584         * sem_open.c: Likewise.
10585         * sem_post.c: Likewise.
10586         * sem_timedwait.c: Likewise.
10587         * sem_trywait.c: Likewise.
10588         * sem_wait.c: Likewise.
10590 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
10592         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
10593         * tst-basic2.c: New file.
10594         * tst-exec1.c: New file.
10595         * tst-exec2.c: New file.
10596         * tst-exec3.c: New file.
10598         * tst-fork1.c: Remove extra */.
10600         * nptl 0.2 released.  The API for IA-32 is complete.