* sysdeps/x86_64/bits/select.h: New file.
[glibc.git] / nptl / ChangeLog
blob83df001f0ad2ad9e8ba4299a451b8d9faf1a3b51
1 2008-12-09  Ulrich Drepper  <drepper@redhat.com>
3         * sysdeps/pthread/pthread.h (pthread_cleanup_pop): Use { } as empty
4         loop body instead of ; to avoid gcc warnings.
5         (pthread_cleanup_pop_restore_np): Likewise.
6         Patch by Caolán McNamara <caolanm@redhat.com>.
8 2008-12-09  Jakub Jelinek  <jakub@redhat.com>
10         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle only the
11         fast path here, for robust/PI/PP mutexes call
12         __pthread_mutex_lock_full.  Don't use switch, instead use a series
13         of ifs according to their probability.
14         (__pthread_mutex_lock_full): New function.
15         * pthread_mutex_unlock.c: Include assert.h.
16         (__pthread_mutex_unlock_usercnt): Handle only the
17         fast path here, for robust/PI/PP mutexes call
18         __pthread_mutex_unlock_full.  Don't use switch, instead use a series
19         of ifs according to their probability.
20         (__pthread_mutex_unlock_full): New function.
21         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c
22         (__pthread_mutex_lock_full): Define.
24 2008-12-08  Ulrich Drepper  <drepper@redhat.com>
26         * sysdeps/x86_64/tls.h (tcbhead_t): Add fields reserved for TM
27         implementation.  Add necessary padding and.
28         * descr.h (struct pthread): Increase padding for tcbhead_t to 24
29         words.
31 2008-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
33         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define FUTEX_WAIT_BITSET
34         and FUTEX_WAKE_BITSET.
36 2008-12-02  Ulrich Drepper  <drepper@redhat.com>
38         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_WAIT_BITSET
39         and FUTEX_WAKE_BITSET.
40         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
41         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
42         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
43         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
45 2008-11-25  Roland McGrath  <roland@redhat.com>
47         * sysdeps/alpha, sysdeps/unix/sysv/linux/alpha:
48         Subdirectories moved to ports repository as
49         sysdeps/.../nptl subdirectories.
51 2008-11-12  Jakub Jelinek  <jakub@redhat.com>
53         [BZ #7008]
54         * pthread_condattr_setclock.c (pthread_condattr_setclock): Fix masking
55         of old value.
56         * pthread_cond_init.c (__pthread_cond_init): Fix
57         cond->__data.__nwaiters initialization.
58         * Makefile (tests): Add tst-cond23.
59         * tst-cond23.c: New test.
61 2008-11-07  Jakub Jelinek  <jakub@redhat.com>
63         * sysdeps/pthread/malloc-machine.h (MALLOC): Adjust __libc_tsd_define
64         arguments.
65         (tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get}
66         arguments.
68 2008-11-01  Ulrich Drepper  <drepper@redhat.com>
70         [BZ #6955]
71         * pthread_mutex_lock.c: Add support for private PI mutexes.
72         * pthread_mutex_timedlock.c: Likewise.
73         * pthread_mutex_trylock.c: Likewise.
74         * pthread_mutex_unlock.c: Likewise.
75         Patch mostly by Ben Jackson <ben@ben.com>.
77 2008-10-31  Ulrich Drepper  <drepper@redhat.com>
79         [BZ #6843]
80         * sysdeps/pthread/gai_misc.h (__gai_create_helper_thread):
81         Increase stack size for helper thread.
83 2008-10-06  Martin Schwidefsky  <schwidefsky@de.ibm.com>
85         * sysdeps/s390/tls.h (THREAD_SET_STACK_GUARD): Add empty inline
86         assembly with a clobber list for access registers a0 and a1.
88 2008-09-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
90         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Add memory barrier
91         to force runp->refcntr to be read from memory.
93 2008-09-08  Richard Guenther  <rguenther@suse.de>
95         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_lock,
96         lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
97         lll_timedlock, lll_robust_timedlock, lll_unlock,
98         lll_robust_unlock): Promote private to int.
100 2008-08-15  Ulrich Drepper  <drepper@redhat.com>
102         * sysdeps/x86_64/pthreaddef.h: Remove ARCH_MAP_FLAGS and
103         ARCH_RETRY_MMAP definitions.
104         * allocatestack.c: Remove definition of ARCH_MAP_FLAGS.
105         Define MAP_STACK when not defined.
106         (allocate_stack): Use MAP_STACK instead of ARCH_MAP_FLAGS.  Remove
107         handling of ARCH_RETRY_MMAP.
109 2008-07-30  Ulrich Drepper  <drepper@redhat.com>
111         * tst-align2.c (f): Print message that f is reached.
113 2008-04-28  Hiroki Kaminaga  <kaminaga@sm.sony.co.jp>
115         [BZ #6740]
116         * sysdeps/powerpc/tcb-offsets.sym (PRIVATE_FUTEX_OFFSET): Guard symbol
117         definition with #ifndef __ASSUME_PRIVATE_FUTEX.
119 2008-07-25  Ulrich Drepper  <drepper@redhat.com>
121         * sysdeps/unix/sysv/linux/mq_notify.c (init_mq_netlink): Use
122         SOCK_CLOEXEC if possible.
124 2008-05-29  Ulrich Drepper  <drepper@redhat.com>
126         * Makefile (tests): Add tst-rwlock2a.
127         * tst-rwlock2.c: Use TYPE macro to decide what rwlock type to use.
128         * tst-rwlock2a.c: New file.
130 2008-06-12  Ulrich Drepper  <drepper@redhat.com>
132         * sysdeps/pthread/pthread.h: Remove inadvertant checkin.
134 2008-05-17  Samuel Thibault  <samuel.thibault@ens-lyon.org>
136         * sysdeps/pthread/pthread.h: Fix typo in comment.
138 2008-05-28  Ulrich Drepper  <drepper@redhat.com>
140         * sysdeps/pthread/createthread.c (do_clone): Pass accurate length
141         of CPU set to the kernel.
143 2008-05-23  Paul Pluzhnikov  <ppluzhnikov@google.com>
145         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Add
146         cfi directives.
147         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
148         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
149         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
150         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
151         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
152         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
154 2008-05-22  Paul Pluzhnikov  <ppluzhnikov@google.com>
156         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S: Add
157         cfi directives.
158         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
159         Likewise.
160         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
161         Likewise.
162         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
163         Likewise.
165 2008-05-26  Ulrich Drepper  <drepper@redhat.com>
167         * tst-typesizes.c: Explicitly check __SIZEOF_PTHREAD_* constants.
169 2008-05-20  Jakub Jelinek  <jakub@redhat.com>
171         David S. Miller  <davem@davemloft.net>
173         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
175 2008-05-10  Ulrich Drepper  <drepper@redhat.com>
177         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Access
178         __pshared correctly.
179         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
180         Likewise.
181         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
182         Likewise.
183         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
184         Likewise.
185         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
186         Likewise.
187         Reported by Clemens Kolbitsch <clemens.kol@gmx.at>.
189 2008-04-14  David S. Miller  <davem@davemloft.net>
191         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
192         (__old_sem_wait): Fix argument to lll_futex_wait().
194 2007-11-26  Daniel Jacobowitz  <dan@codesourcery.com>
196         * pthread_create.c: Require pthread_mutex_trylock and
197         pthread_key_delete for libgcc.
199 2008-04-08  Jakub Jelinek  <jakub@redhat.com>
201         [BZ #6020]
202         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h
203         (lll_futex_wake_unlock): Add private argument to the pre-v9 macro.
204         Patch by Sunil Amitkumar Janki <devel.sjanki@gmail.com>.
206 2008-03-27  Ulrich Drepper  <drepper@redhat.com>
208         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine ARG_MAX if
209         <linux/limits.h> has defined it.
210         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
211         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
212         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
213         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
215 2008-03-18  Jakub Jelinek  <jakub@redhat.com>
217         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Use __ASSEMBLER__ instead
218         of ASSEMBLER.
219         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
220         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Likewise.
222 2008-03-14  Ulrich Drepper  <drepper@redhat.com>
224         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
225         HAVE_DL_DISCOVER_OSVERSION.
226         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
227         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Likewise.
229 2008-03-07  Ulrich Drepper  <drepper@redhat.com>
231         [BZ #5778]
232         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Change
233         _POSIX_CHOWN_RESTRICTED value to zero.
235 2008-01-31  Roland McGrath  <roland@redhat.com>
237         * Makefile (omit-deps): Variable removed.
239 2008-01-30  Ulrich Drepper  <drepper@redhat.com>
241         * sysdeps/unix/sysv/linux/x86_64/sem_post.S (sem_post): Avoid
242         unnecessary addr32 prefix.
244 2008-01-29  Roland McGrath  <roland@redhat.com>
246         * Makeconfig (ptw-CPPFLAGS, sysd-rules-patterns): New variables.
248 2008-01-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
250         * sysdeps/unix/sysv/linux/sh/sem_post.S: Don't overflow value field.
252 2008-01-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
254         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XADD): Use
255         a scratch register.
256         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
257         (__lll_lock_wait_private): Fix typo.
258         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
259         (pthread_barrier_wait): Likewise.  Adjust XADD use.
260         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
261         Adjust XADD use.
262         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
263         (pthread_rwlock_timedrdlock): Return correct return value.
264         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
265         (pthread_rwlock_timedwrlock): Likewise.
267 2008-01-15  Ulrich Drepper  <drepper@redhat.com>
269         * tst-eintr2.c (do_test): make sure that if mutex_lock in main
270         thread returns the program exits with an error code.
272 2008-01-10  Ulrich Drepper  <drepper@redhat.com>
274         * pthread-errnos.sym: Add EOVERFLOW.
275         * sysdeps/unix/sysv/linux/structsem.sym: Add SEM_VALUE_MAX.
276         * sysdeps/unix/sysv/linux/sem_post.c: Don't overflow value field.
277         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
278         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
280 2007-12-14  Ulrich Drepper  <drepper@redhat.com>
282         * sysdeps/x86_64/pthreaddef.h (ARCH_RETRY_MMAP): Take additional
283         parameter.  Passed it as permission to mmap.
284         * allocatestack.c (allocate_stack): Pass prot as second parameter
285         to ARCH_RETRY_MMAP.
287 2007-12-12  Ulrich Drepper  <drepper@redhat.com>
289         * tst-basic7.c: Allocate memory for the stack.
291         [BZ #5465]
292         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S [!SHARED]
293         (__pthread_cond_timedwait): Don't use VDSO.
294         Patch by Michal Januszewski.
296 2007-12-07  Ulrich Drepper  <drepper@redhat.com>
298         [BZ #5455]
299         * sysdeps/pthread/pthread.h [!__EXCEPTIONS] (pthread_cleanup_pop):
300         Allow label before pthread_cleanup_pop.
301         (pthread_cleanup_pop_restore_np): Likewise.
303 2007-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
305         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
306         Store 2 before returning ETIMEDOUT.
308 2007-11-23  Ulrich Drepper  <drepper@redhat.com>
310         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
311         Store 2 before returning ETIMEDOUT.
312         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise
313         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
314         (__lll_lock_wait_private): Optimize.
315         (__lll_lock_wait): Likewise.
317 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
319         * sysdeps/pthread/pthread.h (pthread_cleanup_push,
320         pthread_cleanup_push_defer_np): Add extra (void *) cast to shut up
321         g++ 4.1 and 4.2 -Wstrict-aliasing warnings.
323 2007-11-08  Ulrich Drepper  <drepper@redhat.com>
325         [BZ #5240]
326         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
327         If we time out, try one last time to lock the futex to avoid
328         losing a wakeup signal.
329         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
330         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
332         [BZ #5245]
333         * sysdeps/pthread/createthread.c (do_clone): Translate clone error
334         if necessary.
336 2007-11-07  Ulrich Drepper  <drepper@redhat.com>
338         [BZ #5245]
339         * allocatestack.c (allocate_stack): Change ENOMEM error in case
340         mmap failed to EAGAIN.
341         * Makefile (tests): Add tst-basic7.
342         * tst-basic7.c: New file.
344 2007-11-05  Ulrich Drepper  <drepper@redhat.com>
346         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
347         Use __linkin_atfork.
349 2007-11-03  Mike Frysinger  <vapier@gentoo.org>
351         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (LOAD_FUTEX_WAIT): Add
352         missing line continuations.
353         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S (LOAD_FUTEX_WAIT,
354         LOAD_FUTEX_WAKE): Likewise.  Also add missing 3rd parameter.
356 2007-10-28  Ulrich Drepper  <drepper@redhat.com>
358         [BZ #5220]
359         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Declare
360         __active_timer_sigev_thread and __active_timer_sigev_thread_lock.
361         (struct timer): Add next element.
362         * sysdeps/unix/sysv/linux/timer_create.c: For SIGEV_THREAD timers,
363         enqueue timer structure into __active_timer_sigev_thread list.
364         * sysdeps/unix/sysv/linux/timer_delete.c: For SIGEV_THREAD timers,
365         remove timer struct from __active_timer_sigev_thread.
366         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
367         Before using timer structure make sure it is still on the
368         __active_timer_sigev_thread list.  Keep lock until done.
369         Define __active_timer_sigev_thread and
370         __active_timer_sigev_thread_lock.
372 2007-10-27  Ulrich Drepper  <drepper@redhat.com>
374         * sysdeps/pthread/malloc-machine.h: Define ATFORK_MEM.
375         Redefine thread_atfork for use of ATFORK_MEM.
376         * sysdeps/unix/sysv/linux/fork.h: Define __linkin_atfork.
377         * sysdeps/unix/sysv/linux/register-atfork.c (__linkin_atfork): New
378         function.
379         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
380         Use atomic operation when removing first element of list.
382 2007-10-17  Jakub Jelinek  <jakub@redhat.com>
384         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__old_sem_post): New
385         routine instead of an alias to __new_sem_post.
387 2007-10-15  Jakub Jelinek  <jakub@redhat.com>
389         * init.c (__pthread_initialize_minimal): Initialize word to appease
390         valgrind.
392 2007-10-10  Jakub Jelinek  <jakub@redhat.com>
394         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
395         libc.so just clear NAME.
396         (__libc_rwlock_fini): Nop inside of libc.so.
397         * tst-initializers1.c (main): Test if PTHREAD_RWLOCK_INITIALIZER is
398         all zeros.
400 2007-09-02  Ulrich Drepper  <drepper@redhat.com>
402         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
403         (__pthread_cond_wait): Fix unlocking of internal lock after mutex
404         unlocking failed.
405         Patch by Luca Barbieri <luca.barbieri@gmail.com>.
407 2007-08-21  Ulrich Drepper  <drepper@redhat.com>
409         [BZ #4938]
410         * allocatestack.c (__reclaim_stacks): Clear the TSD in the
411         reclaimed stack if necessary.
412         * Makefile (tests): Add tst-tsd6.
413         * tst-tsd6.c: New file.
415 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
417         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
418         Add private argument.
420 2007-08-20  Ulrich Drepper  <drepper@redhat.com>
422         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
423         (__pthread_cond_timedwait): Use clock_gettime from VDSO if possible.
425 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
427         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h
428         (__lll_robust_timedlock): Pass private as last argument to
429         __lll_robust_timedlock_wait.
430         (__lll_unlock): Fix a pasto.
432 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
434         * sysdeps/unix/sysv/linux/sparc/internaltypes.h (sparc_new_sem,
435         sparc_old_sem): New structs.
436         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
437         (__sem_wait_cleanup): New function.
438         (__new_sem_wait): Use sparc_new_sem structure.  Bump and afterwards
439         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
440         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
441         lll_futex_wait.
442         (__old_sem_wait): New function.
443         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: Include
444         nptl/sysdeps/unix/sysv/linux/sparc version.
445         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c:
446         Likewise.
447         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: Likewise.
448         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
449         (__new_sem_trywait): Use sparc_old_sem structure.
450         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
451         (sem_timedwait): Use sparc_new_sem structure.  Bump and afterwards
452         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
453         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
454         lll_futex_timed_wait.
455         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c (__new_sem_post):
456         Use sparc_new_sem structure.  Only wake if nwaiters > 0.  Pass
457         isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
458         lll_futex_wake.
459         (__old_sem_post): New function.
460         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: New file.
461         * sysdeps/unix/sysv/linux/sparc/sem_init.c: New file.
462         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: New file.
463         * sysdeps/unix/sysv/linux/sparc/sem_post.c: New file.
464         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: Remove.
465         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: Remove.
467 2007-08-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
469         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
470         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
471         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
472         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
473         * sysdeps/unix/sysv/linux/shpthread_cond_signal.S
474         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
475         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
476         Use FUTEX_WAKE_OP.
477         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
478         kernel-features.h and tcb-offsets.h.
479         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
480         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
481         process private.
482         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
483         tcb-offsets.h.
484         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE
485         to lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
486         process private.
487         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use #ifdef
488         __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
489         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
490         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
491         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
492         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
493         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
495 2007-08-14  Jakub Jelinek  <jakub@redhat.com>
497         * sysdeps/unix/sysv/linux/lowlevellock.c: Comment fix.
498         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
499         (__lll_timedwait_tid): Pass LLL_SHARED as 4th argument to
500         lll_futex_timed_wait.
502         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock,
503         __lll_robust_unlock): Rewrite as macros instead of inline functions.
504         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock,
505         __lll_robust_unlock, __lll_wait_tid): Likewise.
507 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
509         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
510         Fix a pasto.
511         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
512         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
513         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
514         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
515         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
516         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
517         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
518         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Include
519         kernel-features.h.
520         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
521         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
522         process private.  Switch DW_CFA_advance_loc1 and some
523         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
524         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
525         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE to
526         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
527         process private.  Switch DW_CFA_advance_loc{1,2} and some
528         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
529         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use
530         #ifdef __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
531         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
532         Likewise.
533         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
534         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
535         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
536         Likewise.
537         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
538         (__pthread_cond_broadcast): Compare %r8 instead of
539         dep_mutex-cond_*(%rdi) with $-1.
540         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
541         (__pthread_cond_signal): Xor FUTEX_WAKE_OP with FUTEX_WAKE instead
542         of oring.
544 2007-08-13  Ulrich Drepper  <drepper@redhat.com>
546         * sysdeps/unix/sysv/linux/i386/i786/Implies: New file.
548 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
550         * allocatestack.c: Include kernel-features.h.
551         * pthread_create.c: Likewise.
552         * pthread_mutex_init.c: Likewise.
553         * init.c: Likewise.
554         * pthread_cond_timedwait.c: Likewise.
555         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
556         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
557         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
558         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
559         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
560         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
561         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
562         Likewise.
563         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
564         Likewise.
565         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
566         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
567         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
568         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
570 2007-08-12  Jakub Jelinek  <jakub@redhat.com>
572         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
573         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
574         byte elements.  One of them is the new __shared element.
575         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
576         adjust names of other padding elements.
577         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
578         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
579         byte elements.  One of them is the new __shared element.
580         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
581         adjust names of other padding elements.
582         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_rwlock_t):
583         Renamed __pad1 element to __shared, adjust names of other padding
584         elements.
585         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
586         (pthread_rwlock_t): Likewise.
587         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock): Fix a
588         typo.
590 2007-08-09  Anton Blanchard  <anton@samba.org>
592         * sysdeps/unix/sysv/linux/powerpc/pthread_spin_unlock.c: New file.
594 2007-08-12  Ulrich Drepper  <drepper@redhat.com>
596         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Include
597         <kernel-features.h>.
598         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
600 2007-08-11  Ulrich Drepper  <drepper@redhat.com>
602         * pthreadP.h (PTHREAD_ROBUST_MUTEX_PSHARED): Define.
603         * pthread_mutex_lock.c: Use it instead of PTHREAD_MUTEX_PSHARED when
604         dealing with robust mutexes.
605         * pthread_mutex_timedlock.c: Likewise.
606         * pthread_mutex_trylock.c: Likewise.
607         * pthread_mutex_unlock.c: Likewise.
608         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
610 2007-08-06  Jakub Jelinek  <jakub@redhat.com>
612         * pthreadP.h (PTHREAD_MUTEX_PSHARED_BIT): Define.
613         (PTHREAD_MUTEX_TYPE): Mask __kind with 127.
614         (PTHREAD_MUTEX_PSHARED): Define.
615         * pthread_mutex_init.c (__pthread_mutex_init): Set
616         PTHREAD_MUTEX_PSHARED_BIT for pshared or robust
617         mutexes.
618         * pthread_mutex_lock.c (LLL_MUTEX_LOCK): Take mutex as argument
619         instead of its __data.__lock field, pass PTHREAD_MUTEX_PSHARED
620         as second argument to lll_lock.
621         (LLL_MUTEX_TRYLOCK): Take mutex as argument
622         instead of its __data.__lock field.
623         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
624         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
625         to lll_robust_lock.
626         (__pthread_mutex_lock): Update LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
627         LLL_ROBUST_MUTEX_LOCK users, use PTHREAD_MUTEX_TYPE (mutex)
628         instead of mutex->__data.__kind directly, pass
629         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock and lll_futex_wait.
630         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use
631         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
632         directly, pass PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock.
633         (pthread_mutex_timedlock): Pass PTHREAD_MUTEX_PSHARED (mutex)
634         to lll_timedlock, lll_robust_timedlock, lll_unlock and
635         lll_futex_timed_wait.  Use PTHREAD_MUTEX_TYPE (mutex) instead
636         of mutex->__data.__kind directly.
637         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Pass
638         PTHREAD_MUTEX_PSHARED (mutex) to lll_timedlock,
639         lll_robust_timedlock, lll_unlock and lll_futex_timed_wait.  Use
640         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind directly.
641         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Pass
642         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock, lll_robust_unlock
643         and lll_futex_wake.
644         * pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Pass
645         PTHREAD_MUTEX_PSHARED (mutex) to lll_futex_wait and lll_futex_wake.
646         Use PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
647         directly.
648         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK):
649         Take mutex as argument instead of its __data.__lock field, pass
650         PTHREAD_MUTEX_PSHARED as second argument to lll_cond_lock.
651         (LLL_MUTEX_TRYLOCK): Take mutex as argument instead of its
652         __data.__lock field.
653         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
654         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
655         to lll_robust_cond_lock.
656         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Add pshared
657         variable, pass it to lll_lock, lll_unlock, lll_futex_requeue and
658         lll_futex_wake.  Don't use lll_futex_requeue if dependent mutex
659         has PTHREAD_MUTEX_PSHARED_BIT bit set in its __data.__kind.
660         * pthread_cond_destroy.c (__pthread_cond_destroy): Add pshared
661         variable, pass it to lll_lock, lll_unlock, lll_futex_wake and
662         lll_futex_wait.
663         * pthread_cond_signal.c (__pthread_cond_signal): Add pshared
664         variable, pass it to lll_lock, lll_unlock, lll_futex_wake_unlock and
665         lll_futex_wake.
666         * pthread_cond_timedwait.c (__pthread_cond_wait): Add
667         pshared variable, pass it to lll_lock, lll_unlock,
668         lll_futex_timedwait and lll_futex_wake.
669         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait): Add
670         pshared variable, pass it to lll_lock, lll_unlock, lll_futex_wait
671         and lll_futex_wake.
672         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_requeue,
673         lll_futex_wake_unlock): Add private argument, use __lll_private_flag
674         macro.
675         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue,
676         lll_futex_wake_unlock): Likewise.
677         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_requeue):
678         Likewise.
679         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_futex_requeue,
680         lll_futex_wake_unlock): Likewise.
681         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_requeue):
682         Likewise.
683         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue,
684         lll_futex_wake_unlock): Likewise.
685         (lll_futex_wake): Fix a typo.
686         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym (PS_BIT): Add.
687         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
688         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
689         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
690         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
691         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
692         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
693         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
694         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
695         (__pthread_cond_timedwait): Likewise.
696         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
697         (__condvar_cleanup, __pthread_cond_wait): Likewise.
699 2007-08-05  Jakub Jelinek  <jakub@redhat.com>
701         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
702         Don't use CGOTSETUP and CGOTRESTORE macros.
703         (CGOTSETUP, CGOTRESTORE): Remove.
704         <IS_IN_rtld> (CENABLE, CDISABLE): Don't use JUMPTARGET, branch to
705         @local symbol.
707 2007-08-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
709         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Remove
710         definitions for private futexes.
711         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Include
712         kernel-features.h and lowlevellock.h.  Use private futexes if
713         they are available.
714         (__lll_lock_wait_private, __lll_unlock_wake_private): New.
715         (__lll_mutex_lock_wait): Rename to
716         (__lll_lock_wait): ... this.  Don't compile in for libc.so.
717         (__lll_mutex_timedlock_wait): Rename to ...
718         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.
719         Don't compile in for libc.so.
720         (__lll_mutex_unlock_wake): Rename to ...
721         (__lll_unlock_wake): ... this.  Don't compile in for libc.so.
722         (__lll_timedwait_tid): Use __NR_gettimeofday.
723         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Allow including
724         the header from assembler.  Renamed all lll_mutex_* resp.
725         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
726         Renamed all LLL_MUTEX_LOCK_* macros to LLL_LOCK_*.
727         (FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE):
728         Define.
729         (__lll_lock_wait_private): Add prototype.
730         (__lll_lock_wait, __lll_timedlock_wait, __lll_robust_lock_wait,
731         __lll_robust_timedlock_wait, __lll_unlock_wake_private,
732         __lll_unlock_wake): Likewise.
733         (lll_lock): Add private argument.  Call __lll_lock_wait_private
734         if private is constant LLL_PRIVATE.
735         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
736         lll_timedlock, lll_robust_timedlock): Add private argument.
737         (lll_unlock): Add private argument.  Call __lll_unlock_wake_private
738         if private is constant LLL_PRIVATE.
739         (lll_robust_unlock, lll_robust_dead): Add private argument.
740         (lll_lock_t): Remove.
741         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
742         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
743         lll_cond_wake, lll_cond_broadcast): Remove.
744         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: Include
745         kernel-features.h and lowlevellock.h.
746         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
747         (LOAD_FUTEX_WAIT): Define.
748         (__lll_robust_mutex_lock_wait): Rename to ...
749         (__lll_robust_lock_wait): ... this.  Add private argument.
750         Use LOAD_FUTEX_WAIT macro.
751         (__lll_robust_mutex_timedlock_wait): Rename to ...
752         (__lll_robust_timedlock_wait): ... this.    Add private argument.
753         Use __NR_gettimeofday.  Use LOAD_FUTEX_WAIT macro.
754         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Include
755         lowlevellock.h.
756         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
757         (pthread_barrier_wait): Use __lll_{lock,unlock}_* instead of
758         __lll_mutex_{lock,unlock}_*.
759         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Include
760         lowlevellock.h and pthread-errnos.h.
761         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
762         FUTEX_CMP_REQUEUE, EINVAL): Remove.
763         (__pthread_cond_broadcast): Use __lll_{lock,unlock}_* instead of
764         __lll_mutex_{lock,unlock}_*.
765         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Include
766         lowlevellock.h and pthread-errnos.h.
767         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE, EINVAL): Remove.
768         (__pthread_cond_signal): Use __lll_{lock,unlock}_* instead of
769         __lll_mutex_{lock,unlock}_*.
770         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
771         lowlevellock.h.
772         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE): Remove.
773         (__pthread_cond_timedwait): Use __lll_{lock,unlock}_* instead of
774         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
775         (__condvar_tw_cleanup): Likewise.
776         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
777         lowlevellock.h.
778         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
779         (__pthread_cond_wait): Use __lll_{lock,unlock}_* instead of
780         __lll_mutex_{lock,unlock}_*.
781         ( __condvar_w_cleanup): Likewise.
782         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Include lowlevellock.h.
783         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
784         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Include
785         lowlevellock.h.
786         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
787         (__pthread_rwlock_rdlock): Use __lll_{lock,unlock}_* instead of
788         __lll_mutex_{lock,unlock}_*.
789         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Include
790         lowlevellock.h.
791         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
792         FUTEX_PRIVATE_FLAG): Remove.
793         (pthread_rwlock_timedrdlock): Use __lll_{lock,unlock}_* instead of
794         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
795         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Include
796         lowlevellock.h.
797         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
798         FUTEX_PRIVATE_FLAG): Remove.
799         (pthread_rwlock_timedwrlock): Use __lll_{lock,unlock}_* instead of
800         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
801         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Include
802         lowlevellock.h.
803         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
804         (__pthread_rwlock_unlock): Use __lll_{lock,unlock}_* instead of
805         __lll_mutex_{lock,unlock}_*.
806         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Include
807         lowlevellock.h.
808         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
809         (__pthread_rwlock_wrlock): Use __lll_{lock,unlock}_* instead of
810         __lll_mutex_{lock,unlock}_*.
811         * sysdeps/unix/sysv/linux/sh/sem_post.S: Include lowlevellock.h.
812         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
813         (__new_sem_post): Use standard initial exec code sequences.
814         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Include
815         lowlevellock.h.
816         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
817         FUTEX_PRIVATE_FLAG): Remove.
818         (sem_timedwait): Use __NR_gettimeofday.  Use standard initial
819         exec code sequences.
820         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Include lowlevellock.h.
821         (__new_sem_trywait): Use standard initial exec code sequences.
822         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Include lowlevellock.h.
823         (__new_sem_wait): Use standard initial exec code sequences.
825 2007-07-31  Anton Blanchard  <anton@samba.org>
827         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
828         Use __asm __volatile (__lll_acq_instr ::: "memory") instead of
829         atomic_full_barrier.
831 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
833         * allocatestack.c (stack_cache_lock): Change type to int.
834         (get_cached_stack, allocate_stack, __deallocate_stack,
835         __make_stacks_executable, __find_thread_by_id, __nptl_setxid,
836         __pthread_init_static_tls, __wait_lookup_done): Add LLL_PRIVATE
837         as second argument to lll_lock and lll_unlock macros on
838         stack_cache_lock.
839         * pthread_create.c (__find_in_stack_list): Likewise.
840         (start_thread): Similarly with pd->lock.  Use lll_robust_dead
841         macro instead of lll_robust_mutex_dead, pass LLL_SHARED to it
842         as second argument.
843         * descr.h (struct pthread): Change lock and setxid_futex field
844         type to int.
845         * old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0): Use
846         LLL_LOCK_INITIALIZER instead of LLL_MUTEX_LOCK_INITIALIZER.
847         * old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
848         * old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
849         Likewise.
850         * old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
851         * pthread_cond_init.c (__pthread_cond_init): Likewise.
852         * pthreadP.h (__attr_list_lock): Change type to int.
853         * pthread_attr_init.c (__attr_list_lock): Likewise.
854         * pthread_barrier_destroy.c (pthread_barrier_destroy): Pass
855         ibarrier->private ^ FUTEX_PRIVATE_FLAG as second argument to
856         lll_{,un}lock.
857         * pthread_barrier_wait.c (pthread_barrier_wait): Likewise and
858         also for lll_futex_{wake,wait}.
859         * pthread_barrier_init.c (pthread_barrier_init): Make iattr
860         a pointer to const.
861         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Pass
862         LLL_SHARED as second argument to lll_{,un}lock.
863         * pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
864         * pthread_cond_signal.c (__pthread_cond_singal): Likewise.
865         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
866         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait):
867         Likewise.
868         * pthread_getattr_np.c (pthread_getattr_np): Add LLL_PRIVATE
869         as second argument to lll_{,un}lock macros on pd->lock.
870         * pthread_getschedparam.c (__pthread_getschedparam): Likewise.
871         * pthread_setschedparam.c (__pthread_setschedparam): Likewise.
872         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
873         * tpp.c (__pthread_tpp_change_priority, __pthread_current_priority):
874         Likewise.
875         * sysdeps/pthread/createthread.c (do_clone, create_thread):
876         Likewise.
877         * pthread_once.c (once_lock): Change type to int.
878         (__pthread_once): Pass LLL_PRIVATE as second argument to
879         lll_{,un}lock macros on once_lock.
880         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Use
881         lll_{,un}lock macros instead of lll_mutex_{,un}lock, pass
882         rwlock->__data.__shared as second argument to them and similarly
883         for lll_futex_w*.
884         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
885         Likewise.
886         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
887         Likewise.
888         * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Likewise.
889         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Likewise.
890         * pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Likewise.
891         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
892         * sem_close.c (sem_close): Pass LLL_PRIVATE as second argument
893         to lll_{,un}lock macros on __sem_mappings_lock.
894         * sem_open.c (check_add_mapping): Likewise.
895         (__sem_mappings_lock): Change type to int.
896         * semaphoreP.h (__sem_mappings_lock): Likewise.
897         * pthread_mutex_lock.c (LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
898         LLL_ROBUST_MUTEX_LOCK): Use lll_{,try,robust_}lock macros
899         instead of lll_*mutex_*, pass LLL_SHARED as last
900         argument.
901         (__pthread_mutex_lock): Use lll_unlock instead of lll_mutex_unlock,
902         pass LLL_SHARED as last argument.
903         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK,
904         LLL_MUTEX_TRYLOCK, LLL_ROBUST_MUTEX_LOCK): Use
905         lll_{cond_,cond_try,robust_cond}lock macros instead of lll_*mutex_*,
906         pass LLL_SHARED as last argument.
907         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
908         lll_{timed,try,robust_timed,un}lock instead of lll_*mutex*, pass
909         LLL_SHARED as last argument.
910         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Similarly.
911         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
912         Similarly.
913         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_lock,
914         __libc_lock_lock_recursive, __libc_lock_unlock,
915         __libc_lock_unlock_recursive): Pass LLL_PRIVATE as second
916         argument to lll_{,un}lock.
917         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_lock,
918         _IO_lock_unlock): Likewise.
919         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Don't use
920         compound literal.
921         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
922         Pass LLL_PRIVATE as second argument to lll_{,un}lock macros on
923         __fork_lock.
924         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork,
925         free_mem): Likewise.
926         (__fork_lock): Change type to int.
927         * sysdeps/unix/sysv/linux/fork.h (__fork_lock): Likewise.
928         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Pass
929         isem->private ^ FUTEX_PRIVATE_FLAG as second argument to
930         lll_futex_wake.
931         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
932         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Likewise.
933         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait_private):
934         New function.
935         (__lll_lock_wait, __lll_timedlock_wait): Add private argument and
936         pass it through to lll_futex_*wait, only compile in when
937         IS_IN_libpthread.
938         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
939         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Add private
940         argument and pass it through to lll_futex_*wait.
941         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Renamed all
942         lll_mutex_* resp. lll_robust_mutex_* macros to lll_* resp.
943         lll_robust_*.  Renamed all __lll_mutex_* resp. __lll_robust_mutex_*
944         inline functions to __lll_* resp. __lll_robust_*.
945         (LLL_MUTEX_LOCK_INITIALIZER): Remove.
946         (lll_mutex_dead): Add private argument.
947         (__lll_lock_wait_private): New prototype.
948         (__lll_lock_wait, __lll_robust_lock_wait, __lll_lock_timedwait,
949         __lll_robust_lock_timedwait): Add private argument to prototypes.
950         (__lll_lock): Add private argument, if it is constant LLL_PRIVATE,
951         call __lll_lock_wait_private, otherwise pass private to
952         __lll_lock_wait.
953         (__lll_robust_lock, __lll_cond_lock, __lll_timedlock,
954         __lll_robust_timedlock): Add private argument, pass it to
955         __lll_*wait functions.
956         (__lll_unlock): Add private argument, if it is constant LLL_PRIVATE,
957         call __lll_unlock_wake_private, otherwise pass private to
958         __lll_unlock_wake.
959         (__lll_robust_unlock): Add private argument, pass it to
960         __lll_robust_unlock_wake.
961         (lll_lock, lll_robust_lock, lll_cond_lock, lll_timedlock,
962         lll_robust_timedlock, lll_unlock, lll_robust_unlock): Add private
963         argument, pass it through to __lll_* inline function.
964         (__lll_mutex_unlock_force, lll_mutex_unlock_force): Remove.
965         (lll_lock_t): Remove.
966         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
967         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
968         lll_cond_wake, lll_cond_broadcast): Remove.
969         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
970         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
971         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
972         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
973         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Allow including
974         the header from assembler.  Renamed all lll_mutex_* resp.
975         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
976         (LOCK, FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP,
977         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
978         (LLL_MUTEX_LOCK_INITIALIZER, LLL_MUTEX_LOCK_INITIALIZER_LOCKED,
979         LLL_MUTEX_LOCK_INITIALIZER_WAITERS): Remove.
980         (__lll_mutex_lock_wait, __lll_mutex_timedlock_wait,
981         __lll_mutex_unlock_wake, __lll_lock_wait, __lll_unlock_wake):
982         Remove prototype.
983         (__lll_trylock_asm, __lll_lock_asm_start, __lll_unlock_asm): Define.
984         (lll_robust_trylock, lll_cond_trylock): Use LLL_LOCK_INITIALIZER*
985         rather than LLL_MUTEX_LOCK_INITIALIZER* macros.
986         (lll_trylock): Likewise, use __lll_trylock_asm, pass
987         MULTIPLE_THREADS_OFFSET as another asm operand.
988         (lll_lock): Add private argument, use __lll_lock_asm_start, pass
989         MULTIPLE_THREADS_OFFSET as last asm operand, call
990         __lll_lock_wait_private if private is constant LLL_PRIVATE,
991         otherwise pass private as another argument to __lll_lock_wait.
992         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
993         lll_timedlock, lll_robust_timedlock): Add private argument, pass
994         private as another argument to __lll_*lock_wait call.
995         (lll_unlock): Add private argument, use __lll_unlock_asm, pass
996         MULTIPLE_THREADS_OFFSET as another asm operand, call
997         __lll_unlock_wake_private if private is constant LLL_PRIVATE,
998         otherwise pass private as another argument to __lll_unlock_wake.
999         (lll_robust_unlock): Add private argument, pass private as another
1000         argument to __lll_unlock_wake.
1001         (lll_robust_dead): Add private argument, use __lll_private_flag
1002         macro.
1003         (lll_islocked): Use LLL_LOCK_INITIALIZER instead of
1004         LLL_MUTEX_LOCK_INITIALIZER.
1005         (lll_lock_t): Remove.
1006         (LLL_LOCK_INITIALIZER_WAITERS): Define.
1007         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1008         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1009         lll_cond_wake, lll_cond_broadcast): Remove.
1010         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1011         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Revert
1012         2007-05-2{3,9} changes.
1013         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Include
1014         kernel-features.h and lowlevellock.h.
1015         (LOAD_PRIVATE_FUTEX_WAIT): Define.
1016         (LOAD_FUTEX_WAIT): Rewritten.
1017         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
1018         define.
1019         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
1020         (__lll_mutex_lock_wait): Rename to ...
1021         (__lll_lock_wait): ... this.  Take futex addr from %edx instead of
1022         %ecx, %ecx is now private argument.  Don't compile in for libc.so.
1023         (__lll_mutex_timedlock_wait): Rename to ...
1024         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.  %esi
1025         contains private argument.  Don't compile in for libc.so.
1026         (__lll_mutex_unlock_wake): Rename to ...
1027         (__lll_unlock_wake): ... this.  %ecx contains private argument.
1028         Don't compile in for libc.so.
1029         (__lll_timedwait_tid): Use __NR_gettimeofday.
1030         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Include
1031         kernel-features.h and lowlevellock.h.
1032         (LOAD_FUTEX_WAIT): Define.
1033         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
1034         define.
1035         (__lll_robust_mutex_lock_wait): Rename to ...
1036         (__lll_robust_lock_wait): ... this.  Futex addr is now in %edx
1037         argument, %ecx argument contains private.  Use LOAD_FUTEX_WAIT
1038         macro.
1039         (__lll_robust_mutex_timedlock_wait): Rename to ...
1040         (__lll_robust_timedlock_wait): ... this.  Use __NR_gettimeofday.
1041         %esi argument contains private, use LOAD_FUTEX_WAIT macro.
1042         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Include
1043         lowlevellock.h.
1044         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1045         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
1046         PRIVATE(%ebx) ^ LLL_SHARED as private argument in %ecx to
1047         __lll_lock_wait and __lll_unlock_wake, pass MUTEX(%ebx) address
1048         to __lll_lock_wait in %edx.
1049         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
1050         Include lowlevellock.h and pthread-errnos.h.
1051         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1052         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
1053         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*, pass
1054         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1055         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1056         __lll_unlock_wake.
1057         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
1058         Include lowlevellock.h and pthread-errnos.h.
1059         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
1060         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
1061         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*, pass
1062         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1063         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1064         __lll_unlock_wake.
1065         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
1066         Include lowlevellock.h.
1067         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1068         Don't define.
1069         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*, pass
1070         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1071         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1072         __lll_unlock_wake.  Use __NR_gettimeofday.
1073         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
1074         Include lowlevellock.h.
1075         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1076         (__pthread_cond_wait, __condvar_w_cleanup): Rename __lll_mutex_*
1077         to __lll_*, pass cond_lock address in %edx rather than %ecx to
1078         __lll_lock_wait, pass LLL_SHARED in %ecx to both __lll_lock_wait
1079         and __lll_unlock_wake.
1080         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S:
1081         Include lowlevellock.h.
1082         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1083         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*, pass
1084         MUTEX(%ebx) address in %edx rather than %ecx to
1085         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
1086         and __lll_unlock_wake.  Move return value from %ecx to %edx
1087         register.
1088         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1089         Include lowlevellock.h.
1090         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1091         Don't define.
1092         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1093         MUTEX(%ebp) address in %edx rather than %ecx to
1094         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
1095         and __lll_unlock_wake.  Move return value from %ecx to %edx
1096         register.  Use __NR_gettimeofday.
1097         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1098         Include lowlevellock.h.
1099         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1100         Don't define.
1101         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1102         MUTEX(%ebp) address in %edx rather than %ecx to
1103         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
1104         and __lll_unlock_wake.  Move return value from %ecx to %edx
1105         register.  Use __NR_gettimeofday.
1106         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
1107         Include lowlevellock.h.
1108         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1109         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*, pass
1110         MUTEX(%edi) address in %edx rather than %ecx to
1111         __lll_lock_wait, pass PSHARED(%edi) in %ecx to both __lll_lock_wait
1112         and __lll_unlock_wake.
1113         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
1114         Include lowlevellock.h.
1115         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1116         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1117         MUTEX(%ebx) address in %edx rather than %ecx to
1118         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
1119         and __lll_unlock_wake.  Move return value from %ecx to %edx
1120         register.
1121         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Include
1122         lowlevellock.h.
1123         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1124         define.
1125         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Include lowlevellock.h.
1126         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1127         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Include
1128         lowlevellock.h.
1129         (LOCK, SYS_futex, SYS_gettimeofday, FUTEX_WAIT): Don't define.
1130         (sem_timedwait): Use __NR_gettimeofday.
1131         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Include
1132         lowlevellock.h.
1133         (LOCK): Don't define.
1134         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include
1135         lowlevellock.h.
1136         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1137         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Wake only when there
1138         are waiters.
1139         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Revert
1140         2007-05-2{3,9} changes.
1141         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Include
1142         kernel-features.h and lowlevellock.h.
1143         (LOAD_PRIVATE_FUTEX_WAIT): Define.
1144         (LOAD_FUTEX_WAIT): Rewritten.
1145         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
1146         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
1147         (__lll_mutex_lock_wait): Rename to ...
1148         (__lll_lock_wait): ... this.  %esi is now private argument.
1149         Don't compile in for libc.so.
1150         (__lll_mutex_timedlock_wait): Rename to ...
1151         (__lll_timedlock_wait): ... this.  %esi contains private argument.
1152         Don't compile in for libc.so.
1153         (__lll_mutex_unlock_wake): Rename to ...
1154         (__lll_unlock_wake): ... this.  %esi contains private argument.
1155         Don't compile in for libc.so.
1156         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Include
1157         kernel-features.h and lowlevellock.h.
1158         (LOAD_FUTEX_WAIT): Define.
1159         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
1160         (__lll_robust_mutex_lock_wait): Rename to ...
1161         (__lll_robust_lock_wait): ... this.  %esi argument contains private.
1162         Use LOAD_FUTEX_WAIT macro.
1163         (__lll_robust_mutex_timedlock_wait): Rename to ...
1164         (__lll_robust_timedlock_wait): ... this. %esi argument contains
1165         private, use LOAD_FUTEX_WAIT macro.
1166         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Include
1167         lowlevellock.h.
1168         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1169         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
1170         PRIVATE(%rdi) ^ LLL_SHARED as private argument in %esi to
1171         __lll_lock_wait and __lll_unlock_wake.
1172         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S:
1173         Include lowlevellock.h and pthread-errnos.h.
1174         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1175         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
1176         (__pthread_cond_broadcast): 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_signal.S:
1180         Include lowlevellock.h and pthread-errnos.h.
1181         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
1182         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
1183         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*,
1184         pass LLL_SHARED in %esi to both __lll_lock_wait and
1185         __lll_unlock_wake.
1186         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:
1187         Include lowlevellock.h.
1188         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1189         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*,
1190         pass LLL_SHARED in %esi to both __lll_lock_wait and
1191         __lll_unlock_wake.
1192         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
1193         Include lowlevellock.h.
1194         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1195         (__pthread_cond_wait, __condvar_cleanup): Rename __lll_mutex_*
1196         to __lll_*, pass LLL_SHARED in %esi to both __lll_lock_wait
1197         and __lll_unlock_wake.
1198         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:
1199         Include lowlevellock.h.
1200         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1201         Don't define.
1202         (__pthread_rwlock_rdlock): 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_timedrdlock.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_timedwrlock.S:
1213         Include lowlevellock.h.
1214         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1215         Don't define.
1216         (__pthread_rwlock_wrlock): 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_unlock.S:
1220         Include lowlevellock.h.
1221         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1222         Don't define.
1223         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*,
1224         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1225         and __lll_unlock_wake.
1226         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:
1227         Include lowlevellock.h.
1228         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1229         Don't define.
1230         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1231         pass PSHARED(%rdi) in %ecx to both __lll_lock_wait
1232         and __lll_unlock_wake.
1233         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Include
1234         lowlevellock.h.
1235         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1236         define.
1237         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Include lowlevellock.h.
1238         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1239         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Include
1240         lowlevellock.h.
1241         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1242         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Include
1243         lowlevellock.h.
1244         (LOCK): Don't define.
1245         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Include
1246         lowlevellock.h.
1247         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1248         * sysdeps/unix/sysv/linux/sparc/internaltypes.h: New file.
1249         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c: New file.
1250         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c: New file.
1251         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c: New file.
1252         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
1253         (__lll_lock_wait_private): New function.
1254         (__lll_lock_wait, __lll_timedlock_wait): Add private argument, pass
1255         it to lll_futex_*wait.  Don't compile in for libc.so.
1256         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c:
1257         Remove.
1258         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
1259         (struct sparc_pthread_barrier): Remove.
1260         (pthread_barrier_wait): Use union sparc_pthread_barrier instead of
1261         struct sparc_pthread_barrier.  Pass
1262         ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE to lll_{,un}lock
1263         and lll_futex_wait macros.
1264         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
1265         Remove.
1266         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1267         Include sparc pthread_barrier_wait.c instead of generic one.
1269 2007-07-30  Jakub Jelinek  <jakub@redhat.com>
1271         * tst-rwlock14.c (do_test): Avoid warnings on 32-bit arches.
1273         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
1274         (pthread_rwlock_timedrdlock): Copy futex retval to %esi rather than
1275         %ecx.
1276         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
1277         (pthread_rwlock_timedwrlock): Likewise.
1278         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
1279         (__pthread_rwlock_unlock): Fix MUTEX != 0 args to __lll_*.
1281 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
1283         * sysdeps/sparc/tls.h (tcbhead_t): Add private_futex field.
1285 2007-07-26  Jakub Jelinek  <jakub@redhat.com>
1287         * tst-locale2.c (useless): Add return statement.
1289 2007-07-24  Jakub Jelinek  <jakub@redhat.com>
1291         * allocatestack.c (__nptl_setxid, __wait_lookup_done): Replace
1292         lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).
1293         * pthread_create.c (start_thread): Likewise.
1294         * init.c (sighandler_setxid): Likewise.
1295         * sysdeps/alpha/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1296         * sysdeps/ia64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1297         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1298         * sysdeps/s390/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1299         * sysdeps/powerpc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1300         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1301         * sysdeps/sparc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1302         * sysdeps/sh/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1303         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY, AIO_MISC_WAIT):
1304         Likewise.
1305         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY, GAI_MISC_WAIT):
1306         Likewise.
1307         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1308         Likewise.
1309         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_waitzero,
1310         __rtld_notify): Likewise.
1311         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Likewise.
1312         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (clear_once_control,
1313         __pthread_once): Likewise.
1314         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (clear_once_control,
1315         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1316         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1317         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1318         (lll_futex_wait): Add private argument, define as wrapper around
1319         lll_futex_timed_wait.
1320         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1321         use __lll_private_flag macro.
1322         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1323         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1324         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (clear_once_control,
1325         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1326         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1327         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1328         (lll_futex_wait): Add private argument, define as wrapper around
1329         lll_futex_timed_wait.
1330         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1331         use __lll_private_flag macro.
1332         (__lll_mutex_unlock, __lll_robust_mutex_unlock, lll_wait_tid,
1333         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1334         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
1335         Define.
1336         (lll_futex_timed_wait, lll_futex_wake): Use it.
1337         (lll_private_futex_wait, lll_private_futex_timed_wait,
1338         lll_private_futex_wake): Removed.
1339         * sysdeps/unix/sysv/linux/s390/pthread_once.c (clear_once_control,
1340         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1341         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1342         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1343         (lll_futex_wait): Add private argument, define as wrapper around
1344         lll_futex_timed_wait.
1345         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1346         use __lll_private_flag macro.
1347         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1348         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1349         to lll_futex_*.
1350         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1351         (lll_private_futex_wait, lll_private_futex_timed_wait,
1352         lll_private_futex_wake): Removed.
1353         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_private_flag):
1354         Fix !__ASSUME_PRIVATE_FUTEX non-constant private case.
1355         (lll_private_futex_wait, lll_private_futex_timed_wait,
1356         lll_private_futex_wake): Removed.
1357         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (clear_once_control,
1358         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1359         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1360         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1361         (lll_futex_wait): Add private argument, define as wrapper around
1362         lll_futex_timed_wait.
1363         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1364         use __lll_private_flag macro.
1365         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1366         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1367         to lll_futex_*.
1368         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (__lll_private_flag):
1369         Define.
1370         (lll_futex_timed_wait, lll_futex_wake): Use it.
1371         (lll_private_futex_wait, lll_private_futex_timed_wait,
1372         lll_private_futex_wake): Removed.
1374 2007-07-27  Jakub Jelinek  <jakub@redhat.com>
1376         * sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
1377         of the structure for sparc32.
1379 2007-07-26  Aurelien Jarno  <aurelien@aurel32.net>
1381         * sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
1383 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1385         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1386         code used when private futexes are assumed.
1387         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1388         Likewise.
1390 2007-07-23  Jakub Jelinek  <jakub@redhat.com>
1392         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1393         (__lll_private_flag): Define.
1394         (lll_futex_wait): Define as a wrapper around lll_futex_timed_wait.
1395         (lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Use
1396         __lll_private_flag.
1397         (lll_private_futex_wait, lll_private_futex_timedwait,
1398         lll_private_futex_wake): Define as wrapper around non-_private
1399         macros.
1400         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1401         (__lll_private_flag): Define.
1402         (lll_futex_timed_wait, lll_futex_wake): Use __lll_private_flag.
1403         (lll_private_futex_wait, lll_private_futex_timedwait,
1404         lll_private_futex_wake): Define as wrapper around non-_private
1405         macros.
1407 2007-07-10  Steven Munroe  <sjmunroe@us.ibm.com>
1409         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Add LLL_SHARED
1410         parameter to lll_futex_wait call.
1411         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1413         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
1414         Replace lll_futex_wait with lll_private_futex_wait.
1415         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1416         Add LLL_SHARED parameter to lll_futex_wake().
1418         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define LLL_PRIVATE
1419         LLL_SHARED, lll_private_futex_wait, lll_private_futex_timed_wait and
1420         lll_private_futex_wake.
1421         (lll_futex_wait): Add private parameter. Adjust FUTEX_PRIVATE_FLAG
1422         bit from private parm before syscall.
1423         (lll_futex_timed_wait): Likewise.
1424         (lll_futex_wake): Likewise.
1425         (lll_futex_wake_unlock): Likewise.
1426         (lll_mutex_unlock): Add LLL_SHARED parm to lll_futex_wake call.
1427         (lll_robust_mutex_unlock): Likewise.
1428         (lll_mutex_unlock_force): Likewise.
1429         (lll_wait_tid): Add LLL_SHARED parm to lll_futex_wait call.
1431 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1433         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1434         compilation when unconditionally using private futexes.
1435         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1436         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1437         Likewise.
1438         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1439         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1441 2007-07-17  Jakub Jelinek  <jakub@redhat.com>
1443         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
1444         Define.
1446 2007-07-06  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1448         * sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and
1449         kernel-features.h.
1451 2007-05-16  Roland McGrath  <roland@redhat.com>
1453         * init.c (__nptl_initial_report_events): New variable.
1454         (__pthread_initialize_minimal_internal): Initialize pd->report_events
1455         to that.
1457 2007-06-22  Jakub Jelinek  <jakub@redhat.com>
1459         * pthread_getattr_np.c (pthread_getattr_np): Clear cpuset and
1460         cpusetsize if pthread_getaffinity_np failed with ENOSYS.
1462 2007-06-19  Ulrich Drepper  <drepper@redhat.com>
1464         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Remove mrlock
1465         implementation.
1467 2007-06-18  Ulrich Drepper  <drepper@redhat.com>
1469         * pthreadP.h: Define PTHREAD_MUTEX_TYPE.
1470         * phtread_mutex_lock.c: Use PTHREAD_MUTEX_TYPE.
1471         * pthread_mutex_timedlock.c: Likewise.
1472         * pthread_mutex_trylock.c: Likewise.
1473         * pthread_mutex_unlock.c: Likewise.
1475 2007-06-17  Andreas Schwab  <schwab@suse.de>
1477         * sysdeps/pthread/pt-initfini.c: Tell gcc about the nonstandard
1478         sections.
1480 2007-06-17  Ulrich Drepper  <drepper@redhat.com>
1482         * allocatestack.c (allocate_stack): Make code compile if
1483         __ASSUME_PRIVATE_FUTEX is set.
1485 2007-06-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1487         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S:
1488         (__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
1489         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
1490         (__pthread_rwlock_wrlock): Likewise.
1491         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
1492         (pthread_rwlock_timedrdlock): Likewise.
1493         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
1494         (pthread_rwlock_timedwrlock): Likewise.
1495         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
1496         (__pthread_rwlock_unlock): Likewise.
1498 2007-06-10  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1500         * sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
1501         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
1502         Split __flags into __flags, __shared, __pad1 and __pad2.
1503         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
1504         futexes if they are available.
1505         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
1506         in libc-lowlevellock.S allow using private futexes.
1507         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
1508         FUTEX_PRIVATE_FLAG.  Add additional parameter to lll_futex_wait,
1509         lll_futex_timed_wait and lll_futex_wake.  Change lll_futex_wait
1510         to call lll_futex_timed_wait.  Add lll_private_futex_wait,
1511         lll_private_futex_timed_wait and lll_private_futex_wake.
1512         (lll_robust_mutex_unlock): Fix typo.
1513         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
1514         field in futex command setup.
1515         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
1516         COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
1517         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
1518         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
1519         if they are available.  Remove clear_once_control.
1520         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
1521         futexes if they are available.
1522         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1523         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1524         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1525         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1526         * sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
1527         Wake only when there are waiters.
1528         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
1529         support.  Indicate that there are waiters.  Remove unnecessary
1530         extra cancellation test.
1531         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.  Removed
1532         left-over duplication of __sem_wait_cleanup.
1534 2007-06-07  Ulrich Drepper  <drepper@redhat.com>
1536         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Add additional
1537         parameter to lll_futex_wait, lll_futex_timed_wait, and
1538         lll_futex_wake.  Change lll_futex_wait to call lll_futex_timed_wait.
1539         Add lll_private_futex_wait, lll_private_futex_timed_wait, and
1540         lll_private_futex_wake.
1541         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1542         * allocatestack.c: Adjust use of lll_futex_* macros.
1543         * init.c: Likewise.
1544         * lowlevellock.h: Likewise.
1545         * pthread_barrier_wait.c: Likewise.
1546         * pthread_cond_broadcast.c: Likewise.
1547         * pthread_cond_destroy.c: Likewise.
1548         * pthread_cond_signal.c: Likewise.
1549         * pthread_cond_timedwait.c: Likewise.
1550         * pthread_cond_wait.c: Likewise.
1551         * pthread_create.c: Likewise.
1552         * pthread_mutex_lock.c: Likewise.
1553         * pthread_mutex_setprioceiling.c: Likewise.
1554         * pthread_mutex_timedlock.c: Likewise.
1555         * pthread_mutex_unlock.c: Likewise.
1556         * pthread_rwlock_timedrdlock.c: Likewise.
1557         * pthread_rwlock_timedwrlock.c: Likewise.
1558         * pthread_rwlock_unlock.c: Likewise.
1559         * sysdeps/alpha/tls.h: Likewise.
1560         * sysdeps/i386/tls.h: Likewise.
1561         * sysdeps/ia64/tls.h: Likewise.
1562         * sysdeps/powerpc/tls.h: Likewise.
1563         * sysdeps/pthread/aio_misc.h: Likewise.
1564         * sysdeps/pthread/gai_misc.h: Likewise.
1565         * sysdeps/s390/tls.h: Likewise.
1566         * sysdeps/sh/tls.h: Likewise.
1567         * sysdeps/sparc/tls.h: Likewise.
1568         * sysdeps/unix/sysv/linux/fork.c: Likewise.
1569         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
1570         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
1571         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Likewise.
1572         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
1573         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1574         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
1575         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
1576         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
1577         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
1578         Likewise.
1579         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise.
1580         * sysdeps/x86_64/tls.h: Likewise.
1582 2007-05-29  Ulrich Drepper  <drepper@redhat.com>
1584         * pthread_getattr_np.c: No need to install a cancellation handler,
1585         this is no cancellation point.
1586         * pthread_getschedparam.c: Likewise.
1587         * pthread_setschedparam.c: Likewise.
1588         * pthread_setschedprio.c: Likewise.
1589         * sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
1590         lll_unlock_wake_cb.
1591         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
1592         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1593         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1594         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1595         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1596         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1597         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
1598         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
1599         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1600         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
1601         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1602         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1604         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
1605         whether there are more than one thread makes no sense here since
1606         we only call the slow path if the locks are taken.
1607         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
1609         * sysdeps/unix/sysv/linux/internaltypes.h: Introduce
1610         COND_NWAITERS_SHIFT.
1611         * pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of
1612         COND_CLOCK_BITS.
1613         * pthread_cond_init.c: Likewise.
1614         * pthread_cond_timedwait.c: Likewise.
1615         * pthread_cond_wait.c: Likewise.
1616         * pthread_condattr_getclock.c: Likewise.
1617         * pthread_condattr_setclock.c: Likewise.
1618         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise.
1619         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1620         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1621         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1622         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1624 2007-05-28  Jakub Jelinek  <jakub@redhat.com>
1626         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
1627         unistd.h.
1629         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
1630         insn suffix.
1631         (THREAD_GSCOPE_GET_FLAG): Remove.
1632         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Remove.
1633         * allocatestack.c (__wait_lookup_done): Revert 2007-05-24
1634         changes.
1635         * sysdeps/powerpc/tls.h (tcbhead_t): Remove gscope_flag.
1636         (THREAD_GSCOPE_GET_FLAG): Remove.
1637         (THREAD_GSCOPE_RESET_FLAG): Use THREAD_SELF->header.gscope_flag
1638         instead of THREAD_GSCOPE_GET_FLAG.
1639         (THREAD_GSCOPE_SET_FLAG): Likewise.  Add atomic_write_barrier after
1640         it.
1641         * sysdeps/s390/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1642         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1643         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1644         THREAD_GSCOPE_WAIT): Define.
1645         * sysdeps/sparc/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1646         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1647         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1648         THREAD_GSCOPE_WAIT): Define.
1649         * sysdeps/sh/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1650         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1651         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1652         THREAD_GSCOPE_WAIT): Define.
1653         * sysdeps/ia64/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1654         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1655         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1656         THREAD_GSCOPE_WAIT): Define.
1658 2007-05-24  Richard Henderson  <rth@redhat.com>
1660         * descr.h (struct pthread): Add header.gscope_flag.
1661         * sysdeps/alpha/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1662         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1663         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1664         THREAD_GSCOPE_WAIT): Define.
1666 2007-05-27  Ulrich Drepper  <drepper@redhat.com>
1668         * init.c: Make it compile with older kernel headers.
1670         * tst-initializers1.c: Show through exit code which test failed.
1672         * pthread_rwlock_init.c: Also initialize __shared field.
1673         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
1674         element in rwlock structure into four byte elements.  One of them is
1675         the new __shared element.
1676         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
1677         Likewise.
1678         [__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
1679         __shared, adjust names of other padding elements.
1680         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1681         * sysdeps/pthread/pthread.h: Adjust rwlock initializers.
1682         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
1683         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
1684         FUTEX_PRIVATE_FLAG.
1685         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
1686         futex to use private operations if possible.
1687         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1688         Likewise.
1689         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1690         Likewise.
1691         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1692         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1693         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1694         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1695         Likewise.
1696         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1697         Likewise.
1698         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1699         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1701 2007-05-26  Ulrich Drepper  <drepper@redhat.com>
1703         * pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
1704         * pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
1705         * pthread_rwlock_timedrdlock.c: Likewise.
1706         * pthread_rwlock_tryrdlock.c: Likewise.
1708         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
1709         optimization.
1711         * sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
1712         * sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
1713         duplication of __sem_wait_cleanup.
1715         * allocatestack.c: Revert last change.
1716         * init.c: Likewise.
1717         * sysdeps/i386/tls.h: Likewise.
1718         * sysdeps/x86_64/tls.h: Likewise.
1719         * descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
1720         header structure.
1721         * sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
1723         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
1724         Add private field.
1725         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
1726         * pthread_barrier_init.c: Set private flag if pshared and private
1727         futexes are supported.
1728         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
1729         private field in futex command setup.
1730         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
1732 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1734         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
1735         support.
1736         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1737         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1738         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1739         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1740         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1742         * semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
1743         * sem_init.c (__new_sem_init): Rewrite to initialize all three
1744         fields in the structure.
1745         (__old_sem_init): New function.
1746         * sem_open.c: Initialize all fields of the structure.
1747         * sem_getvalue.c: Adjust for renamed element.
1748         * sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
1749         (gen-as-const-headers): Add structsem.sym.
1750         * sysdeps/unix/sysv/linux/structsem.sym: New file.
1751         * sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
1752         struct new_sem.  Add struct old_sem.
1753         * sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
1754         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
1755         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1756         * sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
1757         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1758         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1759         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1760         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1761         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1762         * Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
1763         * tst-sem10.c: New file.
1764         * tst-sem11.c: New file.
1765         * tst-sem12.c: New file.
1766         * tst-typesizes.c: Test struct new_sem and struct old_sem instead
1767         of struct sem.
1769 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1770             Jakub Jelinek  <jakub@redhat.com>
1772         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
1773         Move __pthread_enable_asynccancel right before futex syscall.
1774         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
1775         Likewise.
1777 2007-05-24  Jakub Jelinek  <jakub@redhat.com>
1779         * sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
1780         THREAD_COPY_PRIVATE_FUTEX): Define.
1781         * sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
1782         THREAD_COPY_PRIVATE_FUTEX): Define.
1783         * allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
1784         * init.c (__pthread_initialize_minimal_internal): Use
1785         THREAD_SET_PRIVATE_FUTEX.
1787         * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
1788         (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
1789         THREAD_GSCOPE_FLAG_WAIT): Define.
1790         (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG,
1791         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define.
1792         * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use
1793         PTR_DEMANGLE.
1794         (THREAD_GSCOPE_GET_FLAG): Define.
1795         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define.
1796         * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
1797         instead of ->header.gscope_flag directly.
1799 2007-05-23  Ulrich Drepper  <drepper@redhat.com>
1801         * init.c (__pthread_initialize_minimal_internal): Check whether
1802         private futexes are available.
1803         * allocatestack.c (allocate_stack): Copy private_futex field from
1804         current thread into the new stack.
1805         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
1806         futexes if they are available.
1807         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
1808         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
1809         in libc-lowlevellock.S allow using private futexes.
1810         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1811         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
1812         FUTEX_PRIVATE_FLAG.
1813         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1814         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
1815         if they are available.
1816         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
1817         * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
1818         * sysdeps/i386/tcb-offsets.sym: Likewise.
1819         * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
1820         * sysdeps/i386/tls.h (tcbhead_t): Likewise.
1822 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
1824         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1825         Remove ptr_wait_lookup_done again.
1826         * init.c (pthread_functions): Don't add .ptr_wait_lookup_done here.
1827         (__pthread_initialize_minimal_internal): Initialize
1828         _dl_wait_lookup_done pointer in _rtld_global directly.
1829         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1830         Remove code to code _dl_wait_lookup_done.
1831         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
1832         encrypted for now.
1834 2007-05-21  Jakub Jelinek  <jakub@redhat.com>
1836         * tst-robust9.c (do_test): Don't fail if ENABLE_PI and
1837         pthread_mutex_init failed with ENOTSUP.
1839 2007-05-19  Ulrich Drepper  <drepper@redhat.com>
1841         * allocatestack.c (__wait_lookup_done): New function.
1842         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1843         Add ptr_wait_lookup_done.
1844         * init.c (pthread_functions): Initialize .ptr_wait_lookup_done.
1845         * pthreadP.h: Declare __wait_lookup_done.
1846         * sysdeps/i386/tls.h (tcbhead_t): Add gscope_flag.
1847         Define macros to implement reference handling of global scope.
1848         * sysdeps/x86_64/tls.h: Likewise.
1849         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1850         Initialize GL(dl_wait_lookup_done).
1852 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
1854         [BZ #4512]
1855         * pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
1856         is detected.
1857         * pthread_mutex_timedlock.c: Likewise.
1858         * pthread_mutex_trylock.c: Likewise.
1859         Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
1861         * Makefile (tests): Add tst-robust9 and tst-robustpi9.
1862         * tst-robust9.c: New file.
1863         * tst-robustpi9.c: New file.
1865         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
1866         unnecessary extra cancellation test.
1868 2007-05-14  Ulrich Drepper  <drepper@redhat.com>
1870         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
1871         extra cancellation test.
1872         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1874 2007-05-10  Ulrich Drepper  <drepper@redhat.com>
1876         * descr.h (struct pthread): Rearrange members to fill hole in
1877         64-bit layout.
1879         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1880         (__pthread_setaffinity_new): If syscall was successful and
1881         RESET_VGETCPU_CACHE is defined, use it before returning.
1882         * sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
1884 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
1886         [BZ #4455]
1887         * tst-align2.c: Include stackinfo.h.
1888         * tst-getpid1.c: Likewise.
1890 2007-05-02  Carlos O'Donell  <carlos@systemhalted.org>
1892         [BZ #4455]
1893         * tst-align2.c (do_test): Add _STACK_GROWS_UP case.
1894         * tst-getpid1.c (do_test): Likewise.
1896         [BZ #4456]
1897         * allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
1898         (allocate_stack): Likewise.
1900 2007-05-07  Ulrich Drepper  <drepper@redhat.com>
1902         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
1903         (__lll_robust_lock_wait): Fix race caused by reloading of futex value.
1904         (__lll_robust_timedlock_wait): Likewise.
1905         Reported by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
1907 2007-05-06  Mike Frysinger  <vapier@gentoo.org>
1909         [BZ #4465]
1910         * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
1911         * tst-cancel4.c (tf_fdatasync): New test.
1913 2007-04-27  Ulrich Drepper  <drepper@redhat.com>
1915         [BZ #4392]
1916         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Treat error
1917         check mutexes like normal mutexes.
1919         [BZ #4306]
1920         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
1921         Initialize the whole sigevent structure to appease valgrind.
1923 2007-04-25  Ulrich Drepper  <drepper@redhat.com>
1925         * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
1926         * sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
1928 2007-04-06  Ulrich Drepper  <drepper@redhat.com>
1930         * tst-locale1.c: Avoid warnings.
1931         * tst-locale2.c: Likewise.
1933 2007-03-19  Steven Munroe  <sjmunroe@us.ibm.com>
1935         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1936         (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
1938 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
1940         * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
1941         __extern_always_inline where appropriate.
1942         * sysdeps/pthread/pthread.h: Likewise.
1944 2007-03-13  Richard Henderson  <rth@redhat.com>
1946         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
1947         separate cfi regions for the two subsections.
1949 2007-02-25  Ulrich Drepper  <drepper@redhat.com>
1951         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
1952         new thread, don't just decrement it.
1953         Patch by Suzuki K P <suzuki@in.ibm.com>.
1955 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
1957         * sysdeps/pthread/pthread-functions.h: Correct last patch, correct
1958         PTHFCT_CALL definition.
1960 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
1962         * sysdeps/pthread/pthread-functions.h: If PTR_DEMANGLE is not
1963         available, don't use it.
1965 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
1967         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1968         (__lll_mutex_timedlock_wait): Use correct pointer when we don't
1969         call into the kernel to delay.
1971 2007-01-18  Ulrich Drepper  <drepper@redhat.com>
1973         * tst-initializers1.c: We want to test the initializers as seen
1974         outside of libc, so undefined _LIBC.
1976         * pthread_join.c (cleanup): Avoid warning.
1978 2007-01-17  Ulrich Drepper  <drepper@redhat.com>
1980         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1981         (__lll_timedwait_tid): Add unwind info.
1983         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Don't just copy the
1984         function table, mangle the pointers.
1985         * sysdeps/pthread/pthread-functions.h: Define PTHFCT_CALL.
1986         * forward.c: Use PTHFCT_CALL and __libc_pthread_functions_init.
1987         * sysdeps/pthread/bits/libc-lock.h: When using __libc_pthread_functions
1988         demangle pointers before use.
1989         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Use PTHFCT_CALL to
1990         demangle pointer.
1991         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
1992         * sysdeps/pthread/setxid.h: Likewise.
1994 2007-01-12  Ulrich Drepper  <drepper@redhat.com>
1996         * tst-rwlock7.c: Show some more information in case of correct
1997         behavior.
1999 2007-01-11  Ulrich Drepper  <drepper@redhat.com>
2001         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2002         (lll_futex_timed_wait): Undo part of last change, don't negate
2003         return value.
2005 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
2007         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups.  Define
2008         FUTEX_CMP_REQUEUE and lll_futex_requeue.
2010 2006-12-28  David S. Miller  <davem@davemloft.net>
2012         * shlib-versions: Fix sparc64 linux target specification.
2014 2007-01-10  Jakub Jelinek  <jakub@redhat.com>
2016         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2017         Adjust include path for pthread_barrier_wait.c move.
2019 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
2021         * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
2022         tid isn't reread from pd->tid in between ESRCH test and the syscall.
2024 2006-12-06  Jakub Jelinek  <jakub@redhat.com>
2026         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
2027         6 argument cancellable syscalls.
2028         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
2029         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
2030         6 argument cancellable syscalls.
2031         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
2033 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
2035         * sysdeps/unix/sysv/linux/rtld-lowlevel.h
2036         (__rtld_mrlock_initialize): Add missing closing parenthesis.
2038 2006-10-30  Jakub Jelinek  <jakub@redhat.com>
2040         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
2041         __sync_lock_release instead of __sync_lock_release_si.
2043 2006-10-29  Jakub Jelinek  <jakub@redhat.com>
2045         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P):
2046         Define.
2047         (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld.
2048         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
2049         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
2050         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
2051         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
2052         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2053         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
2054         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
2055         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2056         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2057         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
2059 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
2061         * sysdeps/pthread/pthread_barrier_wait.c: Move to...
2062         * pthread_barrier_wait.c: ...here.
2063         * sysdeps/pthread/pthread_cond_broadcast.c: Move to...
2064         * pthread_cond_broadcast.c: ...here.
2065         * sysdeps/pthread/pthread_cond_signal.c: Move to...
2066         * pthread_cond_signal.c: ...here.
2067         * sysdeps/pthread/pthread_cond_timedwait.c: Move to...
2068         * pthread_cond_timedwait.c: ...here.
2069         * sysdeps/pthread/pthread_cond_wait.c: Move to...
2070         * pthread_cond_wait.c: ...here.
2071         * sysdeps/pthread/pthread_once.c: Move to...
2072         * pthread_once.c: ...here.
2073         * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to...
2074         * pthread_rwlock_rdlock.c: ...here.
2075         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to...
2076         * pthread_rwlock_timedrdlock.c: ...here.
2077         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to...
2078         * pthread_rwlock_timedwrlock.c: ...here.
2079         * sysdeps/pthread/pthread_rwlock_unlock.c: Move to...
2080         * pthread_rwlock_unlock.c: ...here.
2081         * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to...
2082         * pthread_rwlock_wrlock.c: ...here.
2083         * sysdeps/pthread/pthread_spin_destroy.c: Move to...
2084         * pthread_spin_destroy.c: ...here.
2085         * sysdeps/pthread/pthread_spin_init.c: Move to...
2086         * pthread_spin_init.c: ...here.
2087         * sysdeps/pthread/pthread_spin_unlock.c: Move to...
2088         * pthread_spin_unlock.c: ...here.
2089         * sysdeps/pthread/pthread_getcpuclockid.c: Move to...
2090         * pthread_getcpuclockid.c: ...here.
2092         * init.c: USE_TLS support is now always enabled.
2093         * tst-tls5.h: Likewise.
2094         * sysdeps/alpha/tls.h: Likewise.
2095         * sysdeps/i386/tls.h: Likewise.
2096         * sysdeps/ia64/tls.h: Likewise.
2097         * sysdeps/powerpc/tls.h: Likewise.
2098         * sysdeps/s390/tls.h: Likewise.
2099         * sysdeps/sh/tls.h: Likewise.
2100         * sysdeps/sparc/tls.h: Likewise.
2101         * sysdeps/x86_64/tls.h: Likewise.
2103 2006-10-27  Jakub Jelinek  <jakub@redhat.com>
2105         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
2106         __rtld_mrlock_change): Update oldval if atomic compare and exchange
2107         failed.
2109         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
2110         Define to THREAD_SELF->header.multiple_threads.
2111         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
2112         Likewise.
2113         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
2114         Likewise.
2115         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
2116         (SINGLE_THREAD_P): Likewise.
2117         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
2118         (SINGLE_THREAD_P): Likewise.
2119         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2120         (SINGLE_THREAD_P): Likewise.
2121         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
2122         (SINGLE_THREAD_P): Likewise.
2123         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P):
2124         Likewise.
2125         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
2126         (SINGLE_THREAD_P): Likewise.
2127         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
2128         (SINGLE_THREAD_P): Likewise.
2129         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P):
2130         Likewise.
2132 2006-10-26  Jakub Jelinek  <jakub@redhat.com>
2134         * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3
2135         by default rather than 2_3_3.
2137 2006-10-17  Jakub Jelinek  <jakub@redhat.com>
2139         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
2140         __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
2141         atomic_* instead of catomic_* macros.
2143 2006-10-12  Ulrich Drepper  <drepper@redhat.com>
2145         [BZ #3285]
2146         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX.
2147         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
2148         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
2149         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
2150         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
2151         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX.
2152         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
2153         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
2154         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
2155         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise.
2156         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
2157         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
2158         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
2160 2006-10-11  Ulrich Drepper  <drepper@redhat.com>
2162         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for
2163         cancelable syscalls with six parameters.
2165         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
2166         operations instead of atomic_*.
2168 2006-10-09  Ulrich Drepper  <drepper@redhat.com>
2170         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
2172 2006-10-07  Ulrich Drepper  <drepper@redhat.com>
2174         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file.
2175         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file.
2176         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c:
2177         New file.
2178         * pthread_attr_setstack.c: Allow overwriting the version number of the
2179         new symbol.
2180         * pthread_attr_setstacksize.c: Likewise.
2181         (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use
2182         it.
2183         * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add
2184         pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6.
2186 2006-09-24  Ulrich Drepper  <drepper@redhat.com>
2188         [BZ #3251]
2189         * descr.h (ENQUEUE_MUTEX_BOTH): Add cast to avoid warning.
2190         Patch by Petr Baudis.
2192 2006-09-18  Jakub Jelinek  <jakub@redhat.com>
2194         * tst-kill4.c (do_test): Explicitly set tf thread's stack size.
2196         * tst-cancel2.c (tf): Loop as long as something was written.
2198 2006-09-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2200         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: For PI
2201         mutexes wake all mutexes.
2202         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Don't increment
2203         WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2204         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2206 2006-09-12  Ulrich Drepper  <drepper@redhat.com>
2208         * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use
2209         to guarantee the thread is always canceled.
2211 2006-09-08  Jakub Jelinek  <jakub@redhat.com>
2213         * tst-cond22.c: Include pthread.h instead of pthreadP.h.
2214         Include stdlib.h.
2215         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Only
2216         increase FUTEX if increasing WAKEUP_SEQ.  Fix comment typo.
2217         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2218         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2219         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2221 2006-09-08  Ulrich Drepper  <drepper@redhat.com>
2223         [BZ #3123]
2224         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Don't
2225         increment WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2226         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2227         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2228         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2229         * Makefile (tests): Add tst-cond22.
2230         * tst-cond22.c: New file.
2232 2006-09-05  Ulrich Drepper  <drepper@redhat.com>
2234         [BZ #3124]
2235         * descr.h (struct pthread): Add parent_cancelhandling.
2236         * sysdeps/pthread/createthread.c (create_thread): Pass parent
2237         cancelhandling value to child.
2238         * pthread_create.c (start_thread): If parent thread was canceled
2239         reset the SIGCANCEL mask.
2240         * Makefile (tests): Add tst-cancel25.
2241         * tst-cancel25.c: New file.
2243 2006-09-05  Jakub Jelinek  <jakub@redhat.com>
2244             Ulrich Drepper  <drepper@redhat.com>
2246         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
2247         counterp if it is already zero.
2248         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
2250 2006-03-04  Jakub Jelinek  <jakub@redhat.com>
2251             Roland McGrath  <roland@redhat.com>
2253         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2254         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2255         LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
2256         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2257         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2258         lll_robust_mutex_timedlock, lll_mutex_unlock,
2259         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2260         Add _L_*_ symbols around the subsection.
2261         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
2262         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2264 2006-03-03  Jakub Jelinek  <jakub@redhat.com>
2265             Roland McGrath  <roland@redhat.com>
2267         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2268         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2269         LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
2270         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2271         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2272         lll_robust_mutex_timedlock, lll_mutex_unlock,
2273         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2274         Add _L_*_ symbols around the subsection.
2275         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
2276         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2278 2006-08-31  Ulrich Drepper  <drepper@redhat.com>
2280         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Undo last
2281         change because it can disturb too much existing code.  If real hard
2282         reader preference is needed we'll introduce another type.
2283         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2284         (pthread_rwlock_timedwrlock): Likewise.
2285         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2286         Likewise.
2288 2006-08-30  Ulrich Drepper  <drepper@redhat.com>
2290         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Respect
2291         reader preference.
2292         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2293         (pthread_rwlock_timedwrlock): Likewise.
2294         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2295         Likewise.
2297 2006-08-25  Jakub Jelinek  <jakub@redhat.com>
2299         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
2300         Only define ifdef SHARED.
2302 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
2304         * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
2305         (free_stacks): ...here.
2306         (__free_stack_cache): New function.
2307         * pthreadP.h: Declare __free_stack_cache.
2308         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
2309         ptr_freeres.
2310         * init.c (pthread_functions): Initialize ptr_freeres.
2311         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
2312         New freeres function.
2314 2006-07-30  Joseph S. Myers  <joseph@codesourcery.com>
2316         [BZ #3018]
2317         * Makefile (extra-objs): Add modules to extra-test-objs instead.
2319 2006-08-20  Ulrich Drepper  <drepper@redhat.com>
2321         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2322         _XOPEN_REALTIME_THREADS.
2324 2006-08-15  Jakub Jelinek  <jakub@redhat.com>
2326         * sysdeps/unix/sysv/linux/clock_settime.c (INTERNAL_VSYSCALL): Use
2327         HAVE_CLOCK_GETRES_VSYSCALL as guard macro rather than
2328         HAVE_CLOCK_GETTIME_VSYSCALL.
2329         (maybe_syscall_settime_cpu): Use plain INTERNAL_VSYSCALL here.
2331 2006-08-14  Jakub Jelinek  <jakub@redhat.com>
2333         * sysdeps/unix/sysv/linux/bits/posix_opt.h
2334         (_POSIX_THREAD_PRIO_PROTECT): Define to 200112L.
2335         * descr.h (struct priority_protection_data): New type.
2336         (struct pthread): Add tpp field.
2337         * pthreadP.h (PTHREAD_MUTEX_PP_NORMAL_NP,
2338         PTHREAD_MUTEX_PP_RECURSIVE_NP, PTHREAD_MUTEX_PP_ERRORCHECK_NP,
2339         PTHREAD_MUTEX_PP_ADAPTIVE_NP): New enum values.
2340         * pthread_mutex_init.c (__pthread_mutex_init): Handle non-robust
2341         TPP mutexes.
2342         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle TPP mutexes.
2343         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
2344         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
2345         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
2346         * tpp.c: New file.
2347         * pthread_setschedparam.c (__pthread_setschedparam): Handle priority
2348         boosted by TPP.
2349         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
2350         * pthread_mutexattr_getprioceiling.c
2351         (pthread_mutexattr_getprioceiling): If ceiling is 0, ensure it is
2352         in the SCHED_FIFO priority range.
2353         * pthread_mutexattr_setprioceiling.c
2354         (pthread_mutexattr_setprioceiling): Fix prioceiling validation.
2355         * pthread_mutex_getprioceiling.c (pthread_mutex_getprioceiling): Fail
2356         if mutex is not TPP.  Ceiling is now in __data.__lock.
2357         * pthread_mutex_setprioceiling.c: Include stdbool.h.
2358         (pthread_mutex_setprioceiling): Fix prioceiling validation.  Ceiling
2359         is now in __data.__lock.  Add locking.
2360         * pthread_create.c (__free_tcb): Free pd->tpp structure.
2361         * Makefile (libpthread-routines): Add tpp.
2362         (xtests): Add tst-mutexpp1, tst-mutexpp6 and tst-mutexpp10.
2363         * tst-tpp.h: New file.
2364         * tst-mutexpp1.c: New file.
2365         * tst-mutexpp6.c: New file.
2366         * tst-mutexpp10.c: New file.
2367         * tst-mutex1.c (TEST_FUNCTION): Don't redefine if already defined.
2368         * tst-mutex6.c (TEST_FUNCTION): Likewise.
2370 2006-08-12  Ulrich Drepper  <drepper@redhat.com>
2372         [BZ #2843]
2373         * pthread_join.c (pthread_join): Account for self being canceled
2374         when checking for deadlocks.
2375         * tst-join5.c: Cleanups.  Allow to be used in tst-join6.
2376         (tf1): Don't print anything after pthread_join returns, this would be
2377         another cancellation point.
2378         (tf2): Likewise.
2379         * tst-join6.c: New file.
2380         * Makefile (tests): Add tst-join6.
2382 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
2384         [BZ #2892]
2385         * pthread_setspecific.c (__pthread_setspecific): Check
2386         out-of-range index before checking for unused key.
2388         * sysdeps/pthread/gai_misc.h: New file.
2390 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
2392         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
2393         file.  Don't use sysctl.
2394         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
2395         overwrite the file if this is likely not true.
2397 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
2399         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
2400         * Makefile (tests): Add tst-getpid3.
2401         * tst-getpid3.c: New file.
2403 2006-07-30  Roland McGrath  <roland@redhat.com>
2405         * Makefile (libpthread-routines): Add ptw-sigsuspend.
2407         * sysdeps/unix/sysv/linux/i386/not-cancel.h
2408         (pause_not_cancel): New macro.
2409         (nanosleep_not_cancel): New macro.
2410         (sigsuspend_not_cancel): New macro.
2411         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
2412         nanosleep_not_cancel macro from <not-cancel.h>.
2413         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
2414         macro from <not-cancel.h>.
2416 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
2417             Jakub Jelinek  <jakub@redhat.com>
2419         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
2420         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
2421         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
2422         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
2423         * pthread_mutex_init.c: Add support for priority inheritance mutex.
2424         * pthread_mutex_lock.c: Likewise.
2425         * pthread_mutex_timedlock.c: Likewise.
2426         * pthread_mutex_trylock.c: Likewise.
2427         * pthread_mutex_unlock.c: Likewise.
2428         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
2429         all mutexes.
2430         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
2431         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
2432         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
2433         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
2434         pthread-pi-defines.sym.
2435         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
2436         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
2437         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2438         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2439         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2440         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2441         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2442         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2443         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2444         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2445         _POSIX_THREAD_PRIO_INHERIT to 200112L.
2446         * tst-mutex1.c: Adjust to allow use in PI mutex test.
2447         * tst-mutex2.c: Likewise.
2448         * tst-mutex3.c: Likewise.
2449         * tst-mutex4.c: Likewise.
2450         * tst-mutex5.c: Likewise.
2451         * tst-mutex6.c: Likewise.
2452         * tst-mutex7.c: Likewise.
2453         * tst-mutex7a.c: Likewise.
2454         * tst-mutex8.c: Likewise.
2455         * tst-mutex9.c: Likewise.
2456         * tst-robust1.c: Likewise.
2457         * tst-robust7.c: Likewise.
2458         * tst-robust8.c: Likewise.
2459         * tst-mutexpi1.c: New file.
2460         * tst-mutexpi2.c: New file.
2461         * tst-mutexpi3.c: New file.
2462         * tst-mutexpi4.c: New file.
2463         * tst-mutexpi5.c: New file.
2464         * tst-mutexpi6.c: New file.
2465         * tst-mutexpi7.c: New file.
2466         * tst-mutexpi7a.c: New file.
2467         * tst-mutexpi8.c: New file.
2468         * tst-mutexpi9.c: New file.
2469         * tst-robust1.c: New file.
2470         * tst-robust2.c: New file.
2471         * tst-robust3.c: New file.
2472         * tst-robust4.c: New file.
2473         * tst-robust5.c: New file.
2474         * tst-robust6.c: New file.
2475         * tst-robust7.c: New file.
2476         * tst-robust8.c: New file.
2477         * Makefile (tests): Add the new tests.
2479         * pthread_create.c (start_thread): Add some casts to avoid warnings.
2480         * pthread_mutex_destroy.c: Remove unneeded label.
2482 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
2484         * pthread_mutex_init.c (__pthread_mutex_init): Move some
2485         computations to compile time.
2487 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
2489         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
2491 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
2493         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
2495 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
2497         * pthread_key_create.c (__pthread_key_create): Do away with
2498         __pthread_keys_lock.
2500         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2501         (__kernel_cpumask_size): Mark as hidden.
2502         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
2504         * sem_open.c (__sem_mappings_lock): Mark as hidden.
2505         * semaphoreP.h (__sem_mappings_lock): Likewise.
2507 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
2509         * pthread_atfork.c: Mark __dso_handle as hidden.
2511 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
2513         [BZ #2644]
2514         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
2515         the reload problem.  Change the one path in pthread_cancel_init
2516         which causes the problem.  Force gcc to reload.  Simplify callers.
2517         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
2518         (_Unwind_GetBSP): Undo last patch.
2520 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
2522         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
2523         function pointer is reloaded after pthread_cancel_init calls.
2525         [BZ #2644]
2526         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
2527         pointers are reloaded after pthread_cancel_init calls.
2529 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
2531         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
2532         __always_inline.
2534 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
2536         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
2537         Allocate new object which is passed to timer_sigev_thread so that
2538         the timer can be deleted before the new thread is scheduled.
2540 2006-04-26  Roland McGrath  <roland@redhat.com>
2542         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
2544 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
2546         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
2547         suffix for conditional jumps.
2548         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
2549         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2550         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
2551         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
2552         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2553         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2555         * init.c (sigcancel_handler): Compare with correct PID even if the
2556         thread is in the middle of a fork call.
2557         (sighandler_setxid): Likewise.
2558         Reported by Suzuki K P <suzuki@in.ibm.com> .
2560 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
2562         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
2564 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
2566         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
2567         fails [Coverity CID 105].
2569 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
2571         * sysdeps/pthread/pthread.h: Add nonnull attributes.
2573 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
2575         [BZ #2505]
2576         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
2577         Define __lll_rel_instr using lwsync.
2579 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
2581         * allocatestack.c (allocate_stack): Always initialize robust_head.
2582         * descr.h: Define struct robust_list_head.
2583         (struct pthread): Use robust_list_head in robust mutex list definition.
2584         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
2585         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
2586         (__pthread_initialize_minimal_internal): Register robust_list with
2587         the kernel.
2588         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
2589         Declare __set_robust_list_avail.
2590         * pthread_create.c (start_thread): Register robust_list of new thread.
2591         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
2592         waiters.
2593         * pthread_mutex_destroy.c: For robust mutexes don't look at the
2594         number of users, it's unreliable.
2595         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
2596         set_robust_list syscall is available.
2597         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
2598         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
2599         Set robust_head.list_op_pending before trying to lock a robust mutex.
2600         * pthread_mutex_timedlock.c: Likewise.
2601         * pthread_mutex_trylock.c: Likewise.
2602         * pthread_mutex_unlock.c: Likewise for unlocking.
2603         * Makefile (tests): Add tst-robust8.
2604         * tst-robust8.c: New file.
2606 2006-03-08  Andreas Schwab  <schwab@suse.de>
2608         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
2609         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
2611 2006-03-05  Roland McGrath  <roland@redhat.com>
2613         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
2614         and $config_os doesn't match *linux*.
2616 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
2618         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
2619         Use __syscall_error.
2620         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2621         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
2622         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
2623         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2624         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
2625         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
2627 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
2629         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
2631 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
2633         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
2634         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
2635         mutex.
2636         (__lll_robust_timedlock_wait): Likewise.
2637         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
2638         (__lll_robust_lock_wait): Likewise.
2639         (__lll_robust_timedlock_wait): Likewise.
2640         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
2641         (__lll_robust_lock_wait): Likewise.
2642         (__lll_robust_timedlock_wait): Likewise.
2644 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
2646         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
2647         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2648         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2649         lll_robust_mutex_unlock): Define.
2650         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2652 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
2654         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
2655         instead of <clone.S>.
2657 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
2659         * Makefile (libpthread-routines): Add
2660         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
2661         and pthread_mutex_[sg]etprioceiling.
2662         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
2663         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
2664         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
2665         pthread_mutex_setprioceiling.
2666         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
2667         PTHREAD_PRIO_PROTECT): New enum values.
2668         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
2669         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
2670         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
2671         prototypes.
2672         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
2673         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
2674         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
2675         Define.
2676         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
2677         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
2678         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
2679         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
2680         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
2681         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
2682         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
2683         protocol mutexes.
2684         * pthread_mutex_getprioceiling.c: New file.
2685         * pthread_mutex_setprioceiling.c: New file.
2686         * pthread_mutexattr_getprioceiling.c: New file.
2687         * pthread_mutexattr_setprioceiling.c: New file.
2688         * pthread_mutexattr_getprotocol.c: New file.
2689         * pthread_mutexattr_setprotocol.c: New file.
2691 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
2693         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
2695 2006-02-27  Roland McGrath  <roland@redhat.com>
2697         * sysdeps/pthread/Subdirs: List nptl here too.
2698         * configure (libc_add_on_canonical): New variable.
2700         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
2702         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
2703         self to get main source tree's file.
2704         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
2705         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
2706         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
2707         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
2708         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
2709         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
2710         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
2711         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
2712         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
2713         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
2714         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
2715         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
2716         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
2718         * Makefile: Use $(sysdirs) in vpath directive.
2720         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
2721         (CPPFLAGS-timer_routines.c): Likewise.
2723         * Makeconfig (includes): Variable removed.
2725 2006-02-26  Roland McGrath  <roland@redhat.com>
2727         * sysdeps/generic/pt-raise.c: Moved to ...
2728         * pt-raise.c: ... here.
2729         * sysdeps/generic/lowlevellock.h: Moved to ...
2730         * lowlevellock.h: ... here.
2732 2006-02-23  Roland McGrath  <roland@redhat.com>
2734         * descr.h (struct pthread): Add final member `end_padding'.
2735         (PTHREAD_STRUCT_END_PADDING): Use it.
2737 2006-02-20  Roland McGrath  <roland@redhat.com>
2739         * sysdeps/mips: Directory removed, saved in ports repository.
2740         * sysdeps/unix/sysv/linux/mips: Likewise.
2742 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
2744         * tst-robust1.c: Add second mutex to check that the mutex list is
2745         handled correctly.
2747 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
2749         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
2750         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2751         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2752         lll_robust_mutex_unlock): New macros.
2753         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2754         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2755         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2756         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2757         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
2759 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2761         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
2762         definitions.
2763         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
2765 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
2767         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2768         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
2769         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2770         (lll_robust_mutex_unlock): Likewise.
2772 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
2774         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
2775         Set robust_list.__next rather than robust_list.
2776         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
2777         (__pthread_list_t): New typedef.
2778         (pthread_mutex_t): Replace __next and __prev fields with __list.
2779         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
2780         (__pthread_list_t): New typedef.
2781         (pthread_mutex_t): Replace __next and __prev fields with __list.
2782         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2783         (__pthread_list_t, __pthread_slist_t): New typedefs.
2784         (pthread_mutex_t): Replace __next and __prev fields with __list.
2785         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
2786         (__pthread_list_t, __pthread_slist_t): New typedefs.
2787         (pthread_mutex_t): Replace __next and __prev fields with __list.
2788         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
2789         (__pthread_list_t, __pthread_slist_t): New typedefs.
2790         (pthread_mutex_t): Replace __next and __prev fields with __list.
2791         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
2792         (__pthread_slist_t): New typedef.
2793         (pthread_mutex_t): Replace __next field with __list.
2795 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
2797         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
2798         PTHREAD_MUTEX_OWNERDEAD.
2799         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
2800         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
2801         * Makefile (libpthread-routines): Add lowlevelrobustlock.
2802         * pthread_create.c (start_thread): Very much simplify robust_list loop.
2803         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
2804         to PTHREAD_MUTEX_INCONSISTENT.
2805         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
2806         * pthread_mutex_lock.c: Reimplement robust mutex handling.
2807         * pthread_mutex_trylock.c: Likewise.
2808         * pthread_mutex_timedlock.c: Likewise.
2809         * pthread_mutex_unlock.c: Likewise.
2810         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
2811         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
2812         lowlevelrobustlock.sym.
2813         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
2814         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
2815         definitions.
2816         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2817         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
2818         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
2819         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
2820         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
2822 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
2824         * allocatestack.c (allocate_stack): Initialize robust_list.
2825         * init.c (__pthread_initialize_minimal_internal): Likewise.
2826         * descr.h (struct xid_command): Pretty printing.
2827         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
2828         robust_list.  Adjust macros.
2829         * pthread_create.c (start_thread): Adjust robust_list handling.
2830         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
2831         but the owner for all robust mutex types.
2832         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
2833         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
2834         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2835         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
2837         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
2838         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
2840 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
2842         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
2843         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
2845 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2847         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
2848         Return status.
2849         (lll_futex_timed_wait): Define.
2851 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
2853         * tst-cancel4.c: Test ppoll.
2855 2006-01-18  Andreas Jaeger  <aj@suse.de>
2857         [BZ #2167]
2858         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
2859         (pthread_mutex_t): Follow changes for other archs.  Based on patch
2860         by Jim Gifford <patches@jg555.com>.
2862 2006-01-13  Richard Henderson  <rth@redhat.com>
2864         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
2866 2006-01-10  Roland McGrath  <roland@redhat.com>
2868         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
2869         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
2870         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
2871         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
2872         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
2873         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
2874         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
2875         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
2876         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
2877         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
2879 2006-01-09  Roland McGrath  <roland@redhat.com>
2881         * tst-initializers1-c89.c: New file.
2882         * tst-initializers1-c99.c: New file.
2883         * tst-initializers1-gnu89.c: New file.
2884         * tst-initializers1-gnu99.c: New file.
2885         * Makefile (tests): Add them.
2886         (CFLAGS-tst-initializers1-c89.c): New variable.
2887         (CFLAGS-tst-initializers1-c99.c): New variable.
2888         (CFLAGS-tst-initializers1-gnu89.c): New variable.
2889         (CFLAGS-tst-initializers1-gnu99.c): New variable.
2891         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2892         Use __extension__ on anonymous union definition.
2893         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2894         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2895         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2896         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2897         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2899 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
2901         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
2902         Don't give the union a name because it changes the mangled name.
2903         Instead name the struct for __data.
2904         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
2905         Likewise.
2906         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
2907         Likewise.
2909 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
2911         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
2912         stack bias to mc_ftp field.
2914 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
2916         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
2917         being too clever and reloading the futex value where it shouldn't.
2919 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
2921         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
2922         correct type.
2924 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
2926         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
2927         Add cfi directives.
2929 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
2931         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
2932         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
2933         rename in tcbhead_t.
2935         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2936         Don't give the union a name because it changes the mangled name.
2937         Instead name the struct for __data.
2938         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2939         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2940         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2941         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2942         * pthread_create.c (start_thread): Adjust robust mutex free loop.
2943         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
2945 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
2947         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
2948         Return status.
2949         (lll_futex_timed_wait): Define.
2950         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2951         * sysdeps/pthread/aio_misc.h: New file.
2953 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
2955         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
2957 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
2959         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2960         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
2961         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2963 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
2965         * tst-cancel24.cc: Use C headers instead of C++ headers.
2967 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
2969         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
2970         sparc-linux configured glibc.
2971         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
2972         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
2973         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
2974         atomic_compare_and_exchange_val_24_acq instead of
2975         atomic_compare_and_exchange_val_acq.
2976         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
2977         instead of atomic_exchange_rel.
2978         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
2979         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
2980         file.
2981         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
2982         file.
2983         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
2984         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
2985         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
2986         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
2987         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
2988         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
2989         New file.
2990         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2991         New file.
2992         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
2993         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
2994         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
2995         file.
2996         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
2997         file.
2998         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
3000 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
3002         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
3003         mutex initializers.
3005 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
3007         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
3008         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3009         THREAD_COPY_POINTER_GUARD): Define.
3010         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
3011         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
3013 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
3015         * version.c: Update copyright year.
3017 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3019         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
3020         .eh_frame section, use cfi_* directives.
3021         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
3023 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
3025         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
3026         now.
3028 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
3030         * sysdeps/pthread/sigaction.c: Removed.
3031         * sigaction.c: New file.
3032         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
3034 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
3036         * Makefile (tests): Add tst-signal7.
3037         * tst-signal7.c: New file.
3039 2005-12-27  Roland McGrath  <roland@redhat.com>
3041         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
3042         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
3043         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
3044         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
3045         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
3046         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3047         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3048         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3049         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3050         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
3051         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3053 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
3055         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
3056         and __prev field to pthread_mutex_t.
3057         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3058         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3059         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3060         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3061         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
3062         to pthread_mutex_t.
3064 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
3066         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
3067         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
3068         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
3069         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
3070         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
3071         and PTHREAD_MUTEXATTR_FLAG_BITS.
3072         * descr.h (struct pthread): Add robust_list field and define
3073         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
3074         * pthread_mutexattr_getrobust.c: New file.
3075         * pthread_mutexattr_setrobust.c: New file.
3076         * pthread_mutex_consistent.c: New file.
3077         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
3078         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
3079         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
3080         Adjust pthread_mutex_t initializers.
3081         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
3082         field to pthread_mutex_t.
3083         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
3084         and __prev field to pthread_mutex_t.
3085         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
3086         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
3087         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
3088         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
3089         * pthread_mutexattr_gettype.c: Likewise.
3090         * pthread_mutexattr_setpshared.c: Likewise.
3091         * pthread_mutexattr_settype.c: Likewise.
3092         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
3093         Initialize mutex kind according to robust flag.
3094         * pthread_mutex_lock.c: Implement local robust mutex.
3095         * pthread_mutex_timedlock.c: Likewise.
3096         * pthread_mutex_trylock.c: Likewise.
3097         * pthread_mutex_unlock.c: Likewise.
3098         * pthread_create.c (start_thread): Mark robust mutexes which remained
3099         locked as dead.
3100         * tst-robust1.c: New file.
3101         * tst-robust2.c: New file.
3102         * tst-robust3.c: New file.
3103         * tst-robust4.c: New file.
3104         * tst-robust5.c: New file.
3105         * tst-robust6.c: New file.
3106         * tst-robust7.c: New file.
3107         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
3108         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
3109         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
3110         tst-robust5, tst-robust6, and tst-robust7.
3112         * tst-typesizes.c: New file.
3113         * Makefile (tests): Add tst-typesizes.
3115         * tst-once3.c: More debug output.
3117 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
3119         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
3120         missing after last change.
3122         * version.c: Update copyright year.
3124 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
3126         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
3127         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
3128         * pthread_mutex_trylock.c: Likewise.
3129         * pthread_mutex_timedlock.c: Likewise.
3130         * pthread_mutex_unlock.c: Likewise.
3132 2005-12-22  Roland McGrath  <roland@redhat.com>
3134         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
3135         so that #include_next's search location is not reset to the -I..
3136         directory where <nptl/...> can be found.
3138 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
3140         [BZ #1913]
3141         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3142         Fix unwind info.  Remove useless branch prediction prefix.
3143         * tst-cancel24.cc: New file.
3144         * Makefile: Add rules to build and run tst-cancel24.
3146 2005-12-21  Roland McGrath  <roland@redhat.com>
3148         * libc-cancellation.c: Use <> rather than "" #includes.
3149         * pt-cleanup.c: Likewise.
3150         * pthread_create.c: Likewise.
3151         * pthread_join.c: Likewise.
3152         * pthread_timedjoin.c: Likewise.
3153         * pthread_tryjoin.c: Likewise.
3154         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
3155         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
3156         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
3157         * unwind.c: Likewise.
3159 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3161         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
3162         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
3163         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3164         THREAD_COPY_POINTER_GUARD): Define.
3166 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
3168         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
3169         rather than one.
3170         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3171         THREAD_COPY_POINTER_GUARD): Define.
3172         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
3173         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
3174         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3175         THREAD_COPY_POINTER_GUARD): Define.
3176         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
3177         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
3178         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
3179         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
3180         Use PTR_DEMANGLE for B0 if defined.
3182 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
3184         * pthread_create.c (__pthread_create_2_1): Use
3185         THREAD_COPY_POINTER_GUARD if available.
3186         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
3187         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3188         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
3189         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
3190         * sysdeps/x86_64/tls.h: Likewise.
3192 2005-12-15  Roland McGrath  <roland@redhat.com>
3194         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
3196 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
3198         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
3199         sysdeps/generic.
3200         * errno-loc.c: New file.
3202 2005-12-12  Roland McGrath  <roland@redhat.com>
3204         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
3205         adjustments before choosing stack size.  Update minimum stack size
3206         calculation to match allocate_stack change.
3208 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
3210         * allocatestack.c (allocate_stack): Don't demand that there is an
3211         additional full page available on the stack beside guard, TLS, the
3212         minimum stack.
3214 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
3216         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3217         (__cleanup_fct_attribute): Use __regparm__ not regparm.
3219         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
3220         compiling 32-bit code we must define __cleanup_fct_attribute.
3222 005-11-24  Jakub Jelinek  <jakub@redhat.com>
3224         [BZ #1920]
3225         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
3226         __attribute__ instead of __attribute.
3227         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3228         (__cleanup_fct_attribute): Likewise.
3230 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
3232         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
3233         a write barrier before writing libgcc_s_getcfa.
3235 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
3237         * sysdeps/unix/sysv/linux/configure: Removed.
3239 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
3241         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
3242         optional init_array/fini_array support.
3244 2005-10-24  Roland McGrath  <roland@redhat.com>
3246         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
3247         versioned_symbol use.
3249 2005-10-16  Roland McGrath  <roland@redhat.com>
3251         * init.c (__pthread_initialize_minimal_internal): Even when using a
3252         compile-time default stack size, apply the minimum that allocate_stack
3253         will require, and round up to page size.
3255 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
3257         * Makefile ($(test-modules)): Remove static pattern rule.
3259 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
3260             Ulrich Drepper  <drepper@redhat.com>
3262         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
3263         alignment in callback function.
3264         * Makefile: Add rules to build and run tst-align3.
3265         * tst-align3.c: New file.
3267 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
3269         * allocatestack.c (setxid_signal_thread): Add
3270         INTERNAL_SYSCALL_DECL (err).
3272 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
3274         * allocatestack.c (setxid_signal_thread): Need to use
3275         atomic_compare_and_exchange_bool_acq.
3277 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
3278             Jakub Jelinek  <jakub@redhat.com>
3280         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
3281         CANCEL_RESTMASK.
3282         (struct pthread): Move specific_used field to avoid padding.
3283         Add setxid_futex field.
3284         * init.c (sighandler_setxid): Reset setxid flag and release the
3285         setxid futex.
3286         * allocatestack.c (setxid_signal_thread): New function.  Broken
3287         out of the bodies of the two loops in __nptl_setxid.  For undetached
3288         threads check whether they are exiting and if yes, don't send a signal.
3289         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
3290         * pthread_create.c (start_thread): For undetached threads, check
3291         whether setxid bit is set.  If yes, wait until signal has been
3292         processed.
3294         * allocatestack.c (STACK_VARIABLES): Initialize them.
3295         * pthread_create.c (__pthread_create_2_1): Initialize pd.
3297 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
3299         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
3300         waiters, awake all waiters on the associated mutex.
3302 2005-09-22  Roland McGrath  <roland@redhat.com>
3304         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
3305         ../sysdeps/x86_64/hp-timing.h).
3307 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
3309         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
3310         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3311         (lll_futex_wake_unlock): Define.
3312         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
3313         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3314         (lll_futex_wake_unlock): Define.
3315         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
3316         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3317         (lll_futex_wake_unlock): Define.
3318         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
3319         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3320         (lll_futex_wake_unlock): Define.
3321         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
3322         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3323         (lll_futex_wake_unlock): Define.
3324         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
3325         lll_futex_wake_unlock.
3326         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3327         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3328         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3329         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
3330         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3331         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3333 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3335         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
3336         Fix typo in register name.
3338 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
3340         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3341         Use __sigfillset.  Document that sigfillset does the right thing wrt
3342         to SIGSETXID.
3344 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3346         [BZ #1102]
3347         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
3348         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
3349         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
3350         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
3351         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
3352         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
3353         in the structure.
3354         * Makefile (tests): Add tst-initializers1.
3355         (CFLAGS-tst-initializers1.c): Set.
3356         * tst-initializers1.c: New test.
3358 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3360         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
3361         Make sure __flags are located at offset 48 from the start of the
3362         structure.
3364 2005-07-02  Roland McGrath  <roland@redhat.com>
3366         * Makeconfig: Comment fix.
3368 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
3370         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
3371         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
3372         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
3373         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
3374         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3375         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3376         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
3377         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
3378         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
3379         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3381 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
3383         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
3384         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3385         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
3386         fields.
3387         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3388         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
3389         field.  Put in sysinfo field unconditionally.
3390         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3391         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
3392         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3393         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
3394         fields.
3395         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3396         * pthread_create.c (__pthread_create_2_1): Use
3397         THREAD_COPY_STACK_GUARD macro.
3398         * Makefile: Add rules to build and run tst-stackguard1{,-static}
3399         tests.
3400         * tst-stackguard1.c: New file.
3401         * tst-stackguard1-static.c: New file.
3403 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
3405         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
3406         Invoke CGOTSETUP and CGOTRESTORE.
3407         (CGOTSETUP, CGOTRESTORE): Define.
3409 2005-05-29  Richard Henderson  <rth@redhat.com>
3411         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
3412         (tf_write, tf_writev): Use it.
3413         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
3414         the system minimum.
3416 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
3418         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3419         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
3420         __librt_*_asynccancel@local.
3422 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
3424         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
3425         all occurrences of JUMPTARGET.  Instead append @local to labels.
3427 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
3429         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
3430         size/alignment of struct pthread rather than tcbhead_t.
3431         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3432         Likewise.
3433         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3434         Likewise.
3435         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3436         Likewise.
3438 2005-05-19  Richard Henderson  <rth@redhat.com>
3440         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
3441         __sync_val_compare_and_swap, not explicit _si variant.
3442         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
3444 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
3446         [BZ #915]
3447         * sysdeps/pthread/pthread.h: Avoid empty initializers.
3449 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
3451         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
3452         .eh_frame section, use cfi_* directives.
3454 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
3456         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
3457         of "" includes.
3459 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
3461         [BZ #1075]
3462         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
3463         aio_write blocks.
3465 2005-04-27  Roland McGrath  <roland@redhat.com>
3467         * Makefile (tests): Remove tst-clock2.
3469         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
3470         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
3471         translating to the kernel clockid_t for our own process/thread clock.
3473         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
3475 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
3477         * old_pthread_cond_init.c: Include <errno.h>.
3478         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
3479         process shared or uses clock other than CLOCK_REALTIME.
3480         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
3482 2005-04-13  David S. Miller  <davem@davemloft.net>
3484         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
3485         * sysdeps/sparc/sparc64/clone.S: New file.
3487 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
3489         [BZ #1102]
3490         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
3491         __inline instead of inline.
3492         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
3494 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
3496         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
3497         functionally equivalent, but shorter instructions.
3498         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
3499         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3500         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
3501         Likewise.
3502         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
3503         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3504         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3505         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3506         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3507         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
3508         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3509         Likewise.
3510         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3511         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
3512         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3513         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
3514         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3516 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
3518         * sysdeps/mips/Makefile: New file.
3519         * sysdeps/mips/nptl-sysdep.S: New file.
3520         * sysdeps/mips/tcb-offsets.sym: New file.
3521         * sysdeps/mips/pthread_spin_lock.S: New file.
3522         * sysdeps/mips/pthread_spin_trylock.S: New file.
3523         * sysdeps/mips/pthreaddef.h: New file.
3524         * sysdeps/mips/tls.h: New file.
3525         * sysdeps/mips/jmpbuf-unwind.h: New file.
3526         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
3527         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
3528         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
3529         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
3530         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
3531         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
3532         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
3533         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
3534         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
3535         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
3537 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
3539         [BZ #1112]
3540         * pthread_create.c (__pthread_create_2_1): Rename syscall error
3541         variable to scerr.
3543 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
3545         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
3547 2005-02-25  Roland McGrath  <roland@redhat.com>
3549         * alloca_cutoff.c: Correct license text.
3550         * tst-unload.c: Likewise.
3551         * sysdeps/pthread/allocalim.h: Likewise.
3552         * sysdeps/pthread/pt-initfini.c: Likewise.
3553         * sysdeps/pthread/bits/libc-lock.h: Likewise.
3554         * sysdeps/pthread/bits/sigthread.h: Likewise.
3555         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
3556         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
3558 2005-02-16  Roland McGrath  <roland@redhat.com>
3560         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
3561         Use unsigned int * for ptr_nthreads.
3563 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
3565         [BZ #721]
3566         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
3567         gcc4.
3569 2005-02-07  Richard Henderson  <rth@redhat.com>
3571         [BZ #787]
3572         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
3573         argument.
3575 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
3577         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
3578         order of arguments in invocation of atomic_add_zero.
3580 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
3582         [BZ #737]
3583         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
3584         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
3585         at least gotntpoff relocation and addition.
3586         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
3587         Likewise.
3588         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
3589         Likewise.
3590         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3591         Likewise.
3593 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
3595         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
3596         entry for static tls deallocation fix.
3597         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
3598         also contains information whether the memory pointed to is static
3599         TLS or not.
3600         * sysdeps/i386/tls.h: Likewise.
3601         * sysdeps/ia64/tls.h: Likewise.
3602         * sysdeps/powerpc/tls.h: Likewise.
3603         * sysdeps/s390/tls.h: Likewise.
3604         * sysdeps/sh/tls.h: Likewise.
3605         * sysdeps/sparc/tls.h: Likewise.
3606         * sysdeps/x86_64/tls.h: Likewise.
3608 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
3610         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
3612 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
3614         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
3615         %esp.
3616         * Makefile (tests): Add tst-align2.
3617         * tst-align2.c: New test.
3618         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
3619         -mpreferred-stack-boundary=4.
3621 2004-12-18  Roland McGrath  <roland@redhat.com>
3623         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
3624         New file removed withdrawn for the moment.
3626 2004-12-17  Richard Henderson  <rth@redhat.com>
3628         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
3629         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
3631 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
3633         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
3634         Increased PTHREAD_STACK_MIN.
3636         * tst-context1.c (stacks): Use bigger stack size.
3638 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
3640         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
3641         * sysdeps/sparc/tcb-offsets.sym: Add TID.
3643 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
3645         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
3646         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
3647         * sysdeps/s390/tcb-offsets.sym (TID): Add.
3649 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
3651         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
3653 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
3655         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
3656         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
3658         * tst-getpid1.c: If child crashes, report this first.  Print which
3659         signal.
3661 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
3663         * init.c (__pthread_initialize_minimal_internal): Also unblock
3664         SIGSETXID.
3666 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
3668         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
3669         _POSIX_THREAD_CPUTIME): Define to 0.
3670         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
3671         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
3672         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
3673         __timer_signal_thread_tclk): Remove.
3674         (init_module): Remove their initialization.
3675         (thread_cleanup): Remove their cleanup assertions.
3676         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
3677         __timer_signal_thread_tclk): Remove.
3678         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
3679         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
3680         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
3682 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
3684         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
3685         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
3687         * Makefile (tests): Add tst-getpid2.
3688         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
3689         (do_test): Use it.  Use __clone2 instead of clone on ia64.
3690         * tst-getpid2.c: New test.
3692 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3694         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
3696 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
3698         * Makefile (tests): Add tst-getpid1.
3699         * tst-getpid1.c: New file.
3700         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
3701         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
3703 2004-12-02  Roland McGrath  <roland@redhat.com>
3705         * Makefile (libpthread-nonshared): Variable removed.
3706         ($(objpfx)libpthread_nonshared.a): Target removed.
3707         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
3708         These are now handled by generic magic from
3709         libpthread-static-only-routines being set.
3711 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
3713         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
3714         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
3715         _POSIX_THREAD_PRIO_PROTECT): Define.
3716         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3717         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3718         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3720 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
3722         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
3723         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
3724         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
3725         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
3726         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3727         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3728         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3730 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
3732         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
3734         * Makefile (libpthread-routines): Add pthread_setschedprio.
3735         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
3736         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
3737         * pthread_setschedprio.c: New file.
3739 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
3741         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
3742         * pthread_cancel.c (pthread_create): Likewise.
3744         * Makefile (libpthread-routines): Add vars.
3745         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
3746         * init.c (__default_stacksize, __is_smp): Remove.
3747         * vars.c: New file.
3748         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
3749         and define a wrapper macro.
3750         (PTHREAD_STATIC_FN_REQUIRE): Define.
3751         * allocatestack.c (__find_thread_by_id): Undefine.
3752         * pthread_create (__pthread_keys): Remove.
3753         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
3754         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
3755         PTHREAD_STATIC_FN_REQUIRE.
3757 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3759         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
3760         parameter to REGISTER macro.
3762 2004-11-17  Roland McGrath  <roland@redhat.com>
3764         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
3765         Make sure SIGCANCEL is blocked as well.
3767 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3769         * sysdeps/pthread/setxid.h: New file.
3770         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
3771         (struct xid_command): Add forward decl.
3772         (struct pthread_functions): Change return type of __nptl_setxid hook
3773         to int.
3774         * pthreadP.h (__nptl_setxid): Change return type to int.
3775         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
3776         calling thread, return its return value and set errno on failure.
3777         * descr.h (struct xid_command): Change id type to long array.
3779         * Makefile: Add rules to build and test tst-setuid1 and
3780         tst-setuid1-static.
3781         * tst-setuid1.c: New test.
3782         * tst-setuid1-static.c: New test.
3784 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3786         * Makefile (tests): Add tst-exit3.
3787         * tst-exit3.c: New test.
3789 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
3791         * Makefile (tests): Add tst-exit2.
3792         * tst-exit2.c: New file.
3794 2004-11-09  Roland McGrath  <roland@redhat.com>
3796         [BZ #530]
3797         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
3798         here, before calling clone.
3799         * pthread_create.c (start_thread): Don't do it here.
3801 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
3803         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
3805 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
3807         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
3808         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
3809         assembler warning.
3811 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
3813         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
3814         if sched_priority is not between minprio and maxprio.
3816 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3818         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
3819         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
3821         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3822         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
3824 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
3826         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
3827         not-cancelable I/O functions.
3829 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3831         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3832         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3833         make sure 2 is stored in the futex and we looked at the old value.
3834         Fix a few other problems to return the correct value.
3836 2004-10-14  Richard Henderson  <rth@redhat.com>
3838         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
3839         make gcc4 happy.
3841 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
3843         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
3844         of pthread-functions.h and pthreaddef.h.
3845         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
3847         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
3848         Change __data.__nwaiters from int to unsigned int.
3850         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
3851         sysconf (_SC_THREAD_CPUTIME) returns negative value.
3853         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
3854         before return type.
3856         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
3857         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
3859 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
3861         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
3862         test fails, remove message queue.
3863         (tf_msgsnd): Likewise.
3865 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3867         * tst-clock1.c: Change #ifdef to #if defined.
3868         * tst-clock2.c: Likewise.
3869         * tst-cond11.c: Likewise.
3871         * sysdeps/pthread/timer_create.c (timer_create): Use
3872         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
3873         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
3874         THREAD_CPUTIME.
3876 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3878         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
3879         _POSIX_THREAD_CPUTIME): Define to 0.
3881 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
3883         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
3884         and _POSIX_THREAD_CPUTIME to zero.
3885         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3886         * tst-barrier2.c: Fix testing for POSIX feature.
3887         * tst-clock1.c: Likewise.
3888         * tst-clock2.c: Likewise.
3889         * tst-cond11.c: Likewise.
3890         * tst-cond4.c: Likewise.
3891         * tst-cond6.c: Likewise.
3892         * tst-flock2.c: Likewise.
3893         * tst-mutex4.c: Likewise.
3894         * tst-mutex9.c: Likewise.
3895         * tst-rwlock12.c: Likewise.
3896         * tst-rwlock4.c: Likewise.
3897         * tst-signal1.c: Likewise.
3898         * tst-spin2.c: Likewise.
3899         * sysdeps/pthread/posix-timer.h: Likewise.
3900         * sysdeps/pthread/timer_create.c: Likewise.
3901         * sysdeps/pthread/timer_routines.c: Likewise.
3903 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
3905         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3906         (__lll_mutex_timedlock_wait): Address futex correctly.
3908         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
3909         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3910         make sure 2 is stored in the futex and we looked at the old value.
3911         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3912         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
3913         which might very well made the code not working at all before.
3914         [BZ #417]
3916 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
3918         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
3919         allow SIGSETXID to be sent.
3920         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
3921         for SIGSETXID to be defined.
3922         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
3923         SIGSETXID cannot be blocked.
3925         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3926         Add __extension__ to long long types.
3927         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3928         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3929         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3930         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3931         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
3932         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3933         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3935 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
3937         * descr.h (struct pthread): Add stopped_start field.
3938         * sysdeps/pthread/createthread.c (create_thread): Set
3939         start_stopped flag in descriptor for new thread appropriately.
3940         * pthread_create.c (start_thread): Only take lock to be stopped on
3941         startup if stopped_start flag says so.
3943 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
3945         * pthread_create.c (__pthread_create_2_1): Remember whether thread
3946         is created detached and if yes, do not try to free the stack in case
3947         the thread creation failed.
3948         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
3949         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
3950         case there has been no error.  [BZ #405]
3952         * pthread_create.c (start_thread): Don't wait for scheduler data
3953         etc to be set at the beginning of the function.  The cancellation
3954         infrastructure must have been set up.  And enable async
3955         cancellation before potentially going to sleep.  [BZ #401]
3957 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
3959         * Versions: Remove exports for pthread_set*id_np functions.
3960         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
3961         for now.
3962         * Makefile: Don't build pthread_set*id code for now.
3964 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
3966         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
3967         internal use.
3968         * allocatestack.c (__nptl_setxid): New function.
3969         * descr.h (struct xid_command): Define type.
3970         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
3971         (sighandler_setxid): New function.
3972         (__pthread_initialize_minimal): Register sighandler_setxid for
3973         SIGCANCEL.
3974         * pt-allocrtsig.c: Update comment.
3975         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
3976         Declare __nptl_setxid.
3977         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
3978         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
3979         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
3980         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
3981         and pthread_setresuid_np.
3982         * pthread_setgid_np.c: New file.
3983         * pthread_setuid_np.c: New file.
3984         * pthread_setegid_np.c: New file.
3985         * pthread_seteuid_np.c: New file.
3986         * pthread_setregid_np.c: New file.
3987         * pthread_setreuid_np.c: New file.
3988         * pthread_setresgid_np.c: New file.
3989         * pthread_setresuid_np.c: New file.
3990         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
3991         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
3992         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
3993         and pthread_setresuid_np.
3994         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
3995         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
3996         pthread_setregid, and pthread_setresgid.
3998 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
4000         * allocatestack.c (allocate_stack): Return EAGAIN instead of
4001         ENOMEM when out of memory.
4003 2004-09-10  Roland McGrath  <roland@redhat.com>
4005         [BZ #379]
4006         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
4007         code, since we don't try to use the broken CLONE_STOPPED any more.
4008         * pthread_create.c (start_thread): Likewise.
4010 2004-09-15  Richard Henderson  <rth@redhat.com>
4012         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
4014 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
4016         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
4017         (__libc_unwind_longjmp): Delete macro and declare as function.
4018         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
4019         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
4020         nptl directory.
4021         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
4022         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
4023         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
4025 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
4027         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
4028         for __USE_XOPEN2K.
4029         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
4030         types also for __USE_XOPEN2K.
4031         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4032         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4033         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4034         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4035         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4036         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4037         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4038         [BZ #320]
4040 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
4042         * sysdeps/pthread/pthread.h
4043         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
4044         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
4045         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
4046         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
4047         [BZ #375]
4049 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
4051         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
4052         PSEUDO to be used with . prefix.
4054         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
4055         Use atomic_increment instead of atomic_exchange_and_add.
4056         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
4057         Likewise.
4058         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
4059         Likewise.
4060         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
4061         Likewise.
4063         * allocatestack.c (allocate_stack): Use atomic_increment_val
4064         instead of atomic_exchange_and_add.
4065         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
4066         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
4067         Likewise.
4068         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4069         Likewise.
4071         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
4072         the initialization function might throw.
4074 2005-09-05  Richard Henderson  <rth@redhat.com>
4076         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
4077         Move definition inside libpthread, libc, librt check.  Provide
4078         definition for rtld.
4080 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
4082         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
4083         * sysdeps/i386/jmpbuf-unwind.h: Likewise
4084         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
4085         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
4086         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
4087         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
4088         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
4089         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
4090         * unwind.c: Use it.
4092         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4093         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
4094         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4095         Likewise.
4096         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4097         Decrement __nwaiters.  If pthread_cond_destroy has been called and
4098         this is the last waiter, signal pthread_cond_destroy caller and
4099         avoid using the pthread_cond_t structure after unlock.
4100         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4101         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4102         Read clock type from the least significant bits of __nwaiters instead
4103         of __clock.
4104         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4105         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
4107 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
4109         [BZ #342]
4110         * Makefile (tests): Add tst-cond20 and tst-cond21.
4111         * tst-cond20.c: New test.
4112         * tst-cond21.c: New test.
4113         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
4114         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
4115         it unsigned int.
4116         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4117         Likewise.
4118         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4119         (pthread_cond_t): Likewise.
4120         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4121         Likewise.
4122         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4123         Likewise.
4124         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4125         Likewise.
4126         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
4127         (cond_nwaiters): New.
4128         (clock_bits): New.
4129         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
4130         if there are waiters not signalled yet.
4131         Wait until all already signalled waiters wake up.
4132         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
4133         __nwaiters.  If pthread_cond_destroy has been called and this is the
4134         last waiter, signal pthread_cond_destroy caller and avoid using
4135         the pthread_cond_t structure after unlock.
4136         (__pthread_cond_wait): Increment __nwaiters in the beginning,
4137         decrement it when leaving.  If pthread_cond_destroy has been called
4138         and this is the last waiter, signal pthread_cond_destroy caller.
4139         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4140         Likewise.  Read clock type from the least significant bits of
4141         __nwaiters instead of __clock.
4142         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
4143         whether clock ID can be encoded in COND_CLOCK_BITS bits.
4144         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
4145         clock type just from the last COND_CLOCK_BITS bits of value.
4146         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
4147         instead of __clock, just from second bit of condattr's value.
4149 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
4151         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
4152         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
4153         != 64.
4154         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4156 2004-08-15  Roland McGrath  <roland@frob.com>
4158         * pthread_atfork.c: Update copyright terms including special exception
4159         for these trivial files, which are statically linked into executables
4160         that use dynamic linking for the significant library code.
4162 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
4164         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
4165         pthread_rwlock_rdlock.
4166         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
4167         Decrease __nr_readers_queued after reacquiring lock.
4168         * sysdeps/pthread/pthread_rwlock_timedrdlock
4169         (pthread_rwlock_timedrdlock): Likewise.
4170         Reported by Bob Cook <bobcook47@hotmail.com>.
4172 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
4174         * tst-rwlock14.c (tf): Read main thread handle from *ARG
4175         before pthread_barrier_wait.
4177 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
4179         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
4180         Remove unnecessary exception handling data.
4182 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
4184         [BZ #284]
4185         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
4186         instead of clockid_t.
4188 2004-07-21  Roland McGrath  <roland@redhat.com>
4190         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
4192 2004-07-19  Roland McGrath  <roland@redhat.com>
4194         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
4196 2004-07-02  Roland McGrath  <roland@redhat.com>
4198         * configure: Don't exit.
4200 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4202         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4203         (__pthread_cond_timedwait): Check for invalid nanosecond in
4204         timeout value.
4206 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
4208         * Makefile: Add rules to build and run tst-fini1.
4209         * tst-fini1.c: New file.
4210         * tst-fini1mod.c: New file.
4212 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
4214         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
4215         if no cancellation support is needed.
4216         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
4217         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
4218         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4219         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
4220         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
4221         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
4222         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
4223         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
4224         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
4226         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
4227         only if not already defined.
4229 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
4231         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
4232         constraint "m" instead of "0" for futex.
4234         * shlib-versions: Add powerpc64-.*-linux.*.
4236 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
4238         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
4239         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
4240         for valid tv_nsec.
4241         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
4242         1 billion and 64-bit tv_nsec which is valid when truncated to 32
4243         bits.
4245 2004-06-29  Roland McGrath  <roland@redhat.com>
4247         * Banner: NPTL no longer has its own version number.
4248         * Makefile (nptl-version): Variable removed.
4249         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
4250         using $(version), the glibc version number.
4252 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4254         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4255         Fix branch offset for a PLT entry.
4256         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
4257         Likewise.
4258         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
4259         Likewise.
4260         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
4261         Likewise.
4262         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
4263         Likewise.
4265 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4267         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
4268         unconditionally.
4270 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4272         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
4273         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
4274         instead of tv_sec.
4275         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
4276         (pthread_rwlock_timedrdlock): Likewise.
4278 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
4280         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4281         Set __r7 to val, not mutex.
4283 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
4285         * Makefile: Add rules to build tst-rwlock14.
4286         * tst-rwlock14.c: New file.
4288 2004-06-24  Boris Hu  <boris.hu@intel.com>
4290         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
4291         check.
4292         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
4294 2004-06-19  Andreas Jaeger  <aj@suse.de>
4296         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
4297         assembler in last patch.
4299 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
4301         * sysdeps/pthread/pthread_cond_timedwait.c
4302         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
4303         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4304         (__pthread_cond_timedwait): Check for invalid nanosecond in
4305         timeout value.
4306         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4307         * tst-cond19.c: New file.
4308         * Makefile: Add rules to build and run tst-cond19.
4310 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
4312         * tst-context1.c (GUARD_PATTERN): Defined.
4313         (tst_context_t): Define struct containing ucontext_t & guard words.
4314         (ctx): Declare as an array of tst_context_t.
4315         (fct): Verify uc_link & guard words are still valid.
4316         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
4318 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4320         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4321         Add __data.__futex field, reshuffle __data.__clock.
4322         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
4323         (__pthread_cond_signal): Increment __futex at the same time as
4324         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4325         address of low 32-bits of __wakeup_seq to futex syscall.
4326         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4327         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4328         releasing internal lock to FUTEX_WAIT.
4329         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4330         (__pthread_cond_timedwait): Likewise.
4331         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4332         (FUTEX_CMP_REQUEUE): Define.
4333         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4334         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4335         Pass __futex value from before the unlock and __futex address instead
4336         of address of low 32-bits of __wakeup_seq to futex syscall.
4337         Fallback to FUTEX_WAKE all on any errors.
4339 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
4341         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
4342         comment typo.
4343         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
4344         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
4345         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
4346         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
4347         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
4349 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4351         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
4352         Add memory clobber to inline assembly.
4353         (__lll_mutex_trylock): Likewise.
4354         (__lll_mutex_cond_trylock): Likewise.
4356 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4358         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4359         Pass val argument as 6th system call argument in %r7.
4361 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4363         * Makefile (tests): Add tst-cond16.
4364         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
4365         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
4366         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4367         Add __data.__futex field, reshuffle __data.__clock.
4368         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
4369         (__pthread_cond_signal): Increment __futex at the same time as
4370         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4371         address of low 32-bits of __wakeup_seq to futex syscall.
4372         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
4373         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4374         releasing internal lock to FUTEX_WAIT.
4375         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
4376         (__pthread_cond_timedwait): Likewise.
4377         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
4378         (FUTEX_CMP_REQUEUE): Define.
4379         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4380         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4381         Pass __futex value from before the unlock and __futex address instead
4382         of address of low 32-bits of __wakeup_seq to futex syscall.
4383         Fallback to FUTEX_WAKE all on any errors.
4384         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
4385         Define.
4386         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4387         internally.  Return non-zero if error, zero if success.
4388         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4389         Add __data.__futex field, reshuffle __data.__clock.
4390         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
4391         Define.
4392         (lll_futex_requeue): Add val argument, return 1 unconditionally
4393         for the time being.
4394         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4395         Add __data.__futex field, reshuffle __data.__clock.
4396         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4397         Define.
4398         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4399         internally.  Return non-zero if error, zero if success.
4400         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4401         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
4402         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4403         Define.
4404         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4405         internally.  Return non-zero if error, zero if success.
4406         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4407         Add __data.__futex field, reshuffle __data.__clock.
4408         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
4409         Define.
4410         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4411         internally.  Return non-zero if error, zero if success.
4412         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4413         Add __data.__futex field, reshuffle __data.__clock.
4414         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4415         Add __data.__futex field, reshuffle __data.__clock.
4416         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
4417         Increment __futex at the same time as __wakeup_seq or __total_seq.
4418         Pass address of __futex instead of address of low 32-bits of
4419         __wakeup_seq to futex syscall.
4420         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4421         Pass __futex value from before releasing internal lock
4422         to FUTEX_WAIT.
4423         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4424         Likewise.  Avoid unnecessary shadowing of variables.
4425         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
4426         Set __futex to 2 * __total_seq.  Pass __futex value from before the
4427         unlock and __futex address instead of address of low 32-bits of
4428         __wakeup_seq to futex_requeue macro, adjust for new return value
4429         meaning.
4430         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
4431         (__pthread_cond_signal): Increment __futex at the same time as
4432         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4433         address of low 32-bits of __wakeup_seq to futex syscall.
4434         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
4435         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4436         releasing internal lock to FUTEX_WAIT.
4437         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4438         (__pthread_cond_timedwait): Likewise.
4439         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4440         (FUTEX_CMP_REQUEUE): Define.
4441         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4442         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4443         Pass __futex value from before the unlock and __futex address instead
4444         of address of low 32-bits of __wakeup_seq to futex syscall.
4445         Fallback to FUTEX_WAKE all on any errors.
4447 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4449         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
4450         Add nop to align the end of critical section.
4451         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
4453 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4455         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4456         Add __broadcast_seq field.
4457         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
4458         all waiters as woken with woken_seq and bump broadcast counter.
4459         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
4460         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
4461         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4462         Comment typo fixes.  Avoid returning -ETIMEDOUT.
4464 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
4466         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4467         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
4468         Reported by Kaz Kojima.
4470 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
4472         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
4474 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4476         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
4477         __broadcast_seq with bc_seq after acquiring internal lock instead of
4478         before it.
4480 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
4482         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
4483         compilation.
4484         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4485         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
4486         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4487         (pthread_cond_t): Add __data.__broadcast_seq field.
4488         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4489         (FRAME_SIZE): Define.
4490         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
4491         Comment typo fixes.
4492         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
4493         Define.
4494         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
4495         typo fixes.
4496         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4497         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
4498         fixes.
4500 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
4502         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
4503         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4504         Add __broadcast_seq field.
4505         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4506         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4507         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4508         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4509         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4510         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
4511         all waiters as woken with woken_seq and bump broadcast counter.
4512         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
4513         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
4514         __broadcast_seq field.
4515         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4516         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4517         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
4518         * pthread_cond_init.c: Initialize __broadcast_seq field.
4519         * Makefile (tests): Add tst-cond17 and tst-cond18.
4520         Add .NOTPARALLEL goal.
4521         * tst-cond16.c: New file.  From Jakub.
4522         * tst-cond17.c: New file.  From Jakub.
4523         * tst-cond18.c: New file.  From Jakub.
4525 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
4527         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
4528         unwind info.
4530         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4531         Parametrize frame size.  Correct some unwind info.
4532         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4534 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4536         * tst-stack3.c: Note testing functionality beyond POSIX.
4538 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4540         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
4541         Change conditional from ifdef to if.
4543 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
4545         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
4546         SYSDEP_CANCEL_ERROR): Define.
4547         (PSEUDO): Use it.
4549 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
4551         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
4553 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
4555         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
4557 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4559         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
4560         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4561         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
4562         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4564 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
4566         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
4567         thread has all signals blocked.
4569 2004-04-18  Andreas Jaeger  <aj@suse.de>
4571         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
4572         (SEM_VALUE_MAX): Add missing brace.
4574 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4576         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
4577         in rt subdir.
4578         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
4579         * sysdeps/pthread/tst-mqueue8x.c: New test.
4580         * tst-cancel4.c: Update comment about message queues.
4582         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
4583         return it_value { 0, 0 }.
4584         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
4585         like SIGEV_SIGNAL.
4586         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
4587         assertion for SIGEV_NONE.
4588         (thread_attr_compare): Compare all attributes, not just a partial
4589         subset.
4591 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4593         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
4595 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
4597         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
4598         Just use a plain number.
4599         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
4600         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
4601         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
4602         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
4603         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
4604         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
4605         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4607 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4609         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
4610         frame info.
4611         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4613 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
4615         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
4616         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
4617         of calling sigwaitinfo.
4619 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
4621         * allocatestack.c (allocate_stack): Set reported_guardsize
4622         unconditionally.
4623         * pthread_getattr_np.c (pthread_getattr_np): Use
4624         reported_guardsize instead of guardsize.
4625         * descr.h (struct pthread): Add reported_guardsize field.
4627 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
4629         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
4631 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
4633         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
4635 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
4637         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
4638         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
4639         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
4640         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
4641         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
4642         Define.
4643         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
4644         (_POSIX_MESSAGE_PASSING): Define.
4645         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
4646         (_POSIX_MESSAGE_PASSING): Define.
4647         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
4648         (_POSIX_MESSAGE_PASSING): Define.
4650 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
4652         * tst-context1.c (fct): Check whether correct stack is used.
4654 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
4656         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
4657         matching constraints for asm mem parameters.
4659         * tst-clock2.c (tf): Don't define unless needed.
4661 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
4663         * Makefile (link-libc-static): Use $(static-gnulib) instead of
4664         $(gnulib).
4666 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
4668         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
4669         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
4670         * pthreadP.h: Declare __nptl_deallocate_tsd.
4671         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
4672         Adjust caller.
4674         * Makefile (tests): Add tst-tsd5.
4675         * tst-tsd5.c: New file.
4677 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
4679         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4680         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
4681         is SHLIB_COMPAT check.
4682         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
4683         (__pthread_attr_getaffinity_old): Likewise.
4684         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4685         (__pthread_getaffinity_old): Likewise.
4686         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4687         (__pthread_setaffinity_old): Likewise.
4689 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
4691         * allocatestack.c (_make_stacks_executable): Call
4692         _dl_make_stack_executable first.
4694 2004-03-24  Roland McGrath  <roland@redhat.com>
4696         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
4697         constraint instead of "0".
4699 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
4701         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4702         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
4704         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
4705         code to avoid warning.
4707 2004-03-24  Andreas Jaeger  <aj@suse.de>
4709         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4710         (__pthread_attr_setaffinity_old): Remove const.
4712 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
4714         * sysdeps/unix/sysv/linux/smp.h: New file.
4715         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
4716         * init.c: Define __is_smp.
4717         (__pthread_initialize_minimal_internal): Call is_smp_system to
4718         initialize __is_smp.
4719         * pthreadP.h: Declare __is_smp.
4720         Define MAX_ADAPTIVE_COUNT is necessary.
4721         * pthread_mutex_init.c: Add comment regarding __spins field.
4722         * pthread_mutex_lock.c: Implement adaptive mutex type.
4723         * pthread_mutex_timedlock.c: Likewise.
4724         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
4725         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
4726         Add __spins field.
4727         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4728         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
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/x86_64/bits/pthreadtypes.h: Likewise.
4734         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
4735         lll_mutex_cond_trylock.
4736         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4737         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4738         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4739         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4740         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4741         Define BUSY_WAIT_NOP.
4742         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4743         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4745         * tst-mutex5.c: Add support for testing adaptive mutexes.
4746         * tst-mutex7.c: Likewise.
4747         * tst-mutex5a.c: New file.
4748         * tst-mutex7a.c: New file.
4749         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
4751         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4752         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
4753         vgettimeofday call might destroy the content.
4755         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
4756         @pause in the loop.
4758         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4759         No need to restrict type of ret.  Make it int.  Add comment.
4761         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4762         Remove unnecessary setne instruction.
4764 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
4766         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4767         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
4768         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
4769         If realloc fails, break out of the loop.
4771 2004-03-20  Andreas Jaeger  <aj@suse.de>
4773         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4774         (__pthread_setaffinity_old): Fix interface.
4775         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4776         (__pthread_getaffinity_old): Likewise.
4778         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4779         (__pthread_setaffinity_new): Remove duplicate declaration.
4781 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4783         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
4784         the return value to a safe register.
4785         (CDISABLE): Set the function argument correctly.
4787 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4789         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
4790         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
4791         Rewrite so that only one locked memory operation per round is needed.
4792         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
4793         (pthread_barrier_wait): After wakeup, release lock only when the
4794         last thread stopped using the barrier object.
4795         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4796         (__pthread_cond_wait): Don't store mutex address if the current
4797         value is ~0l.  Add correct cleanup support and unwind info.
4798         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4799         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4800         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
4801         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
4802         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4803         Add correct cleanup support and unwind info.
4804         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
4805         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
4806         information for syscall wrappers.
4808 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
4810         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
4811         cpusetsize field, remove next.
4812         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
4813         parameter for size of the CPU set.
4814         (pthread_setaffinity_np): Likewise.
4815         (pthread_attr_getaffinity_np): Likewise.
4816         (pthread_attr_setaffinity_np): Likewise.
4817         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
4818         interface change, keep compatibility code.
4819         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
4820         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
4821         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
4822         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
4823         __pthread_getaffinity_np.
4824         * Versions: Add version for changed interfaces.
4825         * tst-attr3.c: Adjust test for interface change.
4826         * pthread_getattr_np.c: Query the kernel about the affinity mask with
4827         increasing buffer sizes.
4828         * pthread_attr_destroy.c: Remove unused list handling.
4829         * pthread_attr_init.c: Likewise.
4831 2004-03-17  Roland McGrath  <roland@redhat.com>
4833         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
4834         first argument to clock_getres so we ever enable kernel timers.
4836 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
4838         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
4840 2004-03-12  Richard Henderson  <rth@redhat.com>
4842         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
4843         oldvalue from CENABLE to CDISABLE.
4845 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
4847         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
4848         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
4849         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
4850         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
4852 2004-03-11  Richard Henderson  <rth@redhat.com>
4854         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
4855         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
4856         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
4858 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4860         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
4861         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
4862         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
4864 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4866         * forward.c (__pthread_cond_broadcast_2_0,
4867         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
4868         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
4869         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
4871 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4873         * sysdeps/sh/tcb-offsets.sym: Add PID.
4874         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
4875         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
4877 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
4879         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
4880         include <sysdep-cancel.h>, vfork is no cancellation point.
4881         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
4882         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
4883         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
4885 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
4887         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
4888         libc_hidden_def.
4889         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
4890         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
4891         Likewise.
4892         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
4893         Likewise.
4894         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
4895         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
4896         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
4897         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
4898         of DO_CALL_VIA_BREAK.  Work around a gas problem.
4900         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
4901         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
4902         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
4903         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
4904         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
4905         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
4907         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
4908         a local register for saving old PID.  Negate PID in parent upon exit.
4910         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
4911         tcb-offsets.h.
4912         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
4913         before syscall, set to the old value in the parent afterwards.
4914         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
4915         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
4916         tcb-offsets.h.
4917         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
4918         before syscall, set to the old value in the parent afterwards.
4919         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
4920         * sysdeps/s390/tcb-offsets.sym: Add PID.
4922         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
4923         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
4924         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
4925         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
4926         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
4927         * sysdeps/sparc/tcb-offsets.sym: Add PID.
4929 2004-03-10  Andreas Schwab  <schwab@suse.de>
4931         * sysdeps/ia64/tcb-offsets.sym: Add PID.
4932         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
4933         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
4935 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
4937         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
4938         * tst-cancel21.c (do_one_test): Likewise.
4939         Reported by Gordon Jin <gordon.jin@intel.com>.
4941 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
4943         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
4944         if non-zero and set to INT_MIN if zero.
4945         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
4946         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
4947         (SAVE_PID, RESTORE_PID): Define.
4948         (__vfork): Use it.
4949         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
4950         Use relative path to avoid including NPTL i386/vfork.S.
4951         (SAVE_PID, RESTORE_PID): Define.
4952         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
4953         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
4954         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
4955         tst-vfork2x.
4956         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
4957         * tst-vfork1.c: New test.
4958         * tst-vfork2.c: New test.
4959         * tst-vfork1x.c: New test.
4960         * tst-vfork2x.c: New test.
4962 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
4964         * sysdeps/i386/tcb-offsets.sym: Add PID.
4965         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4966         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
4967         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
4969 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
4971         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
4973 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
4975         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
4976         _rtld_global_ro.
4978 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
4980         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
4981         _rtld_global_ro.
4983         * tst-once4.c: Remove unnecessary macro definition.
4985         * tst-mutex7.c (do_test): Limit thread stack size.
4986         * tst-once2.c (do_test): Likewise.
4987         * tst-tls3.c (do_test): Likewise.
4988         * tst-tls1.c (do_test): Likewise.
4989         * tst-signal3.c (do_test): Likewise.
4990         * tst-kill6.c (do_test): Likewise.
4991         * tst-key4.c (do_test): Likewise.
4992         * tst-join4.c (do_test): Likewise.
4993         * tst-fork1.c (do_test): Likewise.
4994         * tst-context1.c (do_test): Likewise.
4995         * tst-cond2.c (do_test): Likewise.
4996         * tst-cond10.c (do_test): Likewise.
4997         * tst-clock2.c (do_test): Likewise.
4998         * tst-cancel10.c (do_test): Likewise.
4999         * tst-basic2.c (do_test): Likewise.
5000         * tst-barrier4.c (do_test): Likewise.
5002 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
5004         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
5006 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
5008         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5009         (__pthread_cond_timedwait): Optimize wakeup test.
5010         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5011         (__pthread_cond_wait): Likewise.
5012         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
5013         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5014         Likewise.
5016 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
5018         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5019         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
5020         the atomic instruction needed.
5021         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5022         (__lll_mutex_lock_wait): Likewise.
5024 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
5026         * Makefile (tests): Add tst-cond14 and tst-cond15.
5027         * tst-cond14.c: New file.
5028         * tst-cond15.c: New file.
5030 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
5032         * sysdeps/pthread/createthread.c (create_thread): Remove use of
5033         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
5034         needs to be implemented differently to be useful.
5036 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
5038         * pthread_attr_setschedparam.c: Don't test priority against limits
5039         here.  Set ATTR_FLAG_SCHED_SET flag.
5040         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
5041         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
5042         from parent thread to child.  If attribute is used and scheduling
5043         parameters are not inherited, copy parameters from attribute or
5044         compute them.  Check priority value.
5045         * pthread_getschedparam.c: If the parameters aren't known yet get
5046         them from the kernel.
5047         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
5048         ATTR_FLAG_POLICY_SET flag for thread.
5049         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
5050         and ATTR_FLAG_POLICY_SET.
5052         * sysdeps/pthread/createthread.c: Use tgkill if possible.
5054         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
5055         fail if stack address hasn't been set.  Just return 0.
5057 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
5059         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
5060         libpthread for the files in this list.
5061         (CFLAGS-tst-unload): Removed.
5062         * tst-unload.c (do_test): Don't use complete path for
5063         LIBPHREAD_SO.
5065         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
5066         tst-_res1mod2.
5068 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
5070         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5071         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
5072         operation per round is needed.
5073         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5074         (__lll_mutex_lock_wait): Likewise.
5076 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
5078         * tst-cancel9.c (cleanup): Don't print to stderr.
5080 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5082         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
5084 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
5086         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
5087         (__syscall_error_handler2): Call CDISABLE.
5088         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
5089         (__syscall_error_handler2): Call CDISABLE.
5091         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5092         Release lock before the loop, don't reacquire it.
5094         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
5096 2004-02-19  Andreas Schwab  <schwab@suse.de>
5098         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5099         Fix last change.
5101 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
5103         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
5104         (pthread_barrier_wait): After wakeup, release lock only when the
5105         last thread stopped using the barrier object.
5106         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
5107         (pthread_barrier_wait): Likewise.
5108         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5109         Likewise.
5110         * Makefile (tests): Add tst-barrier4.
5111         * tst-barrier4.c: New file.
5113         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5114         (__pthread_cond_timedwait): Perform timeout test while holding
5115         internal lock to prevent wakeup race.
5116         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
5117         * sysdeps/pthread/pthread_cond_timedwait.c
5118         (__pthread_cond_timedwait): Likewise.
5119         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5120         (__pthread_cond_timedwait): Likewise.
5122 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
5124         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
5125         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
5126         * Makefile (tests): Add tst-rwlock13.
5127         * tst-rwlock13.c: New test.
5129 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
5131         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5132         (__condvar_tw_cleanup): Little optimization.
5133         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
5135 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
5137         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
5138         libpthread as "lib" parameter to SHLIB_COMPAT.
5139         (__novmx_siglongjmp): Fix typo in function name.
5140         (__novmx_longjmp): Fix typo in function name.
5142 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
5144         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
5145         __builtin_expect.
5147         * sysdeps/generic/pt-longjmp.c: Moved to...
5148         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
5150 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
5152         * Makefile (libpthread-routines): Add pt-cleanup.
5153         * pt-longjmp.c: Removed.
5154         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
5155         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
5156         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
5157         Version longjmp, siglongjmp for GLIBC_2.3.4.
5158         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
5160 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
5162         * sysdeps/pthread/pthread_cond_timedwait.c
5163         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
5164         Reuse code.  Add __builtin_expects.
5166         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5167         (__pthread_cond_timedwait): Get internal lock in case timeout has
5168         passed before the futex syscall.
5169         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5171 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
5173         * allocatestack.c: Pretty printing.
5175         * sysdeps/pthread/createthread.c (create_thread): Don't add
5176         CLONE_DETACHED bit if it is not necessary.
5178 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
5180         * pthread_getattr_np.c: Include ldsodefs.h.
5182 2004-01-16  Richard Henderson  <rth@redhat.com>
5184         * allocatestack.c: Don't declare __libc_stack_end.
5185         * init.c (__pthread_initialize_minimal_internal): Likewise.
5186         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
5188 2004-01-15  Richard Henderson  <rth@redhat.com>
5190         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
5191         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
5192         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
5193         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
5194         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
5195         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
5196         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
5197         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
5199 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
5201         * init.c (pthread_functions): Make array const.
5203 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
5205         * allocatestack.c (__make_stacks_executable): Change interface.
5206         Check parameters.  Pass parameter on to libc counterpart.
5207         * pthreadP.h: Change declaration.
5209 2004-01-13  Richard Henderson  <rth@redhat.com>
5211         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
5212         prototype form.
5213         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
5214         Likewise.
5216         * sysdeps/alpha/Makefile: New file.
5217         * sysdeps/alpha/tcb-offsets.sym: New file.
5218         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
5219         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
5221         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
5222         on powerpc version.
5224 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
5226         * Makefile (tests): Add tst-backtrace1.
5227         * tst-backtrace1.c: New test.
5229 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
5231         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
5232         register as second parameter to the REGISTER macro.
5233         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
5234         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
5235         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
5236         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
5237         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
5238         of thread register as second parameter to REGISTER macro in 64 case.
5240 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
5242         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
5243         (CFLAGS-getpid.o): Defined.
5244         (CFLAGS-getpid.os): Defined.
5246 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
5248         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
5249         returned for main thread does not overlap with any other VMA.
5250         Patch by Jakub Jelinek.
5252 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
5254         * tst-raise1.c: Include stdio.h.
5256 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
5258         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
5259         setting with __ASSUME_TGKILL || defined __NR_tgkill.
5260         If pid is 0, set it to selftid.
5261         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
5262         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
5263         != 0, return self->tid without doing a syscall.
5264         * descr.h (struct pthread): Move pid field after tid.
5266         * Makefile (tests): Add tst-raise1.
5267         * tst-raise1.c: New file.
5269 2003-12-23  Roland McGrath  <roland@redhat.com>
5271         * tst-oddstacklimit.c: New file.
5272         * Makefile (tests): Add it.
5273         (tst-oddstacklimit-ENV): New variable.
5275         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
5276         value up to page size for __default_stacksize.
5278 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
5280         * Makefile (tests): Add tst-eintr5.
5281         * tst-eintr5.c: New file.
5283         * eintr.c (eintr_source): Prevent sending signal to self.
5285         * tst-eintr2.c (tf1): Improve error message.
5287 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
5289         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
5290         * sysdeps/unix/sysv/linux/getpid.c: New file.
5291         * pthread_cancel.c: Add comment explaining use of PID field.
5292         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
5293         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
5294         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
5295         temporarily to signal the field must not be relied on and updated
5296         by getpid().
5297         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
5298         temporarily negative.
5299         * sysdeps/unix/sysv/linux/raise.c: Likewise.
5301 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
5303         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
5304         (eintr_source): If ARG != NULL, use pthread_kill.
5305         * tst-eintr1.c: Adjust for this change.
5306         * tst-eintr2.c: Likewise.
5307         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
5308         * tst-eintr3.c: New file.
5309         * tst-eintr4.c: New file.
5311 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
5313         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
5314         if CANCELSTATE_BITMASK is set.
5315         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
5316         Likewise.
5318         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
5319         (tests-reverse): Add tst-cancel23.
5320         * tst-cancel22.c: New test.
5321         * tst-cancel23.c: New test.
5323 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
5325         * tst-eintr1.c: Better error messages.
5327         * Makefile (tests): Add tst-eintr2.
5328         * tst-eintr2.c: New file.
5330 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
5332         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
5333         (CFLAGS-tst-cancelx21.c): Set.
5334         * tst-cancel21.c: New test.
5335         * tst-cancelx21.c: New test.
5337         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
5338         comparison operand.
5339         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
5340         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
5341         * pt-longjmp.c: Include jmpbuf-unwind.h.
5342         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
5343         _JMPBUF_UNWINDS.  Adjust compared pointers.
5344         * init.c (__pthread_initialize_minimal_internal): Initialize
5345         pd->stackblock_size.
5346         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
5347         * sysdeps/alpha/jmpbuf-unwind.h: New file.
5348         * sysdeps/i386/jmpbuf-unwind.h: New file.
5349         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
5350         * sysdeps/s390/jmpbuf-unwind.h: New file.
5351         * sysdeps/sh/jmpbuf-unwind.h: New file.
5352         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
5353         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
5354         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
5355         (_JMPBUF_CFA_UNWINDS): Remove.
5356         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
5358 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
5360         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
5361         (CFLAGS-tst-cancelx20.c): Set.
5362         * tst-cancel20.c: New test.
5363         * tst-cancelx20.c: New test.
5365 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
5367         * init.c (__pthread_initialize_minimal_internal): Don't treat
5368         architectures with separate register stack special here when
5369         computing default stack size.
5371 2003-12-17  Roland McGrath  <roland@redhat.com>
5373         * Makefile (tst-cancelx7-ARGS): New variable.
5374         Reportd by Greg Schafer <gschafer@zip.com.au>.
5376 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
5378         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
5379         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
5380         (tst-stack3-ENV): Set.
5381         ($(objpfx)tst-stack3-mem): New.
5382         * tst-stack3.c: New test.
5384 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
5386         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
5387         Add unwind directives.  Drop unused .regstk directive.
5388         (_fini_EPILOG_BEGINS): Add unwind directives.
5390 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
5392         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
5393         Assume parameter is a pointer.
5394         (lll_futex_wake): Likewise.
5395         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
5396         Likewise.
5397         (lll_futex_wake): Likewise.
5398         Reported by Boris Hu.
5399         * sysdeps/unix/sysv/linux/unregister-atfork.c
5400         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
5402         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
5404 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
5406         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
5407         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
5408         __rtld_lock_initialize for ld.so lock.
5409         Patch in part by Adam Li <adam.li@intel.com>.
5411 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
5413         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
5414         in $(gnulib).  Also, remove stale comment.
5416 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
5418         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
5419         advantage of new syscall stub and optimize accordingly.
5421         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
5422         from SYS_futex, to match expectations of
5423         sysdep.h:DO_INLINE_SYSCALL.
5424         (lll_futex_clobbers): Remove.
5425         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
5426         (lll_futex_wake): Likewise.
5427         (lll_futex_requeue): Likewise.
5428         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
5429         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
5430         Jelinek).
5431         (__lll_mutex_lock): Likewise.
5432         (__lll_mutex_cond_lock): Likewise.
5433         (__lll_mutex_timed_lock): Likewise.
5434         (__lll_mutex_unlock): Likewise.
5435         (__lll_mutex_unlock_force): Likewise.
5437         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
5438         comes before the include of <sysdep.h>.
5439         (THREAD_SELF_SYSINFO): New macro.
5440         (THREAD_SYSINFO): Likewise.
5441         (INIT_SYSINFO): New macro.
5442         (TLS_INIT_TP): Call INIT_SYSINFO.
5444         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
5446         * sysdeps/pthread/createthread.c (create_thread): Use
5447         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
5448         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
5449         THREAD_SELF_SYSINFO instead of open code.
5450         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
5451         (THREAD_SYSINFO): Likewise.
5453         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
5455         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
5457 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
5459         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
5460         instead of .init.  Patch by David Mosberger.
5462 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
5464         * sysdeps/pthread/configure.in: Remove broken declaration in C
5465         cleanup handling check.
5467 2003-11-30  Andreas Jaeger  <aj@suse.de>
5469         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
5470         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
5471         Likewise.
5473 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
5475         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
5476         * pthread_attr_destroy.c: Include shlib-compat.h.
5477         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
5478         is set in iattr->flags.
5479         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
5481 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
5483         * Makefile (distribute): Add tst-cleanup4aux.c.
5485         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
5486         include.
5488 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
5490         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
5491         pthread_cond_signal.
5493         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
5494         store mutex address if the current value is ~0l.
5495         * sysdeps/pthread/pthread_cond_timedwait.c
5496         (__pthread_cond_timedwait): Likewise.
5497         * sysdeps/pthread/pthread_cond_broadcast.c
5498         (__pthread_cond_broadcast): Don't use requeue for pshared
5499         condvars.
5501         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5502         (__pthread_cond_wait): Don't store mutex address if the current
5503         value is ~0l.
5504         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5505         (__pthread_cond_timedwait): Likewise.
5506         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5507         (__pthread_cond_broadcast): Don't use requeue for pshared
5508         condvars.
5510         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
5511         element with ~0l for pshared condvars, with NULL otherwise.
5513         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5514         (__pthread_cond_wait): Don't store mutex address if the current
5515         value is ~0l.
5516         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5517         (__pthread_cond_timedwait): Likewise.
5518         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
5519         (__pthread_cond_broadcast): Don't use requeue for pshared
5520         condvars.
5522         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
5523         * tst-cond12.c: New file.
5524         * tst-cond13.c: New file.
5526 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
5528         * sysdeps/pthread/configure.in: Make missing forced unwind support
5529         fatal.
5531 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
5533         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
5535 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
5537         * Makefile: Add magic to clean up correctly.
5539 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
5541         * unwind.c (FRAME_LEFT): Define.
5542         (unwind_stop): Handle old style cleanups here.
5543         (__pthread_unwind): Handle old style cleanups only if
5544         !HAVE_FORCED_UNWIND.
5545         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
5546         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
5547         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
5548         ($(objpfx)tst-cleanupx4): Likewise.
5549         * tst-cleanup4.c: New test.
5550         * tst-cleanup4aux.c: New.
5551         * tst-cleanupx4.c: New test.
5553 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
5555         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
5556         lll_mutex_*lock macros to skip atomic operations on some archs.
5558 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
5560         * sysdeps/pthread/tst-timer.c (main): Initialize
5561         sigev2.sigev_value as well.
5563 2003-10-15  Roland McGrath  <roland@redhat.com>
5565         * sysdeps/pthread/configure.in: Barf if visibility attribute support
5566         is missing.
5567         * sysdeps/pthread/configure: Regenerated.
5569 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5571         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
5572         locking macros.  No distinction between normal and mutex locking
5573         anymore.
5574         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
5575         Merge bits from lowlevelmutex.S we still need.
5576         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
5577         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
5578         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
5579         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
5580         new mutex implementation.
5581         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
5582         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
5583         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5584         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
5585         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
5586         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
5587         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
5588         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
5589         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5590         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
5591         symbol for entry point to avoid cancellation.
5593 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
5595         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
5596         changes.
5597         (SAVE_OLDTYPE_0): Fix a typo.
5599 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
5601         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
5602         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
5604 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5606         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
5607         correct offset.
5609 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
5611         * Makefile (tests): Add tst-cancel19.
5612         * tst-cancel19.c: New test.
5614 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5616         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
5617         restoring of the old cancellation type.
5619 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
5621         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
5623 2003-09-27  Wolfram Gloger  <wg@malloc.de>
5625         * sysdeps/pthread/malloc-machine.h: New file
5627 2003-09-24  Roland McGrath  <roland@redhat.com>
5629         * allocatestack.c (__make_stacks_executable): Don't ignore return
5630         value from _dl_make_stack_executable.
5632 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
5634         * allocatestack.c (__make_stacks_executable): Also change
5635         permission of the currently unused stacks.
5637         * allocatestack.c (change_stack_perm): Split out from
5638         __make_stacks_executable.
5639         (allocate_stack): If the required permission changed between the time
5640         we started preparing the stack and queueing it, change the permission.
5641         (__make_stacks_executable): Call change_stack_perm.
5643         * Makefile: Build tst-execstack-mod locally.
5644         * tst-execstack-mod.c: New file.
5646 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
5648         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
5650 2003-09-23  Roland McGrath  <roland@redhat.com>
5652         * tst-execstack.c: New file.
5653         * Makefile (tests): Add it.
5654         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
5655         (LDFLAGS-tst-execstack): New variable.
5657         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
5658         whether to use PROT_EXEC for stack mmap.
5659         (__make_stacks_executable): New function.
5660         * pthreadP.h: Declare it.
5661         * init.c (__pthread_initialize_minimal_internal): Set
5662         GL(dl_make_stack_executable_hook) to that.
5664 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5666         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
5667         recommendation from AMD re avoidance of lock prefix.
5669 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
5671         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
5672         lll_futex_timed_wait instead of lll_futex_wait.
5673         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
5674         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
5675         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
5676         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
5677         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
5678         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
5679         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
5680         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
5681         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
5682         Completely revamp the locking macros.  No distinction between
5683         normal and mutex locking anymore.
5684         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
5685         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
5686         __lll_lock_timedwait): Fix prototypes.
5687         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
5688         __lll_lock_timedwait): Likewise.
5689         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
5690         macros, add __builtin_expect.
5691         (lll_mutex_timedlock): Likewise.  Fix return value.
5692         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
5693         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
5694         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
5695         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
5696         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
5697         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
5698         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
5699         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
5701 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5703         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5704         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
5705         operation if possible.
5707         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
5708         like jumping over the lock prefix.
5710 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
5712         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
5713         locking macros.  No distinction between normal and mutex locking
5714         anymore.
5715         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
5716         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
5717         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
5718         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
5719         locking.  Merge bits from lowlevelmutex.S we still need.
5720         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
5721         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
5722         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
5723         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
5724         * Makefile (routines): Remove libc-lowlevelmutex.
5725         (libpthread-rountines): Remove lowlevelmutex.
5726         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
5727         for new mutex implementation.
5728         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5729         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5730         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5731         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5732         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5733         Likewise.
5734         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5735         Likewise.
5736         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
5737         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5738         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
5739         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
5740         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5741         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5742         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
5743         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
5744         Likewise.
5745         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
5746         Likewise.
5747         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
5748         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
5749         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5750         Don't use requeue.
5751         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
5752         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
5754 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
5756         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
5757         in parameters of asm with output parameters.
5759         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
5760         type of DECR parameter to int.
5761         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
5763 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
5765         * tst-attr3.c (tf, do_test): Print stack start/end/size and
5766         guardsize for each thread.
5768 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5770         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
5771         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5772         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
5774         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
5775         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
5776         NULL.
5777         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
5778         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
5779         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5780         (pthread_getaffinity_np): Add hidden_def.
5782         * Makefile (tests): Add tst-attr3.
5783         * tst-attr3.c: New test.
5785         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
5787 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5789         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
5790         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
5792 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5794         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
5795         * tst-align.c: Include tst-stack-align.h.
5796         (tf, do_test): Use TEST_STACK_ALIGN macro.
5798 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
5800         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
5801         variable.
5803 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
5805         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
5806         stack-related values for the initial thread.
5808 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5810         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
5812 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
5814         * pthread_mutex_lock.c: Minor code rearrangements.
5816 2003-09-05  Roland McGrath  <roland@redhat.com>
5818         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
5819         Instead, include ../nptl_db/db_info.c to do its magic.
5820         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
5821         (__pthread_pthread_key_2ndlevel_size): Likewise.
5822         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
5823         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
5824         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
5825         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
5826         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
5827         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
5828         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
5829         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
5830         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
5831         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
5832         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
5833         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
5834         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
5835         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
5836         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
5837         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
5838         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
5840 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
5842         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
5843         of pthread_t to be compatible with LT.
5844         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5845         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5846         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5847         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5848         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
5849         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5850         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5852 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
5854         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
5856 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
5858         * unwind-forcedunwind.c: Move to...
5859         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
5860         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
5861         * sysdeps/pthread/jmpbuf-unwind.h: New file.
5862         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
5863         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
5864         * unwind.c: Include jmpbuf-unwind.h.
5865         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
5867 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
5869         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
5870         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
5871         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
5872         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
5873         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
5874         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
5875         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
5876         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
5877         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
5878         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
5879         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
5880         function.
5881         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
5882         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
5883         * Makefile (tests): Add tst-stack2.
5884         * tst-stack2.c: New test.
5885         * tst-stack1.c: Include limits.h and sys/param.h.
5886         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
5888         * pthread_condattr_setpshared.c: Include errno.h.
5889         (pthread_condattr_setpshared): Return EINVAL if pshared
5890         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
5892         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
5893         defined symbol for entry point to avoid cancellation.
5894         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
5895         Likewise.
5896         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
5897         Likewise.
5898         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
5899         Likewise.
5900         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
5901         Likewise.
5902         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
5903         Likewise.
5904         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
5905         __close_nocancel, __read_nocancel, __write_nocancel,
5906         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
5907         libpthread.so or librt.so, define to corresponding function
5908         without _nocancel suffix.
5909         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
5910         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
5911         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
5913         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
5915 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
5917         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
5918         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
5920         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
5921         in subsections has a symbol associated with it.
5923         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
5924         defined symbol for entry point to avoid cancellation.
5925         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
5927 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
5929         * Makefile (tests): Add tst-tls5.
5930         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
5931         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
5932         ($(objpfx)tst-tls5): New.
5933         ($(objpfx)tst-tls6.out): Likewise.
5934         (tests): Depend on $(objpfx)tst-tls6.out.
5935         * tst-tls3.c: Include stdint.h and pthreaddef.h.
5936         (do_test): Check pthread_self () return value alignment.
5937         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
5938         (tf): Check pthread_self () return value alignment.
5939         * tst-tls5.c: New test.
5940         * tst-tls5.h: New.
5941         * tst-tls5mod.c: New.
5942         * tst-tls5moda.c: New.
5943         * tst-tls5modb.c: New.
5944         * tst-tls5modc.c: New.
5945         * tst-tls5modd.c: New.
5946         * tst-tls5mode.c: New.
5947         * tst-tls5modf.c: New.
5948         * tst-tls6.sh: New test.
5950         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
5951         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
5952         * init.c (pthread_functions): Initialize them.
5953         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
5954         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
5955         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
5956         pthread_cond_timedwait@@GLIBC_2.3.2.
5958 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
5960         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
5961         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
5962         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
5963         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
5964         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
5965         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
5967         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
5969         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
5970         _POSIX_THREAD_PRIORITY_SCHEDULING.
5971         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
5973 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
5975         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
5976         nested function, use static inline function from libio.h.
5977         Code by Richard Henderson.
5979         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
5980         weak.
5982 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
5984         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
5985         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
5986         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
5987         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
5988         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
5989         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
5990         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
5991         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
5992         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
5993         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
5994         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
5995         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
5996         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
5997         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
5998         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
5999         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
6000         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
6001         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
6002         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
6003         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
6004         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
6005         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
6006         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
6007         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
6008         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
6009         * sysdeps/sparc/tls.h: New file.
6010         * sysdeps/sparc/tcb-offsets.sym: New file.
6011         * sysdeps/sparc/Makefile: New file.
6012         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
6013         * init.c [__sparc__] (__NR_set_tid_address): Define.
6015 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
6017         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
6018         _IO_release_lock): Define.
6020 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
6022         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
6023         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
6025 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
6027         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
6028         (__pthread_cleanup_class): Add missing return types of member
6029         functions.
6031 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
6033         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6034         (lll_mutex_unlock_force): Add memory barrier between store and futex
6035         syscall.
6037 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
6039         * tst-cancel4.c (do_test): Also unlink tempfname and remove
6040         tempmsg in first loop.
6042 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
6044         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
6045         _POSIX_THREAD_PRIORITY_SCHEDULING.
6046         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
6048 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
6050         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
6051         (__rtld_lock_default_lock_recursive,
6052         __rtld_lock_default_unlock_recursive): Define.
6053         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
6054         __rtld_lock_unlock_recursive): Define using
6055         GL(_dl_rtld_*lock_recursive).
6056         * init.c (__pthread_initialize_minimal_internal): Initialize
6057         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
6058         Lock GL(_dl_load_lock) the same number of times as
6059         GL(_dl_load_lock) using non-mt implementation was nested.
6061         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
6062         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
6064 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
6066         * tst-cancel17.c (do_test): Make len2 maximum of page size and
6067         PIPE_BUF.
6069 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
6071         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
6073 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
6075         * sysdeps/pthread/createthread.c (do_clone): Move error handling
6076         to first syscall error check.  Move syscall error check for tkill
6077         into __ASSUME_CLONE_STOPPED #ifdef.
6079 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
6081         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
6082         is not defined, do explicit synchronization.
6083         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
6084         is not defined also unlock pd->lock for non-debugging case in case
6085         it is necessary.
6086         * pthread_create.c (start_thread): Always get and release pd->lock
6087         if __ASSUME_CLONE_STOPPED is not defined.
6088         (start_thread_debug): Removed.  Adjust users.
6089         * allocatestack.c (allocate_stack): Always initialize lock if
6090         __ASSUME_CLONE_STOPPED is not defined.
6091         * Makefile (tests): Add tst-sched1.
6092         * tst-sched1.c: New file.
6094         * sysdeps/pthread/createthread.c (do_clone): Only use
6095         sched_setschduler and pass correct parameters.
6097 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6099         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
6100         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
6101         PTHREAD_STACK_MIN in comments.
6103 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6105         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
6106         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
6107         argument.
6108         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
6109         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
6110         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
6111         (__pthread_cleanup_upto): Fix prototype.
6112         (_longjmp_unwind): Adjust caller.
6113         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
6114         Change second argument to const struct pointer.
6115         * tst-sem8.c (main): Remove unused s2 and s3 variables.
6116         * tst-sem9.c (main): Likewise.
6117         * unwind.c: Include string.h for strlen prototype.
6119 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
6121         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6122         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
6123         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
6124         Define HAVE_CMOV.
6125         Patch by Nicholas Miell <nmiell@attbi.com>.
6127 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
6129         * init.c (__pthread_initialize_minimal_internal): Initialize
6130         GL(dl_init_static_tls).
6131         * pthreadP.h (__pthread_init_static_tls): New prototype.
6132         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
6133         New functions.
6134         * Makefile (tests): Add tst-tls4.
6135         (modules-names): Add tst-tls4moda and tst-tls4modb.
6136         ($(objpfx)tst-tls4): Link against libdl and libpthread.
6137         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
6138         tst-tls4modb.so.
6139         * tst-tls4.c: New file.
6140         * tst-tls4moda.c: New file.
6141         * tst-tls4modb.c: New file.
6143 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
6145         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
6146         before __timer_dealloc.
6147         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
6148         Don't call list_unlink.
6150 2003-07-29  Roland McGrath  <roland@redhat.com>
6152         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
6154 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
6156         * tst-cancel17.c (do_test): Check if aio_cancel failed.
6157         Don't reuse struct aiocb A if it failed.
6158         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
6159         not just one byte, as that does not block.
6161 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
6163         * sysdeps/pthread/unwind-resume.c: New file.
6164         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
6165         unwind-resume in csu subdir.
6166         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
6167         exceptions.
6168         (librt-sysdep_routines, librt-shared-only-routines): Add
6169         rt-unwind-resume.
6170         * sysdeps/pthread/rt-unwind-resume.c: New file.
6171         * unwind-forcedunwind.c: New file.
6172         * Makefile (libpthread-routines): Add unwind-forcedunwind.
6173         (libpthread-shared-only-routines): Likewise.
6174         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
6175         * pthreadP.h (pthread_cancel_init): New prototype.
6176         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
6178         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
6179         attr argument const struct pthread_attr *.
6181         * res.c (__res_state): Return __resp.
6182         * descr.h: Include resolv.h.
6183         (struct pthread): Add res field.
6184         * pthread_create.c: Include resolv.h.
6185         (start_thread): Initialize __resp.
6186         * Makefile (tests): Add tst-_res1.
6187         (module-names): Add tst-_res1mod1, tst-_res1mod2.
6188         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
6189         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
6190         libpthread.
6191         * tst-_res1.c: New file.
6192         * tst-_res1mod1.c: New file.
6193         * tst-_res1mod2.c: New file.
6195 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
6197         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
6199         * Makefile: Define various *-no-z-defs variables for test DSOs
6200         which has undefined symbols.
6202 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
6204         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
6205         Retry if the stwcx fails to store once_control.
6207 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
6209         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
6210         pthread_attr_setaffinity.
6211         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
6212         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
6213         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
6214         * pthread_attr_destroy.c: Free cpuset element if allocated.
6215         * pthread_create.c: Pass iattr as additional parameter to
6216         create_thread.
6217         * sysdeps/pthread/createthread.c: If attribute is provided and
6218         a new thread is created with affinity set or scheduling parameters,
6219         start thread with CLONE_STOPPED.
6220         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
6221         pthread_attr_setaffinity.
6222         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
6223         cpuset element.
6225 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
6227         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
6229 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
6231         * sysdeps/pthread/configure.in: Require CFI directives also for
6232         ppc and s390.
6234 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
6236         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
6237         Add cfi directives.
6239 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6241         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
6242         CLEANUP_JMP_BUF.
6243         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
6244         registers as variables.  Call __pthread_mutex_unlock_usercnt.
6245         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6246         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
6247         not self pointer in __writer.  Compare with TID to determine
6248         deadlocks.
6249         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6250         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
6251         Likewise.
6252         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
6253         Likewise.
6254         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
6255         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
6256         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
6257         macros also when compiling librt.
6259 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
6261         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
6262         -fasynchronous-unwind-tables.
6263         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
6264         (PSEUDO): Add cfi directives.
6265         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
6266         Likewise.
6267         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
6268         Likewise.
6270 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
6272         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
6273         __pthread_unregister_cancel): Add prototypes and hidden_proto.
6274         * unwind.c (__pthread_unwind_next): Add hidden_def.
6275         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
6276         Likewise.
6277         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
6278         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
6279         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
6280         Likewise.
6281         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
6282         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
6283         Likewise.
6284         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
6285         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
6286         __pthread_unregister_cancel and __pthread_unwind_next.
6288 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
6290         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
6291         different symbol for the cancellation syscall wrapper and
6292         non-cancellation syscall wrapper.
6293         (PSEUDO_END): Define.
6295 2003-07-05  Richard Henderson  <rth@redhat.com>
6297         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
6298         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
6299         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6300         return actual return value from the syscall, not 0.
6302 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
6304         * descr.h (struct pthread): Add pid field.
6305         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
6306         (__reclaim_stacks): Likewise.
6307         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
6308         also check for PID of the signal source.
6309         (__pthread_initialize_minimal_internal): Also initialize pid field
6310         of initial thread's descriptor.
6311         * pthread_cancel.c: Use tgkill instead of tkill if possible.
6312         * sysdeps/unix/sysv/linux/fork.c: Likewise.
6313         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
6314         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
6315         * sysdeps/unix/sysv/linux/raise.c: Likewise.
6317 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
6319         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
6320         Fix use of parameter.
6321         (__libc_cleanup_pop): Likewise.
6323 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
6325         * init.c (sigcancel_handler): Change parameters to match handler
6326         for SA_SIGACTION.  Check signal number and code to recognize
6327         invalid invocations.
6329 2003-07-03  Roland McGrath  <roland@redhat.com>
6331         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
6332         Apply sizeof (struct pthread) bias to r13 value.
6334 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
6336         * sysdeps/pthread/configure.in: Require CFI directives.
6338         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
6339         definition.
6340         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
6341         libpthread compilation.
6342         * unwind.c (__pthread_unwind): Add hidden_def.
6343         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
6345 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6347         * libc-cancellation.c (__libc_cleanup_routine): Define.
6348         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
6349         (__pthread_cleanup_pop): Define.
6351 2003-07-01  Richard Henderson  <rth@redhat.com>
6353         * sysdeps/alpha/elf/pt-initfini.c: New file.
6354         * sysdeps/alpha/pthread_spin_lock.S: New file.
6355         * sysdeps/alpha/pthread_spin_trylock.S: New file.
6356         * sysdeps/alpha/pthreaddef.h: New file.
6357         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
6358         * sysdeps/alpha/tls.h: New file.
6359         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
6360         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
6361         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
6362         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
6363         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
6364         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
6365         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
6366         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
6367         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
6368         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
6370 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6372         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
6373         cleanup support and unwind info.
6375 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
6377         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
6378         Use correct cleanup handler registration.  Add unwind info.
6379         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
6380         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
6381         * tst-once3.c: Add cleanup handler and check it is called.
6382         * tst-once4.c: Likewise.
6383         * tst-oncex3.c: New file.
6384         * tst-oncex4.c: New file.
6385         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
6387 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
6389         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
6391 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
6393         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
6394         (tf_msgsnd): Likewise.
6396         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
6397         premature returns a bit more.
6399 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
6401         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
6402         definition to the front.
6404         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
6405         the cleanup functions to make the names unique.  Fix dwarf opcode
6406         un unwind table.
6407         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
6408         functions to make the names unique.  Fix CFA offset for two blocks.
6410 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
6412         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
6413         missing closing braces.
6414         Patch by Christophe Saout <christophe@saout.de>.
6416 2003-06-24  Roland McGrath  <roland@redhat.com>
6418         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
6420 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
6422         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
6423         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
6425         * pthreadP.h: Declare __find_thread_by_id.
6426         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
6427         * pthread_clock_gettime.c: Allow using other thread's clock.
6428         * pthread_clock_settime.c: Likewise.
6429         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
6430         * Makefile: Add rules to build and run tst-clock2.
6431         * tst-clock2.c: New file.
6433 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
6435         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
6436         to use exception-based cleanup handler.
6437         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6439         * tst-cond8.c (ch): Announce that we are done.
6441         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
6443         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
6444         Also test aio_suspend with timeout value.
6446 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
6448         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
6449         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
6450         attribute_hidden.
6452         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
6453         (__pthread_mutex_lock_internal): Likewise.
6454         (__pthread_mutex_unlock_internal): Likewise.
6455         (__pthread_mutex_unlock_usercnt): Declare.
6456         * pthread_mutex_destroy.c: Always fail if used in any way.
6457         * pthread_mutex_init.c: Update comment.
6458         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
6459         * pthread_mutex_timedlock.c: Adjust __nusers.
6460         * pthread_mutex_trylock.c: Adjust __nusers.
6461         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
6462         and public interfaces are wrapper with pass additional parameter.
6463         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
6464         parameter zero.
6465         * tst-mutex8.c: New file.
6466         * Makefile (tests): Add tst-mutex8.
6467         * sysdeps/pthread/pthread_cond_timedwait.c: Call
6468         __pthread_mutex_unlock_usercnt.
6469         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6470         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6471         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6472         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6473         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6474         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
6475         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6476         Add __nusers.
6477         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6478         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6479         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6480         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6481         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6483         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
6484         * pthread_mutex_timedlock.c: Likewise.
6485         * pthread_mutex_trylock.c: Adjust __nusers.
6486         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
6487         * tst-mutex9.c: New file.
6488         * Makefile (tests): Add tst-mutex9.
6489         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
6490         * sysdeps/ia64/tls.h: Likewise.
6491         * sysdeps/powerpc/tls.h: Likewise.
6492         * sysdeps/s390/tls.h: Likewise.
6493         * sysdeps/sh/tls.h: Likewise.
6494         * sysdeps/x86_64/tls.h: Likewise.
6495         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6496         Change type of __owner.
6497         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6498         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6499         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6500         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6501         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6503 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
6505         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
6506         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
6508         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
6509         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
6510         instead of nr to lll_futex_wake.  Only set errno and return -1
6511         if err < 0.
6513         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
6514         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6515         return actual return value from the syscall, not 0.
6517 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
6519         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
6520         find a random value.
6521         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
6522         errno==EIDRM.
6524         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
6525         compat_timer_settime.
6526         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
6527         compat_timer_gettime.
6528         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
6529         compat_timer_getoverrun.
6530         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
6531         compat_timer_delete.
6533         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
6534         error-checking mutex detect busy mutexes.
6536 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6538         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
6539         Add ax to clobber list.
6540         (lll_mutex_cond_lock): Likewise.
6541         (lll_mutex_unlock): Likewise.
6542         (lll_lock): Likewise.
6543         (lll_unlock): Likewise.
6545         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
6546         * tst-cancel18.c: New file.
6547         * tst-cancelx18.c: New file.
6549         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
6550         and tcdrain.
6552         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
6553         * tst-cancel17.c: New file.
6554         * tst-cancelx17.c: New file.
6556         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
6557         * sysdeps/unix/sysv/linux/sigwait.c: New file.
6558         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
6560         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
6562 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
6564         * sysdeps/pthread/createthread.c (create_thread): Set
6565         header.multiple_threads unconditionally.
6566         * allocatestack.c (allocate_stack): Likewise.
6567         * descr.h (struct pthread): Add header.multiple_threads
6568         unconditionally.
6569         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
6570         Define for librt.  #error if neither libpthread, libc nor librt.
6571         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
6572         Likewise.
6573         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
6574         CDISABLE): Likewise.
6575         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
6576         CDISABLE): Likewise.
6577         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
6578         CDISABLE): Likewise.
6579         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
6580         CDISABLE): Likewise.  Access header.multiple_threads outside of
6581         libc and libpthread.
6582         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
6583         Likewise.
6584         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
6585         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
6587 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6589         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
6590         Also test early cancellation before the thread reaches the cancellation
6591         point.
6593         * Makefile: Compile forward.c with exceptions.
6595         * sysdeps/unix/sysv/linux/sleep.c: New file.
6597 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
6599         * Makefile: Add CFLAGS definition to compile function wrappers
6600         duplicated from libc with exceptions.
6601         * tst-cancel4.c: Also check cancellation handlers.
6603         * Makefile: Add rules to build and run tst-cancel16 and
6604         tst-cancelx16.  Add missing CFLAGS definitions.
6605         * tst-cancel16.c: New file.
6606         * tst-cancelx16.c: New file.
6608 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
6610         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6611         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
6612         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
6613         (DL_SYSINFO_IMPLEMENTATION): Likewise.
6615         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
6616         (LIBC_CANCEL_RESET): Likewise.
6617         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
6618         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
6619         librt-cancellation.
6620         (CFLAGS-libcrt-cancellation.c): Define.
6621         * sysdeps/pthread/librt-cancellation.c: New file.
6622         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
6623         macros also when compiling librt.
6624         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
6625         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
6626         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
6627         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
6628         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
6629         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
6630         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
6632         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
6633         compat_timer_create.
6635 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
6637         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
6639         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
6640         __register_atfork.
6641         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
6642         Add libc_hidden_def.
6644 2003-06-13  Roland McGrath  <roland@redhat.com>
6646         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
6647         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
6649 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
6651         * allocatestack.c (queue_stack): Always inline.
6652         * ptreadhP.h (__do_cancel): Likewise.
6654 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
6656         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
6657         a typo.
6659 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
6661         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6662         (__pthread_cond_signal): Remove incorrect second addition for
6663         cond_lock!=0.
6665 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
6667         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6668         (__pthread_cond_signal): Use correct futex pointer in
6669         __lll_mutex_lock_wait call.
6671         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6672         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
6674 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
6676         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
6677         cancelable.
6678         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6679         Likewise.
6681         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
6682         hand-written CFI generation code.  Since ENTRY/END also initiated
6683         CFI frames this caused two CFI sets to be generated.
6685 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
6687         * cleanup_routine.c: New file.
6688         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
6689         * sysdeps/pthread/pthread.h: Add support for fully exception-based
6690         cleanup handling.
6691         * Makefile (libpthread-routines): Add cleanup_routine.
6692         Add more CFLAGS variables to compile with exceptions.  Add comments
6693         why which file needs unwind tables.
6694         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
6695         tests.
6696         * tst-cancelx1.c: New file.
6697         * tst-cancelx2.c: New file.
6698         * tst-cancelx3.c: New file.
6699         * tst-cancelx4.c: New file.
6700         * tst-cancelx5.c: New file.
6701         * tst-cancelx6.c: New file.
6702         * tst-cancelx7.c: New file.
6703         * tst-cancelx8.c: New file.
6704         * tst-cancelx9.c: New file.
6705         * tst-cancelx10.c: New file.
6706         * tst-cancelx11.c: New file.
6707         * tst-cancelx12.c: New file.
6708         * tst-cancelx13.c: New file.
6709         * tst-cancelx14.c: New file.
6710         * tst-cancelx15.c: New file.
6711         * tst-cleanupx0.c: New file.
6712         * tst-cleanupx0.expect: New file.
6713         * tst-cleanupx1.c: New file.
6714         * tst-cleanupx2.c: New file.
6715         * tst-cleanupx3.c: New file.
6717         * tst-cleanup0.c: Make standard compliant.
6718         * tst-cleanup1.c: Likewise.
6720         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
6721         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
6722         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
6723         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
6724         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
6725         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
6726         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
6727         CLEANUP_JMP_BUF.
6728         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6729         * tst-cancel12.c: New file.
6730         * tst-cancel13.c: New file.
6731         * tst-cancel14.c: New file.
6732         * tst-cancel15.c: New file.
6733         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
6734         and tst-cancel15.
6736         * tst-cancel1.c: Add some comments.
6738         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
6739         timeout correctly.
6741 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
6743         * Makefile (CFLAGS-pthread_cancel.c): Define.
6745 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
6747         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
6748         Change type of __writer element to int.
6749         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6750         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6751         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6752         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6753         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6754         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
6755         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6756         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
6757         Compare with TID to determine deadlocks.
6758         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
6759         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6760         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
6761         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6762         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6763         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6764         Likewise.
6765         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6766         Likewise.
6767         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6768         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
6769         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
6770         Likewise.
6771         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
6772         Likewise.
6773         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
6774         * Makefile (tests): Add tst-rwlock12.
6775         * tst-rwlock12.c: New file.
6777 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
6779         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
6780         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
6781         Remove bogus hidden_proto.
6782         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
6783         Likewise.
6784         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
6785         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
6786         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
6787         ___lll_mutex_timedlock): Likewise.
6789 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
6791         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6792         (__pthread_cond_signal): Add some code to eventually handle
6793         cond_lock!=0.
6795 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
6797         * Makefile (tests): Add tst-exec4.
6798         (tst-exec4-ARGS): Define.
6799         * tst-exec4.c: New file.
6801 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
6803         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
6804         Also fail if tv_nsec < 0.
6805         (__lll_timedwait_tid): Likewise.
6806         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
6807         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
6808         Likewise.
6809         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
6810         Likewise.
6811         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
6812         Likewise.
6813         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6814         Likewise.
6815         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
6816         Likewise.
6817         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
6818         Likewise.
6820         * Makefile (tests): Add tst-sem8 and tst-sem9.
6821         * tst-sem8.c: New file.
6822         * tst-sem9.c: New file.
6823         * sem_open.c: Fix creation of in_use record if the file exists but
6824         no internal record.
6826         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
6827         definitions.
6829         * sysdeps/pthread/timer_create.c (timer_create): In case
6830         evp==NULL, assign timer ID to sival_ptr.
6832         * descr.h (struct pthread_unwind_buf): Change type of prev element to
6833         struct pthread_unwind_buf *.
6834         (struct pthread): Likewise for cleanup_jmp_buf element.
6836         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
6837         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
6838         * unwind.c (__pthread_unwind_next): Likewise.
6840 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
6842         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6843         (lll_futex_timed_wait): Use int for futex value parameter.
6844         (lll_futex_wake): Likewise.
6845         (lll_futex_requeue): Likewise.
6847         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
6848         Replace one memory operation with one register operation.
6850         * tst-join4.c (do_test): Fix error message.
6852         * tst-rwlock6.c (do_test): Use correct format specifier.
6854         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
6855         (__lll_mutex_lock_wait): Replace one memory operation with one
6856         register operation.
6857         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
6858         (__lll_mutex_lock_wait): Likewise.
6860         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6861         (__lll_mutex_cond_lock): Add one to value parameter of
6862         __lll_lock_wait to reflect reality in the futex syscall.
6863         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6864         (lll_mutex_cond_lock): Likewise.
6866 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
6868         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
6869         New function.
6870         (lll_mutex_cond_lock): Define.
6872 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
6874         * Makefile (tests): Add tst-signal6.
6875         * tst-signal6.c: New file.
6877         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
6878         (__lll_mutex_unlock_force): New function
6879         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
6881         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6882         (__lll_mutex_unlock_force): New function.
6883         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
6885         * tst-rwlock7.c (do_test): Use correct format specifier.
6887         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
6888         Find break parameter in correct asm argument.
6890 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
6892         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
6893         Remove out4.
6894         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
6895         error occured.
6896         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
6897         Add __mutex.
6898         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
6899         lll_futex_requeue, lll_mutex_unlock_force): Define.
6901 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
6903         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6904         (pthread_cond_t): Add __mutex.
6905         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
6906         lll_futex_requeue, lll_mutex_unlock_force): Define.
6908 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6910         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
6911         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
6912         Add __mutex field.
6913         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
6914         Define.
6915         (lll_futex_wait, lll_futex_wake): Define.
6916         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
6917         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
6918         FUTEX_REQUEUE instead of FUTEX_WAIT.
6919         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
6920         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
6921         mutex which was used in condvar structure.  Call
6922         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
6923         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
6925         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
6926         include tcb-offsets.h.  Read wakeup value in locked region.
6927         Use the value of gbr register as THREAD_ID.
6928         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6929         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
6930         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
6932         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
6933         macros.
6935 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
6937         * sysdeps/pthread/pthread_cond_broadcast.c
6938         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
6940 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
6942         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
6943         typo in register name.
6944         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
6945         correctly.  Actually use requeue.  Little optimization.
6946         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
6947         mutex address early.  Handle cancellation state as 32-bit value.
6948         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6949         Remove unnecessary label.
6951 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
6953         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
6954         instead of FUTEX_WAIT.
6955         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
6956         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6957         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6958         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
6959         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
6960         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
6961         used in condvar structure.  Call __pthread_mutex_cond_lock instead
6962         of __pthread_mutex_lock_internal.
6963         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6964         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6965         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6966         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
6967         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6968         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6969         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
6970         Add pthread_mutex_cond_lock.
6971         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
6972         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
6973         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
6974         lll_mutex_cond_lock.
6975         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
6976         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6977         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
6978         Add __mutex field.
6979         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6980         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6982         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
6983         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6985         * pthreadP.h: Declare __pthread_mutex_cond_lock.
6986         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
6987         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
6988         macro don't define aliases.
6990         * cancellation.c: Remove __pthread_enable_asynccancel_2.
6991         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
6992         * sysdeps/pthread/pthread_cond_timedwait.c: Use
6993         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
6994         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6995         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6996         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6997         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6998         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7000 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
7002         * sem_open.c: Fix one endless loop.  Implement correct semantics
7003         wrt opening the same semaphore more then once.
7004         * sem_close.c: Adjust for sem_open change.
7005         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
7006         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
7007         * Makefile (tests): Add tst-sem7.
7008         * tst-sem7.c: New file.
7010 2003-05-16  Roland McGrath  <roland@redhat.com>
7012         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
7013         uninitialized variable braino.
7015 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
7017         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
7018         test for syscall availability.
7020         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
7021         __no_posix_timers to -1 if the syscalls don't exist.
7023         * pthread_join.c (pthread_join): Set tid field of the joined
7024         thread to -1.  This isn't necessary but helps to recognize some
7025         error conditions with almost no cost.
7027         * allocatestack.c (FREE_P): Also negative values indicate an
7028         unused stack.
7030         * unwind.c: Include <unistd.h>.
7032 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
7034         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
7036 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
7038         * Makefile (crti-objs, crtn-objs): New variables.
7039         (omit-deps, extra-objs): Add crtn.
7040         ($(objpfx)libpthread.so): Depend on both crti and crtn
7041         and links to them in multidir.
7042         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
7044 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
7046         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
7047         (lll_mutex_unlock): Use atomic_exchange_rel.
7049 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
7051         * cond-perf.c (cons): Add missing locking around setting of alldone.
7053 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
7055         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
7056         related macros.
7057         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7059 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
7061         * tst-sem6.c: New file.
7062         * Makefile (tests): Add tst-sem6.
7064         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
7065         Use atomic_exchange_rel instead of atomic_exchange.
7066         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
7067         Likewise.
7069         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
7070         code for lll_futex_wait and lll_futex_wake in static apps.  Use
7071         vsyscall is possible.
7073         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
7074         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
7075         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
7076         pthread_setaffinity_np.
7077         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
7078         and pthread_setaffinity_np.
7079         * Makefile (libpthread-routines): Add pthread_getaffinity and
7080         pthread_setaffinity.
7082         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
7083         use it in case mmap to allocate the stack fails.
7084         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
7085         ARCH_MAP_FLAGS here.
7086         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
7087         ARCH_RETRY_MMAP.
7089 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
7091         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
7092         handler implementation.  It is now lockless in fork().
7093         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
7094         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
7095         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
7096         declare the __fork_*_lists.
7097         (struct fork_handler): Include pointers to all three functions.
7098         Add next, refcntr and need_signal elements.
7099         (__fork_handlers): New declaration.
7100         (__register_atfork_malloc): Remove declaration.
7101         (HAVE_register_atfork_malloc): Remove definition.
7102         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
7103         __pthread_child_handler variable.
7104         (__libc_pthread_init): Use __register_atfork instead of explicitly
7105         adding to the list.
7106         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
7107         and lll_futex_wake.
7108         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7110         * unwind.c (unwind_cleanup): Print error message and then abort.  This
7111         function must never be reached.
7113         * cond-perf.c: New file.
7115 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
7117         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
7119 2003-05-04  Roland McGrath  <roland@redhat.com>
7121         * Makefile ($(objpfx)../libc.so): New target.
7123 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
7125         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7126         (pthread_condattr_t): Size is only an int, don't use long for
7127         alignment.
7128         (pthread_mutexattr_t): Likewise.
7129         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7130         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7131         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7133 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
7135         * sysdeps/i386/tls.h: Define THREAD_ID.
7136         * sysdeps/ia64/tls.h: Likewise.
7137         * sysdeps/powerpc/tls.h: Likewise.
7138         * sysdeps/s390/tls.h: Likewise.
7139         * sysdeps/sh/tls.h: Likewise.
7140         * sysdeps/x86_64/tls.h: Likewise.
7141         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
7142         record ownership.
7143         * pthread_mutex_timedlock.c: Likewise.
7144         * pthread_mutex_trylock.c: Likewise.
7145         * pthread_mutex_unlock.c: Likewise.
7146         * pthread_rwlock_trywrlock.c: Likewise.
7147         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
7148         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
7149         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
7150         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
7152         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
7153         flag.
7155 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
7157         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7158         (__SIZEOF_PTHREAD_COND_T): Define to 48.
7159         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
7160         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
7161         Make __align long long instead of long.
7162         (pthread_rwlock_t): Formatting.
7163         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
7164         (pthread_rwlock_t): Formatting.
7165         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7166         (pthread_cond_t): Make __align long long instead of long.
7167         (pthread_rwlock_t): Move __flags field to the same position as in
7168         linuxthreads.
7170 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
7172         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
7173         * tst-rwlock7.c (do_test): Likewise.
7175 2003-04-26  Roland McGrath  <roland@redhat.com>
7177         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
7179 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
7181         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
7182         sizeof (struct pthread).
7183         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
7184         1 struct pthread.
7185         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
7186         to 0.
7187         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
7188         struct pthread.
7189         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
7190         to 32-bit bytes.
7191         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
7192         tcbp.
7193         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
7194         unneccessarily.
7195         (NO_TLS_OFFSET): Define.
7196         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
7197         add TLS_TCB_SIZE unnecessarily.
7199 2003-04-22  Roland McGrath  <roland@redhat.com>
7201         * Makeconfig (shared-thread-library): Reverse link order to work
7202         around linker bug.
7204 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
7206         * semaphore.h: Fix typo in comment.
7208 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
7210         * sysdeps/pthread/sigfillset.c: New file.
7212         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
7213         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
7214         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
7215         * sysdeps/pthread/sigaction.c: Likewise.
7216         * sysdeps/pthread/sigprocmask.c: New file.
7217         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
7218         __SIGRTMIN+1.
7219         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7220         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
7221         in this case.
7223 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
7225         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
7226         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
7228         * sysdeps/unix/sysv/linux/unregister-atfork.c
7229         (__unregister_atfork): Don't free memory not allocated dynamically.
7231         * semaphore.h: Remove __THROW marker from cancellation points.
7232         * nptl/sysdeps/pthread/pthread.h: Likewise.
7234 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
7236         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
7237         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
7238         __THROW.
7240 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
7242         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
7244 2003-04-15  Roland McGrath  <roland@redhat.com>
7246         * forward.c (__pthread_unwind): Tweak to avoid warning.
7248 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
7250         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
7252 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
7254         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
7255         overflow CFA advance instructions.
7256         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7258 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
7260         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
7261         * sysdeps/i386/pthread_spin_lock.c: Likewise.
7262         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
7263         defined.
7265         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
7266         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
7267         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
7268         DW_CFA_advance_loc for .Laddl-.Lsubl.
7270 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
7272         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
7273         position-independent unwind data for static libraries.
7274         Add missing unwind info.  Add comments.
7276         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
7277         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7278         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7279         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7281 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
7283         * Makefile: Make sure all cancellation points are compiled with
7284         exception and asynchronous unwind tables.
7286         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
7287         which mishandles loading of global object addresses in PIC.
7288         (THREAD_SETMEM_NC): Likewise.
7290 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7292         * pthread.h: Define new data structure for cleanup buffer.  Declare
7293         new cleanup handler interfaces.
7294         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
7295         (struct pthread): Add cleanup_jmp_buf pointer.  Define
7296         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
7297         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
7298         it.  Declare old cleanup handler installation functions.
7299         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
7300         handling.
7301         * cleanup_defer.c: Likewise.
7302         * cleanup_compat.c: New file.  Old cleanup code.
7303         * cleanup_def_compat.c: New file.  Old cleanup code.
7304         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
7305         if own thread descriptor.
7306         * unwind.c: New file.
7307         * forward.c: Add __pthread_unwind.
7308         * init.c (pthread_functions): Add __pthread_unwind.
7309         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
7310         Add ptr___pthread_unwind.
7311         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
7312         and unwind function.
7313         * Makefile (libpthread-routines): Add cleanup_compat,
7314         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
7315         table generation if necessary.
7316         * version.c: Record whether unwind support is compiled in.
7317         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
7318         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
7319         handler interfaces.
7320         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
7321         complication to generate unwind information for syscall wrappers.
7322         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
7323         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
7324         __cleanup_fct_attribute.
7326         * Makefile: Add rules to build and run tst-cleanup0.
7327         * tst-cleanup0.c: New file.
7328         * tst-cleanup0.expect: New file.
7330         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
7331         caller.  Optimize to avoid often unecessary local variable.
7333 2003-04-11  Roland McGrath  <roland@redhat.com>
7335         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
7336         sets variable `multidir'; include that.
7337         (generated): Add it.
7338         ($(objpfx)$(multidir)/crti.o): New target.
7339         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
7341 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7343         * tst-attr2.c (do_test): Add cast to avoid warning.
7344         * tst-mutex4.c (do_test): Likewise.
7346 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
7348         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
7349         in child.
7351 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
7353         * Makefile (tests): Add tst-detach1.
7354         * tst-detach1.c: New file.
7356 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
7358         * sysdeps/pthread/pthread.h: Remove duplicate
7359         pthread_cleanup_{push,pop} definitions.
7361         * tst-barrier2.c: Eliminate warnings.
7362         * tst-cancel4.c: Likewise.
7363         * tst-cond4.c: Likewise.
7364         * tst-cond6.c: Likewise.
7365         * tst-detach1.c: Likewise.
7366         * tst-rwlock4.c: Likewise.
7367         * tst-rwlock6.c: Likewise.
7368         * tst-rwlock7.c: Likewise.
7369         * tst-sem3.c: Likewise.
7370         * tst-spin2.c: Likewise.
7371         * tst-umask1.c: Likewise.
7373 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
7375         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
7377 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
7379         * descr.h (struct pthread): Move cancelhandling member to the front.
7381 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
7383         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
7384         malloc_parent, and malloc_child statically.
7385         (__register_atfork_malloc): New function.
7386         (free_mem): Don't free any of the malloc_* variables on the list.
7387         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
7388         Define HAVE_register_atfork_malloc.
7390 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
7392         * sysdeps/pthread/createthread.c (create_thread): Add some more
7393         comments explaining when to set multiple_threads and when not.
7395         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7396         THREAD_ATOMIC_BIT_SET if not already defined.
7397         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7398         THREAD_ATOMIC_BIT_SET:
7399         * sysdeps/x86_64/tls.h: Likewise.
7400         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
7401         THREAD_ATOMIC_CMPXCHG_VAL.
7402         (_pthread_cleanup_pop_restore): Likewise.
7403         * cancellation.c (__pthread_enable_asynccancel): Likewise.
7404         (__pthread_enable_asynccancel_2): Likewise.
7405         (__pthread_disable_asynccancel): Likewise.
7406         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7407         (__libc_disable_asynccancel): Likewise.
7408         * init.c (sigcancel_handler): Likewise.
7409         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
7410         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
7412 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
7414         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
7415         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7416         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
7417         * Makefile (tests): Add tst-cancel11.
7418         * tst-cancel11.c: New file.
7420 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
7422         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
7423         round, not the first.  Use specific_used flag instead of local
7424         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
7425         (__free_tcb): Don't call deallocate_tsd here.
7426         (start_thread): Call deallocate_tsd here.
7427         * pthread_setspecific.c: Set specific_used flag really only when
7428         needed.
7429         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
7430         * tst-tsd3.c: New file.
7431         * tst-tsd4.c: New file.
7433 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7435         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
7436         Use atomic_exchange_and_add instead of __lll_add.
7437         (__lll_mutex_timedlock): Likewise.
7438         Patch by Ian Wienand.
7440 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
7442         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7443         (SINGLE_THREAD_P): Fix typo.
7444         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
7446 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7448         * Makefile (tests): Add tst-align.
7449         * tst-align.c: New file.
7450         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
7452         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
7453         function correctly.
7455         * tst-tsd2.c: Add casts to avoid warnings.
7457 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
7459         * descr.h (struct pthread): Move most often used elements to the front.
7461 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
7463         * Makefile (libpthread-routines): Add pthread_atfork.
7464         (libpthread-static-only-routines): Add pthread_atfork.
7466 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7468         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
7469         of TLS_DTV_AT_TP.
7470         (INSTALL_DTV): Add parens.
7471         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
7472         Use passed descr instead of THREAD_SELF.
7473         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
7474         (__lll_mutex_timedlock_wait): Correct expected value after
7475         spurious wakeup.
7476         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
7477         Release lock before waking up the waiters.
7478         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
7479         criteria.  Reorderstruct passed to cleanup handler.  Fix
7480         handling of cancellation and failung pthread_mutex_unlock call.
7481         Use __pthread_enable_asynccancel_2 instead of
7482         __pthread_enable_asynccancel.
7483         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7484         Return result of lock re-get if it fails.
7485         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
7486         for __pthread_cleanup_push.
7487         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
7488         completely broken rwlock implementation.
7489         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7490         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7491         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7492         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
7493         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7494         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
7495         versioned_symbol macro.
7496         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
7497         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
7499 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
7501         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
7502         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
7503         and __helper_tid.
7504         (struct timer): Remove th and bar field.
7505         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
7506         debugging code.  Create only one helper thread.
7507         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
7508         helper thread.
7509         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7510         Renamed.  Define statically.  Use thread info from siginfo.
7511         (__helper_once): New variable.
7512         (__helper_tid): New variable.
7513         (__reset_helper_control): New function.
7514         (__start_helper_thread): New function.
7516         * pthread_create.c (start_thread): Don't use setjmp inside
7517         __builtin_expect to work around gcc bug.
7519         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
7520         timer_delete syscall fails, but not with ENOSYS, set
7521         __no_posix_timers.
7523         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
7524         (timer_settime): Fix typo.
7525         * sysdeps/unix/sysv/linux/timer_getoverr.c
7526         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
7528 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
7530         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
7531         offset of cleanupbuf.__prev.
7533 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
7535         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
7536         of included file.
7538 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
7540         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
7541         NULL provide default definition to syscall.
7543 2003-03-25  Roland McGrath  <roland@redhat.com>
7545         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
7546         (timer_id2ptr): Fix typo.
7548 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
7550         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
7551         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
7552         * sysdeps/ia64/pthreaddef.h: Likewise.
7553         * sysdeps/powerpc/pthreaddef.h: Likewise.
7554         * sysdeps/s390/pthreaddef.h: Likewise.
7555         * sysdeps/sh/pthreaddef.h: Likewise.
7556         * sysdeps/x86_64/pthreaddef.h: Likewise.
7557         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
7558         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
7559         being changed.
7560         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
7561         SIGTIMER is not unblocked.
7562         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
7563         RT signal taken.
7564         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
7565         be send.
7566         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
7567         pass pointer through as ID.
7568         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
7569         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
7570         * sysdeps/unix/sysv/linux/timer_create.c: New file.
7571         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
7572         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
7573         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
7574         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
7575         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
7576         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
7577         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
7578         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
7579         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
7580         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
7581         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
7582         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
7583         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
7584         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
7585         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
7586         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
7587         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
7588         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
7589         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
7590         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
7591         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
7592         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
7593         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
7594         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
7595         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
7596         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
7597         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
7598         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
7599         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
7600         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
7602         * pthreadP.h: Remove FRAME_LEFT definition.
7603         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
7604         already left frame.  Programs which have this problem are not POSIX
7605         compliant.
7606         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
7608 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
7610         * sysdeps/pthread/tst-timer.c: Check return values of the
7611         functions we test.
7613 2003-03-23  Roland McGrath  <roland@redhat.com>
7615         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
7616         * tst-tls3mod.c: Likewise.
7617         * tst-tls1.c: Likewise.
7618         * tst-tls2.c: Likewise.
7620         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
7621         undefined behavior.
7623         * tst-join5.c (tf1, tf2): Add a cast.
7625         * Makeconfig (includes): Append -I$(..)nptl to this variable.
7627         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
7628         Don't test anything.
7629         * tst-cond4.c: Likewise.
7630         * tst-cond6.c: Likewise.
7631         * tst-flock2.c: Likewise.
7632         * tst-mutex4.c: Likewise.
7633         * tst-rwlock4.c: Likewise.
7634         * tst-signal1.c: Likewise.
7635         * tst-spin2.c: Likewise.
7636         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
7638         * tst-mutex4.c: Use test-skeleton.c.
7639         * tst-spin2.c: Likewise.
7640         * tst-sysconf.c: Likewise.
7641         * tst-barrier2.c: Likewise.
7642         * tst-cond4.c: Likewise.
7643         * tst-cond6.c: Likewise.
7644         * tst-rwlock4.c: Likewise.
7645         * tst-unload.c: Likewise.
7646         * tst-flock2.c (do_test): Use return instead of exit.
7648 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
7650         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
7652 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
7654         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7655         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
7656         instead of __lll_compare_and_swap.
7657         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
7658         Likewise.
7659         Removed definition if __lll_compare_and_swap.
7661         * cancellation.c: Adjust for new form of compare&exchange macros.
7662         * cleanup_defer.c: Likewise.
7663         * init.c: Likewise.
7664         * libc-cancellation.c: Likewise.
7665         * old_pthread_cond_broadcast.c: Likewise.
7666         * old_pthread_cond_signal.c: Likewise.
7667         * old_pthread_cond_timedwait.c: Likewise.
7668         * old_pthread_cond_wait.c: Likewise.
7669         * pthread_cancel.c: Likewise.
7670         * pthread_create.c: Likewise.
7671         * pthread_detach.c: Likewise.
7672         * pthread_join.c: Likewise.
7673         * pthread_key_delete.c: Likewise.
7674         * pthread_setcancelstate.c: Likewise.
7675         * pthread_setcanceltype.c: Likewise.
7676         * pthread_timedjoin.c: Likewise.
7677         * pthread_tryjoin.c: Likewise.
7678         * sysdeps/pthread/createthread.c: Likewise.
7680 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
7682         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
7683         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
7684         definitions.  Replace uses with calls to atomic_* functions.
7685         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
7686         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
7687         __lll_test_and_set calls with atomic_exchange_and_add and
7688         atomic_exchange calls respectively.
7689         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
7690         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
7691         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
7692         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
7693         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
7694         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
7695         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
7697         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
7698         returns the old value.
7700 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
7702         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
7703         int for variable OLDVAL and correct inline assembler contraint.
7704         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
7705         type int for variable OLD.
7707         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
7708         only for s390-32.
7709         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7710         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
7711         instead of multiple_threads field in the TCB.
7713 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
7715         * sysdeps/i386/i686/bits/atomic.h: Removed.
7716         * sysdeps/i386/i586/bits/atomic.h: Removed.
7717         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
7718         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
7719         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
7720         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
7721         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
7722         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
7723         * atomic.h: Removed.  Moved to glibc.
7725         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
7726         support for clock selection.
7728         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
7729         signalling waiters.
7731 2003-03-18  Roland McGrath  <roland@redhat.com>
7733         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7734         Add __lll_rel_instr first.  Add memory clobber.
7735         (lll_mutex_unlock): Use __lll_test_and_set.
7736         From Paul Mackerras <paulus@samba.org>.
7738         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
7739         unconditionally.
7740         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7741         (SINGLE_THREAD_P):  Add `header.' prefix.
7742         From Paul Mackerras <paulus@samba.org>.
7744         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
7745         pthread_timedjoin_np to ...
7746         (libpthread: GLIBC_2.3.3): ... here.
7747         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
7749         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
7750         Avoid shadowing VAL variable.
7752         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7753         New macro.
7755 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
7757         * Makefile (tests): Add tst-cond11.
7758         * tst-cond11.c: New file.
7760         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
7761         struct passed to cleanup handler to eliminate one more
7762         instruction.
7763         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7765         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7766         (pthrad_cond_t): Replace __unused field with __clock.
7768         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
7769         waken all waiters in cleanup handler.
7770         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7771         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7773         * pthread_condattr_getclock.c: New file.
7774         * pthread_condattr_setclock.c: New file.
7775         * sysdeps/pthread/pthread.h: Declare these new functions.
7776         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
7777         * Makefile (libpthread-routines): Add the new functions.
7778         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
7779         Renamed field to value.  Document use of the bits.
7780         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
7781         change.
7782         * pthread_condattr_setpshared.c: Likewise.
7783         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
7784         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
7785         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
7786         Add __clock field.
7787         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7788         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7789         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7790         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7791         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
7792         Implement clock selection.
7793         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7794         * pthread-errnos.sym: Add ENOSYS.
7795         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
7796         _POSIX_CLOCK_SELECTION.
7797         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
7799         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
7800         invalid .size directive.
7802 2003-03-17  Roland McGrath  <roland@redhat.com>
7804         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
7805         Formatting tweaks.
7807 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7809         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
7810         Use __lll_add instead of spelling it out.  Use protected symbol names.
7811         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
7812         Use __lll_add.
7813         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
7814         Renamed from lll_compare_and_swap.  Use new name where necessary.
7815         (__lll_add): Defined.
7816         (__lll_dec_if_positive): Defined.
7817         (__lll_test_and_set): Defined.
7818         * sysdeps/ia64/pthread_spin_init.c: Removed.
7819         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
7820         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
7821         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
7822         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
7823         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
7824         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
7825         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
7826         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
7827         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
7828         __sync_lock_release_si.
7829         Patch by Jakub Jelinek.
7831         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
7832         Fix timeout handling.
7833         (__lll_timedwait_tid): Likewise.
7834         (lll_unlock_wake_cb): Wake up other waiters if necessary.
7835         Patch by Jakub Jelinek.
7837         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
7839 2003-03-17  Roland McGrath  <roland@redhat.com>
7841         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
7842         * sysdeps/pthread/pthread_spin_init.c: New file.
7843         * sysdeps/pthread/pthread_spin_unlock.c: New file.
7844         * sysdeps/powerpc/Makefile: New file.
7845         * sysdeps/powerpc/pthread_spin_lock.c: New file.
7846         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
7847         * sysdeps/powerpc/pthreaddef.h: New file.
7848         * sysdeps/powerpc/tcb-offsets.sym: New file.
7849         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
7850         * sysdeps/powerpc/tls.h: New file.
7851         * sysdeps/powerpc/bits/atomic.h: New file.
7852         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
7853         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
7854         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
7856         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
7857         * sysdeps/unix/sysv/linux/sem_post.c: New file.
7858         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
7859         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
7860         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
7861         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
7862         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
7863         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
7864         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
7865         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
7866         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
7867         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
7868         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
7869         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
7870         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
7872         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
7873         not gettimeofday.
7874         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
7875         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
7876         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
7877         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
7878         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
7880 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7882         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
7883         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7884         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7885         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7886         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
7888 2003-03-16  Roland McGrath  <roland@redhat.com>
7890         * tst-fork4.c: Include <string.h>.
7891         * tst-signal2.c: Likewise.
7892         * tst-mutex5.c (do_test): exit -> return.
7893         * tst-mutex2.c: Include <stdlib.h>.
7895 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
7897         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
7898         (__lll_mutex_timedlock_wait): Correct expected value after
7899         spurious wakeup.  Otherwise we would never wait again.
7901         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
7902         zone versus inline asm stupidity.  Use correct instructions.
7904         * tst-rwlock6.c: Add some more status output.
7906 2003-03-15  Roland McGrath  <roland@redhat.com>
7908         * sysdeps/pthread/configure.in: New file.
7909         * sysdeps/pthread/configure: New file (generated).
7911 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
7913         * allocatestack.c (allocate_stack): Store the exact stack size of
7914         user allocated stacks.
7916 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
7918         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
7919         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
7920         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
7921         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
7922         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
7923         Use `header.' prefix.
7924         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
7926 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
7928         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
7929         __builtin_frame_address, use stack pointer.
7931         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
7932         instead of __builtin_frame_pointer.
7934 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
7936         * tst-basic1.c (do_test): Add cast to avoid warning.
7937         * tst-basic2.c (do_test): Likewise.
7939         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
7940         amount of stack correction.
7942         * tst-fork4.c: Use test-skeleton.c.
7944 2003-03-14  Roland McGrath  <roland@redhat.com>
7946         * init.c: Fix typo "#eli" for "#else".
7948 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
7950         * allocatestack.c (__stack_user): Use hidden_data_def.
7951         * pthread_create.c (__pthread_keys): Likewise.
7953         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
7955 2003-03-14  Roland McGrath  <roland@redhat.com>
7957         * tst-fork4.c: New file.
7958         * Makefile (tests): Add it.
7960         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
7961         we always define the padding space.
7962         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
7963         stopped supporting its own extensions fully.
7964         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
7965         struct also called `header', so `header.multiple_threads' is the field
7966         name to use on all machines.
7967         * allocatestack.c (allocate_stack): Use `header.' prefix.
7968         * sysdeps/pthread/createthread.c (create_thread): Likewise.
7969         * pthread_create.c (__pthread_create_2_1): Likewise.
7970         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
7971         (THREAD_SELF): Likewise.
7972         * sysdeps/x86_64/tls.h: Likewise.
7973         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
7974         (SINGLE_THREAD_P): Likewise.
7975         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
7976         (SINGLE_THREAD_P): Likewise.
7977         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7978         (SINGLE_THREAD_P): Likewise.
7980         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
7981         value directly.
7983 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
7985         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
7986         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
7988         * pthread_create.c (start_thread): setjmp is expected to return 0.
7990         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
7991         (THREAD_GETMEM_NC): Likewise.
7993 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
7995         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
7996         and the size of the stack which must be allocated is a multiple,
7997         allocate one more page.
7998         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
7999         MULTI_PAGE_ALIASING.
8001 2003-03-13  Roland McGrath  <roland@redhat.com>
8003         * pthread_create.c (start_thread): Set EXITING_BIT after the
8004         event-reporting (and destructors), not before.
8006 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
8008         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
8009         lll_futex_wake): Declare register variables as long int instead of
8010         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
8011         Make syscall arguments clobbered by the syscall.
8012         (lll_futex_wait): Define using lll_futex_timed_wait.
8014         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
8015         to void *.
8017         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
8018         PPID if [! NDEBUG].
8020         * allocatestack.c (nptl_ncreated): Only declare if
8021         COLORING_INCREMENT != 0.
8023         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
8024         (__libc_enable_asynccancel_2): Remove prototype.
8026         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
8027         ctid to match kernel.
8029 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
8031         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
8032         libc_multiple_threads.
8033         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
8034         __libc_multiple_threads to...
8035         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
8037         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
8038         versioning.
8039         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8040         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8042         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
8043         (__pthread_once_internal): Define.
8045         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
8046         macros instead of .symver directly.
8047         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
8048         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
8050         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
8051         * sysdeps/x86_64/tcb-offsets.sym: New file.
8052         * sysdeps/x86_64/Makefile: New file.
8054         * sysdeps/i386/tcb-offsets.sym: Add SELF.
8055         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
8056         to access own pthread_t in TCB.
8057         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8058         Likewise.
8059         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8060         Likewise.
8061         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8063 2003-03-12  Roland McGrath  <roland@redhat.com>
8065         * pthread-errnos.sym: New file.
8066         * Makefile (gen-as-const-headers): New variable, list that file.
8067         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
8068         header <pthread-errnos.h> instead of defining errno values here.
8069         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
8070         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8071         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8072         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8073         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8074         Likewise.
8075         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8076         Likewise.
8077         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8078         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8079         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8080         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8081         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8082         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8083         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
8084         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
8085         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
8086         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
8087         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
8088         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
8089         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
8090         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
8091         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
8092         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8093         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
8094         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
8095         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
8096         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
8097         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8098         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
8099         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
8100         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
8101         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
8102         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
8103         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
8105         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
8106         CLONE_CHILD_SETTID worked.
8108 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
8110         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
8111         file.
8112         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
8113         file.
8115         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
8116         (pthread_cond_t): Add padding.
8118         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
8119         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
8120         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
8122         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
8123         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
8124         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
8125         (__pthread_rwlock_timedrdlock): Likewise.
8126         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
8127         (__pthread_rwlock_wrlock): Likewise.
8128         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
8129         (__pthread_rwlock_rdlock): Likewise.
8131         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
8133         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
8134         result of lock re-get if it fails.
8136 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8138         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
8139         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
8140         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
8141         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
8142         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
8143         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
8144         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
8145         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
8146         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8147         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8149         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
8150         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
8152         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
8153         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
8154         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
8155         (create_thread): Likewise.
8156         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
8157         * init.c (__pthread_initialize_minimal_internal): Initialize
8158         __libc_multiple_threads_ptr if necessary.
8159         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
8160         __pthread_multiple_threads and __libc_multiple_threads_ptr.
8161         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
8162         __libc_multiple_threads.
8163         (__libc_pthread_init): Return pointer to __libc_pthread_init if
8164         necessary.
8166         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
8167         (THREAD_SETMEM_NC): Likewise.
8169         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
8170         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
8171         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
8172         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
8174         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
8175         Eliminate one entire instruction.
8177         * cancellation.c (__pthread_enable_asynccancel_2): New function.
8178         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
8179         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
8180         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
8181         instead of __pthread_enable_asynccancel.
8182         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8183         (__pthread_cond_wait): Likewise.
8184         * sysdeps/pthread/pthread_cond_timedwait.c
8185         (__pthread_cond_timedwait): Likewise.
8186         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
8188         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8189         (__condvar_cleanup): Wake up all waiters in case we got signaled
8190         after being woken up but before disabling asynchronous
8191         cancellation.
8192         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8193         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
8194         (__condvar_cleanup): Likewise.
8196         * init.c (__NR_set_tid_address): If already defined, don't redefine.
8197         Make it an error if architecture has no #if case.  Add x86-64.
8199         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
8200         pt-initfini.s generation.
8202         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
8203         (TLS_INIT_TP): Fix typo.
8205 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8207         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
8208         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
8210         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
8211         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
8212         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
8213         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
8214         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
8215         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8216         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8217         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8219 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8221         * sysdeps/pthread/pthread_cond_timedwait.c
8222         (__pthread_cond_timedwait): Return the result of the final
8223         locking.  If it succeeds, the regular function return value.
8225         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
8226         Return result of the final locking.
8227         * version.c (__nptl_main): Work around problems with the strange
8228         INTERNAL_SYSCALL macro on ppc32.
8229         * init.c (__pthread_initialize_minimal_internal): Unblock
8230         SIGCANCEL in case the parent blocked it.
8231         Reported by Paul Mackerras <paulus@samba.org>.
8233         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
8234         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
8235         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
8237 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8239         * sysdeps/pthread/pthread_cond_timedwait.c
8240         (__pthread_cond_timedwait): Unlock and fail if
8241         __pthread_mutex_unlock_internal failed.
8243         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
8244         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
8245         Use ARCH_CLONE.
8246         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
8247         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
8248         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
8249         ALLOCATE_STACK): New macros.
8250         (TLS_TPADJ): New macro.
8251         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
8252         (allocate_stack): Handle TLS_DTV_AT_TP and
8253         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
8254         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
8255         Don't set PD->self.
8256         * init.c [__ia64__] (__NR_set_tid_address): Define.
8258         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
8259         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
8260         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
8261         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
8262         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
8263         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
8264         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
8265         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
8266         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
8267         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
8268         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
8269         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
8270         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
8271         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
8272         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
8273         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
8274         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
8275         * sysdeps/ia64/bits/atomic.h: New file.
8276         * sysdeps/ia64/Makefile: New file.
8277         * sysdeps/ia64/pthread_spin_init.c: New file.
8278         * sysdeps/ia64/pthread_spin_lock.c: New file.
8279         * sysdeps/ia64/pthread_spin_trylock.c: New file.
8280         * sysdeps/ia64/pthread_spin_unlock.c: New file.
8281         * sysdeps/ia64/pthreaddef.h: New file.
8282         * sysdeps/ia64/tcb-offsets.sym: New file.
8283         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
8284         * sysdeps/ia64/tls.h: New file.
8286         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
8287         to syscall instead of no arguments.
8289 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
8291         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
8292         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
8293         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
8294         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
8296         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
8297         unused code.
8299         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
8301         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8302         lowlevelbarrier.sym.
8303         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
8304         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
8305         Include lowlevelbarrier.h and don't define offsets locally.
8306         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
8308         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
8309         (__lll_mutex_lock_wait): Reverse order of first two parameters.
8310         (__lll_mutex_timedlock_wait): Likewise.
8311         (lll_mutex_lock): Adjust asm for that.
8312         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
8313         (lll_lock): Adjust asm for operand order change.
8314         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
8315         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
8317         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
8318         Reverse order of parameters.
8319         (__lll_timedwait_tid): Remove regparms attribute.
8320         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
8321         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
8323         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8324         (__lll_timedwait_tid): Remove one unnecessary instruction.
8326         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
8327         __lll_mutex_timedlock_wait only for NOT_IN_libc.
8328         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
8329         lowlevelmutex.S.
8331         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
8332         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
8333         for NOT_IN_libc.
8334         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
8335         lowlevellock.S.
8337         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
8338         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
8339         for libc.so.
8340         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
8341         define LOCK here (if UP is not defined).  The actual code is in
8342         lowlevelmutex.S.
8344         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
8345         LOCK is already defined.  Don't define lll_unlock_wake_cb and
8346         __lll_timedwait_tid for libc.so.
8347         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
8348         define LOCK here (if UP is not defined).  The actual code is in
8349         lowlevellock.S.
8351         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
8352         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
8353         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
8354         instead of lowlevelsem.h.
8355         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8356         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8357         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8359         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8360         lowlevelrwlock.sym.
8361         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
8362         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
8363         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
8365         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
8366         register loading.
8367         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
8368         last changed.  D'oh.
8370         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
8372         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
8373         of __libc_locking_needed.
8374         (lll_trylock): Initialize %eax to zero.
8376         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
8377         pthread_cond_t definition.
8379 2003-03-10  Roland McGrath  <roland@redhat.com>
8381         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
8382         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
8383         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
8384         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
8385         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
8387         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
8388         Instead of setting PD->multiple_threads, set globals
8389         __pthread_multiple_threads and __libc_multiple_threads.
8390         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8391         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
8392         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
8394         * descr.h (struct pthread): Conditionalize first member on
8395         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
8396         containing an anonymous tcbhead_t.  Move `list' member out.
8397         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
8398         * allocatestack.c: Remove use of `header.data.' prefix.
8399         * pthread_create.c: Likewise.
8400         * init.c (__pthread_initialize_minimal_internal): Likewise.
8401         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8402         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
8403         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
8404         * sysdeps/x86_64/tls.h: Likewise.
8405         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
8406         (SINGLE_THREAD_P): Likewise.
8407         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
8408         (SINGLE_THREAD_P): Likewise.
8409         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
8410         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
8412 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
8414         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
8416         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
8417         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8419         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
8420         leftovers from the ia32 code.
8422         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
8423         memory load.
8424         (clear_once_control): Don't load %esi.
8426         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
8427         handling.
8429         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8431         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
8432         * sysdeps/unix/sysv/linux/createthread.c: ...here.
8434         * Makefile (tests): Add tst-cond10.
8435         * tst-cond10.c: New file.
8437 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
8439         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
8440         * tst-signal3.c (do_test): Likewise.
8441         * tst-sem5.c (do_test): Likewise.
8442         * tst-kill6.c (do_test): Likewise.
8443         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
8445         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
8446         of inc/dec.
8447         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
8448         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
8449         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8450         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8451         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8452         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8453         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8454         Likewise.
8455         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8456         Likewise.
8457         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8458         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8459         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8460         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
8461         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
8462         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
8463         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8464         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8466         * allocatestack.c (allocate_stack): If mprotect() fails free the
8467         TLS memory.
8469 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
8471         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
8473         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
8474         lll_wake_tid.  This was used only to work around kernel limits in
8475         the early days.
8476         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
8477         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
8478         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8479         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
8481         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
8482         (__pthread_initialize_minimal_internal): Change initialization of
8483         __static_tls_align_m1 appropriately.
8484         * pthreadP.h (__static_tls_align_m1): Renamed from
8485         __static_tls_align.
8486         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
8487         instead of __static_tls_align-1.
8489 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
8491         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
8493         * pthread_create.c: Define __pthread_keys using nocommon
8494         attribute, not by placing it explicitly in bss.
8495         Remove DEFINE_DEALLOC definition.  Not needed anymore.
8497         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
8498         Use it in mmap call to allocate stacks.
8500         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
8502         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
8503         result of the thread function.
8505 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
8507         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
8508         version is just fine.
8510         * sysdeps/unix/sysv/linux/libc_pthread_init.c
8511         (__pthread_child_handler): Renamed from pthread_child_handler,
8512         exported, and marked hidden.  Change all users.
8513         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
8514         free __pthread_child_handler from child list.
8516 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8518         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
8520         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
8521         Fix handling of cancellation and failing pthread_mutex_unlock call.
8522         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8523         (__pthread_cond_wait): Likewise.
8525         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
8526         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
8527         lll_futex_timed_wait call.
8528         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
8529         (pthread_rwlock_timedwrlock): Likewise.
8531         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
8532         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
8533         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
8535         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
8536         check of lll_futex_wake return value.
8538 2003-03-03  Roland McGrath  <roland@redhat.com>
8540         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
8542         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8543         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
8544         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
8546 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
8548         * sysdeps/pthread/timer_create.c (timer_create): Return correct
8549         error for CPU clocks.
8551         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
8552         _POSIX_MONOTONIC_CLOCK.
8553         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
8555         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
8556         recent kernels.
8558 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8560         * descr.h (struct pthread): Move cleanup field to the front.
8562 2003-03-01  Roland McGrath  <roland@redhat.com>
8564         * sem_open.c (sem_open): Braino fix.
8566 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8568         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
8569         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
8570         __pthread_cleanup_pop functionality.
8571         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8573         * descr.h (struct pthread): Move tid field to the front now that
8574         it is often used.
8576         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
8577         (__lll_mutex_timedlock_wait): Remove.
8578         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8579         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
8580         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8581         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8582         (lll_unlock_wake_cb): Don't save and restore %esi.
8583         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8584         %esi.
8585         (__lll_timedwait_tid): Add alignment.
8586         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
8587         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8588         %esi.
8589         (__lll_timedwait_tid): Removed.
8590         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
8591         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
8592         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
8593         (pthread_barrier_wait): Don't save, load, and restore %esi for
8594         last thread.
8595         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
8596         (__pthread_cond_signal): Don't save, load, and restore %esi.
8597         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
8598         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
8599         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
8600         Don't save, load, and restore %esi.
8602 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
8604         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
8605         Release lock before waking up the waiters.
8607         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
8609         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
8610         (reader_thread): Likewise.
8612         * sysdeps/pthread/pthread_rwlock_unlock.c
8613         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
8614         to wake up readers if there are none.
8616         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
8617         Release internal lock before wake threads.
8619 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
8621         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
8622         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
8623         predefined.
8624         * tst-rwlock9.c: Likewise.
8625         * tst-rwlock10.c: New file.
8626         * tst-rwlock11.c: New file.
8628         * Makefile (tests): Add tst-dlsym1.
8629         * tst-dlsym1.c: New file.
8631         * init.c (__pthread_initialize_minimal_internal): Set
8632         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
8633         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
8635 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
8637         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
8639         * tst-cond2.c: Fix sychronization with child.
8641         * tst-rwlock8.c (reader_thread): Remove unused variable.
8643         * Makefile: Add rules to build and run tst-tls3.
8644         * tst-tls3.c: New file.
8645         * tst-tls3mod.c: New file.
8647         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
8648         * tst-rwlock8.c: New file.
8649         * tst-rwlock9.c: New file.
8650         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
8651         complete broken rwlock implementation.
8652         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8653         Likewise.
8654         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8655         Likewise.
8656         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8657         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8658         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
8659         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
8660         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
8661         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
8662         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
8664 2003-02-23  Roland McGrath  <roland@redhat.com>
8666         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
8668 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
8670         * Makefile (tests): Add tst-context1.
8671         * tst-context1.c: New file.
8673         * Makefile (tests): Add tst-tls1 and tst-tls2.
8674         * tst-tls1.c: New file.
8675         * tst-tls2.c: New file.
8677         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
8678         for failed cmpxchg.
8680         * pthread_create.c (start_thread): Set EXITING_BIT early.
8682         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
8683         (THREAD_GETMEM_NC): Likewise.
8685 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
8687         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
8688         off 3 more bytes by using offset-less instructions when possible.
8690         * Makefile: Add dependency for $(objpfx)version.d.
8692         * eintr.c (eintr_source): Add unnecessary return but the compiler
8693         insists.
8695         * tst-kill3.c: Include <unistd.h>.
8697 2003-02-21  Roland McGrath  <roland@redhat.com>
8699         * pthread_create.c (start_thread): Call __libc_thread_freeres.
8701 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8703         * Makefile (tests): Add tst-eintr1.
8704         (distribute): Add eintr.c.
8705         * tst-eintr1.c: New file.
8706         * eintr.c: New file.
8708         * pthread_cancel.c (pthread_cancel): Use tkill directly.
8710         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
8711         Disallow sending SIGCANCEL.
8713         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
8714         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
8715         * tst-kill1.c: New file.
8716         * tst-kill2.c: New file.
8717         * tst-kill3.c: New file.
8718         * tst-kill5.c: New file.
8719         * tst-kill6.c: New file.
8720         * tst-basic7.c: Renamed to...
8721         * tst-kill4.c: ...this.
8723 2003-02-21  Roland McGrath  <roland@redhat.com>
8725         * Makefile (install-lib-ldscripts): New variable.
8727 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8729         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
8730         * pthread_cancel.c: Use INVALID_TD_P.
8731         * pthread_detach.c: Likewise.
8732         * pthread_getschedparam.c: Likewise.
8733         * pthread_setschedparam.c: Likewise.
8734         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
8735         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
8736         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
8737         * pthread_timedjoin.c: Likewise.
8739         * tst-basic7.c: Include <signal.h>.
8741         * pthread_join.c (pthread_join): Limited checking for invalid
8742         descriptors.
8743         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
8745 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
8747         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
8748         beginning of the loop.  Clear the entire first block of TSD.
8749         * Makefile (tests): Add tst-key4.
8750         * tst-key4.c: New file.
8752 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
8754         * Makefile (tests): Add tst-basic7.
8755         * tst-basic7.c: New file.
8757         * pthread_create.c (deallocate_tsd): Mark as internal_function.
8758         Add some more __builtin_expect.
8760         * pthreadP.h: Define dummy version of DEBUGGING_P.
8762 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
8764         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
8765         _POSIX_THREAD_PRIORITY_SCHEDULING.
8766         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
8767         _XOPEN_REALTIME_THREADS.
8768         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
8770         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
8771         kernel returns EINVAL for PID <= 0, work around it.
8773         * Makefile (tests): Add tst-signal5.
8774         * tst-signal5.c: New file.
8776         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
8777         and LOGIN_NAME_MAX.
8779         * tst-cancel1.c (tf): Block all signals.
8781         * Makefile (tests): Add tst-basic6.
8782         * tst-basic6.c: New file.
8784         * tst-basic1.c: Add test for process ID.
8786         * Makefile (tests): Add tst-cancel10.
8787         * tst-cancel10.c: New file.
8789         * Makefile (tests): Add tst-signal4.
8790         * tst-signal4.c: New file.
8792         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
8793         __sigismember instead of sigismember.  Add __builtin_expect.
8795 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
8797         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
8798         pthread_setcancelstate, and pthread_rwlock_setpshared.
8800         * tst-cancel7.c (do_test): Make sure the pid file exists before
8801         canceling the thread.
8803         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
8804         pthread_rwlock_timedrdlock tests.
8805         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
8806         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8807         Check for invalid tv_nsec field.
8808         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8809         Likewise.
8811         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
8812         recursive mutex of overflow.
8814         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
8816         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
8817         going into an endless loop.
8818         * Makefile (tests): Add tst-cancel9.
8819         * tst-cancel9.c: New file.
8821         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
8823 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
8825         * tst-mutex5.c (do_test): Add more timedlock tests.
8827         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
8828         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
8830         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
8831         use INLINE_SYSCALL.  Error number is returned, not -1.
8833         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
8834         and __deallocate_stack with internal_function.
8835         * pthread_create.c: Adjust definitions appropriately.
8836         * allocatestack.c: Likewise.
8838         * pthread_join.c: Add one more __builtin_expect.
8839         * pthread_timedjoin.c: Likewise.
8841         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
8842         not data of sequence number does not match.
8843         Add one __builtin_expect.
8845         * Makefile (tests): Add tst-clock1.
8846         * tst-clock1.c: New file.
8848         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
8849         negative arguments.
8850         * Makefile (tests): Add tst-basic5.
8851         * tst-basic5.c: New file.
8853 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
8855         * Makefile (tests): Add tst-basic4.
8856         * tst-basic4.c: New file.
8858         * pthreadP.h: Add declaraction for __nptl_nthreads.
8859         * pthread_create.c: Define __nptl_nthreads
8860         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
8861         after thread is done.  If then zero, call exit(0).
8862         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8863         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
8864         * init.c (pthread_functions): Initialize ptr_nthreads.
8865         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
8866         (__reclaim_stacks): Decrement __nptl_nthreads.
8867         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
8868         Define.
8869         * Makefile (tests): Add tst-basic3.
8870         * tst-basic3.c: New file.
8872         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
8873         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
8874         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
8875         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
8876         if asynchronous canceling is enabled.
8877         * pthread_join.c (pthread_join): When recognizing circular joins,
8878         take into account the other thread might be already canceled.
8879         * Makefile (tests): Add tst-join5.
8880         * tst-join5.c: New file.
8882         * Makefile (tests): Add tst-join4.
8883         * tst-join4.c: New file.
8885 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
8887         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
8889 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8891         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
8892         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
8893         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
8894         warning.
8895         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
8896         to avoid warning.
8897         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
8898         error if lll_futex_wake failed.
8900 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
8902         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
8903         handling of cancellation and failung pthread_mutex_unlock call.
8904         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8905         * Makefile (tests): Add tst-cond8 and tst-cond9.
8906         * tst-cond8.c: New file.
8907         * tst-cond9.c: New file.
8909         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
8911         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
8912         non-standard initializers with __USE_GNU.
8914         * Makefile (tests): Add tst-cleanup3.
8915         * tst-cleanup3.c: New file.
8917 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
8919         * Makefile (tests): Add tst-attr1 and tst-attr2.
8920         * tst-attr1.c: New file.
8921         * tst-attr2.c: New file.
8923         * Makefile: Add rules to build and run tst-atfork2 test.
8924         * tst-atfork2.c: New file.
8925         * tst-atfork2mod.c: New file.
8927         * sysdeps/unix/sysv/linux/unregister-atfork.c
8928         (__unregister_atfork): Free the memory allocated for the handlers
8929         after removing them from the lists.
8931         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
8932         cleanup function.
8934         * tst-atfork1.c (do_test): Wait for the child we forked.
8935         Report error in child.
8937         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
8939         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
8941 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
8943         * Makefile (tests): Add tst-cancel8.
8944         * tst-cancel8.c: New file.
8946         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
8947         clearing of control variable.
8948         * Makefile (tests): Add tst-once3 and tst-once4.
8949         * tst-once3.c: New file.
8950         * tst-once4.c: New file.
8952 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
8954         * sysdeps/sh/Makefile: New file.
8955         * sysdeps/sh/bits/atomic.h: New file.
8956         * sysdeps/sh/pthread_spin_init.c: New file.
8957         * sysdeps/sh/pthread_spin_lock.c: New file.
8958         * sysdeps/sh/pthread_spin_trylock.S: New file.
8959         * sysdeps/sh/pthread_spin_unlock.S: New file.
8960         * sysdeps/sh/pthreaddef.h: New file.
8961         * sysdeps/sh/tcb-offsets.sym: New file.
8962         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
8963         * sysdeps/sh/tls.h: New file.
8964         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
8965         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
8966         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
8967         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
8968         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
8969         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
8970         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
8971         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
8972         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
8973         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
8974         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
8975         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
8976         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
8977         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
8978         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
8979         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
8980         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
8981         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
8982         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
8983         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
8984         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
8985         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
8986         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
8987         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
8988         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
8989         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
8990         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
8991         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
8992         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
8993         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
8995 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
8997         * tst-cond2.c: Rearrange code to not rely on behavior undefined
8998         according to POSIX.
9000         * tst-basic2.c (do_test): Lock mutex before creating the thread.
9002 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
9004         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
9005         (TLS_GET_FS): New #define.
9006         (TLS_SET_FS): New #define.
9007         Correct value of __NR_set_thread_area.
9009         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
9011 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
9013         * Makefile (tests): Add tst-popen1.
9014         * tst-popen1.c: New file.
9016         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
9017         but inactive generalization.
9018         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9019         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
9020         Minor optimization, remove one instruction.
9021         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
9023 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9025         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
9027 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9029         * init.c (__NR_set_tid_address): Add #ifdef for s390.
9030         * sysdeps/pthread/pthread_barrier_wait.c: New file.
9031         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
9032         * sysdeps/pthread/pthread_cond_signal.c: New file.
9033         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
9034         * sysdeps/pthread/pthread_cond_wait.c: New file.
9035         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
9036         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
9037         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
9038         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
9039         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
9040         * sysdeps/s390/Makefile: New file.
9041         * sysdeps/s390/bits/atomic.h: New file.
9042         * sysdeps/s390/pthread_spin_init.c: New file.
9043         * sysdeps/s390/pthread_spin_lock.c: New file.
9044         * sysdeps/s390/pthread_spin_trylock.c: New file.
9045         * sysdeps/s390/pthread_spin_unlock.c: New file.
9046         * sysdeps/s390/pthreaddef.h: New file.
9047         * sysdeps/s390/tcb-offsets.sym: New file.
9048         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
9049         * sysdeps/s390/tls.h: New file.
9050         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
9051         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
9052         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
9053         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
9054         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
9055         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
9056         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
9057         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
9058         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
9059         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
9060         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
9061         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
9062         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
9063         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
9064         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
9065         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
9066         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
9067         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
9068         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
9069         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
9070         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
9071         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
9072         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
9074 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
9076         * atomic.h: Add a couple more default implementations.
9077         (atomic_compare_and_exchange_acq): Use
9078         __arch_compare_and_exchange_32_acq in return value definition.  It
9079         always exists.
9080         (atomic_bit_set): Renamed from atomic_set_bit.
9081         Add missing atomic_ prefixes.
9083         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
9084         thread library is available, use correct value to mark initialized
9085         once variable.
9087 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
9089         * allocatestack.c (allocate_stack): Use __getpagesize instead of
9090         __sysconf to determine pagesize.
9092         * pthread_create.c: Include <atomic.h>.
9093         * allocatestack.c (allocate_stack): Implement coloring of the
9094         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
9095         size minus one.  Adjust users.
9096         * sysdeps/i386/i686/Makefile: New file.
9098 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
9100         * allocatestack.c: Improve comment throughout the file.
9102         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9103         (__lll_lock_wait): Add branch prediction.
9104         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
9105         (__lll_lock_wait): Likewise.
9106         (lll_unlock_wake_cb): Removed.
9108 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
9110         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
9111         _POSIX_THREAD_PRIORITY_SCHEDULING.
9113 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
9115         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9116         Fix return type of ptr___pthread_getspecific.
9118 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
9120         * Makefile (tests): Add tst-umask1.
9121         (tst-umask1-ARGS): Define.
9122         * tst-umask1.c: New file.
9124 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
9126         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
9127         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
9128         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
9129         pthread_rwlock_unlock.
9130         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
9131         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
9132         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
9133         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
9134         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9135         New file.
9136         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
9137         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9138         New file.
9139         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
9140         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
9141         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
9142         New file.
9143         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
9144         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
9145         New file.
9146         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
9147         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
9148         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
9149         New file.
9150         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
9151         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
9152         New file.
9153         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
9155         * Makefile (libpthread-routines): Remove lowlevelcond and
9156         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
9157         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
9158         and pthread_cond_broadcast.
9159         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
9160         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
9161         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
9162         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
9163         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
9164         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
9165         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
9166         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
9167         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
9168         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
9169         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
9170         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
9171         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
9172         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
9173         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
9174         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
9175         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
9176         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
9177         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
9178         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
9179         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
9180         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
9181         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
9182         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
9183         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
9184         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
9185         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
9186         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
9187         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
9188         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
9189         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
9191         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
9192         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
9193         of the code is moved to ...
9194         * sysdeps/pthread/createthread.c: ...here.  New file.
9196 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
9198         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
9199         (__new_sem_post): Clear %eax before returning.
9200         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
9202         * Makefile (tests): Add tst-cleanup2.
9203         * tst-cleanup2.c: New file.
9205         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
9206         Interpret first parameter correctly.
9208 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
9210         * Makefile (headers): Add bits/semaphore.h.
9212 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
9214         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
9215         if not SHARED.
9217 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
9219         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
9220         must be used and mapping failed.
9221         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
9223         * Makefile (CFLAGS-pthread_self.os): Define this, not
9224         CFLAGS-pthread_self.c.
9226 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9228         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
9229         lll_unlock_wake_cb.
9231         * Makefile (libpthread-routines): Add version.  Add rules to build
9232         version.os and banner.h.
9233         * version.c: New file.
9235 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
9237         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
9238         the alias unconditional.
9239         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
9241 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9243         * Makefile (CFLAGS-pthread_self.c): New definition.
9245 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9247         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
9248         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
9249         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
9250         * init.c (__pthread_initialize_minimal_internal): Likewise.
9252 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
9254         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
9256         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
9257         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9258         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9259         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
9260         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9261         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9263 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9265         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
9266         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
9267         * tst-cancel-wrappers.sh: Remove all exceptions.
9269 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
9271         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
9272         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
9274         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
9275         Use __libc_pthread_functions array if SHARED.
9277         * pthreadP.h: Move pthread_cond_2_0_t definition to...
9278         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
9280         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
9281         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
9282         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
9283         __libc_ptf_call instead of __libc_maybe_call.
9284         (PTF): New #define.
9285         (__libc_cleanup_region_start): Wrap function name with PTF call.
9286         (__libc_cleanup_region_end): Likewise.
9287         (__libc_cleanup_end): Likewise.
9289         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
9290         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
9291         * pthread_key_create.c: Add __pthread_key_create_internal alias.
9292         * pthreadP.h: Add prototypes.
9294         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
9295         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
9296         __pthread_rwlock_unlock aliases.
9297         * pthreadP.h: Add prototypes for new aliases.
9299         * pthreadP.h (struct pthead_functions): Moved to...
9300         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
9301         * init.c (pthread_functions): Add initializers for new elements.
9303         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
9304         __pthread_cleanup_pop_restore aliases.
9305         * pthreadP.h: Add prototypes.
9307         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
9308         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
9309         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
9310         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
9311         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
9312         * pthreadP.h: Adjust prototypes and callers.
9314 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
9316         * Makefile (tests): Add tst-cancel7.
9317         (tst-cancel7-ARGS): New variable.
9318         * tst-cancel7.c: New file.
9320         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
9321         around gcc defficiencies.
9322         * old_pthread_cond_signal.c: Likewise.
9323         * old_pthread_cond_timedwait.c: Likewise.
9324         * old_pthread_cond_wait.c: Likewise.
9326         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
9328 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9330         * Makefile (tests): Add tst-cond7.
9331         * tst-cond7.c: New file.
9333         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9334         (condvar_cleanup): Get condvar address from the right place.
9336         * atomic.h: Correct definitions of atomic_full_barrier,
9337         atomic_read_barrier, atomic_write_barrier.
9339         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
9340         race-free.
9341         * old_pthread_cond_signal.c: Likewise.
9342         * old_pthread_cond_timedwait.c: Likewise.
9343         * old_pthread_cond_wait.c: Likewise.
9345 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
9347         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
9349 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9351         * pthreadP.h (pthread_cond_2_0_t): New type.
9352         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
9353         Use new type for the 2.0 condvar function prototypes.
9354         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
9355         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
9356         parameter.
9357         * old_pthread_cond_destroy.c: Likewise.
9358         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
9359         * old_pthread_cond_signal.c: Likewise.
9360         * old_pthread_cond_timedwait.c: Likewise.
9361         * old_pthread_cond_wait.c: Likewise.
9363         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9364         (__pthread_cond_wait): Don't save cancellation mode and seq value
9365         in same location.
9367         * herrno.c (__h_errno_location): Don't define as weak.
9369 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9371         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
9372         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
9373         and pthread_cond_wait.
9374         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
9375         Renamed to...
9376         (__pthread_cond_broadcast_2_0): ... this.
9377         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
9378         Renamed to...
9379         (__pthread_cond_destroy_2_0): ... this.
9380         * old_pthread_cond_init.c (__old_pthread_cond_init):
9381         Renamed to...
9382         (__pthread_cond_init_2_0): ... this.
9383         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
9384         Renamed to...
9385         (__pthread_cond_signal_2_0): ... this.
9386         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
9387         Renamed to...
9388         (__pthread_cond_wait_2_0): ... this.
9389         * pthread_cond_destroy.c: Include shlib-compat.h.
9390         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
9391         * pthread_cond_init.c: Include shlib-compat.h.
9392         (pthread_cond_init): Change strong_alias into versioned_symbol.
9393         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
9394         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
9395         fields.
9396         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
9397         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
9398         __pthread_cond_wait_2_0): New prototypes.
9399         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
9400         __old_pthread_cond_init, __old_pthread_cond_signal,
9401         __old_pthread_cond_wait): Removed.
9402         * init.c: Include shlib-compat.h.
9403         (pthread_functions): Guard ptr___pthread_attr_init_2_0
9404         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
9405         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
9406         ptr___pthread_cond_*_2_0 fields.
9407         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
9408         pthread_cond_*@GLIBC_2.0 compatibility symbols.
9410         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
9411         LIBC_SIGACTION was not yet defined.
9412         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
9413         [!defined LIBC_SIGACTION] (__sigaction): New function and
9414         libc_hidden_weak.
9415         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
9416         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
9418 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9420         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
9422 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
9424         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
9425         New, larger type definition.
9426         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
9427         implementation.
9428         * Versions [libpthread]: Add definitions for new pthread_cond_*
9429         interfaces for version GLIBC_2.3.2.
9430         * pthread_cond_init.c: Update initialization for new type definition.
9431         * Makefile (libpthread-routines): Remove pthread_cond_wait,
9432         pthread_cond_timedwait, pthread_cond_signal, and
9433         pthread_cond_broadcast.  Add old_pthread_cond_init,
9434         old_pthread_cond_destroy, old_pthread_cond_wait,
9435         old_pthread_cond_timedwait, old_pthread_cond_signal, and
9436         old_pthread_cond_broadcast.
9437         * old_pthread_cond_broadcast.c: New file.
9438         * old_pthread_cond_destroy.c: New file.
9439         * old_pthread_cond_init.c: New file.
9440         * old_pthread_cond_signal.c: New file.
9441         * old_pthread_cond_timedwait.c: New file.
9442         * old_pthread_cond_wait.c: New file.
9443         * pthreadP.h: Add prototypes for the compatibility interfaces.
9445         * pthread_cond_destroy.c: Don't include <errno.h>.
9447 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
9449         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
9450         unnecessary zero offset when addressing MUTEX.
9452 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9454         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
9455         __register_atfork.
9456         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
9457         for __register_atfork.
9459 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9461         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
9462         instead of ASSEMBLER test macro.
9464         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
9465         __libc_current_sigrtmax): Add libc_hidden_def.
9467         * sysdeps/pthread/list.h: Remove assert.h include.
9469 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9471         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
9472         __pthread_initialize_minimal_internal not
9473         __pthread_initialize_minimal.
9475 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
9477         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
9478         __pthread_initialize_minimal as hidden.
9480         * init.c (__pthread_initialize_minimal_internal): Don't mark as
9481         constructor.
9483 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9485         * Makefile ($(inst_libdir)/libpthread.so): Depend on
9486         $(common-objpfx)format.lds, include that into the output script.
9487         Fix comment.
9488         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
9490 2002-12-28  Andreas Jaeger  <aj@suse.de>
9492         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
9493         nsec resolution changes.
9494         (xstat64_conv): Likewise.
9495         (xstat32_conv): Likewise.
9496         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
9497         struct kernel_stat.
9498         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
9499         structs stat and stat64.
9500         * time/time.h (__timespec_defined): Define for __USE_MISC.
9501         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
9503 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
9505         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
9506         argument.
9507         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
9508         (pthread_exit): Use strong_alias to avoid warnings.
9509         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
9510         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
9511         ptr___pthread_attr_init_2_*.
9512         * init.c (pthread_functions): Adjust.
9514 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
9516         * forward.c: Make all functions available by default again.  It
9517         caused too much trouble.
9519         * pt-siglongjmp.c: Removed.
9521 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
9523         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
9524         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
9525         * sysdeps/i386/Makefile: New file.
9526         * sysdeps/i386/tcb-offsets.sym: New file.
9527         * sysdeps/pthread/tcb-offsets.h: New file.
9528         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9529         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
9531         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
9532         __register_atfork...
9533         (GLIBC_2.3.2): ...here.
9535 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9537         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
9538         pthread_attr_setstackaddr with __attribute_deprecated__.
9540 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9542         * pt-system.c (system): Remove cancellation handling.
9543         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
9544         cancellation routines.
9546 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9548         * descr.h: Include <dl-sysdep.h>.
9549         (struct pthread): Move header.data.list to the back of the struct.
9550         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
9551         (MULTIPLE_THREADS_OFFSET): Adjust offset.
9552         (SYSINFO_OFFSEET): Likewise.
9554 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9556         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
9557         Define.
9558         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
9559         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
9560         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
9561         (USE_DL_SYSINFO): Undef.
9563 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
9565         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
9566         $(common-objpfx)libc.so.
9567         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
9568         it is bigger than pipe buffer size even on arches with bigger
9569         page size.
9570         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
9572 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
9574         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
9575         correct errno access for case that USE___THREAD is not defined.
9577 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
9579         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
9580         Patch by Marijn Ros <marijn@mad.scientist.com>.
9582 2002-12-22  Roland McGrath  <roland@redhat.com>
9584         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
9586 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
9588         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
9590 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
9592         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
9593         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
9594         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
9596         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
9597         of int $0x80.
9598         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9599         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
9600         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
9601         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
9602         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
9603         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
9604         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
9605         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
9607         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
9608         sysenter.
9609         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
9611         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
9613         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
9614         in new TCB.
9615         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
9616         that sysinfo is properly initialized.
9617         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
9618         to 1 only for ld.so.
9620         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
9621         RTLD_CORRECT_DYNAMIC_WEAK.
9623 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
9625         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
9626         Use return 0 as 6th argument to FORWARD4.
9627         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
9629 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9631         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
9632         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
9633         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
9634         (INIT_SYSINFO): New #define.
9635         (TLS_TP_INIT): Use INIT_SYSINFO.
9636         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9637         At test to make sure SYSINFO_OFFSET value is correct.
9638         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
9640 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
9642         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
9643         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
9644         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
9645         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
9646         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
9647         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
9648         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
9650 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9652         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
9653         macro instead of using int $0x80 directly.
9655         * sysdeps/pthread/bits/stdio-lock.h: New file.
9656         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
9657         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
9658         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
9659         * Makefile (routines): Add libc-lowlevelmutex.
9661         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
9662         __i686.get_pc_thunk.dx.
9664 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9666         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
9667         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
9668         ($(objpfx)tst-cancel-wrappers.out): New rule.
9669         * tst-cancel-wrappers.sh: New test.
9670         * tst-locale1.c: Include signal.h.
9671         (uselocale): Test static linking of __libc_current_sigrt*.
9673 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
9675         * Makefile (tests): Add tst-cancel6.
9676         * tst-cancel6.c: New file
9678 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9680         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
9681         Define meaningfully for assembler as well.
9682         * pthreadP.h (struct pthread_functions): Remove
9683         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
9684         and ptr_pthread_attr_init_2_1 fields.
9685         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
9686         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
9687         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
9688         (FORWARD3): Define using FORWARD4.
9689         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
9690         versions.
9691         * pt-system.c: Remove duplicate stdlib.h include.
9693 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
9695         * sem_init.c: Define sem_init@GLIBC_2.0.
9696         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
9697         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
9699         * flockfile.c: Moved to...
9700         * sysdeps/pthread/flockfile.c: ...here.  New file.
9701         * funlockfile.c: Moved to...
9702         * sysdeps/pthread/funlockfile.c: ...here.  New file.
9703         * ftrylockfile.c: Moved to...
9704         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
9706 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
9708         * libc-cancellation.c: Guard both function with
9709         #if !defined NOT_IN_libc.
9710         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
9711         automatically provided pthread wrappers.
9712         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
9713         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
9714         nor in libpthread.
9715         * pt-open.c: Removed.
9716         * pt-fcntl.c: Removed.
9717         * pt-fsync.c: Removed.
9718         * pt-lseek.c: Removed.
9719         * pt-msgrcv.c: Removed.
9720         * pt-msgsnd.c: Removed.
9721         * pt-msync.c: Removed.
9722         * pt-nanosleep.c: Removed.
9723         * pt-open64.c: Removed.
9724         * pt-pause.c: Removed.
9725         * pt-pread.c: Removed.
9726         * pt-pread64.c: Removed.
9727         * pt-pwrite.c: Removed.
9728         * pt-pwrite64.c: Removed.
9729         * pt-read.c: Removed.
9730         * pt-recv.c: Removed.
9731         * pt-recvfrom.c: Removed.
9732         * pt-recvmsg.c: Removed.
9733         * pt-send.c: Removed.
9734         * pt-sendto.c: Removed.
9735         * pt-sigtimedwait.c: Removed.
9736         * pt-sigwait.c: Removed.
9737         * pt-wait.c: Removed.
9738         * pt-waitpid.c: Removed.
9739         * pt-write.c: Removed.
9740         * pt-accept.c: Removed.
9741         * pt-close.c: Removed.
9742         * pt-connect.c: Removed.
9743         * pt-lseek64.c: Removed.
9744         * pt-sendmsg.c: Removed.
9745         * pt-tcdrain.c: Removed.
9747 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
9749         * init.c (__pthread_initialize_minimal_internal): Renamed from
9750         __pthread_initialize_minimal.  Make old name an alias.  This
9751         converts a normal relocation into a relative relocation.
9753         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
9755         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
9756         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
9757         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
9758         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
9759         pt-sigwaitinfo, pt-waitid, and pt-writev.
9760         * pt-creat.c: Removed.
9761         * pt-poll.c: Removed.
9762         * pt-pselect.c: Removed.
9763         * pt-readv.c: Removed.
9764         * pt-select.c: Removed.
9765         * pt-sigpause.c: Removed.
9766         * pt-sigsuspend.c: Removed.
9767         * pt-sigwaitinfo.c: Removed.
9768         * pt-waitid.c: Removed.
9769         * pt-writev.c: Removed.
9771         * init.c (pthread_functions): New variable.
9772         (__pthread_initialize_minimal): Pass pointer to pthread_functions
9773         (or NULL) to __libc_pthread_init.
9774         * forward.c: Rewrite to use __libc:pthread_functions array to get
9775         function addresses.
9776         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
9777         prototype.
9778         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9779         Take new parameter.  Copy content of variable pointed to by it
9780         to __libc_pthread_init.
9782         * pthreadP.h (struct pthread_functions): New type.
9783         (__libc_pthread_init): Declare.
9785         * pthread_attr_destroy.c: Add namespace protected alias.
9786         * pthread_attr_getdetachstate.c: Likewise.
9787         * pthread_attr_getinheritsched.c: Likewise.
9788         * pthread_attr_getschedparam.c: Likewise.
9789         * pthread_attr_getschedpolicy.c: Likewise.
9790         * pthread_attr_getscope.c: Likewise.
9791         * pthread_attr_setdetachstate.c: Likewise.
9792         * pthread_attr_setinheritsched.c: Likewise.
9793         * pthread_attr_setschedparam.c: Likewise.
9794         * pthread_attr_setschedpolicy.c: Likewise.
9795         * pthread_attr_setscope.c: Likewise.
9796         * pthread_cond_broadcast.c: Likewise.
9797         * pthread_cond_destroy.c: Likewise.
9798         * pthread_cond_init.c: Likewise.
9799         * pthread_cond_signal.c: Likewise.
9800         * pthread_cond_wait.c: Likewise.
9801         * pthread_condattr_destroy.c: Likewise.
9802         * pthread_condattr_init.c: Likewise.
9803         * pthread_equal.c: Likewise.
9804         * pthread_exit.c: Likewise.
9805         * pthread_getschedparam.c: Likewise.
9806         * pthread_self.c: Likewise.
9807         * pthread_setcancelstate.c: Likewise.
9808         * pthread_setschedparam.c: Likewise.
9809         * pthread_mutex_destroy.c: Likewise.
9810         * pthread_mutex_init.c: Likewise.
9811         * pthreadP.h: Add prototypes for the aliases.
9813         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
9814         multiple_threads member in correct TCB to 1.
9816         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
9817         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
9818         member of thread decriptor, otherwise return unconditionally 1.
9820 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9822         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
9823         regular Linux version.  Remove file.
9824         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
9825         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
9826         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
9827         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
9828         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
9829         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
9830         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
9831         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
9832         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
9833         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
9834         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
9835         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
9836         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
9837         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
9838         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
9839         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
9840         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
9841         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
9842         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
9843         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
9844         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
9845         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
9846         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
9847         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
9848         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
9849         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
9850         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
9851         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
9852         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
9853         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
9855 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9857         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
9858         * sysdeps/unix/sysv/linux/open.c: Removed.
9859         * sysdeps/unix/sysv/linux/fsync.c: Removed.
9860         * sysdeps/unix/sysv/linux/lseek.c: Removed.
9861         * sysdeps/unix/sysv/linux/msync.c: Removed.
9862         * sysdeps/unix/sysv/linux/read.c: Removed.
9863         * sysdeps/unix/sysv/linux/close.c: Removed.
9864         * sysdeps/unix/sysv/linux/creat.c: Removed.
9865         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
9866         * sysdeps/unix/sysv/linux/pause.c: Removed.
9867         * sysdeps/unix/sysv/linux/select.c: Removed.
9868         * sysdeps/unix/sysv/linux/write.c: Removed.
9870 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9872         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
9873         element in TCB to see whether locking is needed.
9875         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
9876         MULTIPLE_THREADS_OFFSET value is correct.
9878         * sysdeps/unix/sysv/linux/close.c: New file.
9879         * sysdeps/unix/sysv/linux/connect.S: New file.
9880         * sysdeps/unix/sysv/linux/creat.c: New file.
9881         * sysdeps/unix/sysv/linux/fsync.c: New file.
9882         * sysdeps/unix/sysv/linux/llseek.c: New file.
9883         * sysdeps/unix/sysv/linux/lseek.c: New file.
9884         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
9885         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
9886         * sysdeps/unix/sysv/linux/msync.c: New file.
9887         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
9888         * sysdeps/unix/sysv/linux/open.c: New file.
9889         * sysdeps/unix/sysv/linux/open64.c: New file.
9890         * sysdeps/unix/sysv/linux/pause.c: New file.
9891         * sysdeps/unix/sysv/linux/poll.c: New file.
9892         * sysdeps/unix/sysv/linux/pread.c: New file.
9893         * sysdeps/unix/sysv/linux/pread64.c: New file.
9894         * sysdeps/unix/sysv/linux/pselect.c: New file.
9895         * sysdeps/unix/sysv/linux/pwrite.c: New file.
9896         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
9897         * sysdeps/unix/sysv/linux/readv.c: New file.
9898         * sysdeps/unix/sysv/linux/recv.S: New file.
9899         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
9900         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
9901         * sysdeps/unix/sysv/linux/select.c: New file.
9902         * sysdeps/unix/sysv/linux/send.S: New file.
9903         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
9904         * sysdeps/unix/sysv/linux/sendto.S: New file.
9905         * sysdeps/unix/sysv/linux/sigpause.c: New file.
9906         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
9907         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
9908         * sysdeps/unix/sysv/linux/sigwait.c: New file.
9909         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
9910         * sysdeps/unix/sysv/linux/system.c: New file.
9911         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
9912         * sysdeps/unix/sysv/linux/wait.c: New file.
9913         * sysdeps/unix/sysv/linux/waitid.c: New file.
9914         * sysdeps/unix/sysv/linux/waitpid.c: New file.
9915         * sysdeps/unix/sysv/linux/writev.c: New file.
9916         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
9918         * pt-readv.c: Fix comment.
9920 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9922         * tst-cleanup1.c: Include stdlib.h.
9924         * tst-cancel5.c: New test.
9925         * Makefile (tests): Add tst-cancel5.
9926         (tst-cancel5): Link against libc.so libpthread.so in that order.
9928 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
9930         * forward.c (test_loaded): Prevent recursive calls.
9932         * Makefile (routines): Add libc-cancellation.
9933         * libc-cancellation.c: New file.
9934         * descr.h (struct pthread): Add multiple_threads field.
9935         * allocatestack.c (allocate_stack): Initialize multiple_header field of
9936         new thread descriptor to 1.
9937         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
9938         Initialize multiple_thread field after successful thread creation.
9939         * cancellation.c (__do_cancel): Move to pthreadP.h.
9940         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
9941         (__pthread_disable_asynccancel): Add internal_function attribute.
9942         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
9943         * pthread_setcancelstate.c: Likewise.
9944         * pthread_setcanceltype.c: Likewise.
9945         * pthread_exit.c: Likewise.
9946         * pthreadP.h (CANCELLATION_P): Likewise.
9947         (__do_cancel): Define as static inline.
9948         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
9949         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
9950         declarations.
9951         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
9952         fields.  Define MULTIPLE_THREADS_OFFSET.
9953         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
9954         declaration.
9955         * sysdeps/unix/sysv/linux/accept.S: New file.
9956         * sysdeps/unix/sysv/linux/read.c: New file.
9957         * sysdeps/unix/sysv/linux/write.c: New file.
9958         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
9959         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
9960         initialization of __libc_locking_needed.
9961         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
9962         __libc_locking_needed, use multiple_threads field in TCB.
9963         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9965 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
9967         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
9968         version.
9969         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
9971         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
9972         access to __libc_locking_needed for PIC.
9974 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
9976         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
9977         declare for libc.so.
9978         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
9979         expression.
9980         (__libc_lock_lock): Put into statement expression.
9981         (__libc_lock_unlock): Remove trailing semicolon.
9982         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
9984 2002-12-12  Roland McGrath  <roland@redhat.com>
9986         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
9987         "m" constraint to refer to __libc_locking_needed.  Declare it here.
9989 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
9991         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
9992         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
9993         Initialize __libc_locking_needed.
9994         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
9995         instead of __register_pthread_fork_handler.
9996         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
9997         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
9998         fork-gen with libc_pthread_init.
9999         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
10000         of __register_pthread_fork_handler.
10001         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
10002         of __register_pthread_fork_handler.
10003         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
10004         __libc_locking_needed to determine whether lock prefix can be avoided.
10005         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10007 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
10009         * Makefile (tests): Add tst-cleanup1.
10010         * tst-cleanup1.c: New file.
10011         * cancellation.c (__cleanup_thread): Removed.
10012         (__do_cancel): Remove call to __cleanup_thread.
10013         * pthreadP.h: Remove __cleanup_thread prorotype.
10015         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
10016         Remember function and argument even if cancellation handler
10017         function is not available.
10018         (__libc_cleanup_region_end): Execute registered function directly if
10019         pthread functions are not available.
10020         (__libc_cleanup_end): Likewise.
10022         * init.c (__pthread_initialize_minimal): Fix initialization in
10023         static lib by preventing gcc from being too clever.
10025 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
10027         * init.c (__pthread_initialize_minimal): Remove unneccesary
10028         sigaddset call.
10030         * Makefile (tests): We can run tst-locale2 now.
10032 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
10034         * Versions: Remove duplicated sigwait entry.
10036 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
10038         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
10039         inside libpthread.
10041         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
10043         * pthreadP.h: Declare __pthread_enable_asynccancel and
10044         __pthread_disable_asynccancel.
10045         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
10046         (CANCEL_RESET): Use __pthread_disable_asynccancel.
10047         * cancellation.c (__pthread_enable_asynccancel): New function.
10048         (__pthread_disable_asynccancel): New function.
10049         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
10050         * pt-close.c: Likewise.
10051         * pt-connect.c: Likewise.
10052         * pt-creat.c: Likewise.
10053         * pt-fcntl.c: Likewise.
10054         * pt-fsync.c: Likewise.
10055         * pt-lseek.c: Likewise.
10056         * pt-lseek64.c: Likewise.
10057         * pt-msgrcv.c: Likewise.
10058         * pt-msgsnd.c: Likewise.
10059         * pt-msync.c: Likewise.
10060         * pt-nanosleep.c: Likewise.
10061         * pt-open.c: Likewise.
10062         * pt-open64.c: Likewise.
10063         * pt-pause.c: Likewise.
10064         * pt-poll.c: Likewise.
10065         * pt-pread.c: Likewise.
10066         * pt-pread64.c: Likewise.
10067         * pt-pselect.c: Likewise.
10068         * pt-pwrite.c: Likewise.
10069         * pt-pwrite64.c: Likewise.
10070         * pt-read.c: Likewise.
10071         * pt-readv.c: Likewise.
10072         * pt-recv.c: Likewise.
10073         * pt-recvfrom.c: Likewise.
10074         * pt-recvmsg.c: Likewise.
10075         * pt-select.c: Likewise.
10076         * pt-send.c: Likewise.
10077         * pt-sendmsg.c: Likewise.
10078         * pt-sendto.c: Likewise.
10079         * pt-sigpause.c: Likewise.
10080         * pt-sigsuspend.c: Likewise.
10081         * pt-sigtimedwait.c: Likewise.
10082         * pt-sigwait.c: Likewise.
10083         * pt-sigwaitinfo.c: Likewise.
10084         * pt-system.c: Likewise.
10085         * pt-tcdrain.c: Likewise.
10086         * pt-wait.c: Likewise.
10087         * pt-waitid.c: Likewise.
10088         * pt-waitpid.c: Likewise.
10089         * pt-write.c: Likewise.
10090         * pt-writev.c: Likewise.
10091         * pthread_join.c: Likewise.
10092         * pthread_timedjoin.c: Likewise.
10094         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
10095         (__xpg_sigpause): New function.
10096         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
10098 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
10100         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
10102         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
10103         _GI_pthread_cleanup_pop to pthreadP.h.
10105         * ftrylockfile.c: Use _IO_lock_trylock instead of
10106         pthread_mutex_trylock.
10108         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
10109         (CANCEL_RESET): Likewise.
10110         (__pthread_setcanceltype_): Declare.
10111         (__pthread_mutex_lock_internal): Declare.
10112         (__pthread_mutex_unlock_internal): Declare.
10113         (__pthread_once_internal): Declare.
10114         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
10115         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
10117         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
10118         and pthread_mutex_unlock.
10119         * pthread_cond_wait.c: Likewise.
10120         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
10121         * pthread_mutex_unlock.c: Likewise.
10123         * pthread_setcanceltype.c: Add additional alias
10124         __pthread_setcanceltype.
10126         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
10127         * sem_open.c (sem_open): Likewise.
10128         Use __libc_open, __libc_write, and __libc_close instead of
10129         open, write, and close respectively.
10131         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
10132         Rewrite as statement expression since it must return a value.
10134         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
10135         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
10136         __pthread_kill.
10138         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
10139         alias __pthread_once_internal.
10141         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
10143 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
10145         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
10146         * tst-stdio1.c: New file.
10147         * tst-stdio2.c: New file.
10149         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
10151         * Makefile (tests): Comment out tst-locale2 for now.
10152         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
10154         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
10155         -D_IO_MTSAFE_IO.
10156         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
10157         Use _IO_lock_init instead of explicit assignment.
10159         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
10160         Define __libc_lock_* and __libc_lock_recursive macros with
10161         lowlevellock macros, not pthread mutexes.
10163         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
10164         of pthread_mutex_lock.
10165         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
10166         instead of pthread_mutex_unlock.
10168 2002-12-06  Roland McGrath  <roland@redhat.com>
10170         * allocatestack.c (__stack_user): Use uninitialized defn.
10171         * init.c (__pthread_initialize_minimal): Initialize it here.
10173 2002-12-05  Roland McGrath  <roland@redhat.com>
10175         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
10176         string.
10177         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
10179         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
10180         missing & here too.
10182 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
10184         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10185         lowlevellock.
10186         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
10187         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
10188         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
10189         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
10190         for __libc_lock_* macros.
10191         * Makefile (routines): Add libc-lowlevellock.
10193 2002-10-09  Roland McGrath  <roland@redhat.com>
10195         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
10196         Under [__PIC__], call the function via the pointer fetched for
10197         comparison rather than a call by name that uses the PLT.
10198         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
10199         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
10200         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
10201         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
10202         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
10204 2002-12-04  Roland McGrath  <roland@redhat.com>
10206         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
10208         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
10209         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
10211         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
10213 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10215         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
10216         a completely opaque, non-integer type.
10217         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
10219 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
10221         * sysdeps/i386/tls.h: Include stdlib.h.
10222         * sysdeps/x86_64/tls.h: Likewise.
10224 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10226         * Makefile (tests): Add tst-locale2.
10227         (tests-static): Likewise.
10228         * tst-locale2.c: New file.
10230         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
10231         volatile and add memory clobbers to lock operations.
10233 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
10235         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
10236         * sysdeps/i386/i486/bits/atomic.h: New file.
10237         * sysdeps/i386/i586/bits/atomic.h: New file.
10238         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
10239         include i486 version.
10240         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
10241         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
10242         Patch by Marijn Ros <marijn@mad.scientist.com>.
10244         * allocatestack.c (get_cached_stack): Don't crash if we first
10245         found a stack with a larger size then needed.
10246         Reported by Hui Huang <hui.huang@sun.com>.
10248         * Makefile (tests): Add tst-sysconf.
10249         * tst-sysconf.c: New file.
10251         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
10252         PTHREAD_THREADS_MAX.
10254 2002-12-02  Roland McGrath  <roland@redhat.com>
10256         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
10257         Declare using hidden_proto instead of attribute_hidden, so there are
10258         non-.hidden static symbols for gdb to find.
10259         (__pthread_keys): Likewise.
10260         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
10261         * allocatestack.c (__stack_user): Likewise.
10262         * pthread_create.c (__pthread_keys): Likewise.
10263         (__nptl_threads_events, __nptl_last_event): Make these static instead
10264         of hidden.
10265         * pthread_key_create.c (__pthread_pthread_keys_max,
10266         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
10268 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
10270         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
10271         statically.
10272         * tst-locale1.c: New file.
10274         * pthread_cond_timedwait.c: Include <stdlib.h>.
10276         * Makefile (tests): Add tst-fork2 and tst-fork3.
10277         * tst-fork2.c: New file.
10278         * tst-fork3.c: New file.
10280 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
10282         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
10284         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
10285         require it to 200112L.
10287         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
10288         instruction only if HAVE_CMOV is defined.
10289         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
10291         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
10293         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
10295         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
10297         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
10299 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
10301         * sysdeps/x86_64/bits/atomic.h: New file.
10303         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
10304         16-bit operations.
10306         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
10307         possible since gettid cannot fail.
10309         * sysdeps/x86_64/pthreaddef.h: New file.
10311         * sysdeps/i386/pthreaddef.h (gettid): Removed.
10313         * sysdeps/x86_64/pthread_spin_init.c: New file.
10314         * sysdeps/x86_64/pthread_spin_lock.c: New file.
10315         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
10316         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
10318         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
10319         Add missing lock prefix.  Minute optimization.
10321         * tst-spin2.c (main): Also check successful trylock call.
10323         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
10324         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
10326         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
10327         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
10329         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
10330         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
10331         value in case of an error.  Add support for INTERNAL_SYSCALL.
10333         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
10334         value in case of an error.
10336         * sysdeps/x86_64/tls.h: New file.
10338 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10340         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
10341         takes the array member name and the index as parameters.
10342         (THREAD_SETMEM_NC): Likewise.
10343         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
10344         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
10345         interfaces.
10347         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
10348         to decide which code to use.
10349         (THREAD_SETMEM_NC): Likewise.
10351         * allocatestack.c (queue_stack): Don't remove stack from list here.
10352         Do it in the caller.  Correct condition to prematurely terminate
10353         loop to free stacks.
10354         (__deallocate_stack): Remove stack from list here.
10356 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10358         * Makefile (tests): Add tst-stack1.
10359         * tst-stack1.c: New file.
10361         * allocatestack.c (allocate_stack): Initialize the TCB on a user
10362         provided stack.
10364         * pthread_attr_getstack.c: Return bottom of the thread area.
10366 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
10368         * Makefile (libpthread-routines): Add pt-allocrtsig and
10369         pthread_kill_other_threads.
10370         * pt-allocrtsig.c: New file.
10371         * pthread_kill_other_threads.c: New file.
10372         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
10373         all three functions.
10374         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10375         allocrtsig.
10376         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
10377         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
10378         and __libc_allocate_rtsig_private.
10379         * Versions (libpthread): Export pthread_kill_other_threads_np,
10380         __libc_current_sigrtmin, and __libc_current_sigrtmax.
10382 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
10384         * allocatestack.c (allocate_stack): stackaddr in attribute points to
10385         the end of the stack.  Adjust computations.
10386         When mprotect call fails dequeue stack and free it.
10387         * pthread_attr_setstack.c: Store top of the stack in stackaddr
10388         attribute.
10389         * pthread_getattr_np.c: Likewise.
10391         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
10392         surprises.
10394 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
10396         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
10397         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10399 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
10401         * pthread_getspecific.c: Optimize access to first 2nd-level array.
10402         * pthread_setspecific.c: Likewise.
10404 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
10406         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
10407         definitions.  Get them from the official place.
10408         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
10410         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
10411         Use new CLONE_ flags in clone() calls.
10413         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
10414         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
10416         * Versions: Add pthread_* functions for libc.
10417         * forward.c: New file.
10419         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
10420         errno-loc.
10421         * herrno.c: New file.
10422         * res.c: New file.
10424         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
10425         sem_trywait, and sem_timedwait.  Add herrno and res.
10426         * sem_init.c: Don't initialize lock and waiters members.
10427         * sem_open.c: Likewise.
10428         * sem_post.c: Removed.
10429         * sem_wait.c: Removed.
10430         * sem_trywait.c: Removed.
10431         * sem_timedwait.c: Removed.
10432         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
10433         Includes full implementations of sem_post, sem_wait, sem_trywait,
10434         and sem_timedwait.
10435         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
10436         for new implementation.
10437         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
10438         and waiters fields.
10440         * tst-sem3.c: Improve error message.
10441         * tst-signal3.c: Likewise.
10443         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
10444         to tell the kernel about the termination futex and to initialize tid
10445         member.  Don't initialize main_thread.
10446         * descr.h (struct pthread): Remove main_thread member.
10447         * cancelllation.c (__do_cancel): Remove code handling main thread.
10448         The main thread is not special anymore.
10450         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
10451         size of the stacks to stack_cache_actsize.
10453         * pt-readv.c: Add missing "defined".
10454         * pt-sigwait.c: Likewise.
10455         * pt-writev.c: Likewise.
10457 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
10459         * Versions: Export __connect from libpthread.
10460         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10462         * Makefile (libpthread-routines): Add pt-raise.
10463         * sysdeps/unix/sysv/linux/raise.c: New file.
10464         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
10465         * sysdeps/generic/pt-raise.c: New file.
10467         * pthread_cond_init.c: Initialize all data elements of the condvar
10468         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10470         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
10471         * pthread_create.c: Likewise.
10473         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
10474         * tst-key1.c: New file.
10475         * tst-key2.c: New file.
10476         * tst-key3.c: New file.
10478         * Versions: Export pthread_detach for version GLIBC_2.0.
10479         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
10481 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
10483         * pthread_key_create.c: Terminate search after an unused key was found.
10484         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10486         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
10487         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10489 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
10491         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
10492         dynamic lookup for errno in PIC.
10494         * allocatestack.c (get_cached_stack): Rearrange code slightly to
10495         release the stack lock as soon as possible.
10496         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
10497         the static TLS block.
10498         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
10500         * cancellation.c: Renamed from cancelation.c.
10501         * Makefile: Adjust accordingly.
10502         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
10503         * cleanup_defer.c: Use CANCELLATION_P.
10504         * pthread_testcancel.c: Likewise.
10505         * descr.h: Fix spelling in comments.
10506         * init.c: Likewise.
10507         * pthread_getattr_np.c: Likewise.
10508         * pthread_getschedparam.c: Likewise.
10509         * pthread_setschedparam.c: Likewise.
10510         * Versions: Likewise.
10512         * pt-pselect.c: New file.
10513         * Makefile (libpthread-routines): Add pt-pselect.
10514         * Versions: Add pselect.
10516         * tst-cancel4.c: New file.
10517         * Makefile (tests): Add tst-cancel4.
10519 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
10521         * pthread_mutex_lock.c: Always record lock ownership.
10522         * pthread_mutex_timedlock.c: Likewise.
10523         * pthread_mutex_trylock.c: Likewise.
10525         * pt-readv.c: New file.
10526         * pt-writev.c: New file.
10527         * pt-creat.c: New file.
10528         * pt-msgrcv.c: New file.
10529         * pt-msgsnd.c: New file.
10530         * pt-poll.c: New file.
10531         * pt-select.c: New file.
10532         * pt-sigpause.c: New file.
10533         * pt-sigsuspend.c: New file.
10534         * pt-sigwait.c: New file.
10535         * pt-sigwaitinfo.c: New file.
10536         * pt-waitid.c: New file.
10537         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
10538         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
10539         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
10540         * Versions: Add all the new functions.
10542         * tst-exit1.c: New file.
10543         * Makefile (tests): Add tst-exit1.
10545         * sem_timedwait.c: Minor optimization for more optimal fastpath.
10547 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
10549         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
10551         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
10552         call.  pthread_join is an official cancellation point.
10553         * pthread_timedjoin.c: Likewise.
10555         * pthread_cond_wait.c: Revert order in which internal lock are dropped
10556         and the condvar's mutex are retrieved.
10557         * pthread_cond_timedwait.c: Likewise.
10558         Reported by dice@saros.East.Sun.COM.
10560 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
10562         * pthreadP.h: Cut out all type definitions and move them...
10563         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
10564         * pthreadP.h: Include <internaltypes.h>.
10566         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
10567         performance tweaks.
10569         * sem_trywait.c: Shuffle #includes around to get right order.
10570         * sem_timedwait.c: Likewise.
10571         * sem_post.c: Likewise.
10572         * sem_wait.c: Likewise.
10574         * nptl 0.3 released.
10576         * Makefile (tests): Add tst-signal3.
10577         * tst-signal3.c: New file.
10579 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
10581         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
10582         the asms modify the sem object.
10583         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
10585         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
10586         the actual members.
10587         * pthreadP.h (struct sem): New type.  Actual semaphore type.
10588         * semaphoreP.h: Include pthreadP.h.
10589         * sem_getvalue.c: Adjust to sem_t change.
10590         * sem_init.c: Likewise.
10591         * sem_open.c: Likewise.
10592         * sem_post.c: Likewise.
10593         * sem_timedwait.c: Likewise.
10594         * sem_trywait.c: Likewise.
10595         * sem_wait.c: Likewise.
10597 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
10599         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
10600         * tst-basic2.c: New file.
10601         * tst-exec1.c: New file.
10602         * tst-exec2.c: New file.
10603         * tst-exec3.c: New file.
10605         * tst-fork1.c: Remove extra */.
10607         * nptl 0.2 released.  The API for IA-32 is complete.