Updated to fedora-glibc-20090427T1419
[glibc/history.git] / nptl / ChangeLog
blob0a928a91b90d9429c2a2fb923603d2cc8c4fed86
1 2009-04-26  Ulrich Drepper  <drepper@redhat.com>
3         * sem_open.c (sem_open): Rewrite initialization of initsem to
4         avoid warnings.
6         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
7         Avoid warning by using may_alias attribute on ptrhack.
9 2009-04-22  Ulrich Drepper  <drepper@redhat.com>
11         [BZ #10090]
12         * pthread_attr_setschedparam.c (__pthread_attr_setschedparam):
13         Check policy and priority for validity.
14         Patch mostly by Zhang Xiliang <zhangxiliang@cn.fujitsu.com>.
16 2009-03-15  Ulrich Drepper  <drepper@redhat.com>
18         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
19         (__pthread_cond_timedwait): Change to use cfi directives instead of
20         hand-coded unwind sections.
22 2009-03-10  Ulrich Drepper  <drepper@redhat.com>
24         * init.c (nptl_freeres): Compile only for SHARED.
26 2009-03-09  Jakub Jelinek  <jakub@redhat.com>
28         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Define
29         FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET, FUTEX_CLOCK_REALTIME and
30         FUTEX_BITSET_MATCH_ANY.
32 2009-02-27  Roland McGrath  <roland@redhat.com>
34         * init.c (__nptl_initial_report_events): Mark __attribute_used__.
35         * pthread_create.c (__nptl_threads_events, __nptl_last_event): Likewise.
37 2009-02-26  Ulrich Drepper  <drepper@redhat.com>
39         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
40         _POSIX_THREAD_ROBUST_PRIO_INHERIT and
41         _POSIX_THREAD_ROBUST_PRIO_PROTECT.  Reset value of macros from
42         200112L to 200809L.
44 2009-02-25  Ulrich Drepper  <drepper@redhat.com>
46         * sysdeps/pthread/pthread.h: The robust mutex functions are in
47         POSIX 2008.
49 2009-02-24  Ulrich Drepper  <drepper@redhat.com>
51         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_BITS_POSIX_OPT_H):
52         Unify name of include protector macro.
54 2009-02-14  SUGIOKA Toshinobu  <sugioka@itonet.co.jp>
56         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
57         LOAD_FUTEX_WAIT_ABS even if (FUTEX_WAIT == 0).
59 2009-01-29  Ulrich Drepper  <drepper@redhat.com>
61         * sysdeps/pthread/unwind-forcedunwind.c: Encrypt all function
62         pointer variables.
64         * allocatestack.c (__free_stacks): Renamed from free_stacks.
65         (__free_stack_cache): Removed.  Change callers to call __free_stacks.
66         * init.c (nptl_freeres): New function.
67         (pthread_functions): Initialize ptr_freeres to nptl_freeres.
68         * pthreadP.h: Don't declare __free_stack_cache.  Declare __free_stacks.
69         * sysdeps/pthread/unwind-forcedunwind.c (libgcc_s_handle): New
70         variable.
71         (pthread_cancel_init): Depend in libgcc_s_handle for decision to
72         load DSO.  Assign last.
73         (__unwind_freeres): New function.
75         * allocatestack.c (__reclaim_stacks): Reset in_flight_stack later
76         for better debugging.  No need to use stack_list_add here.
78 2009-01-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
80         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
81         (__lll_timedlock_wait): Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME
82         instead of computing relative timeout.
83         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
84         FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
86 2009-01-25  Ulrich Drepper  <drepper@redhat.com>
88         * pthread_mutex_lock.c (__pthread_mutex_lock): Remove unused label out.
90 2009-01-08  Ulrich Drepper  <drepper@redhat.com>
92         * sysdeps/pthread/list.h (list_add): Initialize new element first.
93         (list_add_tail): Removed.
95 2009-01-04  Ulrich Drepper  <drepper@redhat.com>
97         * init.c (__pthread_initialize_minimal_internal): Optimize test
98         FUTEX_CLOCK_REALTIME a bit.
100 2009-01-03  Ulrich Drepper  <drepper@redhat.com>
102         * init.c (__pthread_initialize_minimal_internal): Cheat a bit by
103         only passing five parameters to FUTEX_WAIT_BITSET call.
105         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
106         (__lll_timedlock_wait): Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME
107         instead of computing relative timeout.
109 2009-01-02  Ulrich Drepper  <drepper@redhat.com>
111         * init.c (__pthread_initialize_minimal_internal): Check for
112         FUTEX_CLOCK_REALTIME flag.
113         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
114         Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME instead of computing
115         relative timeout.
117         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
118         FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
119         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
120         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
121         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
122         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
124 2008-12-09  Ulrich Drepper  <drepper@redhat.com>
126         * sysdeps/pthread/pthread.h (pthread_cleanup_pop): Use { } as empty
127         loop body instead of ; to avoid gcc warnings.
128         (pthread_cleanup_pop_restore_np): Likewise.
129         Patch by Caolán McNamara <caolanm@redhat.com>.
131 2008-12-09  Jakub Jelinek  <jakub@redhat.com>
133         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle only the
134         fast path here, for robust/PI/PP mutexes call
135         __pthread_mutex_lock_full.  Don't use switch, instead use a series
136         of ifs according to their probability.
137         (__pthread_mutex_lock_full): New function.
138         * pthread_mutex_unlock.c: Include assert.h.
139         (__pthread_mutex_unlock_usercnt): Handle only the
140         fast path here, for robust/PI/PP mutexes call
141         __pthread_mutex_unlock_full.  Don't use switch, instead use a series
142         of ifs according to their probability.
143         (__pthread_mutex_unlock_full): New function.
144         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c
145         (__pthread_mutex_lock_full): Define.
147 2008-12-08  Ulrich Drepper  <drepper@redhat.com>
149         * sysdeps/x86_64/tls.h (tcbhead_t): Add fields reserved for TM
150         implementation.  Add necessary padding and.
151         * descr.h (struct pthread): Increase padding for tcbhead_t to 24
152         words.
154 2008-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
156         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define FUTEX_WAIT_BITSET
157         and FUTEX_WAKE_BITSET.
159 2008-12-02  Ulrich Drepper  <drepper@redhat.com>
161         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_WAIT_BITSET
162         and FUTEX_WAKE_BITSET.
163         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
164         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
165         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
166         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
168 2008-11-25  Roland McGrath  <roland@redhat.com>
170         * sysdeps/alpha, sysdeps/unix/sysv/linux/alpha:
171         Subdirectories moved to ports repository as
172         sysdeps/.../nptl subdirectories.
174 2008-11-12  Jakub Jelinek  <jakub@redhat.com>
176         [BZ #7008]
177         * pthread_condattr_setclock.c (pthread_condattr_setclock): Fix masking
178         of old value.
179         * pthread_cond_init.c (__pthread_cond_init): Fix
180         cond->__data.__nwaiters initialization.
181         * Makefile (tests): Add tst-cond23.
182         * tst-cond23.c: New test.
184 2008-11-07  Jakub Jelinek  <jakub@redhat.com>
186         * sysdeps/pthread/malloc-machine.h (MALLOC): Adjust __libc_tsd_define
187         arguments.
188         (tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get}
189         arguments.
191 2008-11-01  Ulrich Drepper  <drepper@redhat.com>
193         [BZ #6955]
194         * pthread_mutex_lock.c: Add support for private PI mutexes.
195         * pthread_mutex_timedlock.c: Likewise.
196         * pthread_mutex_trylock.c: Likewise.
197         * pthread_mutex_unlock.c: Likewise.
198         Patch mostly by Ben Jackson <ben@ben.com>.
200 2008-10-31  Ulrich Drepper  <drepper@redhat.com>
202         [BZ #6843]
203         * sysdeps/pthread/gai_misc.h (__gai_create_helper_thread):
204         Increase stack size for helper thread.
206 2008-10-06  Martin Schwidefsky  <schwidefsky@de.ibm.com>
208         * sysdeps/s390/tls.h (THREAD_SET_STACK_GUARD): Add empty inline
209         assembly with a clobber list for access registers a0 and a1.
211 2008-09-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
213         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Add memory barrier
214         to force runp->refcntr to be read from memory.
216 2008-09-08  Richard Guenther  <rguenther@suse.de>
218         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_lock,
219         lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
220         lll_timedlock, lll_robust_timedlock, lll_unlock,
221         lll_robust_unlock): Promote private to int.
223 2008-08-15  Ulrich Drepper  <drepper@redhat.com>
225         * sysdeps/x86_64/pthreaddef.h: Remove ARCH_MAP_FLAGS and
226         ARCH_RETRY_MMAP definitions.
227         * allocatestack.c: Remove definition of ARCH_MAP_FLAGS.
228         Define MAP_STACK when not defined.
229         (allocate_stack): Use MAP_STACK instead of ARCH_MAP_FLAGS.  Remove
230         handling of ARCH_RETRY_MMAP.
232 2008-07-30  Ulrich Drepper  <drepper@redhat.com>
234         * tst-align2.c (f): Print message that f is reached.
236 2008-04-28  Hiroki Kaminaga  <kaminaga@sm.sony.co.jp>
238         [BZ #6740]
239         * sysdeps/powerpc/tcb-offsets.sym (PRIVATE_FUTEX_OFFSET): Guard symbol
240         definition with #ifndef __ASSUME_PRIVATE_FUTEX.
242 2008-07-25  Ulrich Drepper  <drepper@redhat.com>
244         * sysdeps/unix/sysv/linux/mq_notify.c (init_mq_netlink): Use
245         SOCK_CLOEXEC if possible.
247 2008-05-29  Ulrich Drepper  <drepper@redhat.com>
249         * Makefile (tests): Add tst-rwlock2a.
250         * tst-rwlock2.c: Use TYPE macro to decide what rwlock type to use.
251         * tst-rwlock2a.c: New file.
253 2008-06-12  Ulrich Drepper  <drepper@redhat.com>
255         * sysdeps/pthread/pthread.h: Remove inadvertant checkin.
257 2008-05-17  Samuel Thibault  <samuel.thibault@ens-lyon.org>
259         * sysdeps/pthread/pthread.h: Fix typo in comment.
261 2008-05-28  Ulrich Drepper  <drepper@redhat.com>
263         * sysdeps/pthread/createthread.c (do_clone): Pass accurate length
264         of CPU set to the kernel.
266 2008-05-23  Paul Pluzhnikov  <ppluzhnikov@google.com>
268         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Add
269         cfi directives.
270         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
271         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
272         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
273         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
274         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
275         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
277 2008-05-22  Paul Pluzhnikov  <ppluzhnikov@google.com>
279         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S: Add
280         cfi directives.
281         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
282         Likewise.
283         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
284         Likewise.
285         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
286         Likewise.
288 2008-05-26  Ulrich Drepper  <drepper@redhat.com>
290         * tst-typesizes.c: Explicitly check __SIZEOF_PTHREAD_* constants.
292 2008-05-20  Jakub Jelinek  <jakub@redhat.com>
294         David S. Miller  <davem@davemloft.net>
296         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
298 2008-05-10  Ulrich Drepper  <drepper@redhat.com>
300         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Access
301         __pshared correctly.
302         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
303         Likewise.
304         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
305         Likewise.
306         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
307         Likewise.
308         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
309         Likewise.
310         Reported by Clemens Kolbitsch <clemens.kol@gmx.at>.
312 2008-04-14  David S. Miller  <davem@davemloft.net>
314         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
315         (__old_sem_wait): Fix argument to lll_futex_wait().
317 2007-11-26  Daniel Jacobowitz  <dan@codesourcery.com>
319         * pthread_create.c: Require pthread_mutex_trylock and
320         pthread_key_delete for libgcc.
322 2008-04-08  Jakub Jelinek  <jakub@redhat.com>
324         [BZ #6020]
325         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h
326         (lll_futex_wake_unlock): Add private argument to the pre-v9 macro.
327         Patch by Sunil Amitkumar Janki <devel.sjanki@gmail.com>.
329 2008-03-27  Ulrich Drepper  <drepper@redhat.com>
331         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine ARG_MAX if
332         <linux/limits.h> has defined it.
333         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
334         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
335         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
336         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
338 2008-03-18  Jakub Jelinek  <jakub@redhat.com>
340         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Use __ASSEMBLER__ instead
341         of ASSEMBLER.
342         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
343         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Likewise.
345 2008-03-14  Ulrich Drepper  <drepper@redhat.com>
347         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
348         HAVE_DL_DISCOVER_OSVERSION.
349         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
350         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Likewise.
352 2008-03-07  Ulrich Drepper  <drepper@redhat.com>
354         [BZ #5778]
355         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Change
356         _POSIX_CHOWN_RESTRICTED value to zero.
358 2008-01-31  Roland McGrath  <roland@redhat.com>
360         * Makefile (omit-deps): Variable removed.
362 2008-01-30  Ulrich Drepper  <drepper@redhat.com>
364         * sysdeps/unix/sysv/linux/x86_64/sem_post.S (sem_post): Avoid
365         unnecessary addr32 prefix.
367 2008-01-29  Roland McGrath  <roland@redhat.com>
369         * Makeconfig (ptw-CPPFLAGS, sysd-rules-patterns): New variables.
371 2008-01-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
373         * sysdeps/unix/sysv/linux/sh/sem_post.S: Don't overflow value field.
375 2008-01-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
377         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XADD): Use
378         a scratch register.
379         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
380         (__lll_lock_wait_private): Fix typo.
381         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
382         (pthread_barrier_wait): Likewise.  Adjust XADD use.
383         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
384         Adjust XADD use.
385         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
386         (pthread_rwlock_timedrdlock): Return correct return value.
387         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
388         (pthread_rwlock_timedwrlock): Likewise.
390 2008-01-15  Ulrich Drepper  <drepper@redhat.com>
392         * tst-eintr2.c (do_test): make sure that if mutex_lock in main
393         thread returns the program exits with an error code.
395 2008-01-10  Ulrich Drepper  <drepper@redhat.com>
397         * pthread-errnos.sym: Add EOVERFLOW.
398         * sysdeps/unix/sysv/linux/structsem.sym: Add SEM_VALUE_MAX.
399         * sysdeps/unix/sysv/linux/sem_post.c: Don't overflow value field.
400         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
401         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
403 2007-12-14  Ulrich Drepper  <drepper@redhat.com>
405         * sysdeps/x86_64/pthreaddef.h (ARCH_RETRY_MMAP): Take additional
406         parameter.  Passed it as permission to mmap.
407         * allocatestack.c (allocate_stack): Pass prot as second parameter
408         to ARCH_RETRY_MMAP.
410 2007-12-12  Ulrich Drepper  <drepper@redhat.com>
412         * tst-basic7.c: Allocate memory for the stack.
414         [BZ #5465]
415         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S [!SHARED]
416         (__pthread_cond_timedwait): Don't use VDSO.
417         Patch by Michal Januszewski.
419 2007-12-07  Ulrich Drepper  <drepper@redhat.com>
421         [BZ #5455]
422         * sysdeps/pthread/pthread.h [!__EXCEPTIONS] (pthread_cleanup_pop):
423         Allow label before pthread_cleanup_pop.
424         (pthread_cleanup_pop_restore_np): Likewise.
426 2007-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
428         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
429         Store 2 before returning ETIMEDOUT.
431 2007-11-23  Ulrich Drepper  <drepper@redhat.com>
433         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
434         Store 2 before returning ETIMEDOUT.
435         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise
436         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
437         (__lll_lock_wait_private): Optimize.
438         (__lll_lock_wait): Likewise.
440 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
442         * sysdeps/pthread/pthread.h (pthread_cleanup_push,
443         pthread_cleanup_push_defer_np): Add extra (void *) cast to shut up
444         g++ 4.1 and 4.2 -Wstrict-aliasing warnings.
446 2007-11-08  Ulrich Drepper  <drepper@redhat.com>
448         [BZ #5240]
449         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
450         If we time out, try one last time to lock the futex to avoid
451         losing a wakeup signal.
452         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
453         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
455         [BZ #5245]
456         * sysdeps/pthread/createthread.c (do_clone): Translate clone error
457         if necessary.
459 2007-11-07  Ulrich Drepper  <drepper@redhat.com>
461         [BZ #5245]
462         * allocatestack.c (allocate_stack): Change ENOMEM error in case
463         mmap failed to EAGAIN.
464         * Makefile (tests): Add tst-basic7.
465         * tst-basic7.c: New file.
467 2007-11-05  Ulrich Drepper  <drepper@redhat.com>
469         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
470         Use __linkin_atfork.
472 2007-11-03  Mike Frysinger  <vapier@gentoo.org>
474         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (LOAD_FUTEX_WAIT): Add
475         missing line continuations.
476         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S (LOAD_FUTEX_WAIT,
477         LOAD_FUTEX_WAKE): Likewise.  Also add missing 3rd parameter.
479 2007-10-28  Ulrich Drepper  <drepper@redhat.com>
481         [BZ #5220]
482         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Declare
483         __active_timer_sigev_thread and __active_timer_sigev_thread_lock.
484         (struct timer): Add next element.
485         * sysdeps/unix/sysv/linux/timer_create.c: For SIGEV_THREAD timers,
486         enqueue timer structure into __active_timer_sigev_thread list.
487         * sysdeps/unix/sysv/linux/timer_delete.c: For SIGEV_THREAD timers,
488         remove timer struct from __active_timer_sigev_thread.
489         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
490         Before using timer structure make sure it is still on the
491         __active_timer_sigev_thread list.  Keep lock until done.
492         Define __active_timer_sigev_thread and
493         __active_timer_sigev_thread_lock.
495 2007-10-27  Ulrich Drepper  <drepper@redhat.com>
497         * sysdeps/pthread/malloc-machine.h: Define ATFORK_MEM.
498         Redefine thread_atfork for use of ATFORK_MEM.
499         * sysdeps/unix/sysv/linux/fork.h: Define __linkin_atfork.
500         * sysdeps/unix/sysv/linux/register-atfork.c (__linkin_atfork): New
501         function.
502         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
503         Use atomic operation when removing first element of list.
505 2007-10-17  Jakub Jelinek  <jakub@redhat.com>
507         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__old_sem_post): New
508         routine instead of an alias to __new_sem_post.
510 2007-10-15  Jakub Jelinek  <jakub@redhat.com>
512         * init.c (__pthread_initialize_minimal): Initialize word to appease
513         valgrind.
515 2007-10-10  Jakub Jelinek  <jakub@redhat.com>
517         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
518         libc.so just clear NAME.
519         (__libc_rwlock_fini): Nop inside of libc.so.
520         * tst-initializers1.c (main): Test if PTHREAD_RWLOCK_INITIALIZER is
521         all zeros.
523 2007-09-02  Ulrich Drepper  <drepper@redhat.com>
525         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
526         (__pthread_cond_wait): Fix unlocking of internal lock after mutex
527         unlocking failed.
528         Patch by Luca Barbieri <luca.barbieri@gmail.com>.
530 2007-08-21  Ulrich Drepper  <drepper@redhat.com>
532         [BZ #4938]
533         * allocatestack.c (__reclaim_stacks): Clear the TSD in the
534         reclaimed stack if necessary.
535         * Makefile (tests): Add tst-tsd6.
536         * tst-tsd6.c: New file.
538 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
540         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
541         Add private argument.
543 2007-08-20  Ulrich Drepper  <drepper@redhat.com>
545         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
546         (__pthread_cond_timedwait): Use clock_gettime from VDSO if possible.
548 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
550         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h
551         (__lll_robust_timedlock): Pass private as last argument to
552         __lll_robust_timedlock_wait.
553         (__lll_unlock): Fix a pasto.
555 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
557         * sysdeps/unix/sysv/linux/sparc/internaltypes.h (sparc_new_sem,
558         sparc_old_sem): New structs.
559         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
560         (__sem_wait_cleanup): New function.
561         (__new_sem_wait): Use sparc_new_sem structure.  Bump and afterwards
562         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
563         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
564         lll_futex_wait.
565         (__old_sem_wait): New function.
566         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: Include
567         nptl/sysdeps/unix/sysv/linux/sparc version.
568         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c:
569         Likewise.
570         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: Likewise.
571         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
572         (__new_sem_trywait): Use sparc_old_sem structure.
573         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
574         (sem_timedwait): Use sparc_new_sem structure.  Bump and afterwards
575         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
576         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
577         lll_futex_timed_wait.
578         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c (__new_sem_post):
579         Use sparc_new_sem structure.  Only wake if nwaiters > 0.  Pass
580         isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
581         lll_futex_wake.
582         (__old_sem_post): New function.
583         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: New file.
584         * sysdeps/unix/sysv/linux/sparc/sem_init.c: New file.
585         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: New file.
586         * sysdeps/unix/sysv/linux/sparc/sem_post.c: New file.
587         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: Remove.
588         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: Remove.
590 2007-08-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
592         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
593         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
594         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
595         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
596         * sysdeps/unix/sysv/linux/shpthread_cond_signal.S
597         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
598         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
599         Use FUTEX_WAKE_OP.
600         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
601         kernel-features.h and tcb-offsets.h.
602         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
603         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
604         process private.
605         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
606         tcb-offsets.h.
607         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE
608         to lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
609         process private.
610         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use #ifdef
611         __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
612         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
613         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
614         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
615         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
616         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
618 2007-08-14  Jakub Jelinek  <jakub@redhat.com>
620         * sysdeps/unix/sysv/linux/lowlevellock.c: Comment fix.
621         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
622         (__lll_timedwait_tid): Pass LLL_SHARED as 4th argument to
623         lll_futex_timed_wait.
625         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock,
626         __lll_robust_unlock): Rewrite as macros instead of inline functions.
627         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock,
628         __lll_robust_unlock, __lll_wait_tid): Likewise.
630 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
632         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
633         Fix a pasto.
634         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
635         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
636         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
637         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
638         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
639         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
640         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
641         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Include
642         kernel-features.h.
643         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
644         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
645         process private.  Switch DW_CFA_advance_loc1 and some
646         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
647         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
648         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE to
649         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
650         process private.  Switch DW_CFA_advance_loc{1,2} and some
651         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
652         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use
653         #ifdef __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
654         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
655         Likewise.
656         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
657         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
658         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
659         Likewise.
660         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
661         (__pthread_cond_broadcast): Compare %r8 instead of
662         dep_mutex-cond_*(%rdi) with $-1.
663         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
664         (__pthread_cond_signal): Xor FUTEX_WAKE_OP with FUTEX_WAKE instead
665         of oring.
667 2007-08-13  Ulrich Drepper  <drepper@redhat.com>
669         * sysdeps/unix/sysv/linux/i386/i786/Implies: New file.
671 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
673         * allocatestack.c: Include kernel-features.h.
674         * pthread_create.c: Likewise.
675         * pthread_mutex_init.c: Likewise.
676         * init.c: Likewise.
677         * pthread_cond_timedwait.c: Likewise.
678         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
679         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
680         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
681         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
682         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
683         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
684         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
685         Likewise.
686         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
687         Likewise.
688         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
689         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
690         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
691         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
693 2007-08-12  Jakub Jelinek  <jakub@redhat.com>
695         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
696         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
697         byte elements.  One of them is the new __shared element.
698         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
699         adjust names of other padding elements.
700         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
701         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
702         byte elements.  One of them is the new __shared element.
703         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
704         adjust names of other padding elements.
705         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_rwlock_t):
706         Renamed __pad1 element to __shared, adjust names of other padding
707         elements.
708         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
709         (pthread_rwlock_t): Likewise.
710         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock): Fix a
711         typo.
713 2007-08-09  Anton Blanchard  <anton@samba.org>
715         * sysdeps/unix/sysv/linux/powerpc/pthread_spin_unlock.c: New file.
717 2007-08-12  Ulrich Drepper  <drepper@redhat.com>
719         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Include
720         <kernel-features.h>.
721         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
723 2007-08-11  Ulrich Drepper  <drepper@redhat.com>
725         * pthreadP.h (PTHREAD_ROBUST_MUTEX_PSHARED): Define.
726         * pthread_mutex_lock.c: Use it instead of PTHREAD_MUTEX_PSHARED when
727         dealing with robust mutexes.
728         * pthread_mutex_timedlock.c: Likewise.
729         * pthread_mutex_trylock.c: Likewise.
730         * pthread_mutex_unlock.c: Likewise.
731         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
733 2007-08-06  Jakub Jelinek  <jakub@redhat.com>
735         * pthreadP.h (PTHREAD_MUTEX_PSHARED_BIT): Define.
736         (PTHREAD_MUTEX_TYPE): Mask __kind with 127.
737         (PTHREAD_MUTEX_PSHARED): Define.
738         * pthread_mutex_init.c (__pthread_mutex_init): Set
739         PTHREAD_MUTEX_PSHARED_BIT for pshared or robust
740         mutexes.
741         * pthread_mutex_lock.c (LLL_MUTEX_LOCK): Take mutex as argument
742         instead of its __data.__lock field, pass PTHREAD_MUTEX_PSHARED
743         as second argument to lll_lock.
744         (LLL_MUTEX_TRYLOCK): Take mutex as argument
745         instead of its __data.__lock field.
746         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
747         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
748         to lll_robust_lock.
749         (__pthread_mutex_lock): Update LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
750         LLL_ROBUST_MUTEX_LOCK users, use PTHREAD_MUTEX_TYPE (mutex)
751         instead of mutex->__data.__kind directly, pass
752         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock and lll_futex_wait.
753         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use
754         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
755         directly, pass PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock.
756         (pthread_mutex_timedlock): Pass PTHREAD_MUTEX_PSHARED (mutex)
757         to lll_timedlock, lll_robust_timedlock, lll_unlock and
758         lll_futex_timed_wait.  Use PTHREAD_MUTEX_TYPE (mutex) instead
759         of mutex->__data.__kind directly.
760         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Pass
761         PTHREAD_MUTEX_PSHARED (mutex) to lll_timedlock,
762         lll_robust_timedlock, lll_unlock and lll_futex_timed_wait.  Use
763         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind directly.
764         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Pass
765         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock, lll_robust_unlock
766         and lll_futex_wake.
767         * pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Pass
768         PTHREAD_MUTEX_PSHARED (mutex) to lll_futex_wait and lll_futex_wake.
769         Use PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
770         directly.
771         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK):
772         Take mutex as argument instead of its __data.__lock field, pass
773         PTHREAD_MUTEX_PSHARED as second argument to lll_cond_lock.
774         (LLL_MUTEX_TRYLOCK): Take mutex as argument instead of its
775         __data.__lock field.
776         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
777         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
778         to lll_robust_cond_lock.
779         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Add pshared
780         variable, pass it to lll_lock, lll_unlock, lll_futex_requeue and
781         lll_futex_wake.  Don't use lll_futex_requeue if dependent mutex
782         has PTHREAD_MUTEX_PSHARED_BIT bit set in its __data.__kind.
783         * pthread_cond_destroy.c (__pthread_cond_destroy): Add pshared
784         variable, pass it to lll_lock, lll_unlock, lll_futex_wake and
785         lll_futex_wait.
786         * pthread_cond_signal.c (__pthread_cond_signal): Add pshared
787         variable, pass it to lll_lock, lll_unlock, lll_futex_wake_unlock and
788         lll_futex_wake.
789         * pthread_cond_timedwait.c (__pthread_cond_wait): Add
790         pshared variable, pass it to lll_lock, lll_unlock,
791         lll_futex_timedwait and lll_futex_wake.
792         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait): Add
793         pshared variable, pass it to lll_lock, lll_unlock, lll_futex_wait
794         and lll_futex_wake.
795         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_requeue,
796         lll_futex_wake_unlock): Add private argument, use __lll_private_flag
797         macro.
798         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue,
799         lll_futex_wake_unlock): Likewise.
800         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_requeue):
801         Likewise.
802         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_futex_requeue,
803         lll_futex_wake_unlock): Likewise.
804         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_requeue):
805         Likewise.
806         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue,
807         lll_futex_wake_unlock): Likewise.
808         (lll_futex_wake): Fix a typo.
809         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym (PS_BIT): Add.
810         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
811         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
812         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
813         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
814         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
815         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
816         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
817         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
818         (__pthread_cond_timedwait): Likewise.
819         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
820         (__condvar_cleanup, __pthread_cond_wait): Likewise.
822 2007-08-05  Jakub Jelinek  <jakub@redhat.com>
824         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
825         Don't use CGOTSETUP and CGOTRESTORE macros.
826         (CGOTSETUP, CGOTRESTORE): Remove.
827         <IS_IN_rtld> (CENABLE, CDISABLE): Don't use JUMPTARGET, branch to
828         @local symbol.
830 2007-08-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
832         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Remove
833         definitions for private futexes.
834         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Include
835         kernel-features.h and lowlevellock.h.  Use private futexes if
836         they are available.
837         (__lll_lock_wait_private, __lll_unlock_wake_private): New.
838         (__lll_mutex_lock_wait): Rename to
839         (__lll_lock_wait): ... this.  Don't compile in for libc.so.
840         (__lll_mutex_timedlock_wait): Rename to ...
841         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.
842         Don't compile in for libc.so.
843         (__lll_mutex_unlock_wake): Rename to ...
844         (__lll_unlock_wake): ... this.  Don't compile in for libc.so.
845         (__lll_timedwait_tid): Use __NR_gettimeofday.
846         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Allow including
847         the header from assembler.  Renamed all lll_mutex_* resp.
848         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
849         Renamed all LLL_MUTEX_LOCK_* macros to LLL_LOCK_*.
850         (FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE):
851         Define.
852         (__lll_lock_wait_private): Add prototype.
853         (__lll_lock_wait, __lll_timedlock_wait, __lll_robust_lock_wait,
854         __lll_robust_timedlock_wait, __lll_unlock_wake_private,
855         __lll_unlock_wake): Likewise.
856         (lll_lock): Add private argument.  Call __lll_lock_wait_private
857         if private is constant LLL_PRIVATE.
858         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
859         lll_timedlock, lll_robust_timedlock): Add private argument.
860         (lll_unlock): Add private argument.  Call __lll_unlock_wake_private
861         if private is constant LLL_PRIVATE.
862         (lll_robust_unlock, lll_robust_dead): Add private argument.
863         (lll_lock_t): Remove.
864         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
865         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
866         lll_cond_wake, lll_cond_broadcast): Remove.
867         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: Include
868         kernel-features.h and lowlevellock.h.
869         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
870         (LOAD_FUTEX_WAIT): Define.
871         (__lll_robust_mutex_lock_wait): Rename to ...
872         (__lll_robust_lock_wait): ... this.  Add private argument.
873         Use LOAD_FUTEX_WAIT macro.
874         (__lll_robust_mutex_timedlock_wait): Rename to ...
875         (__lll_robust_timedlock_wait): ... this.    Add private argument.
876         Use __NR_gettimeofday.  Use LOAD_FUTEX_WAIT macro.
877         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Include
878         lowlevellock.h.
879         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
880         (pthread_barrier_wait): Use __lll_{lock,unlock}_* instead of
881         __lll_mutex_{lock,unlock}_*.
882         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Include
883         lowlevellock.h and pthread-errnos.h.
884         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
885         FUTEX_CMP_REQUEUE, EINVAL): Remove.
886         (__pthread_cond_broadcast): Use __lll_{lock,unlock}_* instead of
887         __lll_mutex_{lock,unlock}_*.
888         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Include
889         lowlevellock.h and pthread-errnos.h.
890         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE, EINVAL): Remove.
891         (__pthread_cond_signal): Use __lll_{lock,unlock}_* instead of
892         __lll_mutex_{lock,unlock}_*.
893         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
894         lowlevellock.h.
895         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE): Remove.
896         (__pthread_cond_timedwait): Use __lll_{lock,unlock}_* instead of
897         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
898         (__condvar_tw_cleanup): Likewise.
899         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
900         lowlevellock.h.
901         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
902         (__pthread_cond_wait): Use __lll_{lock,unlock}_* instead of
903         __lll_mutex_{lock,unlock}_*.
904         ( __condvar_w_cleanup): Likewise.
905         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Include lowlevellock.h.
906         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
907         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Include
908         lowlevellock.h.
909         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
910         (__pthread_rwlock_rdlock): Use __lll_{lock,unlock}_* instead of
911         __lll_mutex_{lock,unlock}_*.
912         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Include
913         lowlevellock.h.
914         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
915         FUTEX_PRIVATE_FLAG): Remove.
916         (pthread_rwlock_timedrdlock): Use __lll_{lock,unlock}_* instead of
917         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
918         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Include
919         lowlevellock.h.
920         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
921         FUTEX_PRIVATE_FLAG): Remove.
922         (pthread_rwlock_timedwrlock): Use __lll_{lock,unlock}_* instead of
923         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
924         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Include
925         lowlevellock.h.
926         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
927         (__pthread_rwlock_unlock): Use __lll_{lock,unlock}_* instead of
928         __lll_mutex_{lock,unlock}_*.
929         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Include
930         lowlevellock.h.
931         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
932         (__pthread_rwlock_wrlock): Use __lll_{lock,unlock}_* instead of
933         __lll_mutex_{lock,unlock}_*.
934         * sysdeps/unix/sysv/linux/sh/sem_post.S: Include lowlevellock.h.
935         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
936         (__new_sem_post): Use standard initial exec code sequences.
937         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Include
938         lowlevellock.h.
939         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
940         FUTEX_PRIVATE_FLAG): Remove.
941         (sem_timedwait): Use __NR_gettimeofday.  Use standard initial
942         exec code sequences.
943         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Include lowlevellock.h.
944         (__new_sem_trywait): Use standard initial exec code sequences.
945         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Include lowlevellock.h.
946         (__new_sem_wait): Use standard initial exec code sequences.
948 2007-07-31  Anton Blanchard  <anton@samba.org>
950         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
951         Use __asm __volatile (__lll_acq_instr ::: "memory") instead of
952         atomic_full_barrier.
954 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
956         * allocatestack.c (stack_cache_lock): Change type to int.
957         (get_cached_stack, allocate_stack, __deallocate_stack,
958         __make_stacks_executable, __find_thread_by_id, __nptl_setxid,
959         __pthread_init_static_tls, __wait_lookup_done): Add LLL_PRIVATE
960         as second argument to lll_lock and lll_unlock macros on
961         stack_cache_lock.
962         * pthread_create.c (__find_in_stack_list): Likewise.
963         (start_thread): Similarly with pd->lock.  Use lll_robust_dead
964         macro instead of lll_robust_mutex_dead, pass LLL_SHARED to it
965         as second argument.
966         * descr.h (struct pthread): Change lock and setxid_futex field
967         type to int.
968         * old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0): Use
969         LLL_LOCK_INITIALIZER instead of LLL_MUTEX_LOCK_INITIALIZER.
970         * old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
971         * old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
972         Likewise.
973         * old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
974         * pthread_cond_init.c (__pthread_cond_init): Likewise.
975         * pthreadP.h (__attr_list_lock): Change type to int.
976         * pthread_attr_init.c (__attr_list_lock): Likewise.
977         * pthread_barrier_destroy.c (pthread_barrier_destroy): Pass
978         ibarrier->private ^ FUTEX_PRIVATE_FLAG as second argument to
979         lll_{,un}lock.
980         * pthread_barrier_wait.c (pthread_barrier_wait): Likewise and
981         also for lll_futex_{wake,wait}.
982         * pthread_barrier_init.c (pthread_barrier_init): Make iattr
983         a pointer to const.
984         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Pass
985         LLL_SHARED as second argument to lll_{,un}lock.
986         * pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
987         * pthread_cond_signal.c (__pthread_cond_singal): Likewise.
988         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
989         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait):
990         Likewise.
991         * pthread_getattr_np.c (pthread_getattr_np): Add LLL_PRIVATE
992         as second argument to lll_{,un}lock macros on pd->lock.
993         * pthread_getschedparam.c (__pthread_getschedparam): Likewise.
994         * pthread_setschedparam.c (__pthread_setschedparam): Likewise.
995         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
996         * tpp.c (__pthread_tpp_change_priority, __pthread_current_priority):
997         Likewise.
998         * sysdeps/pthread/createthread.c (do_clone, create_thread):
999         Likewise.
1000         * pthread_once.c (once_lock): Change type to int.
1001         (__pthread_once): Pass LLL_PRIVATE as second argument to
1002         lll_{,un}lock macros on once_lock.
1003         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Use
1004         lll_{,un}lock macros instead of lll_mutex_{,un}lock, pass
1005         rwlock->__data.__shared as second argument to them and similarly
1006         for lll_futex_w*.
1007         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
1008         Likewise.
1009         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
1010         Likewise.
1011         * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Likewise.
1012         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Likewise.
1013         * pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Likewise.
1014         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1015         * sem_close.c (sem_close): Pass LLL_PRIVATE as second argument
1016         to lll_{,un}lock macros on __sem_mappings_lock.
1017         * sem_open.c (check_add_mapping): Likewise.
1018         (__sem_mappings_lock): Change type to int.
1019         * semaphoreP.h (__sem_mappings_lock): Likewise.
1020         * pthread_mutex_lock.c (LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
1021         LLL_ROBUST_MUTEX_LOCK): Use lll_{,try,robust_}lock macros
1022         instead of lll_*mutex_*, pass LLL_SHARED as last
1023         argument.
1024         (__pthread_mutex_lock): Use lll_unlock instead of lll_mutex_unlock,
1025         pass LLL_SHARED as last argument.
1026         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK,
1027         LLL_MUTEX_TRYLOCK, LLL_ROBUST_MUTEX_LOCK): Use
1028         lll_{cond_,cond_try,robust_cond}lock macros instead of lll_*mutex_*,
1029         pass LLL_SHARED as last argument.
1030         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
1031         lll_{timed,try,robust_timed,un}lock instead of lll_*mutex*, pass
1032         LLL_SHARED as last argument.
1033         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Similarly.
1034         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
1035         Similarly.
1036         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_lock,
1037         __libc_lock_lock_recursive, __libc_lock_unlock,
1038         __libc_lock_unlock_recursive): Pass LLL_PRIVATE as second
1039         argument to lll_{,un}lock.
1040         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_lock,
1041         _IO_lock_unlock): Likewise.
1042         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Don't use
1043         compound literal.
1044         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1045         Pass LLL_PRIVATE as second argument to lll_{,un}lock macros on
1046         __fork_lock.
1047         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork,
1048         free_mem): Likewise.
1049         (__fork_lock): Change type to int.
1050         * sysdeps/unix/sysv/linux/fork.h (__fork_lock): Likewise.
1051         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Pass
1052         isem->private ^ FUTEX_PRIVATE_FLAG as second argument to
1053         lll_futex_wake.
1054         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
1055         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Likewise.
1056         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait_private):
1057         New function.
1058         (__lll_lock_wait, __lll_timedlock_wait): Add private argument and
1059         pass it through to lll_futex_*wait, only compile in when
1060         IS_IN_libpthread.
1061         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
1062         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Add private
1063         argument and pass it through to lll_futex_*wait.
1064         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Renamed all
1065         lll_mutex_* resp. lll_robust_mutex_* macros to lll_* resp.
1066         lll_robust_*.  Renamed all __lll_mutex_* resp. __lll_robust_mutex_*
1067         inline functions to __lll_* resp. __lll_robust_*.
1068         (LLL_MUTEX_LOCK_INITIALIZER): Remove.
1069         (lll_mutex_dead): Add private argument.
1070         (__lll_lock_wait_private): New prototype.
1071         (__lll_lock_wait, __lll_robust_lock_wait, __lll_lock_timedwait,
1072         __lll_robust_lock_timedwait): Add private argument to prototypes.
1073         (__lll_lock): Add private argument, if it is constant LLL_PRIVATE,
1074         call __lll_lock_wait_private, otherwise pass private to
1075         __lll_lock_wait.
1076         (__lll_robust_lock, __lll_cond_lock, __lll_timedlock,
1077         __lll_robust_timedlock): Add private argument, pass it to
1078         __lll_*wait functions.
1079         (__lll_unlock): Add private argument, if it is constant LLL_PRIVATE,
1080         call __lll_unlock_wake_private, otherwise pass private to
1081         __lll_unlock_wake.
1082         (__lll_robust_unlock): Add private argument, pass it to
1083         __lll_robust_unlock_wake.
1084         (lll_lock, lll_robust_lock, lll_cond_lock, lll_timedlock,
1085         lll_robust_timedlock, lll_unlock, lll_robust_unlock): Add private
1086         argument, pass it through to __lll_* inline function.
1087         (__lll_mutex_unlock_force, lll_mutex_unlock_force): Remove.
1088         (lll_lock_t): Remove.
1089         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1090         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1091         lll_cond_wake, lll_cond_broadcast): Remove.
1092         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1093         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1094         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1095         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1096         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Allow including
1097         the header from assembler.  Renamed all lll_mutex_* resp.
1098         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
1099         (LOCK, FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP,
1100         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
1101         (LLL_MUTEX_LOCK_INITIALIZER, LLL_MUTEX_LOCK_INITIALIZER_LOCKED,
1102         LLL_MUTEX_LOCK_INITIALIZER_WAITERS): Remove.
1103         (__lll_mutex_lock_wait, __lll_mutex_timedlock_wait,
1104         __lll_mutex_unlock_wake, __lll_lock_wait, __lll_unlock_wake):
1105         Remove prototype.
1106         (__lll_trylock_asm, __lll_lock_asm_start, __lll_unlock_asm): Define.
1107         (lll_robust_trylock, lll_cond_trylock): Use LLL_LOCK_INITIALIZER*
1108         rather than LLL_MUTEX_LOCK_INITIALIZER* macros.
1109         (lll_trylock): Likewise, use __lll_trylock_asm, pass
1110         MULTIPLE_THREADS_OFFSET as another asm operand.
1111         (lll_lock): Add private argument, use __lll_lock_asm_start, pass
1112         MULTIPLE_THREADS_OFFSET as last asm operand, call
1113         __lll_lock_wait_private if private is constant LLL_PRIVATE,
1114         otherwise pass private as another argument to __lll_lock_wait.
1115         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
1116         lll_timedlock, lll_robust_timedlock): Add private argument, pass
1117         private as another argument to __lll_*lock_wait call.
1118         (lll_unlock): Add private argument, use __lll_unlock_asm, pass
1119         MULTIPLE_THREADS_OFFSET as another asm operand, call
1120         __lll_unlock_wake_private if private is constant LLL_PRIVATE,
1121         otherwise pass private as another argument to __lll_unlock_wake.
1122         (lll_robust_unlock): Add private argument, pass private as another
1123         argument to __lll_unlock_wake.
1124         (lll_robust_dead): Add private argument, use __lll_private_flag
1125         macro.
1126         (lll_islocked): Use LLL_LOCK_INITIALIZER instead of
1127         LLL_MUTEX_LOCK_INITIALIZER.
1128         (lll_lock_t): Remove.
1129         (LLL_LOCK_INITIALIZER_WAITERS): Define.
1130         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1131         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1132         lll_cond_wake, lll_cond_broadcast): Remove.
1133         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1134         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Revert
1135         2007-05-2{3,9} changes.
1136         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Include
1137         kernel-features.h and lowlevellock.h.
1138         (LOAD_PRIVATE_FUTEX_WAIT): Define.
1139         (LOAD_FUTEX_WAIT): Rewritten.
1140         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
1141         define.
1142         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
1143         (__lll_mutex_lock_wait): Rename to ...
1144         (__lll_lock_wait): ... this.  Take futex addr from %edx instead of
1145         %ecx, %ecx is now private argument.  Don't compile in for libc.so.
1146         (__lll_mutex_timedlock_wait): Rename to ...
1147         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.  %esi
1148         contains private argument.  Don't compile in for libc.so.
1149         (__lll_mutex_unlock_wake): Rename to ...
1150         (__lll_unlock_wake): ... this.  %ecx contains private argument.
1151         Don't compile in for libc.so.
1152         (__lll_timedwait_tid): Use __NR_gettimeofday.
1153         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Include
1154         kernel-features.h and lowlevellock.h.
1155         (LOAD_FUTEX_WAIT): Define.
1156         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
1157         define.
1158         (__lll_robust_mutex_lock_wait): Rename to ...
1159         (__lll_robust_lock_wait): ... this.  Futex addr is now in %edx
1160         argument, %ecx argument contains private.  Use LOAD_FUTEX_WAIT
1161         macro.
1162         (__lll_robust_mutex_timedlock_wait): Rename to ...
1163         (__lll_robust_timedlock_wait): ... this.  Use __NR_gettimeofday.
1164         %esi argument contains private, use LOAD_FUTEX_WAIT macro.
1165         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Include
1166         lowlevellock.h.
1167         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1168         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
1169         PRIVATE(%ebx) ^ LLL_SHARED as private argument in %ecx to
1170         __lll_lock_wait and __lll_unlock_wake, pass MUTEX(%ebx) address
1171         to __lll_lock_wait in %edx.
1172         * sysdeps/unix/sysv/linux/i386/i486/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_*, pass
1177         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1178         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1179         __lll_unlock_wake.
1180         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
1181         Include lowlevellock.h and pthread-errnos.h.
1182         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
1183         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
1184         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*, pass
1185         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1186         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1187         __lll_unlock_wake.
1188         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
1189         Include lowlevellock.h.
1190         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1191         Don't define.
1192         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*, pass
1193         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1194         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1195         __lll_unlock_wake.  Use __NR_gettimeofday.
1196         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
1197         Include lowlevellock.h.
1198         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1199         (__pthread_cond_wait, __condvar_w_cleanup): Rename __lll_mutex_*
1200         to __lll_*, pass cond_lock address in %edx rather than %ecx to
1201         __lll_lock_wait, pass LLL_SHARED in %ecx to both __lll_lock_wait
1202         and __lll_unlock_wake.
1203         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S:
1204         Include lowlevellock.h.
1205         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1206         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*, pass
1207         MUTEX(%ebx) address in %edx rather than %ecx to
1208         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
1209         and __lll_unlock_wake.  Move return value from %ecx to %edx
1210         register.
1211         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1212         Include lowlevellock.h.
1213         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1214         Don't define.
1215         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1216         MUTEX(%ebp) address in %edx rather than %ecx to
1217         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
1218         and __lll_unlock_wake.  Move return value from %ecx to %edx
1219         register.  Use __NR_gettimeofday.
1220         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1221         Include lowlevellock.h.
1222         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1223         Don't define.
1224         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1225         MUTEX(%ebp) address in %edx rather than %ecx to
1226         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
1227         and __lll_unlock_wake.  Move return value from %ecx to %edx
1228         register.  Use __NR_gettimeofday.
1229         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
1230         Include lowlevellock.h.
1231         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1232         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*, pass
1233         MUTEX(%edi) address in %edx rather than %ecx to
1234         __lll_lock_wait, pass PSHARED(%edi) in %ecx to both __lll_lock_wait
1235         and __lll_unlock_wake.
1236         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
1237         Include lowlevellock.h.
1238         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1239         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1240         MUTEX(%ebx) address in %edx rather than %ecx to
1241         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
1242         and __lll_unlock_wake.  Move return value from %ecx to %edx
1243         register.
1244         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Include
1245         lowlevellock.h.
1246         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1247         define.
1248         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Include lowlevellock.h.
1249         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1250         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Include
1251         lowlevellock.h.
1252         (LOCK, SYS_futex, SYS_gettimeofday, FUTEX_WAIT): Don't define.
1253         (sem_timedwait): Use __NR_gettimeofday.
1254         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Include
1255         lowlevellock.h.
1256         (LOCK): Don't define.
1257         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include
1258         lowlevellock.h.
1259         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1260         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Wake only when there
1261         are waiters.
1262         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Revert
1263         2007-05-2{3,9} changes.
1264         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Include
1265         kernel-features.h and lowlevellock.h.
1266         (LOAD_PRIVATE_FUTEX_WAIT): Define.
1267         (LOAD_FUTEX_WAIT): Rewritten.
1268         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
1269         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
1270         (__lll_mutex_lock_wait): Rename to ...
1271         (__lll_lock_wait): ... this.  %esi is now private argument.
1272         Don't compile in for libc.so.
1273         (__lll_mutex_timedlock_wait): Rename to ...
1274         (__lll_timedlock_wait): ... this.  %esi contains private argument.
1275         Don't compile in for libc.so.
1276         (__lll_mutex_unlock_wake): Rename to ...
1277         (__lll_unlock_wake): ... this.  %esi contains private argument.
1278         Don't compile in for libc.so.
1279         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Include
1280         kernel-features.h and lowlevellock.h.
1281         (LOAD_FUTEX_WAIT): Define.
1282         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
1283         (__lll_robust_mutex_lock_wait): Rename to ...
1284         (__lll_robust_lock_wait): ... this.  %esi argument contains private.
1285         Use LOAD_FUTEX_WAIT macro.
1286         (__lll_robust_mutex_timedlock_wait): Rename to ...
1287         (__lll_robust_timedlock_wait): ... this. %esi argument contains
1288         private, use LOAD_FUTEX_WAIT macro.
1289         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Include
1290         lowlevellock.h.
1291         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1292         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
1293         PRIVATE(%rdi) ^ LLL_SHARED as private argument in %esi to
1294         __lll_lock_wait and __lll_unlock_wake.
1295         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S:
1296         Include lowlevellock.h and pthread-errnos.h.
1297         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1298         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
1299         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*,
1300         pass LLL_SHARED in %esi to both __lll_lock_wait and
1301         __lll_unlock_wake.
1302         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S:
1303         Include lowlevellock.h and pthread-errnos.h.
1304         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
1305         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
1306         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*,
1307         pass LLL_SHARED in %esi to both __lll_lock_wait and
1308         __lll_unlock_wake.
1309         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:
1310         Include lowlevellock.h.
1311         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1312         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*,
1313         pass LLL_SHARED in %esi to both __lll_lock_wait and
1314         __lll_unlock_wake.
1315         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
1316         Include lowlevellock.h.
1317         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1318         (__pthread_cond_wait, __condvar_cleanup): Rename __lll_mutex_*
1319         to __lll_*, pass LLL_SHARED in %esi to both __lll_lock_wait
1320         and __lll_unlock_wake.
1321         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:
1322         Include lowlevellock.h.
1323         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1324         Don't define.
1325         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*,
1326         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1327         and __lll_unlock_wake.
1328         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1329         Include lowlevellock.h.
1330         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1331         Don't define.
1332         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1333         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1334         and __lll_unlock_wake.
1335         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1336         Include lowlevellock.h.
1337         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1338         Don't define.
1339         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1340         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1341         and __lll_unlock_wake.
1342         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S:
1343         Include lowlevellock.h.
1344         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1345         Don't define.
1346         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*,
1347         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1348         and __lll_unlock_wake.
1349         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:
1350         Include lowlevellock.h.
1351         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1352         Don't define.
1353         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1354         pass PSHARED(%rdi) in %ecx to both __lll_lock_wait
1355         and __lll_unlock_wake.
1356         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Include
1357         lowlevellock.h.
1358         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1359         define.
1360         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Include lowlevellock.h.
1361         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1362         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Include
1363         lowlevellock.h.
1364         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1365         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Include
1366         lowlevellock.h.
1367         (LOCK): Don't define.
1368         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Include
1369         lowlevellock.h.
1370         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1371         * sysdeps/unix/sysv/linux/sparc/internaltypes.h: New file.
1372         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c: New file.
1373         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c: New file.
1374         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c: New file.
1375         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
1376         (__lll_lock_wait_private): New function.
1377         (__lll_lock_wait, __lll_timedlock_wait): Add private argument, pass
1378         it to lll_futex_*wait.  Don't compile in for libc.so.
1379         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c:
1380         Remove.
1381         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
1382         (struct sparc_pthread_barrier): Remove.
1383         (pthread_barrier_wait): Use union sparc_pthread_barrier instead of
1384         struct sparc_pthread_barrier.  Pass
1385         ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE to lll_{,un}lock
1386         and lll_futex_wait macros.
1387         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
1388         Remove.
1389         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1390         Include sparc pthread_barrier_wait.c instead of generic one.
1392 2007-07-30  Jakub Jelinek  <jakub@redhat.com>
1394         * tst-rwlock14.c (do_test): Avoid warnings on 32-bit arches.
1396         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
1397         (pthread_rwlock_timedrdlock): Copy futex retval to %esi rather than
1398         %ecx.
1399         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
1400         (pthread_rwlock_timedwrlock): Likewise.
1401         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
1402         (__pthread_rwlock_unlock): Fix MUTEX != 0 args to __lll_*.
1404 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
1406         * sysdeps/sparc/tls.h (tcbhead_t): Add private_futex field.
1408 2007-07-26  Jakub Jelinek  <jakub@redhat.com>
1410         * tst-locale2.c (useless): Add return statement.
1412 2007-07-24  Jakub Jelinek  <jakub@redhat.com>
1414         * allocatestack.c (__nptl_setxid, __wait_lookup_done): Replace
1415         lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).
1416         * pthread_create.c (start_thread): Likewise.
1417         * init.c (sighandler_setxid): Likewise.
1418         * sysdeps/alpha/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1419         * sysdeps/ia64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1420         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1421         * sysdeps/s390/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1422         * sysdeps/powerpc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1423         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1424         * sysdeps/sparc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1425         * sysdeps/sh/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1426         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY, AIO_MISC_WAIT):
1427         Likewise.
1428         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY, GAI_MISC_WAIT):
1429         Likewise.
1430         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1431         Likewise.
1432         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_waitzero,
1433         __rtld_notify): Likewise.
1434         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Likewise.
1435         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (clear_once_control,
1436         __pthread_once): Likewise.
1437         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (clear_once_control,
1438         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1439         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1440         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1441         (lll_futex_wait): Add private argument, define as wrapper around
1442         lll_futex_timed_wait.
1443         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1444         use __lll_private_flag macro.
1445         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1446         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1447         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (clear_once_control,
1448         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1449         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1450         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1451         (lll_futex_wait): Add private argument, define as wrapper around
1452         lll_futex_timed_wait.
1453         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1454         use __lll_private_flag macro.
1455         (__lll_mutex_unlock, __lll_robust_mutex_unlock, lll_wait_tid,
1456         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1457         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
1458         Define.
1459         (lll_futex_timed_wait, lll_futex_wake): Use it.
1460         (lll_private_futex_wait, lll_private_futex_timed_wait,
1461         lll_private_futex_wake): Removed.
1462         * sysdeps/unix/sysv/linux/s390/pthread_once.c (clear_once_control,
1463         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1464         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1465         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1466         (lll_futex_wait): Add private argument, define as wrapper around
1467         lll_futex_timed_wait.
1468         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1469         use __lll_private_flag macro.
1470         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1471         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1472         to lll_futex_*.
1473         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1474         (lll_private_futex_wait, lll_private_futex_timed_wait,
1475         lll_private_futex_wake): Removed.
1476         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_private_flag):
1477         Fix !__ASSUME_PRIVATE_FUTEX non-constant private case.
1478         (lll_private_futex_wait, lll_private_futex_timed_wait,
1479         lll_private_futex_wake): Removed.
1480         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (clear_once_control,
1481         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1482         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1483         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1484         (lll_futex_wait): Add private argument, define as wrapper around
1485         lll_futex_timed_wait.
1486         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1487         use __lll_private_flag macro.
1488         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1489         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1490         to lll_futex_*.
1491         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (__lll_private_flag):
1492         Define.
1493         (lll_futex_timed_wait, lll_futex_wake): Use it.
1494         (lll_private_futex_wait, lll_private_futex_timed_wait,
1495         lll_private_futex_wake): Removed.
1497 2007-07-27  Jakub Jelinek  <jakub@redhat.com>
1499         * sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
1500         of the structure for sparc32.
1502 2007-07-26  Aurelien Jarno  <aurelien@aurel32.net>
1504         * sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
1506 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1508         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1509         code used when private futexes are assumed.
1510         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1511         Likewise.
1513 2007-07-23  Jakub Jelinek  <jakub@redhat.com>
1515         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1516         (__lll_private_flag): Define.
1517         (lll_futex_wait): Define as a wrapper around lll_futex_timed_wait.
1518         (lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Use
1519         __lll_private_flag.
1520         (lll_private_futex_wait, lll_private_futex_timedwait,
1521         lll_private_futex_wake): Define as wrapper around non-_private
1522         macros.
1523         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1524         (__lll_private_flag): Define.
1525         (lll_futex_timed_wait, lll_futex_wake): Use __lll_private_flag.
1526         (lll_private_futex_wait, lll_private_futex_timedwait,
1527         lll_private_futex_wake): Define as wrapper around non-_private
1528         macros.
1530 2007-07-10  Steven Munroe  <sjmunroe@us.ibm.com>
1532         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Add LLL_SHARED
1533         parameter to lll_futex_wait call.
1534         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1536         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
1537         Replace lll_futex_wait with lll_private_futex_wait.
1538         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1539         Add LLL_SHARED parameter to lll_futex_wake().
1541         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define LLL_PRIVATE
1542         LLL_SHARED, lll_private_futex_wait, lll_private_futex_timed_wait and
1543         lll_private_futex_wake.
1544         (lll_futex_wait): Add private parameter. Adjust FUTEX_PRIVATE_FLAG
1545         bit from private parm before syscall.
1546         (lll_futex_timed_wait): Likewise.
1547         (lll_futex_wake): Likewise.
1548         (lll_futex_wake_unlock): Likewise.
1549         (lll_mutex_unlock): Add LLL_SHARED parm to lll_futex_wake call.
1550         (lll_robust_mutex_unlock): Likewise.
1551         (lll_mutex_unlock_force): Likewise.
1552         (lll_wait_tid): Add LLL_SHARED parm to lll_futex_wait call.
1554 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1556         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1557         compilation when unconditionally using private futexes.
1558         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1559         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1560         Likewise.
1561         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1562         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1564 2007-07-17  Jakub Jelinek  <jakub@redhat.com>
1566         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
1567         Define.
1569 2007-07-06  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1571         * sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and
1572         kernel-features.h.
1574 2007-05-16  Roland McGrath  <roland@redhat.com>
1576         * init.c (__nptl_initial_report_events): New variable.
1577         (__pthread_initialize_minimal_internal): Initialize pd->report_events
1578         to that.
1580 2007-06-22  Jakub Jelinek  <jakub@redhat.com>
1582         * pthread_getattr_np.c (pthread_getattr_np): Clear cpuset and
1583         cpusetsize if pthread_getaffinity_np failed with ENOSYS.
1585 2007-06-19  Ulrich Drepper  <drepper@redhat.com>
1587         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Remove mrlock
1588         implementation.
1590 2007-06-18  Ulrich Drepper  <drepper@redhat.com>
1592         * pthreadP.h: Define PTHREAD_MUTEX_TYPE.
1593         * phtread_mutex_lock.c: Use PTHREAD_MUTEX_TYPE.
1594         * pthread_mutex_timedlock.c: Likewise.
1595         * pthread_mutex_trylock.c: Likewise.
1596         * pthread_mutex_unlock.c: Likewise.
1598 2007-06-17  Andreas Schwab  <schwab@suse.de>
1600         * sysdeps/pthread/pt-initfini.c: Tell gcc about the nonstandard
1601         sections.
1603 2007-06-17  Ulrich Drepper  <drepper@redhat.com>
1605         * allocatestack.c (allocate_stack): Make code compile if
1606         __ASSUME_PRIVATE_FUTEX is set.
1608 2007-06-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1610         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S:
1611         (__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
1612         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
1613         (__pthread_rwlock_wrlock): Likewise.
1614         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
1615         (pthread_rwlock_timedrdlock): Likewise.
1616         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
1617         (pthread_rwlock_timedwrlock): Likewise.
1618         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
1619         (__pthread_rwlock_unlock): Likewise.
1621 2007-06-10  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1623         * sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
1624         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
1625         Split __flags into __flags, __shared, __pad1 and __pad2.
1626         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
1627         futexes if they are available.
1628         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
1629         in libc-lowlevellock.S allow using private futexes.
1630         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
1631         FUTEX_PRIVATE_FLAG.  Add additional parameter to lll_futex_wait,
1632         lll_futex_timed_wait and lll_futex_wake.  Change lll_futex_wait
1633         to call lll_futex_timed_wait.  Add lll_private_futex_wait,
1634         lll_private_futex_timed_wait and lll_private_futex_wake.
1635         (lll_robust_mutex_unlock): Fix typo.
1636         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
1637         field in futex command setup.
1638         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
1639         COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
1640         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
1641         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
1642         if they are available.  Remove clear_once_control.
1643         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
1644         futexes if they are available.
1645         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1646         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1647         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1648         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1649         * sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
1650         Wake only when there are waiters.
1651         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
1652         support.  Indicate that there are waiters.  Remove unnecessary
1653         extra cancellation test.
1654         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.  Removed
1655         left-over duplication of __sem_wait_cleanup.
1657 2007-06-07  Ulrich Drepper  <drepper@redhat.com>
1659         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Add additional
1660         parameter to lll_futex_wait, lll_futex_timed_wait, and
1661         lll_futex_wake.  Change lll_futex_wait to call lll_futex_timed_wait.
1662         Add lll_private_futex_wait, lll_private_futex_timed_wait, and
1663         lll_private_futex_wake.
1664         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1665         * allocatestack.c: Adjust use of lll_futex_* macros.
1666         * init.c: Likewise.
1667         * lowlevellock.h: Likewise.
1668         * pthread_barrier_wait.c: Likewise.
1669         * pthread_cond_broadcast.c: Likewise.
1670         * pthread_cond_destroy.c: Likewise.
1671         * pthread_cond_signal.c: Likewise.
1672         * pthread_cond_timedwait.c: Likewise.
1673         * pthread_cond_wait.c: Likewise.
1674         * pthread_create.c: Likewise.
1675         * pthread_mutex_lock.c: Likewise.
1676         * pthread_mutex_setprioceiling.c: Likewise.
1677         * pthread_mutex_timedlock.c: Likewise.
1678         * pthread_mutex_unlock.c: Likewise.
1679         * pthread_rwlock_timedrdlock.c: Likewise.
1680         * pthread_rwlock_timedwrlock.c: Likewise.
1681         * pthread_rwlock_unlock.c: Likewise.
1682         * sysdeps/alpha/tls.h: Likewise.
1683         * sysdeps/i386/tls.h: Likewise.
1684         * sysdeps/ia64/tls.h: Likewise.
1685         * sysdeps/powerpc/tls.h: Likewise.
1686         * sysdeps/pthread/aio_misc.h: Likewise.
1687         * sysdeps/pthread/gai_misc.h: Likewise.
1688         * sysdeps/s390/tls.h: Likewise.
1689         * sysdeps/sh/tls.h: Likewise.
1690         * sysdeps/sparc/tls.h: Likewise.
1691         * sysdeps/unix/sysv/linux/fork.c: Likewise.
1692         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
1693         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
1694         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Likewise.
1695         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
1696         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1697         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
1698         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
1699         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
1700         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
1701         Likewise.
1702         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise.
1703         * sysdeps/x86_64/tls.h: Likewise.
1705 2007-05-29  Ulrich Drepper  <drepper@redhat.com>
1707         * pthread_getattr_np.c: No need to install a cancellation handler,
1708         this is no cancellation point.
1709         * pthread_getschedparam.c: Likewise.
1710         * pthread_setschedparam.c: Likewise.
1711         * pthread_setschedprio.c: Likewise.
1712         * sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
1713         lll_unlock_wake_cb.
1714         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
1715         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1716         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1717         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1718         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1719         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1720         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
1721         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
1722         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1723         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
1724         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1725         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1727         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
1728         whether there are more than one thread makes no sense here since
1729         we only call the slow path if the locks are taken.
1730         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
1732         * sysdeps/unix/sysv/linux/internaltypes.h: Introduce
1733         COND_NWAITERS_SHIFT.
1734         * pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of
1735         COND_CLOCK_BITS.
1736         * pthread_cond_init.c: Likewise.
1737         * pthread_cond_timedwait.c: Likewise.
1738         * pthread_cond_wait.c: Likewise.
1739         * pthread_condattr_getclock.c: Likewise.
1740         * pthread_condattr_setclock.c: Likewise.
1741         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise.
1742         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1743         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1744         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1745         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1747 2007-05-28  Jakub Jelinek  <jakub@redhat.com>
1749         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
1750         unistd.h.
1752         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
1753         insn suffix.
1754         (THREAD_GSCOPE_GET_FLAG): Remove.
1755         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Remove.
1756         * allocatestack.c (__wait_lookup_done): Revert 2007-05-24
1757         changes.
1758         * sysdeps/powerpc/tls.h (tcbhead_t): Remove gscope_flag.
1759         (THREAD_GSCOPE_GET_FLAG): Remove.
1760         (THREAD_GSCOPE_RESET_FLAG): Use THREAD_SELF->header.gscope_flag
1761         instead of THREAD_GSCOPE_GET_FLAG.
1762         (THREAD_GSCOPE_SET_FLAG): Likewise.  Add atomic_write_barrier after
1763         it.
1764         * sysdeps/s390/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1765         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1766         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1767         THREAD_GSCOPE_WAIT): Define.
1768         * sysdeps/sparc/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1769         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1770         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1771         THREAD_GSCOPE_WAIT): Define.
1772         * sysdeps/sh/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1773         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1774         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1775         THREAD_GSCOPE_WAIT): Define.
1776         * sysdeps/ia64/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1777         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1778         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1779         THREAD_GSCOPE_WAIT): Define.
1781 2007-05-24  Richard Henderson  <rth@redhat.com>
1783         * descr.h (struct pthread): Add header.gscope_flag.
1784         * sysdeps/alpha/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1785         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1786         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1787         THREAD_GSCOPE_WAIT): Define.
1789 2007-05-27  Ulrich Drepper  <drepper@redhat.com>
1791         * init.c: Make it compile with older kernel headers.
1793         * tst-initializers1.c: Show through exit code which test failed.
1795         * pthread_rwlock_init.c: Also initialize __shared field.
1796         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
1797         element in rwlock structure into four byte elements.  One of them is
1798         the new __shared element.
1799         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
1800         Likewise.
1801         [__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
1802         __shared, adjust names of other padding elements.
1803         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1804         * sysdeps/pthread/pthread.h: Adjust rwlock initializers.
1805         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
1806         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
1807         FUTEX_PRIVATE_FLAG.
1808         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
1809         futex to use private operations if possible.
1810         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1811         Likewise.
1812         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1813         Likewise.
1814         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1815         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1816         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1817         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1818         Likewise.
1819         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1820         Likewise.
1821         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1822         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1824 2007-05-26  Ulrich Drepper  <drepper@redhat.com>
1826         * pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
1827         * pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
1828         * pthread_rwlock_timedrdlock.c: Likewise.
1829         * pthread_rwlock_tryrdlock.c: Likewise.
1831         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
1832         optimization.
1834         * sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
1835         * sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
1836         duplication of __sem_wait_cleanup.
1838         * allocatestack.c: Revert last change.
1839         * init.c: Likewise.
1840         * sysdeps/i386/tls.h: Likewise.
1841         * sysdeps/x86_64/tls.h: Likewise.
1842         * descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
1843         header structure.
1844         * sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
1846         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
1847         Add private field.
1848         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
1849         * pthread_barrier_init.c: Set private flag if pshared and private
1850         futexes are supported.
1851         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
1852         private field in futex command setup.
1853         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
1855 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1857         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
1858         support.
1859         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1860         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1861         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1862         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1863         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1865         * semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
1866         * sem_init.c (__new_sem_init): Rewrite to initialize all three
1867         fields in the structure.
1868         (__old_sem_init): New function.
1869         * sem_open.c: Initialize all fields of the structure.
1870         * sem_getvalue.c: Adjust for renamed element.
1871         * sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
1872         (gen-as-const-headers): Add structsem.sym.
1873         * sysdeps/unix/sysv/linux/structsem.sym: New file.
1874         * sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
1875         struct new_sem.  Add struct old_sem.
1876         * sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
1877         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
1878         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1879         * sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
1880         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1881         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1882         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1883         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1884         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1885         * Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
1886         * tst-sem10.c: New file.
1887         * tst-sem11.c: New file.
1888         * tst-sem12.c: New file.
1889         * tst-typesizes.c: Test struct new_sem and struct old_sem instead
1890         of struct sem.
1892 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1893             Jakub Jelinek  <jakub@redhat.com>
1895         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
1896         Move __pthread_enable_asynccancel right before futex syscall.
1897         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
1898         Likewise.
1900 2007-05-24  Jakub Jelinek  <jakub@redhat.com>
1902         * sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
1903         THREAD_COPY_PRIVATE_FUTEX): Define.
1904         * sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
1905         THREAD_COPY_PRIVATE_FUTEX): Define.
1906         * allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
1907         * init.c (__pthread_initialize_minimal_internal): Use
1908         THREAD_SET_PRIVATE_FUTEX.
1910         * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
1911         (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
1912         THREAD_GSCOPE_FLAG_WAIT): Define.
1913         (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG,
1914         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define.
1915         * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use
1916         PTR_DEMANGLE.
1917         (THREAD_GSCOPE_GET_FLAG): Define.
1918         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define.
1919         * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
1920         instead of ->header.gscope_flag directly.
1922 2007-05-23  Ulrich Drepper  <drepper@redhat.com>
1924         * init.c (__pthread_initialize_minimal_internal): Check whether
1925         private futexes are available.
1926         * allocatestack.c (allocate_stack): Copy private_futex field from
1927         current thread into the new stack.
1928         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
1929         futexes if they are available.
1930         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
1931         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
1932         in libc-lowlevellock.S allow using private futexes.
1933         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1934         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
1935         FUTEX_PRIVATE_FLAG.
1936         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1937         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
1938         if they are available.
1939         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
1940         * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
1941         * sysdeps/i386/tcb-offsets.sym: Likewise.
1942         * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
1943         * sysdeps/i386/tls.h (tcbhead_t): Likewise.
1945 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
1947         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1948         Remove ptr_wait_lookup_done again.
1949         * init.c (pthread_functions): Don't add .ptr_wait_lookup_done here.
1950         (__pthread_initialize_minimal_internal): Initialize
1951         _dl_wait_lookup_done pointer in _rtld_global directly.
1952         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1953         Remove code to code _dl_wait_lookup_done.
1954         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
1955         encrypted for now.
1957 2007-05-21  Jakub Jelinek  <jakub@redhat.com>
1959         * tst-robust9.c (do_test): Don't fail if ENABLE_PI and
1960         pthread_mutex_init failed with ENOTSUP.
1962 2007-05-19  Ulrich Drepper  <drepper@redhat.com>
1964         * allocatestack.c (__wait_lookup_done): New function.
1965         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1966         Add ptr_wait_lookup_done.
1967         * init.c (pthread_functions): Initialize .ptr_wait_lookup_done.
1968         * pthreadP.h: Declare __wait_lookup_done.
1969         * sysdeps/i386/tls.h (tcbhead_t): Add gscope_flag.
1970         Define macros to implement reference handling of global scope.
1971         * sysdeps/x86_64/tls.h: Likewise.
1972         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1973         Initialize GL(dl_wait_lookup_done).
1975 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
1977         [BZ #4512]
1978         * pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
1979         is detected.
1980         * pthread_mutex_timedlock.c: Likewise.
1981         * pthread_mutex_trylock.c: Likewise.
1982         Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
1984         * Makefile (tests): Add tst-robust9 and tst-robustpi9.
1985         * tst-robust9.c: New file.
1986         * tst-robustpi9.c: New file.
1988         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
1989         unnecessary extra cancellation test.
1991 2007-05-14  Ulrich Drepper  <drepper@redhat.com>
1993         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
1994         extra cancellation test.
1995         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1997 2007-05-10  Ulrich Drepper  <drepper@redhat.com>
1999         * descr.h (struct pthread): Rearrange members to fill hole in
2000         64-bit layout.
2002         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2003         (__pthread_setaffinity_new): If syscall was successful and
2004         RESET_VGETCPU_CACHE is defined, use it before returning.
2005         * sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
2007 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
2009         [BZ #4455]
2010         * tst-align2.c: Include stackinfo.h.
2011         * tst-getpid1.c: Likewise.
2013 2007-05-02  Carlos O'Donell  <carlos@systemhalted.org>
2015         [BZ #4455]
2016         * tst-align2.c (do_test): Add _STACK_GROWS_UP case.
2017         * tst-getpid1.c (do_test): Likewise.
2019         [BZ #4456]
2020         * allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
2021         (allocate_stack): Likewise.
2023 2007-05-07  Ulrich Drepper  <drepper@redhat.com>
2025         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
2026         (__lll_robust_lock_wait): Fix race caused by reloading of futex value.
2027         (__lll_robust_timedlock_wait): Likewise.
2028         Reported by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
2030 2007-05-06  Mike Frysinger  <vapier@gentoo.org>
2032         [BZ #4465]
2033         * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
2034         * tst-cancel4.c (tf_fdatasync): New test.
2036 2007-04-27  Ulrich Drepper  <drepper@redhat.com>
2038         [BZ #4392]
2039         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Treat error
2040         check mutexes like normal mutexes.
2042         [BZ #4306]
2043         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
2044         Initialize the whole sigevent structure to appease valgrind.
2046 2007-04-25  Ulrich Drepper  <drepper@redhat.com>
2048         * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
2049         * sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
2051 2007-04-06  Ulrich Drepper  <drepper@redhat.com>
2053         * tst-locale1.c: Avoid warnings.
2054         * tst-locale2.c: Likewise.
2056 2007-03-19  Steven Munroe  <sjmunroe@us.ibm.com>
2058         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2059         (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
2061 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
2063         * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
2064         __extern_always_inline where appropriate.
2065         * sysdeps/pthread/pthread.h: Likewise.
2067 2007-03-13  Richard Henderson  <rth@redhat.com>
2069         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
2070         separate cfi regions for the two subsections.
2072 2007-02-25  Ulrich Drepper  <drepper@redhat.com>
2074         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
2075         new thread, don't just decrement it.
2076         Patch by Suzuki K P <suzuki@in.ibm.com>.
2078 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
2080         * sysdeps/pthread/pthread-functions.h: Correct last patch, correct
2081         PTHFCT_CALL definition.
2083 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
2085         * sysdeps/pthread/pthread-functions.h: If PTR_DEMANGLE is not
2086         available, don't use it.
2088 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
2090         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2091         (__lll_mutex_timedlock_wait): Use correct pointer when we don't
2092         call into the kernel to delay.
2094 2007-01-18  Ulrich Drepper  <drepper@redhat.com>
2096         * tst-initializers1.c: We want to test the initializers as seen
2097         outside of libc, so undefined _LIBC.
2099         * pthread_join.c (cleanup): Avoid warning.
2101 2007-01-17  Ulrich Drepper  <drepper@redhat.com>
2103         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2104         (__lll_timedwait_tid): Add unwind info.
2106         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Don't just copy the
2107         function table, mangle the pointers.
2108         * sysdeps/pthread/pthread-functions.h: Define PTHFCT_CALL.
2109         * forward.c: Use PTHFCT_CALL and __libc_pthread_functions_init.
2110         * sysdeps/pthread/bits/libc-lock.h: When using __libc_pthread_functions
2111         demangle pointers before use.
2112         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Use PTHFCT_CALL to
2113         demangle pointer.
2114         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
2115         * sysdeps/pthread/setxid.h: Likewise.
2117 2007-01-12  Ulrich Drepper  <drepper@redhat.com>
2119         * tst-rwlock7.c: Show some more information in case of correct
2120         behavior.
2122 2007-01-11  Ulrich Drepper  <drepper@redhat.com>
2124         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2125         (lll_futex_timed_wait): Undo part of last change, don't negate
2126         return value.
2128 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
2130         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups.  Define
2131         FUTEX_CMP_REQUEUE and lll_futex_requeue.
2133 2006-12-28  David S. Miller  <davem@davemloft.net>
2135         * shlib-versions: Fix sparc64 linux target specification.
2137 2007-01-10  Jakub Jelinek  <jakub@redhat.com>
2139         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2140         Adjust include path for pthread_barrier_wait.c move.
2142 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
2144         * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
2145         tid isn't reread from pd->tid in between ESRCH test and the syscall.
2147 2006-12-06  Jakub Jelinek  <jakub@redhat.com>
2149         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
2150         6 argument cancellable syscalls.
2151         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
2152         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
2153         6 argument cancellable syscalls.
2154         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
2156 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
2158         * sysdeps/unix/sysv/linux/rtld-lowlevel.h
2159         (__rtld_mrlock_initialize): Add missing closing parenthesis.
2161 2006-10-30  Jakub Jelinek  <jakub@redhat.com>
2163         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
2164         __sync_lock_release instead of __sync_lock_release_si.
2166 2006-10-29  Jakub Jelinek  <jakub@redhat.com>
2168         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P):
2169         Define.
2170         (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld.
2171         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
2172         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
2173         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
2174         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
2175         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2176         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
2177         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
2178         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2179         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2180         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
2182 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
2184         * sysdeps/pthread/pthread_barrier_wait.c: Move to...
2185         * pthread_barrier_wait.c: ...here.
2186         * sysdeps/pthread/pthread_cond_broadcast.c: Move to...
2187         * pthread_cond_broadcast.c: ...here.
2188         * sysdeps/pthread/pthread_cond_signal.c: Move to...
2189         * pthread_cond_signal.c: ...here.
2190         * sysdeps/pthread/pthread_cond_timedwait.c: Move to...
2191         * pthread_cond_timedwait.c: ...here.
2192         * sysdeps/pthread/pthread_cond_wait.c: Move to...
2193         * pthread_cond_wait.c: ...here.
2194         * sysdeps/pthread/pthread_once.c: Move to...
2195         * pthread_once.c: ...here.
2196         * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to...
2197         * pthread_rwlock_rdlock.c: ...here.
2198         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to...
2199         * pthread_rwlock_timedrdlock.c: ...here.
2200         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to...
2201         * pthread_rwlock_timedwrlock.c: ...here.
2202         * sysdeps/pthread/pthread_rwlock_unlock.c: Move to...
2203         * pthread_rwlock_unlock.c: ...here.
2204         * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to...
2205         * pthread_rwlock_wrlock.c: ...here.
2206         * sysdeps/pthread/pthread_spin_destroy.c: Move to...
2207         * pthread_spin_destroy.c: ...here.
2208         * sysdeps/pthread/pthread_spin_init.c: Move to...
2209         * pthread_spin_init.c: ...here.
2210         * sysdeps/pthread/pthread_spin_unlock.c: Move to...
2211         * pthread_spin_unlock.c: ...here.
2212         * sysdeps/pthread/pthread_getcpuclockid.c: Move to...
2213         * pthread_getcpuclockid.c: ...here.
2215         * init.c: USE_TLS support is now always enabled.
2216         * tst-tls5.h: Likewise.
2217         * sysdeps/alpha/tls.h: Likewise.
2218         * sysdeps/i386/tls.h: Likewise.
2219         * sysdeps/ia64/tls.h: Likewise.
2220         * sysdeps/powerpc/tls.h: Likewise.
2221         * sysdeps/s390/tls.h: Likewise.
2222         * sysdeps/sh/tls.h: Likewise.
2223         * sysdeps/sparc/tls.h: Likewise.
2224         * sysdeps/x86_64/tls.h: Likewise.
2226 2006-10-27  Jakub Jelinek  <jakub@redhat.com>
2228         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
2229         __rtld_mrlock_change): Update oldval if atomic compare and exchange
2230         failed.
2232         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
2233         Define to THREAD_SELF->header.multiple_threads.
2234         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
2235         Likewise.
2236         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
2237         Likewise.
2238         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
2239         (SINGLE_THREAD_P): Likewise.
2240         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
2241         (SINGLE_THREAD_P): Likewise.
2242         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2243         (SINGLE_THREAD_P): Likewise.
2244         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
2245         (SINGLE_THREAD_P): Likewise.
2246         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P):
2247         Likewise.
2248         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
2249         (SINGLE_THREAD_P): Likewise.
2250         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
2251         (SINGLE_THREAD_P): Likewise.
2252         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P):
2253         Likewise.
2255 2006-10-26  Jakub Jelinek  <jakub@redhat.com>
2257         * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3
2258         by default rather than 2_3_3.
2260 2006-10-17  Jakub Jelinek  <jakub@redhat.com>
2262         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
2263         __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
2264         atomic_* instead of catomic_* macros.
2266 2006-10-12  Ulrich Drepper  <drepper@redhat.com>
2268         [BZ #3285]
2269         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX.
2270         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
2271         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
2272         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
2273         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
2274         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX.
2275         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
2276         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
2277         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
2278         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise.
2279         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
2280         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
2281         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
2283 2006-10-11  Ulrich Drepper  <drepper@redhat.com>
2285         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for
2286         cancelable syscalls with six parameters.
2288         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
2289         operations instead of atomic_*.
2291 2006-10-09  Ulrich Drepper  <drepper@redhat.com>
2293         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
2295 2006-10-07  Ulrich Drepper  <drepper@redhat.com>
2297         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file.
2298         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file.
2299         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c:
2300         New file.
2301         * pthread_attr_setstack.c: Allow overwriting the version number of the
2302         new symbol.
2303         * pthread_attr_setstacksize.c: Likewise.
2304         (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use
2305         it.
2306         * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add
2307         pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6.
2309 2006-09-24  Ulrich Drepper  <drepper@redhat.com>
2311         [BZ #3251]
2312         * descr.h (ENQUEUE_MUTEX_BOTH): Add cast to avoid warning.
2313         Patch by Petr Baudis.
2315 2006-09-18  Jakub Jelinek  <jakub@redhat.com>
2317         * tst-kill4.c (do_test): Explicitly set tf thread's stack size.
2319         * tst-cancel2.c (tf): Loop as long as something was written.
2321 2006-09-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2323         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: For PI
2324         mutexes wake all mutexes.
2325         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Don't increment
2326         WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2327         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2329 2006-09-12  Ulrich Drepper  <drepper@redhat.com>
2331         * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use
2332         to guarantee the thread is always canceled.
2334 2006-09-08  Jakub Jelinek  <jakub@redhat.com>
2336         * tst-cond22.c: Include pthread.h instead of pthreadP.h.
2337         Include stdlib.h.
2338         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Only
2339         increase FUTEX if increasing WAKEUP_SEQ.  Fix comment typo.
2340         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2341         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2342         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2344 2006-09-08  Ulrich Drepper  <drepper@redhat.com>
2346         [BZ #3123]
2347         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Don't
2348         increment WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2349         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2350         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2351         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2352         * Makefile (tests): Add tst-cond22.
2353         * tst-cond22.c: New file.
2355 2006-09-05  Ulrich Drepper  <drepper@redhat.com>
2357         [BZ #3124]
2358         * descr.h (struct pthread): Add parent_cancelhandling.
2359         * sysdeps/pthread/createthread.c (create_thread): Pass parent
2360         cancelhandling value to child.
2361         * pthread_create.c (start_thread): If parent thread was canceled
2362         reset the SIGCANCEL mask.
2363         * Makefile (tests): Add tst-cancel25.
2364         * tst-cancel25.c: New file.
2366 2006-09-05  Jakub Jelinek  <jakub@redhat.com>
2367             Ulrich Drepper  <drepper@redhat.com>
2369         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
2370         counterp if it is already zero.
2371         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
2373 2006-03-04  Jakub Jelinek  <jakub@redhat.com>
2374             Roland McGrath  <roland@redhat.com>
2376         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2377         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2378         LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
2379         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2380         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2381         lll_robust_mutex_timedlock, lll_mutex_unlock,
2382         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2383         Add _L_*_ symbols around the subsection.
2384         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
2385         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2387 2006-03-03  Jakub Jelinek  <jakub@redhat.com>
2388             Roland McGrath  <roland@redhat.com>
2390         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2391         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2392         LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
2393         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2394         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2395         lll_robust_mutex_timedlock, lll_mutex_unlock,
2396         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2397         Add _L_*_ symbols around the subsection.
2398         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
2399         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2401 2006-08-31  Ulrich Drepper  <drepper@redhat.com>
2403         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Undo last
2404         change because it can disturb too much existing code.  If real hard
2405         reader preference is needed we'll introduce another type.
2406         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2407         (pthread_rwlock_timedwrlock): Likewise.
2408         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2409         Likewise.
2411 2006-08-30  Ulrich Drepper  <drepper@redhat.com>
2413         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Respect
2414         reader preference.
2415         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2416         (pthread_rwlock_timedwrlock): Likewise.
2417         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2418         Likewise.
2420 2006-08-25  Jakub Jelinek  <jakub@redhat.com>
2422         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
2423         Only define ifdef SHARED.
2425 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
2427         * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
2428         (free_stacks): ...here.
2429         (__free_stack_cache): New function.
2430         * pthreadP.h: Declare __free_stack_cache.
2431         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
2432         ptr_freeres.
2433         * init.c (pthread_functions): Initialize ptr_freeres.
2434         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
2435         New freeres function.
2437 2006-07-30  Joseph S. Myers  <joseph@codesourcery.com>
2439         [BZ #3018]
2440         * Makefile (extra-objs): Add modules to extra-test-objs instead.
2442 2006-08-20  Ulrich Drepper  <drepper@redhat.com>
2444         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2445         _XOPEN_REALTIME_THREADS.
2447 2006-08-15  Jakub Jelinek  <jakub@redhat.com>
2449         * sysdeps/unix/sysv/linux/clock_settime.c (INTERNAL_VSYSCALL): Use
2450         HAVE_CLOCK_GETRES_VSYSCALL as guard macro rather than
2451         HAVE_CLOCK_GETTIME_VSYSCALL.
2452         (maybe_syscall_settime_cpu): Use plain INTERNAL_VSYSCALL here.
2454 2006-08-14  Jakub Jelinek  <jakub@redhat.com>
2456         * sysdeps/unix/sysv/linux/bits/posix_opt.h
2457         (_POSIX_THREAD_PRIO_PROTECT): Define to 200112L.
2458         * descr.h (struct priority_protection_data): New type.
2459         (struct pthread): Add tpp field.
2460         * pthreadP.h (PTHREAD_MUTEX_PP_NORMAL_NP,
2461         PTHREAD_MUTEX_PP_RECURSIVE_NP, PTHREAD_MUTEX_PP_ERRORCHECK_NP,
2462         PTHREAD_MUTEX_PP_ADAPTIVE_NP): New enum values.
2463         * pthread_mutex_init.c (__pthread_mutex_init): Handle non-robust
2464         TPP mutexes.
2465         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle TPP mutexes.
2466         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
2467         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
2468         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
2469         * tpp.c: New file.
2470         * pthread_setschedparam.c (__pthread_setschedparam): Handle priority
2471         boosted by TPP.
2472         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
2473         * pthread_mutexattr_getprioceiling.c
2474         (pthread_mutexattr_getprioceiling): If ceiling is 0, ensure it is
2475         in the SCHED_FIFO priority range.
2476         * pthread_mutexattr_setprioceiling.c
2477         (pthread_mutexattr_setprioceiling): Fix prioceiling validation.
2478         * pthread_mutex_getprioceiling.c (pthread_mutex_getprioceiling): Fail
2479         if mutex is not TPP.  Ceiling is now in __data.__lock.
2480         * pthread_mutex_setprioceiling.c: Include stdbool.h.
2481         (pthread_mutex_setprioceiling): Fix prioceiling validation.  Ceiling
2482         is now in __data.__lock.  Add locking.
2483         * pthread_create.c (__free_tcb): Free pd->tpp structure.
2484         * Makefile (libpthread-routines): Add tpp.
2485         (xtests): Add tst-mutexpp1, tst-mutexpp6 and tst-mutexpp10.
2486         * tst-tpp.h: New file.
2487         * tst-mutexpp1.c: New file.
2488         * tst-mutexpp6.c: New file.
2489         * tst-mutexpp10.c: New file.
2490         * tst-mutex1.c (TEST_FUNCTION): Don't redefine if already defined.
2491         * tst-mutex6.c (TEST_FUNCTION): Likewise.
2493 2006-08-12  Ulrich Drepper  <drepper@redhat.com>
2495         [BZ #2843]
2496         * pthread_join.c (pthread_join): Account for self being canceled
2497         when checking for deadlocks.
2498         * tst-join5.c: Cleanups.  Allow to be used in tst-join6.
2499         (tf1): Don't print anything after pthread_join returns, this would be
2500         another cancellation point.
2501         (tf2): Likewise.
2502         * tst-join6.c: New file.
2503         * Makefile (tests): Add tst-join6.
2505 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
2507         [BZ #2892]
2508         * pthread_setspecific.c (__pthread_setspecific): Check
2509         out-of-range index before checking for unused key.
2511         * sysdeps/pthread/gai_misc.h: New file.
2513 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
2515         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
2516         file.  Don't use sysctl.
2517         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
2518         overwrite the file if this is likely not true.
2520 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
2522         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
2523         * Makefile (tests): Add tst-getpid3.
2524         * tst-getpid3.c: New file.
2526 2006-07-30  Roland McGrath  <roland@redhat.com>
2528         * Makefile (libpthread-routines): Add ptw-sigsuspend.
2530         * sysdeps/unix/sysv/linux/i386/not-cancel.h
2531         (pause_not_cancel): New macro.
2532         (nanosleep_not_cancel): New macro.
2533         (sigsuspend_not_cancel): New macro.
2534         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
2535         nanosleep_not_cancel macro from <not-cancel.h>.
2536         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
2537         macro from <not-cancel.h>.
2539 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
2540             Jakub Jelinek  <jakub@redhat.com>
2542         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
2543         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
2544         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
2545         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
2546         * pthread_mutex_init.c: Add support for priority inheritance mutex.
2547         * pthread_mutex_lock.c: Likewise.
2548         * pthread_mutex_timedlock.c: Likewise.
2549         * pthread_mutex_trylock.c: Likewise.
2550         * pthread_mutex_unlock.c: Likewise.
2551         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
2552         all mutexes.
2553         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
2554         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
2555         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
2556         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
2557         pthread-pi-defines.sym.
2558         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
2559         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
2560         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2561         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2562         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2563         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2564         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2565         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2566         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2567         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2568         _POSIX_THREAD_PRIO_INHERIT to 200112L.
2569         * tst-mutex1.c: Adjust to allow use in PI mutex test.
2570         * tst-mutex2.c: Likewise.
2571         * tst-mutex3.c: Likewise.
2572         * tst-mutex4.c: Likewise.
2573         * tst-mutex5.c: Likewise.
2574         * tst-mutex6.c: Likewise.
2575         * tst-mutex7.c: Likewise.
2576         * tst-mutex7a.c: Likewise.
2577         * tst-mutex8.c: Likewise.
2578         * tst-mutex9.c: Likewise.
2579         * tst-robust1.c: Likewise.
2580         * tst-robust7.c: Likewise.
2581         * tst-robust8.c: Likewise.
2582         * tst-mutexpi1.c: New file.
2583         * tst-mutexpi2.c: New file.
2584         * tst-mutexpi3.c: New file.
2585         * tst-mutexpi4.c: New file.
2586         * tst-mutexpi5.c: New file.
2587         * tst-mutexpi6.c: New file.
2588         * tst-mutexpi7.c: New file.
2589         * tst-mutexpi7a.c: New file.
2590         * tst-mutexpi8.c: New file.
2591         * tst-mutexpi9.c: New file.
2592         * tst-robust1.c: New file.
2593         * tst-robust2.c: New file.
2594         * tst-robust3.c: New file.
2595         * tst-robust4.c: New file.
2596         * tst-robust5.c: New file.
2597         * tst-robust6.c: New file.
2598         * tst-robust7.c: New file.
2599         * tst-robust8.c: New file.
2600         * Makefile (tests): Add the new tests.
2602         * pthread_create.c (start_thread): Add some casts to avoid warnings.
2603         * pthread_mutex_destroy.c: Remove unneeded label.
2605 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
2607         * pthread_mutex_init.c (__pthread_mutex_init): Move some
2608         computations to compile time.
2610 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
2612         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
2614 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
2616         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
2618 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
2620         * pthread_key_create.c (__pthread_key_create): Do away with
2621         __pthread_keys_lock.
2623         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2624         (__kernel_cpumask_size): Mark as hidden.
2625         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
2627         * sem_open.c (__sem_mappings_lock): Mark as hidden.
2628         * semaphoreP.h (__sem_mappings_lock): Likewise.
2630 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
2632         * pthread_atfork.c: Mark __dso_handle as hidden.
2634 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
2636         [BZ #2644]
2637         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
2638         the reload problem.  Change the one path in pthread_cancel_init
2639         which causes the problem.  Force gcc to reload.  Simplify callers.
2640         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
2641         (_Unwind_GetBSP): Undo last patch.
2643 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
2645         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
2646         function pointer is reloaded after pthread_cancel_init calls.
2648         [BZ #2644]
2649         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
2650         pointers are reloaded after pthread_cancel_init calls.
2652 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
2654         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
2655         __always_inline.
2657 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
2659         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
2660         Allocate new object which is passed to timer_sigev_thread so that
2661         the timer can be deleted before the new thread is scheduled.
2663 2006-04-26  Roland McGrath  <roland@redhat.com>
2665         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
2667 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
2669         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
2670         suffix for conditional jumps.
2671         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
2672         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2673         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
2674         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
2675         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2676         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2678         * init.c (sigcancel_handler): Compare with correct PID even if the
2679         thread is in the middle of a fork call.
2680         (sighandler_setxid): Likewise.
2681         Reported by Suzuki K P <suzuki@in.ibm.com> .
2683 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
2685         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
2687 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
2689         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
2690         fails [Coverity CID 105].
2692 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
2694         * sysdeps/pthread/pthread.h: Add nonnull attributes.
2696 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
2698         [BZ #2505]
2699         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
2700         Define __lll_rel_instr using lwsync.
2702 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
2704         * allocatestack.c (allocate_stack): Always initialize robust_head.
2705         * descr.h: Define struct robust_list_head.
2706         (struct pthread): Use robust_list_head in robust mutex list definition.
2707         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
2708         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
2709         (__pthread_initialize_minimal_internal): Register robust_list with
2710         the kernel.
2711         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
2712         Declare __set_robust_list_avail.
2713         * pthread_create.c (start_thread): Register robust_list of new thread.
2714         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
2715         waiters.
2716         * pthread_mutex_destroy.c: For robust mutexes don't look at the
2717         number of users, it's unreliable.
2718         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
2719         set_robust_list syscall is available.
2720         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
2721         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
2722         Set robust_head.list_op_pending before trying to lock a robust mutex.
2723         * pthread_mutex_timedlock.c: Likewise.
2724         * pthread_mutex_trylock.c: Likewise.
2725         * pthread_mutex_unlock.c: Likewise for unlocking.
2726         * Makefile (tests): Add tst-robust8.
2727         * tst-robust8.c: New file.
2729 2006-03-08  Andreas Schwab  <schwab@suse.de>
2731         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
2732         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
2734 2006-03-05  Roland McGrath  <roland@redhat.com>
2736         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
2737         and $config_os doesn't match *linux*.
2739 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
2741         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
2742         Use __syscall_error.
2743         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2744         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
2745         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
2746         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2747         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
2748         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
2750 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
2752         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
2754 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
2756         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
2757         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
2758         mutex.
2759         (__lll_robust_timedlock_wait): Likewise.
2760         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
2761         (__lll_robust_lock_wait): Likewise.
2762         (__lll_robust_timedlock_wait): Likewise.
2763         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
2764         (__lll_robust_lock_wait): Likewise.
2765         (__lll_robust_timedlock_wait): Likewise.
2767 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
2769         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
2770         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2771         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2772         lll_robust_mutex_unlock): Define.
2773         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2775 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
2777         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
2778         instead of <clone.S>.
2780 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
2782         * Makefile (libpthread-routines): Add
2783         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
2784         and pthread_mutex_[sg]etprioceiling.
2785         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
2786         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
2787         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
2788         pthread_mutex_setprioceiling.
2789         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
2790         PTHREAD_PRIO_PROTECT): New enum values.
2791         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
2792         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
2793         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
2794         prototypes.
2795         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
2796         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
2797         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
2798         Define.
2799         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
2800         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
2801         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
2802         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
2803         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
2804         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
2805         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
2806         protocol mutexes.
2807         * pthread_mutex_getprioceiling.c: New file.
2808         * pthread_mutex_setprioceiling.c: New file.
2809         * pthread_mutexattr_getprioceiling.c: New file.
2810         * pthread_mutexattr_setprioceiling.c: New file.
2811         * pthread_mutexattr_getprotocol.c: New file.
2812         * pthread_mutexattr_setprotocol.c: New file.
2814 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
2816         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
2818 2006-02-27  Roland McGrath  <roland@redhat.com>
2820         * sysdeps/pthread/Subdirs: List nptl here too.
2821         * configure (libc_add_on_canonical): New variable.
2823         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
2825         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
2826         self to get main source tree's file.
2827         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
2828         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
2829         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
2830         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
2831         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
2832         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
2833         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
2834         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
2835         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
2836         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
2837         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
2838         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
2839         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
2841         * Makefile: Use $(sysdirs) in vpath directive.
2843         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
2844         (CPPFLAGS-timer_routines.c): Likewise.
2846         * Makeconfig (includes): Variable removed.
2848 2006-02-26  Roland McGrath  <roland@redhat.com>
2850         * sysdeps/generic/pt-raise.c: Moved to ...
2851         * pt-raise.c: ... here.
2852         * sysdeps/generic/lowlevellock.h: Moved to ...
2853         * lowlevellock.h: ... here.
2855 2006-02-23  Roland McGrath  <roland@redhat.com>
2857         * descr.h (struct pthread): Add final member `end_padding'.
2858         (PTHREAD_STRUCT_END_PADDING): Use it.
2860 2006-02-20  Roland McGrath  <roland@redhat.com>
2862         * sysdeps/mips: Directory removed, saved in ports repository.
2863         * sysdeps/unix/sysv/linux/mips: Likewise.
2865 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
2867         * tst-robust1.c: Add second mutex to check that the mutex list is
2868         handled correctly.
2870 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
2872         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
2873         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2874         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2875         lll_robust_mutex_unlock): New macros.
2876         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2877         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2878         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2879         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2880         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
2882 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2884         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
2885         definitions.
2886         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
2888 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
2890         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2891         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
2892         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2893         (lll_robust_mutex_unlock): Likewise.
2895 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
2897         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
2898         Set robust_list.__next rather than robust_list.
2899         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
2900         (__pthread_list_t): New typedef.
2901         (pthread_mutex_t): Replace __next and __prev fields with __list.
2902         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
2903         (__pthread_list_t): New typedef.
2904         (pthread_mutex_t): Replace __next and __prev fields with __list.
2905         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2906         (__pthread_list_t, __pthread_slist_t): New typedefs.
2907         (pthread_mutex_t): Replace __next and __prev fields with __list.
2908         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
2909         (__pthread_list_t, __pthread_slist_t): New typedefs.
2910         (pthread_mutex_t): Replace __next and __prev fields with __list.
2911         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
2912         (__pthread_list_t, __pthread_slist_t): New typedefs.
2913         (pthread_mutex_t): Replace __next and __prev fields with __list.
2914         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
2915         (__pthread_slist_t): New typedef.
2916         (pthread_mutex_t): Replace __next field with __list.
2918 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
2920         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
2921         PTHREAD_MUTEX_OWNERDEAD.
2922         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
2923         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
2924         * Makefile (libpthread-routines): Add lowlevelrobustlock.
2925         * pthread_create.c (start_thread): Very much simplify robust_list loop.
2926         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
2927         to PTHREAD_MUTEX_INCONSISTENT.
2928         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
2929         * pthread_mutex_lock.c: Reimplement robust mutex handling.
2930         * pthread_mutex_trylock.c: Likewise.
2931         * pthread_mutex_timedlock.c: Likewise.
2932         * pthread_mutex_unlock.c: Likewise.
2933         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
2934         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
2935         lowlevelrobustlock.sym.
2936         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
2937         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
2938         definitions.
2939         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2940         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
2941         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
2942         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
2943         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
2945 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
2947         * allocatestack.c (allocate_stack): Initialize robust_list.
2948         * init.c (__pthread_initialize_minimal_internal): Likewise.
2949         * descr.h (struct xid_command): Pretty printing.
2950         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
2951         robust_list.  Adjust macros.
2952         * pthread_create.c (start_thread): Adjust robust_list handling.
2953         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
2954         but the owner for all robust mutex types.
2955         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
2956         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
2957         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2958         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
2960         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
2961         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
2963 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
2965         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
2966         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
2968 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2970         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
2971         Return status.
2972         (lll_futex_timed_wait): Define.
2974 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
2976         * tst-cancel4.c: Test ppoll.
2978 2006-01-18  Andreas Jaeger  <aj@suse.de>
2980         [BZ #2167]
2981         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
2982         (pthread_mutex_t): Follow changes for other archs.  Based on patch
2983         by Jim Gifford <patches@jg555.com>.
2985 2006-01-13  Richard Henderson  <rth@redhat.com>
2987         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
2989 2006-01-10  Roland McGrath  <roland@redhat.com>
2991         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
2992         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
2993         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
2994         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
2995         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
2996         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
2997         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
2998         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
2999         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
3000         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3002 2006-01-09  Roland McGrath  <roland@redhat.com>
3004         * tst-initializers1-c89.c: New file.
3005         * tst-initializers1-c99.c: New file.
3006         * tst-initializers1-gnu89.c: New file.
3007         * tst-initializers1-gnu99.c: New file.
3008         * Makefile (tests): Add them.
3009         (CFLAGS-tst-initializers1-c89.c): New variable.
3010         (CFLAGS-tst-initializers1-c99.c): New variable.
3011         (CFLAGS-tst-initializers1-gnu89.c): New variable.
3012         (CFLAGS-tst-initializers1-gnu99.c): New variable.
3014         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3015         Use __extension__ on anonymous union definition.
3016         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3017         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3018         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3019         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3020         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3022 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
3024         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
3025         Don't give the union a name because it changes the mangled name.
3026         Instead name the struct for __data.
3027         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
3028         Likewise.
3029         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
3030         Likewise.
3032 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
3034         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
3035         stack bias to mc_ftp field.
3037 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
3039         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
3040         being too clever and reloading the futex value where it shouldn't.
3042 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
3044         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
3045         correct type.
3047 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
3049         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
3050         Add cfi directives.
3052 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
3054         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
3055         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
3056         rename in tcbhead_t.
3058         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3059         Don't give the union a name because it changes the mangled name.
3060         Instead name the struct for __data.
3061         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3062         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3063         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3064         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3065         * pthread_create.c (start_thread): Adjust robust mutex free loop.
3066         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
3068 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
3070         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
3071         Return status.
3072         (lll_futex_timed_wait): Define.
3073         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3074         * sysdeps/pthread/aio_misc.h: New file.
3076 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
3078         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
3080 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
3082         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3083         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
3084         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
3086 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
3088         * tst-cancel24.cc: Use C headers instead of C++ headers.
3090 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
3092         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
3093         sparc-linux configured glibc.
3094         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
3095         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
3096         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
3097         atomic_compare_and_exchange_val_24_acq instead of
3098         atomic_compare_and_exchange_val_acq.
3099         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
3100         instead of atomic_exchange_rel.
3101         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
3102         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
3103         file.
3104         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
3105         file.
3106         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
3107         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
3108         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
3109         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
3110         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
3111         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
3112         New file.
3113         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
3114         New file.
3115         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
3116         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
3117         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
3118         file.
3119         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
3120         file.
3121         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
3123 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
3125         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
3126         mutex initializers.
3128 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
3130         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
3131         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3132         THREAD_COPY_POINTER_GUARD): Define.
3133         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
3134         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
3136 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
3138         * version.c: Update copyright year.
3140 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3142         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
3143         .eh_frame section, use cfi_* directives.
3144         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
3146 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
3148         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
3149         now.
3151 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
3153         * sysdeps/pthread/sigaction.c: Removed.
3154         * sigaction.c: New file.
3155         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
3157 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
3159         * Makefile (tests): Add tst-signal7.
3160         * tst-signal7.c: New file.
3162 2005-12-27  Roland McGrath  <roland@redhat.com>
3164         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
3165         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
3166         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
3167         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
3168         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
3169         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3170         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3171         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3172         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3173         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
3174         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3176 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
3178         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
3179         and __prev field to pthread_mutex_t.
3180         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3181         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3182         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3183         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3184         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
3185         to pthread_mutex_t.
3187 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
3189         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
3190         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
3191         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
3192         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
3193         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
3194         and PTHREAD_MUTEXATTR_FLAG_BITS.
3195         * descr.h (struct pthread): Add robust_list field and define
3196         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
3197         * pthread_mutexattr_getrobust.c: New file.
3198         * pthread_mutexattr_setrobust.c: New file.
3199         * pthread_mutex_consistent.c: New file.
3200         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
3201         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
3202         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
3203         Adjust pthread_mutex_t initializers.
3204         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
3205         field to pthread_mutex_t.
3206         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
3207         and __prev field to pthread_mutex_t.
3208         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
3209         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
3210         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
3211         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
3212         * pthread_mutexattr_gettype.c: Likewise.
3213         * pthread_mutexattr_setpshared.c: Likewise.
3214         * pthread_mutexattr_settype.c: Likewise.
3215         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
3216         Initialize mutex kind according to robust flag.
3217         * pthread_mutex_lock.c: Implement local robust mutex.
3218         * pthread_mutex_timedlock.c: Likewise.
3219         * pthread_mutex_trylock.c: Likewise.
3220         * pthread_mutex_unlock.c: Likewise.
3221         * pthread_create.c (start_thread): Mark robust mutexes which remained
3222         locked as dead.
3223         * tst-robust1.c: New file.
3224         * tst-robust2.c: New file.
3225         * tst-robust3.c: New file.
3226         * tst-robust4.c: New file.
3227         * tst-robust5.c: New file.
3228         * tst-robust6.c: New file.
3229         * tst-robust7.c: New file.
3230         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
3231         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
3232         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
3233         tst-robust5, tst-robust6, and tst-robust7.
3235         * tst-typesizes.c: New file.
3236         * Makefile (tests): Add tst-typesizes.
3238         * tst-once3.c: More debug output.
3240 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
3242         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
3243         missing after last change.
3245         * version.c: Update copyright year.
3247 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
3249         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
3250         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
3251         * pthread_mutex_trylock.c: Likewise.
3252         * pthread_mutex_timedlock.c: Likewise.
3253         * pthread_mutex_unlock.c: Likewise.
3255 2005-12-22  Roland McGrath  <roland@redhat.com>
3257         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
3258         so that #include_next's search location is not reset to the -I..
3259         directory where <nptl/...> can be found.
3261 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
3263         [BZ #1913]
3264         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3265         Fix unwind info.  Remove useless branch prediction prefix.
3266         * tst-cancel24.cc: New file.
3267         * Makefile: Add rules to build and run tst-cancel24.
3269 2005-12-21  Roland McGrath  <roland@redhat.com>
3271         * libc-cancellation.c: Use <> rather than "" #includes.
3272         * pt-cleanup.c: Likewise.
3273         * pthread_create.c: Likewise.
3274         * pthread_join.c: Likewise.
3275         * pthread_timedjoin.c: Likewise.
3276         * pthread_tryjoin.c: Likewise.
3277         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
3278         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
3279         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
3280         * unwind.c: Likewise.
3282 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3284         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
3285         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
3286         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3287         THREAD_COPY_POINTER_GUARD): Define.
3289 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
3291         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
3292         rather than one.
3293         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3294         THREAD_COPY_POINTER_GUARD): Define.
3295         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
3296         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
3297         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3298         THREAD_COPY_POINTER_GUARD): Define.
3299         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
3300         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
3301         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
3302         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
3303         Use PTR_DEMANGLE for B0 if defined.
3305 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
3307         * pthread_create.c (__pthread_create_2_1): Use
3308         THREAD_COPY_POINTER_GUARD if available.
3309         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
3310         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3311         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
3312         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
3313         * sysdeps/x86_64/tls.h: Likewise.
3315 2005-12-15  Roland McGrath  <roland@redhat.com>
3317         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
3319 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
3321         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
3322         sysdeps/generic.
3323         * errno-loc.c: New file.
3325 2005-12-12  Roland McGrath  <roland@redhat.com>
3327         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
3328         adjustments before choosing stack size.  Update minimum stack size
3329         calculation to match allocate_stack change.
3331 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
3333         * allocatestack.c (allocate_stack): Don't demand that there is an
3334         additional full page available on the stack beside guard, TLS, the
3335         minimum stack.
3337 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
3339         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3340         (__cleanup_fct_attribute): Use __regparm__ not regparm.
3342         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
3343         compiling 32-bit code we must define __cleanup_fct_attribute.
3345 005-11-24  Jakub Jelinek  <jakub@redhat.com>
3347         [BZ #1920]
3348         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
3349         __attribute__ instead of __attribute.
3350         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3351         (__cleanup_fct_attribute): Likewise.
3353 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
3355         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
3356         a write barrier before writing libgcc_s_getcfa.
3358 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
3360         * sysdeps/unix/sysv/linux/configure: Removed.
3362 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
3364         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
3365         optional init_array/fini_array support.
3367 2005-10-24  Roland McGrath  <roland@redhat.com>
3369         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
3370         versioned_symbol use.
3372 2005-10-16  Roland McGrath  <roland@redhat.com>
3374         * init.c (__pthread_initialize_minimal_internal): Even when using a
3375         compile-time default stack size, apply the minimum that allocate_stack
3376         will require, and round up to page size.
3378 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
3380         * Makefile ($(test-modules)): Remove static pattern rule.
3382 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
3383             Ulrich Drepper  <drepper@redhat.com>
3385         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
3386         alignment in callback function.
3387         * Makefile: Add rules to build and run tst-align3.
3388         * tst-align3.c: New file.
3390 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
3392         * allocatestack.c (setxid_signal_thread): Add
3393         INTERNAL_SYSCALL_DECL (err).
3395 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
3397         * allocatestack.c (setxid_signal_thread): Need to use
3398         atomic_compare_and_exchange_bool_acq.
3400 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
3401             Jakub Jelinek  <jakub@redhat.com>
3403         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
3404         CANCEL_RESTMASK.
3405         (struct pthread): Move specific_used field to avoid padding.
3406         Add setxid_futex field.
3407         * init.c (sighandler_setxid): Reset setxid flag and release the
3408         setxid futex.
3409         * allocatestack.c (setxid_signal_thread): New function.  Broken
3410         out of the bodies of the two loops in __nptl_setxid.  For undetached
3411         threads check whether they are exiting and if yes, don't send a signal.
3412         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
3413         * pthread_create.c (start_thread): For undetached threads, check
3414         whether setxid bit is set.  If yes, wait until signal has been
3415         processed.
3417         * allocatestack.c (STACK_VARIABLES): Initialize them.
3418         * pthread_create.c (__pthread_create_2_1): Initialize pd.
3420 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
3422         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
3423         waiters, awake all waiters on the associated mutex.
3425 2005-09-22  Roland McGrath  <roland@redhat.com>
3427         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
3428         ../sysdeps/x86_64/hp-timing.h).
3430 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
3432         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
3433         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3434         (lll_futex_wake_unlock): Define.
3435         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
3436         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3437         (lll_futex_wake_unlock): Define.
3438         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
3439         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3440         (lll_futex_wake_unlock): Define.
3441         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
3442         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3443         (lll_futex_wake_unlock): Define.
3444         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
3445         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3446         (lll_futex_wake_unlock): Define.
3447         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
3448         lll_futex_wake_unlock.
3449         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3450         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3451         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3452         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
3453         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3454         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3456 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3458         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
3459         Fix typo in register name.
3461 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
3463         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3464         Use __sigfillset.  Document that sigfillset does the right thing wrt
3465         to SIGSETXID.
3467 2005-08-08  Jakub Jelinek  <jakub@redhat.com>
3469         * tst-stackguard1.c (do_test): Likewise.
3471 2005-07-29  Jakub Jelinek  <jakub@redhat.com>
3473         * tst-stackguard1.c (do_test): Don't fail if the poor man's
3474         randomization doesn't work well enough.
3476 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3478         [BZ #1102]
3479         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
3480         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
3481         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
3482         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
3483         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
3484         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
3485         in the structure.
3486         * Makefile (tests): Add tst-initializers1.
3487         (CFLAGS-tst-initializers1.c): Set.
3488         * tst-initializers1.c: New test.
3490 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3492         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
3493         Make sure __flags are located at offset 48 from the start of the
3494         structure.
3496 2005-07-02  Roland McGrath  <roland@redhat.com>
3498         * Makeconfig: Comment fix.
3500 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
3502         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
3503         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
3504         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
3505         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
3506         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3507         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3508         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
3509         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
3510         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
3511         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3513 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
3515         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
3516         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3517         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
3518         fields.
3519         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3520         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
3521         field.  Put in sysinfo field unconditionally.
3522         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3523         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
3524         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3525         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
3526         fields.
3527         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3528         * pthread_create.c (__pthread_create_2_1): Use
3529         THREAD_COPY_STACK_GUARD macro.
3530         * Makefile: Add rules to build and run tst-stackguard1{,-static}
3531         tests.
3532         * tst-stackguard1.c: New file.
3533         * tst-stackguard1-static.c: New file.
3535 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
3537         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
3538         Invoke CGOTSETUP and CGOTRESTORE.
3539         (CGOTSETUP, CGOTRESTORE): Define.
3541 2005-05-29  Richard Henderson  <rth@redhat.com>
3543         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
3544         (tf_write, tf_writev): Use it.
3545         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
3546         the system minimum.
3548 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
3550         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3551         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
3552         __librt_*_asynccancel@local.
3554 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
3556         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
3557         all occurrences of JUMPTARGET.  Instead append @local to labels.
3559 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
3561         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
3562         size/alignment of struct pthread rather than tcbhead_t.
3563         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3564         Likewise.
3565         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3566         Likewise.
3567         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3568         Likewise.
3570 2005-05-19  Richard Henderson  <rth@redhat.com>
3572         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
3573         __sync_val_compare_and_swap, not explicit _si variant.
3574         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
3576 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
3578         [BZ #915]
3579         * sysdeps/pthread/pthread.h: Avoid empty initializers.
3581 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
3583         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
3584         .eh_frame section, use cfi_* directives.
3586 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
3588         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
3589         of "" includes.
3591 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
3593         [BZ #1075]
3594         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
3595         aio_write blocks.
3597 2005-04-27  Roland McGrath  <roland@redhat.com>
3599         * Makefile (tests): Remove tst-clock2.
3601         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
3602         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
3603         translating to the kernel clockid_t for our own process/thread clock.
3605         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
3607 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
3609         * old_pthread_cond_init.c: Include <errno.h>.
3610         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
3611         process shared or uses clock other than CLOCK_REALTIME.
3612         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
3614 2005-04-13  David S. Miller  <davem@davemloft.net>
3616         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
3617         * sysdeps/sparc/sparc64/clone.S: New file.
3619 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
3621         [BZ #1102]
3622         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
3623         __inline instead of inline.
3624         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
3626 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
3628         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
3629         functionally equivalent, but shorter instructions.
3630         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
3631         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3632         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
3633         Likewise.
3634         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
3635         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3636         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3637         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3638         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3639         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
3640         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3641         Likewise.
3642         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3643         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
3644         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3645         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
3646         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3648 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
3650         * sysdeps/mips/Makefile: New file.
3651         * sysdeps/mips/nptl-sysdep.S: New file.
3652         * sysdeps/mips/tcb-offsets.sym: New file.
3653         * sysdeps/mips/pthread_spin_lock.S: New file.
3654         * sysdeps/mips/pthread_spin_trylock.S: New file.
3655         * sysdeps/mips/pthreaddef.h: New file.
3656         * sysdeps/mips/tls.h: New file.
3657         * sysdeps/mips/jmpbuf-unwind.h: New file.
3658         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
3659         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
3660         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
3661         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
3662         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
3663         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
3664         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
3665         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
3666         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
3667         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
3669 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
3671         [BZ #1112]
3672         * pthread_create.c (__pthread_create_2_1): Rename syscall error
3673         variable to scerr.
3675 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
3677         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
3679 2005-02-25  Roland McGrath  <roland@redhat.com>
3681         * alloca_cutoff.c: Correct license text.
3682         * tst-unload.c: Likewise.
3683         * sysdeps/pthread/allocalim.h: Likewise.
3684         * sysdeps/pthread/pt-initfini.c: Likewise.
3685         * sysdeps/pthread/bits/libc-lock.h: Likewise.
3686         * sysdeps/pthread/bits/sigthread.h: Likewise.
3687         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
3688         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
3690 2005-02-16  Roland McGrath  <roland@redhat.com>
3692         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
3693         Use unsigned int * for ptr_nthreads.
3695 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
3697         [BZ #721]
3698         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
3699         gcc4.
3701 2005-02-07  Richard Henderson  <rth@redhat.com>
3703         [BZ #787]
3704         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
3705         argument.
3707 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
3709         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
3710         order of arguments in invocation of atomic_add_zero.
3712 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
3714         [BZ #737]
3715         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
3716         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
3717         at least gotntpoff relocation and addition.
3718         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
3719         Likewise.
3720         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
3721         Likewise.
3722         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3723         Likewise.
3725 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
3727         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
3728         entry for static tls deallocation fix.
3729         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
3730         also contains information whether the memory pointed to is static
3731         TLS or not.
3732         * sysdeps/i386/tls.h: Likewise.
3733         * sysdeps/ia64/tls.h: Likewise.
3734         * sysdeps/powerpc/tls.h: Likewise.
3735         * sysdeps/s390/tls.h: Likewise.
3736         * sysdeps/sh/tls.h: Likewise.
3737         * sysdeps/sparc/tls.h: Likewise.
3738         * sysdeps/x86_64/tls.h: Likewise.
3740 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
3742         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
3744 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
3746         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
3747         %esp.
3748         * Makefile (tests): Add tst-align2.
3749         * tst-align2.c: New test.
3750         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
3751         -mpreferred-stack-boundary=4.
3753 2004-12-18  Roland McGrath  <roland@redhat.com>
3755         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
3756         New file removed withdrawn for the moment.
3758 2004-12-17  Richard Henderson  <rth@redhat.com>
3760         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
3761         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
3763 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
3765         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
3766         Increased PTHREAD_STACK_MIN.
3768         * tst-context1.c (stacks): Use bigger stack size.
3770 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
3772         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
3773         * sysdeps/sparc/tcb-offsets.sym: Add TID.
3775 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
3777         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
3778         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
3779         * sysdeps/s390/tcb-offsets.sym (TID): Add.
3781 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
3783         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
3785 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
3787         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
3788         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
3790         * tst-getpid1.c: If child crashes, report this first.  Print which
3791         signal.
3793 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
3795         * init.c (__pthread_initialize_minimal_internal): Also unblock
3796         SIGSETXID.
3798 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
3800         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
3801         _POSIX_THREAD_CPUTIME): Define to 0.
3802         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
3803         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
3804         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
3805         __timer_signal_thread_tclk): Remove.
3806         (init_module): Remove their initialization.
3807         (thread_cleanup): Remove their cleanup assertions.
3808         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
3809         __timer_signal_thread_tclk): Remove.
3810         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
3811         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
3812         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
3814 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
3816         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
3817         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
3819         * Makefile (tests): Add tst-getpid2.
3820         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
3821         (do_test): Use it.  Use __clone2 instead of clone on ia64.
3822         * tst-getpid2.c: New test.
3824 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3826         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
3828 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
3830         * Makefile (tests): Add tst-getpid1.
3831         * tst-getpid1.c: New file.
3832         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
3833         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
3835 2004-12-02  Roland McGrath  <roland@redhat.com>
3837         * Makefile (libpthread-nonshared): Variable removed.
3838         ($(objpfx)libpthread_nonshared.a): Target removed.
3839         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
3840         These are now handled by generic magic from
3841         libpthread-static-only-routines being set.
3843 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
3845         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
3846         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
3847         _POSIX_THREAD_PRIO_PROTECT): Define.
3848         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3849         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3850         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3852 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
3854         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
3855         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
3856         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
3857         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
3858         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3859         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3860         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3862 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
3864         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
3866         * Makefile (libpthread-routines): Add pthread_setschedprio.
3867         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
3868         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
3869         * pthread_setschedprio.c: New file.
3871 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
3873         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
3874         * pthread_cancel.c (pthread_create): Likewise.
3876         * Makefile (libpthread-routines): Add vars.
3877         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
3878         * init.c (__default_stacksize, __is_smp): Remove.
3879         * vars.c: New file.
3880         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
3881         and define a wrapper macro.
3882         (PTHREAD_STATIC_FN_REQUIRE): Define.
3883         * allocatestack.c (__find_thread_by_id): Undefine.
3884         * pthread_create (__pthread_keys): Remove.
3885         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
3886         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
3887         PTHREAD_STATIC_FN_REQUIRE.
3889 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3891         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
3892         parameter to REGISTER macro.
3894 2004-11-17  Roland McGrath  <roland@redhat.com>
3896         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
3897         Make sure SIGCANCEL is blocked as well.
3899 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3901         * sysdeps/pthread/setxid.h: New file.
3902         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
3903         (struct xid_command): Add forward decl.
3904         (struct pthread_functions): Change return type of __nptl_setxid hook
3905         to int.
3906         * pthreadP.h (__nptl_setxid): Change return type to int.
3907         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
3908         calling thread, return its return value and set errno on failure.
3909         * descr.h (struct xid_command): Change id type to long array.
3911         * Makefile: Add rules to build and test tst-setuid1 and
3912         tst-setuid1-static.
3913         * tst-setuid1.c: New test.
3914         * tst-setuid1-static.c: New test.
3916 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3918         * Makefile (tests): Add tst-exit3.
3919         * tst-exit3.c: New test.
3921 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
3923         * Makefile (tests): Add tst-exit2.
3924         * tst-exit2.c: New file.
3926 2004-11-09  Roland McGrath  <roland@redhat.com>
3928         [BZ #530]
3929         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
3930         here, before calling clone.
3931         * pthread_create.c (start_thread): Don't do it here.
3933 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
3935         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
3937 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
3939         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
3940         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
3941         assembler warning.
3943 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
3945         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
3946         if sched_priority is not between minprio and maxprio.
3948 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3950         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
3951         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
3953         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3954         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
3956 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
3958         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
3959         not-cancelable I/O functions.
3961 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3963         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3964         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3965         make sure 2 is stored in the futex and we looked at the old value.
3966         Fix a few other problems to return the correct value.
3968 2004-10-14  Richard Henderson  <rth@redhat.com>
3970         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
3971         make gcc4 happy.
3973 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
3975         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
3976         of pthread-functions.h and pthreaddef.h.
3977         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
3979         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
3980         Change __data.__nwaiters from int to unsigned int.
3982         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
3983         sysconf (_SC_THREAD_CPUTIME) returns negative value.
3985         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
3986         before return type.
3988         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
3989         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
3991 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
3993         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
3994         test fails, remove message queue.
3995         (tf_msgsnd): Likewise.
3997 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3999         * tst-clock1.c: Change #ifdef to #if defined.
4000         * tst-clock2.c: Likewise.
4001         * tst-cond11.c: Likewise.
4003         * sysdeps/pthread/timer_create.c (timer_create): Use
4004         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
4005         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
4006         THREAD_CPUTIME.
4008 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
4010         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
4011         _POSIX_THREAD_CPUTIME): Define to 0.
4013 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
4015         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
4016         and _POSIX_THREAD_CPUTIME to zero.
4017         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4018         * tst-barrier2.c: Fix testing for POSIX feature.
4019         * tst-clock1.c: Likewise.
4020         * tst-clock2.c: Likewise.
4021         * tst-cond11.c: Likewise.
4022         * tst-cond4.c: Likewise.
4023         * tst-cond6.c: Likewise.
4024         * tst-flock2.c: Likewise.
4025         * tst-mutex4.c: Likewise.
4026         * tst-mutex9.c: Likewise.
4027         * tst-rwlock12.c: Likewise.
4028         * tst-rwlock4.c: Likewise.
4029         * tst-signal1.c: Likewise.
4030         * tst-spin2.c: Likewise.
4031         * sysdeps/pthread/posix-timer.h: Likewise.
4032         * sysdeps/pthread/timer_create.c: Likewise.
4033         * sysdeps/pthread/timer_routines.c: Likewise.
4035 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
4037         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4038         (__lll_mutex_timedlock_wait): Address futex correctly.
4040         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4041         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
4042         make sure 2 is stored in the futex and we looked at the old value.
4043         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4044         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
4045         which might very well made the code not working at all before.
4046         [BZ #417]
4048 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
4050         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
4051         allow SIGSETXID to be sent.
4052         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
4053         for SIGSETXID to be defined.
4054         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
4055         SIGSETXID cannot be blocked.
4057         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4058         Add __extension__ to long long types.
4059         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4060         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4061         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4062         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4063         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
4064         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4065         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4067 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
4069         * descr.h (struct pthread): Add stopped_start field.
4070         * sysdeps/pthread/createthread.c (create_thread): Set
4071         start_stopped flag in descriptor for new thread appropriately.
4072         * pthread_create.c (start_thread): Only take lock to be stopped on
4073         startup if stopped_start flag says so.
4075 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
4077         * pthread_create.c (__pthread_create_2_1): Remember whether thread
4078         is created detached and if yes, do not try to free the stack in case
4079         the thread creation failed.
4080         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
4081         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
4082         case there has been no error.  [BZ #405]
4084         * pthread_create.c (start_thread): Don't wait for scheduler data
4085         etc to be set at the beginning of the function.  The cancellation
4086         infrastructure must have been set up.  And enable async
4087         cancellation before potentially going to sleep.  [BZ #401]
4089 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
4091         * Versions: Remove exports for pthread_set*id_np functions.
4092         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
4093         for now.
4094         * Makefile: Don't build pthread_set*id code for now.
4096 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
4098         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
4099         internal use.
4100         * allocatestack.c (__nptl_setxid): New function.
4101         * descr.h (struct xid_command): Define type.
4102         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
4103         (sighandler_setxid): New function.
4104         (__pthread_initialize_minimal): Register sighandler_setxid for
4105         SIGCANCEL.
4106         * pt-allocrtsig.c: Update comment.
4107         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
4108         Declare __nptl_setxid.
4109         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
4110         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
4111         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
4112         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
4113         and pthread_setresuid_np.
4114         * pthread_setgid_np.c: New file.
4115         * pthread_setuid_np.c: New file.
4116         * pthread_setegid_np.c: New file.
4117         * pthread_seteuid_np.c: New file.
4118         * pthread_setregid_np.c: New file.
4119         * pthread_setreuid_np.c: New file.
4120         * pthread_setresgid_np.c: New file.
4121         * pthread_setresuid_np.c: New file.
4122         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
4123         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
4124         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
4125         and pthread_setresuid_np.
4126         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
4127         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
4128         pthread_setregid, and pthread_setresgid.
4130 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
4132         * allocatestack.c (allocate_stack): Return EAGAIN instead of
4133         ENOMEM when out of memory.
4135 2004-09-10  Roland McGrath  <roland@redhat.com>
4137         [BZ #379]
4138         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
4139         code, since we don't try to use the broken CLONE_STOPPED any more.
4140         * pthread_create.c (start_thread): Likewise.
4142 2004-09-15  Richard Henderson  <rth@redhat.com>
4144         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
4146 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
4148         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
4149         (__libc_unwind_longjmp): Delete macro and declare as function.
4150         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
4151         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
4152         nptl directory.
4153         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
4154         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
4155         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
4157 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
4159         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
4160         for __USE_XOPEN2K.
4161         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
4162         types also for __USE_XOPEN2K.
4163         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4164         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4165         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4166         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4167         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4168         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4169         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4170         [BZ #320]
4172 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
4174         * sysdeps/pthread/pthread.h
4175         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
4176         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
4177         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
4178         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
4179         [BZ #375]
4181 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
4183         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
4184         PSEUDO to be used with . prefix.
4186         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
4187         Use atomic_increment instead of atomic_exchange_and_add.
4188         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
4189         Likewise.
4190         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
4191         Likewise.
4192         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
4193         Likewise.
4195         * allocatestack.c (allocate_stack): Use atomic_increment_val
4196         instead of atomic_exchange_and_add.
4197         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
4198         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
4199         Likewise.
4200         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4201         Likewise.
4203         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
4204         the initialization function might throw.
4206 2005-09-05  Richard Henderson  <rth@redhat.com>
4208         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
4209         Move definition inside libpthread, libc, librt check.  Provide
4210         definition for rtld.
4212 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
4214         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
4215         waiters, awake all waiters on the associated mutex.
4217 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
4219         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
4220         * sysdeps/i386/jmpbuf-unwind.h: Likewise
4221         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
4222         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
4223         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
4224         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
4225         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
4226         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
4227         * unwind.c: Use it.
4229         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4230         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
4231         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4232         Likewise.
4233         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4234         Decrement __nwaiters.  If pthread_cond_destroy has been called and
4235         this is the last waiter, signal pthread_cond_destroy caller and
4236         avoid using the pthread_cond_t structure after unlock.
4237         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4238         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4239         Read clock type from the least significant bits of __nwaiters instead
4240         of __clock.
4241         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4242         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
4244 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
4246         [BZ #342]
4247         * Makefile (tests): Add tst-cond20 and tst-cond21.
4248         * tst-cond20.c: New test.
4249         * tst-cond21.c: New test.
4250         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
4251         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
4252         it unsigned int.
4253         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4254         Likewise.
4255         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4256         (pthread_cond_t): Likewise.
4257         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4258         Likewise.
4259         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4260         Likewise.
4261         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4262         Likewise.
4263         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
4264         (cond_nwaiters): New.
4265         (clock_bits): New.
4266         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
4267         if there are waiters not signalled yet.
4268         Wait until all already signalled waiters wake up.
4269         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
4270         __nwaiters.  If pthread_cond_destroy has been called and this is the
4271         last waiter, signal pthread_cond_destroy caller and avoid using
4272         the pthread_cond_t structure after unlock.
4273         (__pthread_cond_wait): Increment __nwaiters in the beginning,
4274         decrement it when leaving.  If pthread_cond_destroy has been called
4275         and this is the last waiter, signal pthread_cond_destroy caller.
4276         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4277         Likewise.  Read clock type from the least significant bits of
4278         __nwaiters instead of __clock.
4279         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
4280         whether clock ID can be encoded in COND_CLOCK_BITS bits.
4281         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
4282         clock type just from the last COND_CLOCK_BITS bits of value.
4283         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
4284         instead of __clock, just from second bit of condattr's value.
4286 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
4288         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
4289         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
4290         != 64.
4291         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4293 2004-08-15  Roland McGrath  <roland@frob.com>
4295         * pthread_atfork.c: Update copyright terms including special exception
4296         for these trivial files, which are statically linked into executables
4297         that use dynamic linking for the significant library code.
4299 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
4301         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
4302         pthread_rwlock_rdlock.
4303         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
4304         Decrease __nr_readers_queued after reacquiring lock.
4305         * sysdeps/pthread/pthread_rwlock_timedrdlock
4306         (pthread_rwlock_timedrdlock): Likewise.
4307         Reported by Bob Cook <bobcook47@hotmail.com>.
4309 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
4311         * tst-rwlock14.c (tf): Read main thread handle from *ARG
4312         before pthread_barrier_wait.
4314 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
4316         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
4317         Remove unnecessary exception handling data.
4319 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
4321         [BZ #284]
4322         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
4323         instead of clockid_t.
4325 2004-07-21  Roland McGrath  <roland@redhat.com>
4327         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
4329 2004-07-19  Roland McGrath  <roland@redhat.com>
4331         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
4333 2004-07-02  Roland McGrath  <roland@redhat.com>
4335         * configure: Don't exit.
4337 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4339         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4340         (__pthread_cond_timedwait): Check for invalid nanosecond in
4341         timeout value.
4343 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
4345         * Makefile: Add rules to build and run tst-fini1.
4346         * tst-fini1.c: New file.
4347         * tst-fini1mod.c: New file.
4349 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
4351         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
4352         if no cancellation support is needed.
4353         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
4354         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
4355         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4356         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
4357         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
4358         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
4359         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
4360         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
4361         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
4363         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
4364         only if not already defined.
4366 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
4368         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
4369         constraint "m" instead of "0" for futex.
4371         * shlib-versions: Add powerpc64-.*-linux.*.
4373 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
4375         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
4376         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
4377         for valid tv_nsec.
4378         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
4379         1 billion and 64-bit tv_nsec which is valid when truncated to 32
4380         bits.
4382 2004-06-29  Roland McGrath  <roland@redhat.com>
4384         * Banner: NPTL no longer has its own version number.
4385         * Makefile (nptl-version): Variable removed.
4386         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
4387         using $(version), the glibc version number.
4389 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4391         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4392         Fix branch offset for a PLT entry.
4393         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
4394         Likewise.
4395         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
4396         Likewise.
4397         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
4398         Likewise.
4399         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
4400         Likewise.
4402 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4404         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
4405         unconditionally.
4407 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4409         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
4410         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
4411         instead of tv_sec.
4412         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
4413         (pthread_rwlock_timedrdlock): Likewise.
4415 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
4417         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4418         Set __r7 to val, not mutex.
4420 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
4422         * Makefile: Add rules to build tst-rwlock14.
4423         * tst-rwlock14.c: New file.
4425 2004-06-24  Boris Hu  <boris.hu@intel.com>
4427         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
4428         check.
4429         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
4431 2004-06-19  Andreas Jaeger  <aj@suse.de>
4433         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
4434         assembler in last patch.
4436 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
4438         * sysdeps/pthread/pthread_cond_timedwait.c
4439         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
4440         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4441         (__pthread_cond_timedwait): Check for invalid nanosecond in
4442         timeout value.
4443         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4444         * tst-cond19.c: New file.
4445         * Makefile: Add rules to build and run tst-cond19.
4447 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
4449         * tst-context1.c (GUARD_PATTERN): Defined.
4450         (tst_context_t): Define struct containing ucontext_t & guard words.
4451         (ctx): Declare as an array of tst_context_t.
4452         (fct): Verify uc_link & guard words are still valid.
4453         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
4455 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4457         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4458         Add __data.__futex field, reshuffle __data.__clock.
4459         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
4460         (__pthread_cond_signal): Increment __futex at the same time as
4461         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4462         address of low 32-bits of __wakeup_seq to futex syscall.
4463         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4464         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4465         releasing internal lock to FUTEX_WAIT.
4466         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4467         (__pthread_cond_timedwait): Likewise.
4468         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4469         (FUTEX_CMP_REQUEUE): Define.
4470         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4471         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4472         Pass __futex value from before the unlock and __futex address instead
4473         of address of low 32-bits of __wakeup_seq to futex syscall.
4474         Fallback to FUTEX_WAKE all on any errors.
4476 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
4478         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
4479         comment typo.
4480         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
4481         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
4482         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
4483         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
4484         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
4486 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4488         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
4489         Add memory clobber to inline assembly.
4490         (__lll_mutex_trylock): Likewise.
4491         (__lll_mutex_cond_trylock): Likewise.
4493 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4495         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4496         Pass val argument as 6th system call argument in %r7.
4498 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4500         * Makefile (tests): Add tst-cond16.
4501         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
4502         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
4503         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4504         Add __data.__futex field, reshuffle __data.__clock.
4505         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
4506         (__pthread_cond_signal): Increment __futex at the same time as
4507         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4508         address of low 32-bits of __wakeup_seq to futex syscall.
4509         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
4510         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4511         releasing internal lock to FUTEX_WAIT.
4512         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
4513         (__pthread_cond_timedwait): Likewise.
4514         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
4515         (FUTEX_CMP_REQUEUE): Define.
4516         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4517         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4518         Pass __futex value from before the unlock and __futex address instead
4519         of address of low 32-bits of __wakeup_seq to futex syscall.
4520         Fallback to FUTEX_WAKE all on any errors.
4521         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
4522         Define.
4523         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4524         internally.  Return non-zero if error, zero if success.
4525         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4526         Add __data.__futex field, reshuffle __data.__clock.
4527         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
4528         Define.
4529         (lll_futex_requeue): Add val argument, return 1 unconditionally
4530         for the time being.
4531         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4532         Add __data.__futex field, reshuffle __data.__clock.
4533         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4534         Define.
4535         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4536         internally.  Return non-zero if error, zero if success.
4537         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4538         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
4539         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4540         Define.
4541         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4542         internally.  Return non-zero if error, zero if success.
4543         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4544         Add __data.__futex field, reshuffle __data.__clock.
4545         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
4546         Define.
4547         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4548         internally.  Return non-zero if error, zero if success.
4549         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4550         Add __data.__futex field, reshuffle __data.__clock.
4551         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4552         Add __data.__futex field, reshuffle __data.__clock.
4553         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
4554         Increment __futex at the same time as __wakeup_seq or __total_seq.
4555         Pass address of __futex instead of address of low 32-bits of
4556         __wakeup_seq to futex syscall.
4557         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4558         Pass __futex value from before releasing internal lock
4559         to FUTEX_WAIT.
4560         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4561         Likewise.  Avoid unnecessary shadowing of variables.
4562         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
4563         Set __futex to 2 * __total_seq.  Pass __futex value from before the
4564         unlock and __futex address instead of address of low 32-bits of
4565         __wakeup_seq to futex_requeue macro, adjust for new return value
4566         meaning.
4567         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
4568         (__pthread_cond_signal): Increment __futex at the same time as
4569         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4570         address of low 32-bits of __wakeup_seq to futex syscall.
4571         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
4572         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4573         releasing internal lock to FUTEX_WAIT.
4574         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4575         (__pthread_cond_timedwait): Likewise.
4576         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4577         (FUTEX_CMP_REQUEUE): Define.
4578         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4579         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4580         Pass __futex value from before the unlock and __futex address instead
4581         of address of low 32-bits of __wakeup_seq to futex syscall.
4582         Fallback to FUTEX_WAKE all on any errors.
4584 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4586         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
4587         Add nop to align the end of critical section.
4588         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
4590 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4592         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4593         Add __broadcast_seq field.
4594         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
4595         all waiters as woken with woken_seq and bump broadcast counter.
4596         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
4597         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
4598         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4599         Comment typo fixes.  Avoid returning -ETIMEDOUT.
4601 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
4603         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4604         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
4605         Reported by Kaz Kojima.
4607 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
4609         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
4611 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4613         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
4614         __broadcast_seq with bc_seq after acquiring internal lock instead of
4615         before it.
4617 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
4619         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
4620         compilation.
4621         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4622         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
4623         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4624         (pthread_cond_t): Add __data.__broadcast_seq field.
4625         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4626         (FRAME_SIZE): Define.
4627         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
4628         Comment typo fixes.
4629         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
4630         Define.
4631         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
4632         typo fixes.
4633         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4634         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
4635         fixes.
4637 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
4639         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
4640         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4641         Add __broadcast_seq field.
4642         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4643         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4644         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4645         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4646         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4647         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
4648         all waiters as woken with woken_seq and bump broadcast counter.
4649         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
4650         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
4651         __broadcast_seq field.
4652         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4653         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4654         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
4655         * pthread_cond_init.c: Initialize __broadcast_seq field.
4656         * Makefile (tests): Add tst-cond17 and tst-cond18.
4657         Add .NOTPARALLEL goal.
4658         * tst-cond16.c: New file.  From Jakub.
4659         * tst-cond17.c: New file.  From Jakub.
4660         * tst-cond18.c: New file.  From Jakub.
4662 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
4664         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
4665         unwind info.
4667         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4668         Parametrize frame size.  Correct some unwind info.
4669         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4671 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4673         * tst-stack3.c: Note testing functionality beyond POSIX.
4675 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4677         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
4678         Change conditional from ifdef to if.
4680 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
4682         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
4683         SYSDEP_CANCEL_ERROR): Define.
4684         (PSEUDO): Use it.
4686 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
4688         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
4690 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
4692         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
4694 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4696         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
4697         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4698         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
4699         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4701 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
4703         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
4704         thread has all signals blocked.
4706 2004-04-18  Andreas Jaeger  <aj@suse.de>
4708         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
4709         (SEM_VALUE_MAX): Add missing brace.
4711 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4713         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
4714         in rt subdir.
4715         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
4716         * sysdeps/pthread/tst-mqueue8x.c: New test.
4717         * tst-cancel4.c: Update comment about message queues.
4719         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
4720         return it_value { 0, 0 }.
4721         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
4722         like SIGEV_SIGNAL.
4723         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
4724         assertion for SIGEV_NONE.
4725         (thread_attr_compare): Compare all attributes, not just a partial
4726         subset.
4728 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4730         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
4732 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
4734         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
4735         Just use a plain number.
4736         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
4737         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
4738         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
4739         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
4740         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
4741         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
4742         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4744 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4746         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
4747         frame info.
4748         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4750 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
4752         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
4753         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
4754         of calling sigwaitinfo.
4756 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
4758         * allocatestack.c (allocate_stack): Set reported_guardsize
4759         unconditionally.
4760         * pthread_getattr_np.c (pthread_getattr_np): Use
4761         reported_guardsize instead of guardsize.
4762         * descr.h (struct pthread): Add reported_guardsize field.
4764 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
4766         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
4768 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
4770         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
4772 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
4774         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
4775         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
4776         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
4777         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
4778         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
4779         Define.
4780         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
4781         (_POSIX_MESSAGE_PASSING): Define.
4782         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
4783         (_POSIX_MESSAGE_PASSING): Define.
4784         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
4785         (_POSIX_MESSAGE_PASSING): Define.
4787 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
4789         * tst-context1.c (fct): Check whether correct stack is used.
4791 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
4793         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
4794         matching constraints for asm mem parameters.
4796         * tst-clock2.c (tf): Don't define unless needed.
4798 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
4800         * Makefile (link-libc-static): Use $(static-gnulib) instead of
4801         $(gnulib).
4803 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
4805         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
4806         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
4807         * pthreadP.h: Declare __nptl_deallocate_tsd.
4808         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
4809         Adjust caller.
4811         * Makefile (tests): Add tst-tsd5.
4812         * tst-tsd5.c: New file.
4814 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
4816         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4817         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
4818         is SHLIB_COMPAT check.
4819         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
4820         (__pthread_attr_getaffinity_old): Likewise.
4821         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4822         (__pthread_getaffinity_old): Likewise.
4823         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4824         (__pthread_setaffinity_old): Likewise.
4826 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
4828         * allocatestack.c (_make_stacks_executable): Call
4829         _dl_make_stack_executable first.
4831 2004-03-24  Roland McGrath  <roland@redhat.com>
4833         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
4834         constraint instead of "0".
4836 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
4838         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4839         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
4841         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
4842         code to avoid warning.
4844 2004-03-24  Andreas Jaeger  <aj@suse.de>
4846         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4847         (__pthread_attr_setaffinity_old): Remove const.
4849 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
4851         * sysdeps/unix/sysv/linux/smp.h: New file.
4852         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
4853         * init.c: Define __is_smp.
4854         (__pthread_initialize_minimal_internal): Call is_smp_system to
4855         initialize __is_smp.
4856         * pthreadP.h: Declare __is_smp.
4857         Define MAX_ADAPTIVE_COUNT is necessary.
4858         * pthread_mutex_init.c: Add comment regarding __spins field.
4859         * pthread_mutex_lock.c: Implement adaptive mutex type.
4860         * pthread_mutex_timedlock.c: Likewise.
4861         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
4862         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
4863         Add __spins field.
4864         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4865         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4866         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4867         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4868         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4869         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4870         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4871         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
4872         lll_mutex_cond_trylock.
4873         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4874         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4875         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4876         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4877         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4878         Define BUSY_WAIT_NOP.
4879         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4880         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4882         * tst-mutex5.c: Add support for testing adaptive mutexes.
4883         * tst-mutex7.c: Likewise.
4884         * tst-mutex5a.c: New file.
4885         * tst-mutex7a.c: New file.
4886         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
4888         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4889         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
4890         vgettimeofday call might destroy the content.
4892         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
4893         @pause in the loop.
4895         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4896         No need to restrict type of ret.  Make it int.  Add comment.
4898         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4899         Remove unnecessary setne instruction.
4901 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
4903         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4904         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
4905         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
4906         If realloc fails, break out of the loop.
4908 2004-03-20  Andreas Jaeger  <aj@suse.de>
4910         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4911         (__pthread_setaffinity_old): Fix interface.
4912         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4913         (__pthread_getaffinity_old): Likewise.
4915         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4916         (__pthread_setaffinity_new): Remove duplicate declaration.
4918 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4920         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
4921         the return value to a safe register.
4922         (CDISABLE): Set the function argument correctly.
4924 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4926         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
4927         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
4928         Rewrite so that only one locked memory operation per round is needed.
4929         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
4930         (pthread_barrier_wait): After wakeup, release lock only when the
4931         last thread stopped using the barrier object.
4932         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4933         (__pthread_cond_wait): Don't store mutex address if the current
4934         value is ~0l.  Add correct cleanup support and unwind info.
4935         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4936         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4937         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
4938         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
4939         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4940         Add correct cleanup support and unwind info.
4941         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
4942         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
4943         information for syscall wrappers.
4945 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
4947         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
4948         cpusetsize field, remove next.
4949         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
4950         parameter for size of the CPU set.
4951         (pthread_setaffinity_np): Likewise.
4952         (pthread_attr_getaffinity_np): Likewise.
4953         (pthread_attr_setaffinity_np): Likewise.
4954         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
4955         interface change, keep compatibility code.
4956         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
4957         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
4958         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
4959         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
4960         __pthread_getaffinity_np.
4961         * Versions: Add version for changed interfaces.
4962         * tst-attr3.c: Adjust test for interface change.
4963         * pthread_getattr_np.c: Query the kernel about the affinity mask with
4964         increasing buffer sizes.
4965         * pthread_attr_destroy.c: Remove unused list handling.
4966         * pthread_attr_init.c: Likewise.
4968 2004-03-17  Roland McGrath  <roland@redhat.com>
4970         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
4971         first argument to clock_getres so we ever enable kernel timers.
4973 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
4975         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
4977 2004-03-12  Richard Henderson  <rth@redhat.com>
4979         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
4980         oldvalue from CENABLE to CDISABLE.
4982 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
4984         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
4985         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
4986         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
4987         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
4989 2004-03-11  Richard Henderson  <rth@redhat.com>
4991         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
4992         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
4993         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
4995 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4997         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
4998         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
4999         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
5001 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
5003         * forward.c (__pthread_cond_broadcast_2_0,
5004         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
5005         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
5006         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
5008 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5010         * sysdeps/sh/tcb-offsets.sym: Add PID.
5011         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
5012         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
5014 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
5016         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
5017         include <sysdep-cancel.h>, vfork is no cancellation point.
5018         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
5019         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
5020         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
5022 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
5024         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
5025         libc_hidden_def.
5026         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
5027         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
5028         Likewise.
5029         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
5030         Likewise.
5031         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
5032         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
5033         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
5034         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
5035         of DO_CALL_VIA_BREAK.  Work around a gas problem.
5037         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
5038         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
5039         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
5040         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
5041         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
5042         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
5044         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
5045         a local register for saving old PID.  Negate PID in parent upon exit.
5047         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
5048         tcb-offsets.h.
5049         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
5050         before syscall, set to the old value in the parent afterwards.
5051         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
5052         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
5053         tcb-offsets.h.
5054         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
5055         before syscall, set to the old value in the parent afterwards.
5056         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
5057         * sysdeps/s390/tcb-offsets.sym: Add PID.
5059         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
5060         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
5061         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
5062         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
5063         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
5064         * sysdeps/sparc/tcb-offsets.sym: Add PID.
5066 2004-03-10  Andreas Schwab  <schwab@suse.de>
5068         * sysdeps/ia64/tcb-offsets.sym: Add PID.
5069         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
5070         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
5072 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
5074         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
5075         * tst-cancel21.c (do_one_test): Likewise.
5076         Reported by Gordon Jin <gordon.jin@intel.com>.
5078 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
5080         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
5081         if non-zero and set to INT_MIN if zero.
5082         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
5083         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
5084         (SAVE_PID, RESTORE_PID): Define.
5085         (__vfork): Use it.
5086         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
5087         Use relative path to avoid including NPTL i386/vfork.S.
5088         (SAVE_PID, RESTORE_PID): Define.
5089         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
5090         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
5091         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
5092         tst-vfork2x.
5093         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
5094         * tst-vfork1.c: New test.
5095         * tst-vfork2.c: New test.
5096         * tst-vfork1x.c: New test.
5097         * tst-vfork2x.c: New test.
5099 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
5101         * sysdeps/i386/tcb-offsets.sym: Add PID.
5102         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
5103         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
5104         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
5106 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
5108         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
5110 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
5112         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
5113         _rtld_global_ro.
5115 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
5117         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
5118         _rtld_global_ro.
5120         * tst-once4.c: Remove unnecessary macro definition.
5122         * tst-mutex7.c (do_test): Limit thread stack size.
5123         * tst-once2.c (do_test): Likewise.
5124         * tst-tls3.c (do_test): Likewise.
5125         * tst-tls1.c (do_test): Likewise.
5126         * tst-signal3.c (do_test): Likewise.
5127         * tst-kill6.c (do_test): Likewise.
5128         * tst-key4.c (do_test): Likewise.
5129         * tst-join4.c (do_test): Likewise.
5130         * tst-fork1.c (do_test): Likewise.
5131         * tst-context1.c (do_test): Likewise.
5132         * tst-cond2.c (do_test): Likewise.
5133         * tst-cond10.c (do_test): Likewise.
5134         * tst-clock2.c (do_test): Likewise.
5135         * tst-cancel10.c (do_test): Likewise.
5136         * tst-basic2.c (do_test): Likewise.
5137         * tst-barrier4.c (do_test): Likewise.
5139 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
5141         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
5143 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
5145         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5146         (__pthread_cond_timedwait): Optimize wakeup test.
5147         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5148         (__pthread_cond_wait): Likewise.
5149         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
5150         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5151         Likewise.
5153 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
5155         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5156         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
5157         the atomic instruction needed.
5158         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5159         (__lll_mutex_lock_wait): Likewise.
5161 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
5163         * Makefile (tests): Add tst-cond14 and tst-cond15.
5164         * tst-cond14.c: New file.
5165         * tst-cond15.c: New file.
5167 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
5169         * sysdeps/pthread/createthread.c (create_thread): Remove use of
5170         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
5171         needs to be implemented differently to be useful.
5173 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
5175         * pthread_attr_setschedparam.c: Don't test priority against limits
5176         here.  Set ATTR_FLAG_SCHED_SET flag.
5177         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
5178         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
5179         from parent thread to child.  If attribute is used and scheduling
5180         parameters are not inherited, copy parameters from attribute or
5181         compute them.  Check priority value.
5182         * pthread_getschedparam.c: If the parameters aren't known yet get
5183         them from the kernel.
5184         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
5185         ATTR_FLAG_POLICY_SET flag for thread.
5186         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
5187         and ATTR_FLAG_POLICY_SET.
5189         * sysdeps/pthread/createthread.c: Use tgkill if possible.
5191         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
5192         fail if stack address hasn't been set.  Just return 0.
5194 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
5196         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
5197         libpthread for the files in this list.
5198         (CFLAGS-tst-unload): Removed.
5199         * tst-unload.c (do_test): Don't use complete path for
5200         LIBPHREAD_SO.
5202         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
5203         tst-_res1mod2.
5205 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
5207         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5208         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
5209         operation per round is needed.
5210         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5211         (__lll_mutex_lock_wait): Likewise.
5213 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
5215         * tst-cancel9.c (cleanup): Don't print to stderr.
5217 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5219         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
5221 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
5223         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
5224         (__syscall_error_handler2): Call CDISABLE.
5225         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
5226         (__syscall_error_handler2): Call CDISABLE.
5228         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5229         Release lock before the loop, don't reacquire it.
5231         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
5233 2004-02-19  Andreas Schwab  <schwab@suse.de>
5235         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5236         Fix last change.
5238 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
5240         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
5241         (pthread_barrier_wait): After wakeup, release lock only when the
5242         last thread stopped using the barrier object.
5243         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
5244         (pthread_barrier_wait): Likewise.
5245         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5246         Likewise.
5247         * Makefile (tests): Add tst-barrier4.
5248         * tst-barrier4.c: New file.
5250         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5251         (__pthread_cond_timedwait): Perform timeout test while holding
5252         internal lock to prevent wakeup race.
5253         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
5254         * sysdeps/pthread/pthread_cond_timedwait.c
5255         (__pthread_cond_timedwait): Likewise.
5256         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5257         (__pthread_cond_timedwait): Likewise.
5259 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
5261         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
5262         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
5263         * Makefile (tests): Add tst-rwlock13.
5264         * tst-rwlock13.c: New test.
5266 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
5268         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5269         (__condvar_tw_cleanup): Little optimization.
5270         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
5272 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
5274         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
5275         libpthread as "lib" parameter to SHLIB_COMPAT.
5276         (__novmx_siglongjmp): Fix typo in function name.
5277         (__novmx_longjmp): Fix typo in function name.
5279 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
5281         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
5282         __builtin_expect.
5284         * sysdeps/generic/pt-longjmp.c: Moved to...
5285         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
5287 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
5289         * Makefile (libpthread-routines): Add pt-cleanup.
5290         * pt-longjmp.c: Removed.
5291         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
5292         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
5293         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
5294         Version longjmp, siglongjmp for GLIBC_2.3.4.
5295         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
5297 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
5299         * sysdeps/pthread/pthread_cond_timedwait.c
5300         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
5301         Reuse code.  Add __builtin_expects.
5303         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5304         (__pthread_cond_timedwait): Get internal lock in case timeout has
5305         passed before the futex syscall.
5306         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5308 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
5310         * allocatestack.c: Pretty printing.
5312         * sysdeps/pthread/createthread.c (create_thread): Don't add
5313         CLONE_DETACHED bit if it is not necessary.
5315 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
5317         * pthread_getattr_np.c: Include ldsodefs.h.
5319 2004-01-16  Richard Henderson  <rth@redhat.com>
5321         * allocatestack.c: Don't declare __libc_stack_end.
5322         * init.c (__pthread_initialize_minimal_internal): Likewise.
5323         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
5325 2004-01-15  Richard Henderson  <rth@redhat.com>
5327         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
5328         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
5329         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
5330         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
5331         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
5332         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
5333         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
5334         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
5336 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
5338         * init.c (pthread_functions): Make array const.
5340 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
5342         * allocatestack.c (__make_stacks_executable): Change interface.
5343         Check parameters.  Pass parameter on to libc counterpart.
5344         * pthreadP.h: Change declaration.
5346 2004-01-13  Richard Henderson  <rth@redhat.com>
5348         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
5349         prototype form.
5350         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
5351         Likewise.
5353         * sysdeps/alpha/Makefile: New file.
5354         * sysdeps/alpha/tcb-offsets.sym: New file.
5355         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
5356         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
5358         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
5359         on powerpc version.
5361 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
5363         * Makefile (tests): Add tst-backtrace1.
5364         * tst-backtrace1.c: New test.
5366 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
5368         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
5369         register as second parameter to the REGISTER macro.
5370         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
5371         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
5372         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
5373         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
5374         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
5375         of thread register as second parameter to REGISTER macro in 64 case.
5377 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
5379         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
5380         (CFLAGS-getpid.o): Defined.
5381         (CFLAGS-getpid.os): Defined.
5383 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
5385         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
5386         returned for main thread does not overlap with any other VMA.
5387         Patch by Jakub Jelinek.
5389 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
5391         * tst-raise1.c: Include stdio.h.
5393 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
5395         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
5396         setting with __ASSUME_TGKILL || defined __NR_tgkill.
5397         If pid is 0, set it to selftid.
5398         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
5399         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
5400         != 0, return self->tid without doing a syscall.
5401         * descr.h (struct pthread): Move pid field after tid.
5403         * Makefile (tests): Add tst-raise1.
5404         * tst-raise1.c: New file.
5406 2003-12-23  Roland McGrath  <roland@redhat.com>
5408         * tst-oddstacklimit.c: New file.
5409         * Makefile (tests): Add it.
5410         (tst-oddstacklimit-ENV): New variable.
5412         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
5413         value up to page size for __default_stacksize.
5415 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
5417         * Makefile (tests): Add tst-eintr5.
5418         * tst-eintr5.c: New file.
5420         * eintr.c (eintr_source): Prevent sending signal to self.
5422         * tst-eintr2.c (tf1): Improve error message.
5424 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
5426         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
5427         * sysdeps/unix/sysv/linux/getpid.c: New file.
5428         * pthread_cancel.c: Add comment explaining use of PID field.
5429         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
5430         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
5431         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
5432         temporarily to signal the field must not be relied on and updated
5433         by getpid().
5434         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
5435         temporarily negative.
5436         * sysdeps/unix/sysv/linux/raise.c: Likewise.
5438 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
5440         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
5441         (eintr_source): If ARG != NULL, use pthread_kill.
5442         * tst-eintr1.c: Adjust for this change.
5443         * tst-eintr2.c: Likewise.
5444         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
5445         * tst-eintr3.c: New file.
5446         * tst-eintr4.c: New file.
5448 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
5450         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
5451         if CANCELSTATE_BITMASK is set.
5452         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
5453         Likewise.
5455         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
5456         (tests-reverse): Add tst-cancel23.
5457         * tst-cancel22.c: New test.
5458         * tst-cancel23.c: New test.
5460 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
5462         * tst-eintr1.c: Better error messages.
5464         * Makefile (tests): Add tst-eintr2.
5465         * tst-eintr2.c: New file.
5467 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
5469         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
5470         (CFLAGS-tst-cancelx21.c): Set.
5471         * tst-cancel21.c: New test.
5472         * tst-cancelx21.c: New test.
5474         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
5475         comparison operand.
5476         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
5477         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
5478         * pt-longjmp.c: Include jmpbuf-unwind.h.
5479         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
5480         _JMPBUF_UNWINDS.  Adjust compared pointers.
5481         * init.c (__pthread_initialize_minimal_internal): Initialize
5482         pd->stackblock_size.
5483         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
5484         * sysdeps/alpha/jmpbuf-unwind.h: New file.
5485         * sysdeps/i386/jmpbuf-unwind.h: New file.
5486         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
5487         * sysdeps/s390/jmpbuf-unwind.h: New file.
5488         * sysdeps/sh/jmpbuf-unwind.h: New file.
5489         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
5490         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
5491         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
5492         (_JMPBUF_CFA_UNWINDS): Remove.
5493         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
5495 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
5497         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
5498         (CFLAGS-tst-cancelx20.c): Set.
5499         * tst-cancel20.c: New test.
5500         * tst-cancelx20.c: New test.
5502 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
5504         * init.c (__pthread_initialize_minimal_internal): Don't treat
5505         architectures with separate register stack special here when
5506         computing default stack size.
5508 2003-12-17  Roland McGrath  <roland@redhat.com>
5510         * Makefile (tst-cancelx7-ARGS): New variable.
5511         Reportd by Greg Schafer <gschafer@zip.com.au>.
5513 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
5515         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
5516         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
5517         (tst-stack3-ENV): Set.
5518         ($(objpfx)tst-stack3-mem): New.
5519         * tst-stack3.c: New test.
5521 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
5523         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
5524         Add unwind directives.  Drop unused .regstk directive.
5525         (_fini_EPILOG_BEGINS): Add unwind directives.
5527 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
5529         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
5530         Assume parameter is a pointer.
5531         (lll_futex_wake): Likewise.
5532         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
5533         Likewise.
5534         (lll_futex_wake): Likewise.
5535         Reported by Boris Hu.
5536         * sysdeps/unix/sysv/linux/unregister-atfork.c
5537         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
5539         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
5541 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
5543         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
5544         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
5545         __rtld_lock_initialize for ld.so lock.
5546         Patch in part by Adam Li <adam.li@intel.com>.
5548 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
5550         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
5551         in $(gnulib).  Also, remove stale comment.
5553 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
5555         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
5556         advantage of new syscall stub and optimize accordingly.
5558         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
5559         from SYS_futex, to match expectations of
5560         sysdep.h:DO_INLINE_SYSCALL.
5561         (lll_futex_clobbers): Remove.
5562         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
5563         (lll_futex_wake): Likewise.
5564         (lll_futex_requeue): Likewise.
5565         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
5566         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
5567         Jelinek).
5568         (__lll_mutex_lock): Likewise.
5569         (__lll_mutex_cond_lock): Likewise.
5570         (__lll_mutex_timed_lock): Likewise.
5571         (__lll_mutex_unlock): Likewise.
5572         (__lll_mutex_unlock_force): Likewise.
5574         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
5575         comes before the include of <sysdep.h>.
5576         (THREAD_SELF_SYSINFO): New macro.
5577         (THREAD_SYSINFO): Likewise.
5578         (INIT_SYSINFO): New macro.
5579         (TLS_INIT_TP): Call INIT_SYSINFO.
5581         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
5583         * sysdeps/pthread/createthread.c (create_thread): Use
5584         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
5585         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
5586         THREAD_SELF_SYSINFO instead of open code.
5587         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
5588         (THREAD_SYSINFO): Likewise.
5590         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
5592         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
5594 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
5596         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
5597         instead of .init.  Patch by David Mosberger.
5599 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
5601         * sysdeps/pthread/configure.in: Remove broken declaration in C
5602         cleanup handling check.
5604 2003-11-30  Andreas Jaeger  <aj@suse.de>
5606         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
5607         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
5608         Likewise.
5610 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
5612         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
5613         * pthread_attr_destroy.c: Include shlib-compat.h.
5614         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
5615         is set in iattr->flags.
5616         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
5618 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
5620         * Makefile (distribute): Add tst-cleanup4aux.c.
5622         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
5623         include.
5625 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
5627         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
5628         pthread_cond_signal.
5630         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
5631         store mutex address if the current value is ~0l.
5632         * sysdeps/pthread/pthread_cond_timedwait.c
5633         (__pthread_cond_timedwait): Likewise.
5634         * sysdeps/pthread/pthread_cond_broadcast.c
5635         (__pthread_cond_broadcast): Don't use requeue for pshared
5636         condvars.
5638         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5639         (__pthread_cond_wait): Don't store mutex address if the current
5640         value is ~0l.
5641         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5642         (__pthread_cond_timedwait): Likewise.
5643         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5644         (__pthread_cond_broadcast): Don't use requeue for pshared
5645         condvars.
5647         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
5648         element with ~0l for pshared condvars, with NULL otherwise.
5650         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5651         (__pthread_cond_wait): Don't store mutex address if the current
5652         value is ~0l.
5653         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5654         (__pthread_cond_timedwait): Likewise.
5655         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
5656         (__pthread_cond_broadcast): Don't use requeue for pshared
5657         condvars.
5659         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
5660         * tst-cond12.c: New file.
5661         * tst-cond13.c: New file.
5663 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
5665         * sysdeps/pthread/configure.in: Make missing forced unwind support
5666         fatal.
5668 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
5670         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
5672 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
5674         * Makefile: Add magic to clean up correctly.
5676 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
5678         * unwind.c (FRAME_LEFT): Define.
5679         (unwind_stop): Handle old style cleanups here.
5680         (__pthread_unwind): Handle old style cleanups only if
5681         !HAVE_FORCED_UNWIND.
5682         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
5683         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
5684         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
5685         ($(objpfx)tst-cleanupx4): Likewise.
5686         * tst-cleanup4.c: New test.
5687         * tst-cleanup4aux.c: New.
5688         * tst-cleanupx4.c: New test.
5690 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
5692         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
5693         lll_mutex_*lock macros to skip atomic operations on some archs.
5695 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
5697         * sysdeps/pthread/tst-timer.c (main): Initialize
5698         sigev2.sigev_value as well.
5700 2003-10-15  Roland McGrath  <roland@redhat.com>
5702         * sysdeps/pthread/configure.in: Barf if visibility attribute support
5703         is missing.
5704         * sysdeps/pthread/configure: Regenerated.
5706 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5708         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
5709         locking macros.  No distinction between normal and mutex locking
5710         anymore.
5711         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
5712         Merge bits from lowlevelmutex.S we still need.
5713         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
5714         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
5715         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
5716         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
5717         new mutex implementation.
5718         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
5719         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
5720         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5721         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
5722         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
5723         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
5724         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
5725         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
5726         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5727         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
5728         symbol for entry point to avoid cancellation.
5730 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
5732         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
5733         changes.
5734         (SAVE_OLDTYPE_0): Fix a typo.
5736 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
5738         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
5739         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
5741 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5743         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
5744         correct offset.
5746 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
5748         * Makefile (tests): Add tst-cancel19.
5749         * tst-cancel19.c: New test.
5751 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5753         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
5754         restoring of the old cancellation type.
5756 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
5758         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
5760 2003-09-27  Wolfram Gloger  <wg@malloc.de>
5762         * sysdeps/pthread/malloc-machine.h: New file
5764 2003-09-24  Roland McGrath  <roland@redhat.com>
5766         * allocatestack.c (__make_stacks_executable): Don't ignore return
5767         value from _dl_make_stack_executable.
5769 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
5771         * allocatestack.c (__make_stacks_executable): Also change
5772         permission of the currently unused stacks.
5774         * allocatestack.c (change_stack_perm): Split out from
5775         __make_stacks_executable.
5776         (allocate_stack): If the required permission changed between the time
5777         we started preparing the stack and queueing it, change the permission.
5778         (__make_stacks_executable): Call change_stack_perm.
5780         * Makefile: Build tst-execstack-mod locally.
5781         * tst-execstack-mod.c: New file.
5783 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
5785         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
5787 2003-09-23  Roland McGrath  <roland@redhat.com>
5789         * tst-execstack.c: New file.
5790         * Makefile (tests): Add it.
5791         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
5792         (LDFLAGS-tst-execstack): New variable.
5794         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
5795         whether to use PROT_EXEC for stack mmap.
5796         (__make_stacks_executable): New function.
5797         * pthreadP.h: Declare it.
5798         * init.c (__pthread_initialize_minimal_internal): Set
5799         GL(dl_make_stack_executable_hook) to that.
5801 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5803         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
5804         recommendation from AMD re avoidance of lock prefix.
5806 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
5808         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
5809         lll_futex_timed_wait instead of lll_futex_wait.
5810         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
5811         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
5812         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
5813         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
5814         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
5815         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
5816         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
5817         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
5818         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
5819         Completely revamp the locking macros.  No distinction between
5820         normal and mutex locking anymore.
5821         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
5822         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
5823         __lll_lock_timedwait): Fix prototypes.
5824         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
5825         __lll_lock_timedwait): Likewise.
5826         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
5827         macros, add __builtin_expect.
5828         (lll_mutex_timedlock): Likewise.  Fix return value.
5829         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
5830         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
5831         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
5832         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
5833         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
5834         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
5835         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
5836         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
5838 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5840         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5841         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
5842         operation if possible.
5844         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
5845         like jumping over the lock prefix.
5847 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
5849         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
5850         locking macros.  No distinction between normal and mutex locking
5851         anymore.
5852         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
5853         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
5854         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
5855         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
5856         locking.  Merge bits from lowlevelmutex.S we still need.
5857         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
5858         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
5859         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
5860         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
5861         * Makefile (routines): Remove libc-lowlevelmutex.
5862         (libpthread-rountines): Remove lowlevelmutex.
5863         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
5864         for new mutex implementation.
5865         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5866         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5867         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5868         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5869         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5870         Likewise.
5871         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5872         Likewise.
5873         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
5874         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5875         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
5876         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
5877         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5878         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5879         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
5880         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
5881         Likewise.
5882         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
5883         Likewise.
5884         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
5885         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
5886         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5887         Don't use requeue.
5888         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
5889         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
5891 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
5893         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
5894         in parameters of asm with output parameters.
5896         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
5897         type of DECR parameter to int.
5898         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
5900 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
5902         * tst-attr3.c (tf, do_test): Print stack start/end/size and
5903         guardsize for each thread.
5905 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5907         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
5908         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5909         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
5911         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
5912         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
5913         NULL.
5914         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
5915         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
5916         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5917         (pthread_getaffinity_np): Add hidden_def.
5919         * Makefile (tests): Add tst-attr3.
5920         * tst-attr3.c: New test.
5922         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
5924 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5926         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
5927         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
5929 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5931         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
5932         * tst-align.c: Include tst-stack-align.h.
5933         (tf, do_test): Use TEST_STACK_ALIGN macro.
5935 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
5937         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
5938         variable.
5940 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
5942         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
5943         stack-related values for the initial thread.
5945 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5947         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
5949 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
5951         * pthread_mutex_lock.c: Minor code rearrangements.
5953 2003-09-05  Roland McGrath  <roland@redhat.com>
5955         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
5956         Instead, include ../nptl_db/db_info.c to do its magic.
5957         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
5958         (__pthread_pthread_key_2ndlevel_size): Likewise.
5959         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
5960         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
5961         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
5962         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
5963         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
5964         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
5965         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
5966         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
5967         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
5968         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
5969         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
5970         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
5971         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
5972         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
5973         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
5974         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
5975         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
5977 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
5979         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
5980         of pthread_t to be compatible with LT.
5981         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5982         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5983         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5984         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5985         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
5986         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5987         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5989 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
5991         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
5993 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
5995         * unwind-forcedunwind.c: Move to...
5996         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
5997         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
5998         * sysdeps/pthread/jmpbuf-unwind.h: New file.
5999         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
6000         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
6001         * unwind.c: Include jmpbuf-unwind.h.
6002         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
6004 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
6006         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
6007         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
6008         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
6009         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
6010         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
6011         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
6012         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
6013         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
6014         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
6015         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
6016         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
6017         function.
6018         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
6019         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
6020         * Makefile (tests): Add tst-stack2.
6021         * tst-stack2.c: New test.
6022         * tst-stack1.c: Include limits.h and sys/param.h.
6023         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
6025         * pthread_condattr_setpshared.c: Include errno.h.
6026         (pthread_condattr_setpshared): Return EINVAL if pshared
6027         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
6029         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
6030         defined symbol for entry point to avoid cancellation.
6031         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
6032         Likewise.
6033         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
6034         Likewise.
6035         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
6036         Likewise.
6037         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
6038         Likewise.
6039         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
6040         Likewise.
6041         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
6042         __close_nocancel, __read_nocancel, __write_nocancel,
6043         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
6044         libpthread.so or librt.so, define to corresponding function
6045         without _nocancel suffix.
6046         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
6047         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
6048         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
6050         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
6052 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
6054         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
6055         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
6057         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
6058         in subsections has a symbol associated with it.
6060         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
6061         defined symbol for entry point to avoid cancellation.
6062         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
6064 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
6066         * Makefile (tests): Add tst-tls5.
6067         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
6068         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
6069         ($(objpfx)tst-tls5): New.
6070         ($(objpfx)tst-tls6.out): Likewise.
6071         (tests): Depend on $(objpfx)tst-tls6.out.
6072         * tst-tls3.c: Include stdint.h and pthreaddef.h.
6073         (do_test): Check pthread_self () return value alignment.
6074         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
6075         (tf): Check pthread_self () return value alignment.
6076         * tst-tls5.c: New test.
6077         * tst-tls5.h: New.
6078         * tst-tls5mod.c: New.
6079         * tst-tls5moda.c: New.
6080         * tst-tls5modb.c: New.
6081         * tst-tls5modc.c: New.
6082         * tst-tls5modd.c: New.
6083         * tst-tls5mode.c: New.
6084         * tst-tls5modf.c: New.
6085         * tst-tls6.sh: New test.
6087         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
6088         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
6089         * init.c (pthread_functions): Initialize them.
6090         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
6091         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
6092         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
6093         pthread_cond_timedwait@@GLIBC_2.3.2.
6095 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
6097         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
6098         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
6099         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
6100         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
6101         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
6102         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
6104         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
6106         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
6107         _POSIX_THREAD_PRIORITY_SCHEDULING.
6108         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
6110 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
6112         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
6113         nested function, use static inline function from libio.h.
6114         Code by Richard Henderson.
6116         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
6117         weak.
6119 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
6121         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
6122         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
6123         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
6124         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
6125         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
6126         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
6127         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
6128         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
6129         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
6130         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
6131         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
6132         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
6133         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
6134         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
6135         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
6136         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
6137         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
6138         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
6139         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
6140         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
6141         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
6142         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
6143         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
6144         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
6145         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
6146         * sysdeps/sparc/tls.h: New file.
6147         * sysdeps/sparc/tcb-offsets.sym: New file.
6148         * sysdeps/sparc/Makefile: New file.
6149         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
6150         * init.c [__sparc__] (__NR_set_tid_address): Define.
6152 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
6154         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
6155         _IO_release_lock): Define.
6157 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
6159         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
6160         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
6162 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
6164         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
6165         (__pthread_cleanup_class): Add missing return types of member
6166         functions.
6168 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
6170         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6171         (lll_mutex_unlock_force): Add memory barrier between store and futex
6172         syscall.
6174 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
6176         * tst-cancel4.c (do_test): Also unlink tempfname and remove
6177         tempmsg in first loop.
6179 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
6181         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
6182         _POSIX_THREAD_PRIORITY_SCHEDULING.
6183         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
6185 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
6187         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
6188         (__rtld_lock_default_lock_recursive,
6189         __rtld_lock_default_unlock_recursive): Define.
6190         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
6191         __rtld_lock_unlock_recursive): Define using
6192         GL(_dl_rtld_*lock_recursive).
6193         * init.c (__pthread_initialize_minimal_internal): Initialize
6194         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
6195         Lock GL(_dl_load_lock) the same number of times as
6196         GL(_dl_load_lock) using non-mt implementation was nested.
6198         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
6199         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
6201 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
6203         * tst-cancel17.c (do_test): Make len2 maximum of page size and
6204         PIPE_BUF.
6206 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
6208         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
6210 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
6212         * sysdeps/pthread/createthread.c (do_clone): Move error handling
6213         to first syscall error check.  Move syscall error check for tkill
6214         into __ASSUME_CLONE_STOPPED #ifdef.
6216 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
6218         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
6219         is not defined, do explicit synchronization.
6220         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
6221         is not defined also unlock pd->lock for non-debugging case in case
6222         it is necessary.
6223         * pthread_create.c (start_thread): Always get and release pd->lock
6224         if __ASSUME_CLONE_STOPPED is not defined.
6225         (start_thread_debug): Removed.  Adjust users.
6226         * allocatestack.c (allocate_stack): Always initialize lock if
6227         __ASSUME_CLONE_STOPPED is not defined.
6228         * Makefile (tests): Add tst-sched1.
6229         * tst-sched1.c: New file.
6231         * sysdeps/pthread/createthread.c (do_clone): Only use
6232         sched_setschduler and pass correct parameters.
6234 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6236         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
6237         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
6238         PTHREAD_STACK_MIN in comments.
6240 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6242         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
6243         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
6244         argument.
6245         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
6246         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
6247         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
6248         (__pthread_cleanup_upto): Fix prototype.
6249         (_longjmp_unwind): Adjust caller.
6250         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
6251         Change second argument to const struct pointer.
6252         * tst-sem8.c (main): Remove unused s2 and s3 variables.
6253         * tst-sem9.c (main): Likewise.
6254         * unwind.c: Include string.h for strlen prototype.
6256 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
6258         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6259         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
6260         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
6261         Define HAVE_CMOV.
6262         Patch by Nicholas Miell <nmiell@attbi.com>.
6264 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
6266         * init.c (__pthread_initialize_minimal_internal): Initialize
6267         GL(dl_init_static_tls).
6268         * pthreadP.h (__pthread_init_static_tls): New prototype.
6269         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
6270         New functions.
6271         * Makefile (tests): Add tst-tls4.
6272         (modules-names): Add tst-tls4moda and tst-tls4modb.
6273         ($(objpfx)tst-tls4): Link against libdl and libpthread.
6274         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
6275         tst-tls4modb.so.
6276         * tst-tls4.c: New file.
6277         * tst-tls4moda.c: New file.
6278         * tst-tls4modb.c: New file.
6280 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
6282         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
6283         before __timer_dealloc.
6284         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
6285         Don't call list_unlink.
6287 2003-07-29  Roland McGrath  <roland@redhat.com>
6289         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
6291 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
6293         * descr.h: Don't include lowlevellock.h, pthreaddef.h and dl-sysdep.h
6294         if __need_struct_pthread_size, instead define lll_lock_t.
6296 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
6298         * tst-cancel17.c (do_test): Check if aio_cancel failed.
6299         Don't reuse struct aiocb A if it failed.
6300         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
6301         not just one byte, as that does not block.
6303 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
6305         * sysdeps/pthread/unwind-resume.c: New file.
6306         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
6307         unwind-resume in csu subdir.
6308         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
6309         exceptions.
6310         (librt-sysdep_routines, librt-shared-only-routines): Add
6311         rt-unwind-resume.
6312         * sysdeps/pthread/rt-unwind-resume.c: New file.
6313         * unwind-forcedunwind.c: New file.
6314         * Makefile (libpthread-routines): Add unwind-forcedunwind.
6315         (libpthread-shared-only-routines): Likewise.
6316         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
6317         * pthreadP.h (pthread_cancel_init): New prototype.
6318         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
6320         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
6321         attr argument const struct pthread_attr *.
6323         * res.c (__res_state): Return __resp.
6324         * descr.h: Include resolv.h.
6325         (struct pthread): Add res field.
6326         * pthread_create.c: Include resolv.h.
6327         (start_thread): Initialize __resp.
6328         * Makefile (tests): Add tst-_res1.
6329         (module-names): Add tst-_res1mod1, tst-_res1mod2.
6330         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
6331         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
6332         libpthread.
6333         * tst-_res1.c: New file.
6334         * tst-_res1mod1.c: New file.
6335         * tst-_res1mod2.c: New file.
6337 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
6339         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
6341         * Makefile: Define various *-no-z-defs variables for test DSOs
6342         which has undefined symbols.
6344 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
6346         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
6347         Retry if the stwcx fails to store once_control.
6349 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
6351         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
6352         pthread_attr_setaffinity.
6353         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
6354         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
6355         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
6356         * pthread_attr_destroy.c: Free cpuset element if allocated.
6357         * pthread_create.c: Pass iattr as additional parameter to
6358         create_thread.
6359         * sysdeps/pthread/createthread.c: If attribute is provided and
6360         a new thread is created with affinity set or scheduling parameters,
6361         start thread with CLONE_STOPPED.
6362         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
6363         pthread_attr_setaffinity.
6364         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
6365         cpuset element.
6367 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
6369         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
6371 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
6373         * sysdeps/pthread/configure.in: Require CFI directives also for
6374         ppc and s390.
6376 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
6378         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
6379         Add cfi directives.
6381 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6383         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
6384         CLEANUP_JMP_BUF.
6385         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
6386         registers as variables.  Call __pthread_mutex_unlock_usercnt.
6387         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6388         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
6389         not self pointer in __writer.  Compare with TID to determine
6390         deadlocks.
6391         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6392         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
6393         Likewise.
6394         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
6395         Likewise.
6396         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
6397         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
6398         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
6399         macros also when compiling librt.
6401 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
6403         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
6404         -fasynchronous-unwind-tables.
6405         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
6406         (PSEUDO): Add cfi directives.
6407         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
6408         Likewise.
6409         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
6410         Likewise.
6412 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
6414         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
6415         __pthread_unregister_cancel): Add prototypes and hidden_proto.
6416         * unwind.c (__pthread_unwind_next): Add hidden_def.
6417         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
6418         Likewise.
6419         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
6420         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
6421         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
6422         Likewise.
6423         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
6424         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
6425         Likewise.
6426         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
6427         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
6428         __pthread_unregister_cancel and __pthread_unwind_next.
6430 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
6432         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
6433         different symbol for the cancellation syscall wrapper and
6434         non-cancellation syscall wrapper.
6435         (PSEUDO_END): Define.
6437 2003-07-05  Richard Henderson  <rth@redhat.com>
6439         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
6440         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
6441         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6442         return actual return value from the syscall, not 0.
6444 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
6446         * descr.h (struct pthread): Add pid field.
6447         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
6448         (__reclaim_stacks): Likewise.
6449         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
6450         also check for PID of the signal source.
6451         (__pthread_initialize_minimal_internal): Also initialize pid field
6452         of initial thread's descriptor.
6453         * pthread_cancel.c: Use tgkill instead of tkill if possible.
6454         * sysdeps/unix/sysv/linux/fork.c: Likewise.
6455         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
6456         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
6457         * sysdeps/unix/sysv/linux/raise.c: Likewise.
6459 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
6461         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
6462         Fix use of parameter.
6463         (__libc_cleanup_pop): Likewise.
6465 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
6467         * init.c (sigcancel_handler): Change parameters to match handler
6468         for SA_SIGACTION.  Check signal number and code to recognize
6469         invalid invocations.
6471 2003-07-03  Roland McGrath  <roland@redhat.com>
6473         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
6474         Apply sizeof (struct pthread) bias to r13 value.
6476 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
6478         * sysdeps/pthread/configure.in: Require CFI directives.
6480         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
6481         definition.
6482         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
6483         libpthread compilation.
6484         * unwind.c (__pthread_unwind): Add hidden_def.
6485         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
6487 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6489         * libc-cancellation.c (__libc_cleanup_routine): Define.
6490         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
6491         (__pthread_cleanup_pop): Define.
6493 2003-07-01  Richard Henderson  <rth@redhat.com>
6495         * sysdeps/alpha/elf/pt-initfini.c: New file.
6496         * sysdeps/alpha/pthread_spin_lock.S: New file.
6497         * sysdeps/alpha/pthread_spin_trylock.S: New file.
6498         * sysdeps/alpha/pthreaddef.h: New file.
6499         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
6500         * sysdeps/alpha/tls.h: New file.
6501         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
6502         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
6503         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
6504         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
6505         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
6506         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
6507         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
6508         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
6509         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
6510         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
6512 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6514         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
6515         cleanup support and unwind info.
6517 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
6519         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
6520         Use correct cleanup handler registration.  Add unwind info.
6521         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
6522         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
6523         * tst-once3.c: Add cleanup handler and check it is called.
6524         * tst-once4.c: Likewise.
6525         * tst-oncex3.c: New file.
6526         * tst-oncex4.c: New file.
6527         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
6529 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
6531         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
6533 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
6535         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
6536         (tf_msgsnd): Likewise.
6538         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
6539         premature returns a bit more.
6541 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
6543         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
6544         definition to the front.
6546         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
6547         the cleanup functions to make the names unique.  Fix dwarf opcode
6548         un unwind table.
6549         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
6550         functions to make the names unique.  Fix CFA offset for two blocks.
6552 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
6554         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
6555         missing closing braces.
6556         Patch by Christophe Saout <christophe@saout.de>.
6558 2003-06-24  Roland McGrath  <roland@redhat.com>
6560         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
6562 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
6564         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
6565         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
6567         * pthreadP.h: Declare __find_thread_by_id.
6568         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
6569         * pthread_clock_gettime.c: Allow using other thread's clock.
6570         * pthread_clock_settime.c: Likewise.
6571         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
6572         * Makefile: Add rules to build and run tst-clock2.
6573         * tst-clock2.c: New file.
6575 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
6577         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
6578         to use exception-based cleanup handler.
6579         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6581         * tst-cond8.c (ch): Announce that we are done.
6583         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
6585         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
6586         Also test aio_suspend with timeout value.
6588 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
6590         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
6591         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
6592         attribute_hidden.
6594         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
6595         (__pthread_mutex_lock_internal): Likewise.
6596         (__pthread_mutex_unlock_internal): Likewise.
6597         (__pthread_mutex_unlock_usercnt): Declare.
6598         * pthread_mutex_destroy.c: Always fail if used in any way.
6599         * pthread_mutex_init.c: Update comment.
6600         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
6601         * pthread_mutex_timedlock.c: Adjust __nusers.
6602         * pthread_mutex_trylock.c: Adjust __nusers.
6603         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
6604         and public interfaces are wrapper with pass additional parameter.
6605         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
6606         parameter zero.
6607         * tst-mutex8.c: New file.
6608         * Makefile (tests): Add tst-mutex8.
6609         * sysdeps/pthread/pthread_cond_timedwait.c: Call
6610         __pthread_mutex_unlock_usercnt.
6611         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6612         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6613         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6614         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6615         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6616         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
6617         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6618         Add __nusers.
6619         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6620         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6621         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6622         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6623         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6625         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
6626         * pthread_mutex_timedlock.c: Likewise.
6627         * pthread_mutex_trylock.c: Adjust __nusers.
6628         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
6629         * tst-mutex9.c: New file.
6630         * Makefile (tests): Add tst-mutex9.
6631         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
6632         * sysdeps/ia64/tls.h: Likewise.
6633         * sysdeps/powerpc/tls.h: Likewise.
6634         * sysdeps/s390/tls.h: Likewise.
6635         * sysdeps/sh/tls.h: Likewise.
6636         * sysdeps/x86_64/tls.h: Likewise.
6637         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6638         Change type of __owner.
6639         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6640         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6641         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6642         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6643         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6645 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
6647         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
6648         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
6650         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
6651         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
6652         instead of nr to lll_futex_wake.  Only set errno and return -1
6653         if err < 0.
6655         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
6656         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6657         return actual return value from the syscall, not 0.
6659 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
6661         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
6662         find a random value.
6663         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
6664         errno==EIDRM.
6666         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
6667         compat_timer_settime.
6668         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
6669         compat_timer_gettime.
6670         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
6671         compat_timer_getoverrun.
6672         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
6673         compat_timer_delete.
6675         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
6676         error-checking mutex detect busy mutexes.
6678 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6680         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
6681         Add ax to clobber list.
6682         (lll_mutex_cond_lock): Likewise.
6683         (lll_mutex_unlock): Likewise.
6684         (lll_lock): Likewise.
6685         (lll_unlock): Likewise.
6687         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
6688         * tst-cancel18.c: New file.
6689         * tst-cancelx18.c: New file.
6691         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
6692         and tcdrain.
6694         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
6695         * tst-cancel17.c: New file.
6696         * tst-cancelx17.c: New file.
6698         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
6699         * sysdeps/unix/sysv/linux/sigwait.c: New file.
6700         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
6702         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
6704 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
6706         * sysdeps/pthread/createthread.c (create_thread): Set
6707         header.multiple_threads unconditionally.
6708         * allocatestack.c (allocate_stack): Likewise.
6709         * descr.h (struct pthread): Add header.multiple_threads
6710         unconditionally.
6711         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
6712         Define for librt.  #error if neither libpthread, libc nor librt.
6713         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
6714         Likewise.
6715         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
6716         CDISABLE): Likewise.
6717         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
6718         CDISABLE): Likewise.
6719         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
6720         CDISABLE): Likewise.
6721         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
6722         CDISABLE): Likewise.  Access header.multiple_threads outside of
6723         libc and libpthread.
6724         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
6725         Likewise.
6726         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
6727         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
6729 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6731         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
6732         Also test early cancellation before the thread reaches the cancellation
6733         point.
6735         * Makefile: Compile forward.c with exceptions.
6737         * sysdeps/unix/sysv/linux/sleep.c: New file.
6739 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
6741         * Makefile: Add CFLAGS definition to compile function wrappers
6742         duplicated from libc with exceptions.
6743         * tst-cancel4.c: Also check cancellation handlers.
6745         * Makefile: Add rules to build and run tst-cancel16 and
6746         tst-cancelx16.  Add missing CFLAGS definitions.
6747         * tst-cancel16.c: New file.
6748         * tst-cancelx16.c: New file.
6750 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
6752         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6753         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
6754         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
6755         (DL_SYSINFO_IMPLEMENTATION): Likewise.
6757         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
6758         (LIBC_CANCEL_RESET): Likewise.
6759         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
6760         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
6761         librt-cancellation.
6762         (CFLAGS-libcrt-cancellation.c): Define.
6763         * sysdeps/pthread/librt-cancellation.c: New file.
6764         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
6765         macros also when compiling librt.
6766         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
6767         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
6768         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
6769         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
6770         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
6771         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
6772         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
6774         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
6775         compat_timer_create.
6777 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
6779         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
6781         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
6782         __register_atfork.
6783         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
6784         Add libc_hidden_def.
6786 2003-06-13  Roland McGrath  <roland@redhat.com>
6788         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
6789         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
6791 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
6793         * allocatestack.c (queue_stack): Always inline.
6794         * ptreadhP.h (__do_cancel): Likewise.
6796 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
6798         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
6799         a typo.
6801 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
6803         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6804         (__pthread_cond_signal): Remove incorrect second addition for
6805         cond_lock!=0.
6807 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
6809         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6810         (__pthread_cond_signal): Use correct futex pointer in
6811         __lll_mutex_lock_wait call.
6813         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6814         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
6816 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
6818         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
6819         cancelable.
6820         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6821         Likewise.
6823         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
6824         hand-written CFI generation code.  Since ENTRY/END also initiated
6825         CFI frames this caused two CFI sets to be generated.
6827 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
6829         * cleanup_routine.c: New file.
6830         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
6831         * sysdeps/pthread/pthread.h: Add support for fully exception-based
6832         cleanup handling.
6833         * Makefile (libpthread-routines): Add cleanup_routine.
6834         Add more CFLAGS variables to compile with exceptions.  Add comments
6835         why which file needs unwind tables.
6836         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
6837         tests.
6838         * tst-cancelx1.c: New file.
6839         * tst-cancelx2.c: New file.
6840         * tst-cancelx3.c: New file.
6841         * tst-cancelx4.c: New file.
6842         * tst-cancelx5.c: New file.
6843         * tst-cancelx6.c: New file.
6844         * tst-cancelx7.c: New file.
6845         * tst-cancelx8.c: New file.
6846         * tst-cancelx9.c: New file.
6847         * tst-cancelx10.c: New file.
6848         * tst-cancelx11.c: New file.
6849         * tst-cancelx12.c: New file.
6850         * tst-cancelx13.c: New file.
6851         * tst-cancelx14.c: New file.
6852         * tst-cancelx15.c: New file.
6853         * tst-cleanupx0.c: New file.
6854         * tst-cleanupx0.expect: New file.
6855         * tst-cleanupx1.c: New file.
6856         * tst-cleanupx2.c: New file.
6857         * tst-cleanupx3.c: New file.
6859         * tst-cleanup0.c: Make standard compliant.
6860         * tst-cleanup1.c: Likewise.
6862         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
6863         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
6864         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
6865         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
6866         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
6867         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
6868         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
6869         CLEANUP_JMP_BUF.
6870         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6871         * tst-cancel12.c: New file.
6872         * tst-cancel13.c: New file.
6873         * tst-cancel14.c: New file.
6874         * tst-cancel15.c: New file.
6875         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
6876         and tst-cancel15.
6878         * tst-cancel1.c: Add some comments.
6880         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
6881         timeout correctly.
6883 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
6885         * Makefile (CFLAGS-pthread_cancel.c): Define.
6887 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
6889         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
6890         Change type of __writer element to int.
6891         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6892         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6893         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6894         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6895         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6896         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
6897         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6898         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
6899         Compare with TID to determine deadlocks.
6900         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
6901         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6902         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
6903         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6904         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6905         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6906         Likewise.
6907         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6908         Likewise.
6909         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6910         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
6911         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
6912         Likewise.
6913         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
6914         Likewise.
6915         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
6916         * Makefile (tests): Add tst-rwlock12.
6917         * tst-rwlock12.c: New file.
6919 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
6921         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
6922         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
6923         Remove bogus hidden_proto.
6924         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
6925         Likewise.
6926         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
6927         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
6928         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
6929         ___lll_mutex_timedlock): Likewise.
6931 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
6933         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6934         (__pthread_cond_signal): Add some code to eventually handle
6935         cond_lock!=0.
6937 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
6939         * Makefile (tests): Add tst-exec4.
6940         (tst-exec4-ARGS): Define.
6941         * tst-exec4.c: New file.
6943 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
6945         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
6946         Also fail if tv_nsec < 0.
6947         (__lll_timedwait_tid): Likewise.
6948         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
6949         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
6950         Likewise.
6951         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
6952         Likewise.
6953         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
6954         Likewise.
6955         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6956         Likewise.
6957         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
6958         Likewise.
6959         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
6960         Likewise.
6962         * Makefile (tests): Add tst-sem8 and tst-sem9.
6963         * tst-sem8.c: New file.
6964         * tst-sem9.c: New file.
6965         * sem_open.c: Fix creation of in_use record if the file exists but
6966         no internal record.
6968         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
6969         definitions.
6971         * sysdeps/pthread/timer_create.c (timer_create): In case
6972         evp==NULL, assign timer ID to sival_ptr.
6974         * descr.h (struct pthread_unwind_buf): Change type of prev element to
6975         struct pthread_unwind_buf *.
6976         (struct pthread): Likewise for cleanup_jmp_buf element.
6978         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
6979         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
6980         * unwind.c (__pthread_unwind_next): Likewise.
6982 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
6984         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6985         (lll_futex_timed_wait): Use int for futex value parameter.
6986         (lll_futex_wake): Likewise.
6987         (lll_futex_requeue): Likewise.
6989         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
6990         Replace one memory operation with one register operation.
6992         * tst-join4.c (do_test): Fix error message.
6994         * tst-rwlock6.c (do_test): Use correct format specifier.
6996         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
6997         (__lll_mutex_lock_wait): Replace one memory operation with one
6998         register operation.
6999         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
7000         (__lll_mutex_lock_wait): Likewise.
7002         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7003         (__lll_mutex_cond_lock): Add one to value parameter of
7004         __lll_lock_wait to reflect reality in the futex syscall.
7005         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
7006         (lll_mutex_cond_lock): Likewise.
7008 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
7010         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
7011         New function.
7012         (lll_mutex_cond_lock): Define.
7014 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
7016         * Makefile (tests): Add tst-signal6.
7017         * tst-signal6.c: New file.
7019         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
7020         (__lll_mutex_unlock_force): New function
7021         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
7023         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7024         (__lll_mutex_unlock_force): New function.
7025         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
7027         * tst-rwlock7.c (do_test): Use correct format specifier.
7029         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
7030         Find break parameter in correct asm argument.
7032 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
7034         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
7035         Remove out4.
7036         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
7037         error occured.
7038         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
7039         Add __mutex.
7040         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
7041         lll_futex_requeue, lll_mutex_unlock_force): Define.
7043 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
7045         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7046         (pthread_cond_t): Add __mutex.
7047         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
7048         lll_futex_requeue, lll_mutex_unlock_force): Define.
7050 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7052         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
7053         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
7054         Add __mutex field.
7055         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
7056         Define.
7057         (lll_futex_wait, lll_futex_wake): Define.
7058         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
7059         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
7060         FUTEX_REQUEUE instead of FUTEX_WAIT.
7061         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
7062         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
7063         mutex which was used in condvar structure.  Call
7064         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
7065         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
7067         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
7068         include tcb-offsets.h.  Read wakeup value in locked region.
7069         Use the value of gbr register as THREAD_ID.
7070         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7071         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7072         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7074         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
7075         macros.
7077 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
7079         * sysdeps/pthread/pthread_cond_broadcast.c
7080         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
7082 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
7084         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
7085         typo in register name.
7086         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
7087         correctly.  Actually use requeue.  Little optimization.
7088         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
7089         mutex address early.  Handle cancellation state as 32-bit value.
7090         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7091         Remove unnecessary label.
7093 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
7095         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
7096         instead of FUTEX_WAIT.
7097         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
7098         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
7099         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
7100         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
7101         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
7102         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
7103         used in condvar structure.  Call __pthread_mutex_cond_lock instead
7104         of __pthread_mutex_lock_internal.
7105         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7106         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7107         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7108         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
7109         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7110         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7111         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
7112         Add pthread_mutex_cond_lock.
7113         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
7114         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
7115         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
7116         lll_mutex_cond_lock.
7117         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
7118         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7119         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
7120         Add __mutex field.
7121         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7122         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7124         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
7125         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7127         * pthreadP.h: Declare __pthread_mutex_cond_lock.
7128         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
7129         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
7130         macro don't define aliases.
7132         * cancellation.c: Remove __pthread_enable_asynccancel_2.
7133         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
7134         * sysdeps/pthread/pthread_cond_timedwait.c: Use
7135         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
7136         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7137         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7138         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7139         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7140         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7142 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
7144         * sem_open.c: Fix one endless loop.  Implement correct semantics
7145         wrt opening the same semaphore more then once.
7146         * sem_close.c: Adjust for sem_open change.
7147         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
7148         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
7149         * Makefile (tests): Add tst-sem7.
7150         * tst-sem7.c: New file.
7152 2003-05-16  Roland McGrath  <roland@redhat.com>
7154         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
7155         uninitialized variable braino.
7157 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
7159         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
7160         test for syscall availability.
7162         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
7163         __no_posix_timers to -1 if the syscalls don't exist.
7165         * pthread_join.c (pthread_join): Set tid field of the joined
7166         thread to -1.  This isn't necessary but helps to recognize some
7167         error conditions with almost no cost.
7169         * allocatestack.c (FREE_P): Also negative values indicate an
7170         unused stack.
7172         * unwind.c: Include <unistd.h>.
7174 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
7176         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
7178 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
7180         * Makefile (crti-objs, crtn-objs): New variables.
7181         (omit-deps, extra-objs): Add crtn.
7182         ($(objpfx)libpthread.so): Depend on both crti and crtn
7183         and links to them in multidir.
7184         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
7186 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
7188         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
7189         (lll_mutex_unlock): Use atomic_exchange_rel.
7191 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
7193         * cond-perf.c (cons): Add missing locking around setting of alldone.
7195 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
7197         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
7198         related macros.
7199         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7201 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
7203         * tst-sem6.c: New file.
7204         * Makefile (tests): Add tst-sem6.
7206         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
7207         Use atomic_exchange_rel instead of atomic_exchange.
7208         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
7209         Likewise.
7211         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
7212         code for lll_futex_wait and lll_futex_wake in static apps.  Use
7213         vsyscall is possible.
7215         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
7216         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
7217         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
7218         pthread_setaffinity_np.
7219         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
7220         and pthread_setaffinity_np.
7221         * Makefile (libpthread-routines): Add pthread_getaffinity and
7222         pthread_setaffinity.
7224         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
7225         use it in case mmap to allocate the stack fails.
7226         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
7227         ARCH_MAP_FLAGS here.
7228         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
7229         ARCH_RETRY_MMAP.
7231 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
7233         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
7234         handler implementation.  It is now lockless in fork().
7235         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
7236         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
7237         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
7238         declare the __fork_*_lists.
7239         (struct fork_handler): Include pointers to all three functions.
7240         Add next, refcntr and need_signal elements.
7241         (__fork_handlers): New declaration.
7242         (__register_atfork_malloc): Remove declaration.
7243         (HAVE_register_atfork_malloc): Remove definition.
7244         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
7245         __pthread_child_handler variable.
7246         (__libc_pthread_init): Use __register_atfork instead of explicitly
7247         adding to the list.
7248         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
7249         and lll_futex_wake.
7250         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7252         * unwind.c (unwind_cleanup): Print error message and then abort.  This
7253         function must never be reached.
7255         * cond-perf.c: New file.
7257 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
7259         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
7261 2003-05-04  Roland McGrath  <roland@redhat.com>
7263         * Makefile ($(objpfx)../libc.so): New target.
7265 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
7267         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7268         (pthread_condattr_t): Size is only an int, don't use long for
7269         alignment.
7270         (pthread_mutexattr_t): Likewise.
7271         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7272         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7273         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7275 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
7277         * sysdeps/i386/tls.h: Define THREAD_ID.
7278         * sysdeps/ia64/tls.h: Likewise.
7279         * sysdeps/powerpc/tls.h: Likewise.
7280         * sysdeps/s390/tls.h: Likewise.
7281         * sysdeps/sh/tls.h: Likewise.
7282         * sysdeps/x86_64/tls.h: Likewise.
7283         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
7284         record ownership.
7285         * pthread_mutex_timedlock.c: Likewise.
7286         * pthread_mutex_trylock.c: Likewise.
7287         * pthread_mutex_unlock.c: Likewise.
7288         * pthread_rwlock_trywrlock.c: Likewise.
7289         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
7290         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
7291         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
7292         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
7294         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
7295         flag.
7297 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
7299         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7300         (__SIZEOF_PTHREAD_COND_T): Define to 48.
7301         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
7302         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
7303         Make __align long long instead of long.
7304         (pthread_rwlock_t): Formatting.
7305         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
7306         (pthread_rwlock_t): Formatting.
7307         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7308         (pthread_cond_t): Make __align long long instead of long.
7309         (pthread_rwlock_t): Move __flags field to the same position as in
7310         linuxthreads.
7312 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
7314         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
7315         * tst-rwlock7.c (do_test): Likewise.
7317 2003-04-26  Roland McGrath  <roland@redhat.com>
7319         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
7321 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
7323         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
7324         sizeof (struct pthread).
7325         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
7326         1 struct pthread.
7327         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
7328         to 0.
7329         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
7330         struct pthread.
7331         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
7332         to 32-bit bytes.
7333         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
7334         tcbp.
7335         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
7336         unneccessarily.
7337         (NO_TLS_OFFSET): Define.
7338         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
7339         add TLS_TCB_SIZE unnecessarily.
7341 2003-04-22  Roland McGrath  <roland@redhat.com>
7343         * Makeconfig (shared-thread-library): Reverse link order to work
7344         around linker bug.
7346 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
7348         * semaphore.h: Fix typo in comment.
7350 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
7352         * sysdeps/pthread/sigfillset.c: New file.
7354         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
7355         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
7356         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
7357         * sysdeps/pthread/sigaction.c: Likewise.
7358         * sysdeps/pthread/sigprocmask.c: New file.
7359         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
7360         __SIGRTMIN+1.
7361         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7362         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
7363         in this case.
7365 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
7367         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
7368         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
7370         * sysdeps/unix/sysv/linux/unregister-atfork.c
7371         (__unregister_atfork): Don't free memory not allocated dynamically.
7373         * semaphore.h: Remove __THROW marker from cancellation points.
7374         * nptl/sysdeps/pthread/pthread.h: Likewise.
7376 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
7378         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
7379         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
7380         __THROW.
7382 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
7384         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
7386 2003-04-15  Roland McGrath  <roland@redhat.com>
7388         * forward.c (__pthread_unwind): Tweak to avoid warning.
7390 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
7392         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
7394 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
7396         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
7397         overflow CFA advance instructions.
7398         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7400 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
7402         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
7403         * sysdeps/i386/pthread_spin_lock.c: Likewise.
7404         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
7405         defined.
7407         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
7408         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
7409         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
7410         DW_CFA_advance_loc for .Laddl-.Lsubl.
7412 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
7414         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
7415         position-independent unwind data for static libraries.
7416         Add missing unwind info.  Add comments.
7418         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
7419         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7420         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7421         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7423 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
7425         * Makefile: Make sure all cancellation points are compiled with
7426         exception and asynchronous unwind tables.
7428         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
7429         which mishandles loading of global object addresses in PIC.
7430         (THREAD_SETMEM_NC): Likewise.
7432 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7434         * pthread.h: Define new data structure for cleanup buffer.  Declare
7435         new cleanup handler interfaces.
7436         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
7437         (struct pthread): Add cleanup_jmp_buf pointer.  Define
7438         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
7439         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
7440         it.  Declare old cleanup handler installation functions.
7441         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
7442         handling.
7443         * cleanup_defer.c: Likewise.
7444         * cleanup_compat.c: New file.  Old cleanup code.
7445         * cleanup_def_compat.c: New file.  Old cleanup code.
7446         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
7447         if own thread descriptor.
7448         * unwind.c: New file.
7449         * forward.c: Add __pthread_unwind.
7450         * init.c (pthread_functions): Add __pthread_unwind.
7451         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
7452         Add ptr___pthread_unwind.
7453         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
7454         and unwind function.
7455         * Makefile (libpthread-routines): Add cleanup_compat,
7456         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
7457         table generation if necessary.
7458         * version.c: Record whether unwind support is compiled in.
7459         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
7460         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
7461         handler interfaces.
7462         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
7463         complication to generate unwind information for syscall wrappers.
7464         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
7465         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
7466         __cleanup_fct_attribute.
7468         * Makefile: Add rules to build and run tst-cleanup0.
7469         * tst-cleanup0.c: New file.
7470         * tst-cleanup0.expect: New file.
7472         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
7473         caller.  Optimize to avoid often unecessary local variable.
7475 2003-04-11  Roland McGrath  <roland@redhat.com>
7477         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
7478         sets variable `multidir'; include that.
7479         (generated): Add it.
7480         ($(objpfx)$(multidir)/crti.o): New target.
7481         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
7483 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7485         * tst-attr2.c (do_test): Add cast to avoid warning.
7486         * tst-mutex4.c (do_test): Likewise.
7488 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
7490         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
7491         in child.
7493 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
7495         * Makefile (tests): Add tst-detach1.
7496         * tst-detach1.c: New file.
7498 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
7500         * sysdeps/pthread/pthread.h: Remove duplicate
7501         pthread_cleanup_{push,pop} definitions.
7503         * tst-barrier2.c: Eliminate warnings.
7504         * tst-cancel4.c: Likewise.
7505         * tst-cond4.c: Likewise.
7506         * tst-cond6.c: Likewise.
7507         * tst-detach1.c: Likewise.
7508         * tst-rwlock4.c: Likewise.
7509         * tst-rwlock6.c: Likewise.
7510         * tst-rwlock7.c: Likewise.
7511         * tst-sem3.c: Likewise.
7512         * tst-spin2.c: Likewise.
7513         * tst-umask1.c: Likewise.
7515 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
7517         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
7519 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
7521         * descr.h (struct pthread): Move cancelhandling member to the front.
7523 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
7525         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
7526         malloc_parent, and malloc_child statically.
7527         (__register_atfork_malloc): New function.
7528         (free_mem): Don't free any of the malloc_* variables on the list.
7529         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
7530         Define HAVE_register_atfork_malloc.
7532 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
7534         * sysdeps/pthread/createthread.c (create_thread): Add some more
7535         comments explaining when to set multiple_threads and when not.
7537         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7538         THREAD_ATOMIC_BIT_SET if not already defined.
7539         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7540         THREAD_ATOMIC_BIT_SET:
7541         * sysdeps/x86_64/tls.h: Likewise.
7542         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
7543         THREAD_ATOMIC_CMPXCHG_VAL.
7544         (_pthread_cleanup_pop_restore): Likewise.
7545         * cancellation.c (__pthread_enable_asynccancel): Likewise.
7546         (__pthread_enable_asynccancel_2): Likewise.
7547         (__pthread_disable_asynccancel): Likewise.
7548         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7549         (__libc_disable_asynccancel): Likewise.
7550         * init.c (sigcancel_handler): Likewise.
7551         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
7552         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
7554 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
7556         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
7557         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7558         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
7559         * Makefile (tests): Add tst-cancel11.
7560         * tst-cancel11.c: New file.
7562 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
7564         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
7565         round, not the first.  Use specific_used flag instead of local
7566         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
7567         (__free_tcb): Don't call deallocate_tsd here.
7568         (start_thread): Call deallocate_tsd here.
7569         * pthread_setspecific.c: Set specific_used flag really only when
7570         needed.
7571         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
7572         * tst-tsd3.c: New file.
7573         * tst-tsd4.c: New file.
7575 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7577         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
7578         Use atomic_exchange_and_add instead of __lll_add.
7579         (__lll_mutex_timedlock): Likewise.
7580         Patch by Ian Wienand.
7582 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
7584         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7585         (SINGLE_THREAD_P): Fix typo.
7586         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
7588 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7590         * Makefile (tests): Add tst-align.
7591         * tst-align.c: New file.
7592         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
7594         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
7595         function correctly.
7597         * tst-tsd2.c: Add casts to avoid warnings.
7599 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
7601         * descr.h (struct pthread): Move most often used elements to the front.
7603 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
7605         * Makefile (libpthread-routines): Add pthread_atfork.
7606         (libpthread-static-only-routines): Add pthread_atfork.
7608 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7610         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
7611         of TLS_DTV_AT_TP.
7612         (INSTALL_DTV): Add parens.
7613         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
7614         Use passed descr instead of THREAD_SELF.
7615         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
7616         (__lll_mutex_timedlock_wait): Correct expected value after
7617         spurious wakeup.
7618         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
7619         Release lock before waking up the waiters.
7620         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
7621         criteria.  Reorderstruct passed to cleanup handler.  Fix
7622         handling of cancellation and failung pthread_mutex_unlock call.
7623         Use __pthread_enable_asynccancel_2 instead of
7624         __pthread_enable_asynccancel.
7625         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7626         Return result of lock re-get if it fails.
7627         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
7628         for __pthread_cleanup_push.
7629         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
7630         completely broken rwlock implementation.
7631         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7632         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7633         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7634         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
7635         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7636         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
7637         versioned_symbol macro.
7638         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
7639         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
7641 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
7643         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
7644         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
7645         and __helper_tid.
7646         (struct timer): Remove th and bar field.
7647         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
7648         debugging code.  Create only one helper thread.
7649         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
7650         helper thread.
7651         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7652         Renamed.  Define statically.  Use thread info from siginfo.
7653         (__helper_once): New variable.
7654         (__helper_tid): New variable.
7655         (__reset_helper_control): New function.
7656         (__start_helper_thread): New function.
7658         * pthread_create.c (start_thread): Don't use setjmp inside
7659         __builtin_expect to work around gcc bug.
7661         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
7662         timer_delete syscall fails, but not with ENOSYS, set
7663         __no_posix_timers.
7665         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
7666         (timer_settime): Fix typo.
7667         * sysdeps/unix/sysv/linux/timer_getoverr.c
7668         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
7670 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
7672         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
7673         offset of cleanupbuf.__prev.
7675 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
7677         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
7678         of included file.
7680 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
7682         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
7683         NULL provide default definition to syscall.
7685 2003-03-25  Roland McGrath  <roland@redhat.com>
7687         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
7688         (timer_id2ptr): Fix typo.
7690 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
7692         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
7693         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
7694         * sysdeps/ia64/pthreaddef.h: Likewise.
7695         * sysdeps/powerpc/pthreaddef.h: Likewise.
7696         * sysdeps/s390/pthreaddef.h: Likewise.
7697         * sysdeps/sh/pthreaddef.h: Likewise.
7698         * sysdeps/x86_64/pthreaddef.h: Likewise.
7699         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
7700         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
7701         being changed.
7702         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
7703         SIGTIMER is not unblocked.
7704         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
7705         RT signal taken.
7706         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
7707         be send.
7708         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
7709         pass pointer through as ID.
7710         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
7711         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
7712         * sysdeps/unix/sysv/linux/timer_create.c: New file.
7713         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
7714         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
7715         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
7716         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
7717         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
7718         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
7719         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
7720         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
7721         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
7722         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
7723         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
7724         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
7725         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
7726         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
7727         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
7728         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
7729         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
7730         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
7731         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
7732         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
7733         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
7734         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
7735         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
7736         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
7737         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
7738         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
7739         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
7740         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
7741         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
7742         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
7744         * pthreadP.h: Remove FRAME_LEFT definition.
7745         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
7746         already left frame.  Programs which have this problem are not POSIX
7747         compliant.
7748         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
7750 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
7752         * sysdeps/pthread/tst-timer.c: Check return values of the
7753         functions we test.
7755 2003-03-23  Roland McGrath  <roland@redhat.com>
7757         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
7758         * tst-tls3mod.c: Likewise.
7759         * tst-tls1.c: Likewise.
7760         * tst-tls2.c: Likewise.
7762         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
7763         undefined behavior.
7765         * tst-join5.c (tf1, tf2): Add a cast.
7767         * Makeconfig (includes): Append -I$(..)nptl to this variable.
7769         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
7770         Don't test anything.
7771         * tst-cond4.c: Likewise.
7772         * tst-cond6.c: Likewise.
7773         * tst-flock2.c: Likewise.
7774         * tst-mutex4.c: Likewise.
7775         * tst-rwlock4.c: Likewise.
7776         * tst-signal1.c: Likewise.
7777         * tst-spin2.c: Likewise.
7778         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
7780         * tst-mutex4.c: Use test-skeleton.c.
7781         * tst-spin2.c: Likewise.
7782         * tst-sysconf.c: Likewise.
7783         * tst-barrier2.c: Likewise.
7784         * tst-cond4.c: Likewise.
7785         * tst-cond6.c: Likewise.
7786         * tst-rwlock4.c: Likewise.
7787         * tst-unload.c: Likewise.
7788         * tst-flock2.c (do_test): Use return instead of exit.
7790 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
7792         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
7794 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
7796         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7797         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
7798         instead of __lll_compare_and_swap.
7799         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
7800         Likewise.
7801         Removed definition if __lll_compare_and_swap.
7803         * cancellation.c: Adjust for new form of compare&exchange macros.
7804         * cleanup_defer.c: Likewise.
7805         * init.c: Likewise.
7806         * libc-cancellation.c: Likewise.
7807         * old_pthread_cond_broadcast.c: Likewise.
7808         * old_pthread_cond_signal.c: Likewise.
7809         * old_pthread_cond_timedwait.c: Likewise.
7810         * old_pthread_cond_wait.c: Likewise.
7811         * pthread_cancel.c: Likewise.
7812         * pthread_create.c: Likewise.
7813         * pthread_detach.c: Likewise.
7814         * pthread_join.c: Likewise.
7815         * pthread_key_delete.c: Likewise.
7816         * pthread_setcancelstate.c: Likewise.
7817         * pthread_setcanceltype.c: Likewise.
7818         * pthread_timedjoin.c: Likewise.
7819         * pthread_tryjoin.c: Likewise.
7820         * sysdeps/pthread/createthread.c: Likewise.
7822 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
7824         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
7825         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
7826         definitions.  Replace uses with calls to atomic_* functions.
7827         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
7828         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
7829         __lll_test_and_set calls with atomic_exchange_and_add and
7830         atomic_exchange calls respectively.
7831         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
7832         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
7833         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
7834         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
7835         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
7836         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
7837         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
7839         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
7840         returns the old value.
7842 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
7844         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
7845         int for variable OLDVAL and correct inline assembler contraint.
7846         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
7847         type int for variable OLD.
7849         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
7850         only for s390-32.
7851         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7852         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
7853         instead of multiple_threads field in the TCB.
7855 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
7857         * sysdeps/i386/i686/bits/atomic.h: Removed.
7858         * sysdeps/i386/i586/bits/atomic.h: Removed.
7859         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
7860         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
7861         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
7862         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
7863         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
7864         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
7865         * atomic.h: Removed.  Moved to glibc.
7867         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
7868         support for clock selection.
7870         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
7871         signalling waiters.
7873 2003-03-18  Roland McGrath  <roland@redhat.com>
7875         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7876         Add __lll_rel_instr first.  Add memory clobber.
7877         (lll_mutex_unlock): Use __lll_test_and_set.
7878         From Paul Mackerras <paulus@samba.org>.
7880         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
7881         unconditionally.
7882         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7883         (SINGLE_THREAD_P):  Add `header.' prefix.
7884         From Paul Mackerras <paulus@samba.org>.
7886         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
7887         pthread_timedjoin_np to ...
7888         (libpthread: GLIBC_2.3.3): ... here.
7889         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
7891         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
7892         Avoid shadowing VAL variable.
7894         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7895         New macro.
7897 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
7899         * Makefile (tests): Add tst-cond11.
7900         * tst-cond11.c: New file.
7902         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
7903         struct passed to cleanup handler to eliminate one more
7904         instruction.
7905         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7907         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7908         (pthrad_cond_t): Replace __unused field with __clock.
7910         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
7911         waken all waiters in cleanup handler.
7912         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7913         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7915         * pthread_condattr_getclock.c: New file.
7916         * pthread_condattr_setclock.c: New file.
7917         * sysdeps/pthread/pthread.h: Declare these new functions.
7918         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
7919         * Makefile (libpthread-routines): Add the new functions.
7920         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
7921         Renamed field to value.  Document use of the bits.
7922         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
7923         change.
7924         * pthread_condattr_setpshared.c: Likewise.
7925         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
7926         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
7927         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
7928         Add __clock field.
7929         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7930         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7931         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7932         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7933         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
7934         Implement clock selection.
7935         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7936         * pthread-errnos.sym: Add ENOSYS.
7937         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
7938         _POSIX_CLOCK_SELECTION.
7939         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
7941         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
7942         invalid .size directive.
7944 2003-03-17  Roland McGrath  <roland@redhat.com>
7946         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
7947         Formatting tweaks.
7949 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7951         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
7952         Use __lll_add instead of spelling it out.  Use protected symbol names.
7953         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
7954         Use __lll_add.
7955         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
7956         Renamed from lll_compare_and_swap.  Use new name where necessary.
7957         (__lll_add): Defined.
7958         (__lll_dec_if_positive): Defined.
7959         (__lll_test_and_set): Defined.
7960         * sysdeps/ia64/pthread_spin_init.c: Removed.
7961         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
7962         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
7963         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
7964         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
7965         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
7966         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
7967         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
7968         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
7969         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
7970         __sync_lock_release_si.
7971         Patch by Jakub Jelinek.
7973         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
7974         Fix timeout handling.
7975         (__lll_timedwait_tid): Likewise.
7976         (lll_unlock_wake_cb): Wake up other waiters if necessary.
7977         Patch by Jakub Jelinek.
7979         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
7981 2003-03-17  Roland McGrath  <roland@redhat.com>
7983         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
7984         * sysdeps/pthread/pthread_spin_init.c: New file.
7985         * sysdeps/pthread/pthread_spin_unlock.c: New file.
7986         * sysdeps/powerpc/Makefile: New file.
7987         * sysdeps/powerpc/pthread_spin_lock.c: New file.
7988         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
7989         * sysdeps/powerpc/pthreaddef.h: New file.
7990         * sysdeps/powerpc/tcb-offsets.sym: New file.
7991         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
7992         * sysdeps/powerpc/tls.h: New file.
7993         * sysdeps/powerpc/bits/atomic.h: New file.
7994         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
7995         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
7996         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
7998         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
7999         * sysdeps/unix/sysv/linux/sem_post.c: New file.
8000         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
8001         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
8002         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
8003         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
8004         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
8005         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
8006         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
8007         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
8008         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
8009         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
8010         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
8011         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
8012         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
8014         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
8015         not gettimeofday.
8016         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
8017         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
8018         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
8019         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
8020         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8022 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
8024         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
8025         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
8026         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8027         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8028         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
8030 2003-03-16  Roland McGrath  <roland@redhat.com>
8032         * tst-fork4.c: Include <string.h>.
8033         * tst-signal2.c: Likewise.
8034         * tst-mutex5.c (do_test): exit -> return.
8035         * tst-mutex2.c: Include <stdlib.h>.
8037 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
8039         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
8040         (__lll_mutex_timedlock_wait): Correct expected value after
8041         spurious wakeup.  Otherwise we would never wait again.
8043         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
8044         zone versus inline asm stupidity.  Use correct instructions.
8046         * tst-rwlock6.c: Add some more status output.
8048 2003-03-15  Roland McGrath  <roland@redhat.com>
8050         * sysdeps/pthread/configure.in: New file.
8051         * sysdeps/pthread/configure: New file (generated).
8053 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
8055         * allocatestack.c (allocate_stack): Store the exact stack size of
8056         user allocated stacks.
8058 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
8060         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
8061         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
8062         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
8063         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
8064         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
8065         Use `header.' prefix.
8066         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
8068 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
8070         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
8071         __builtin_frame_address, use stack pointer.
8073         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
8074         instead of __builtin_frame_pointer.
8076 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
8078         * tst-basic1.c (do_test): Add cast to avoid warning.
8079         * tst-basic2.c (do_test): Likewise.
8081         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
8082         amount of stack correction.
8084         * tst-fork4.c: Use test-skeleton.c.
8086 2003-03-14  Roland McGrath  <roland@redhat.com>
8088         * init.c: Fix typo "#eli" for "#else".
8090 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
8092         * allocatestack.c (__stack_user): Use hidden_data_def.
8093         * pthread_create.c (__pthread_keys): Likewise.
8095         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
8097 2003-03-14  Roland McGrath  <roland@redhat.com>
8099         * tst-fork4.c: New file.
8100         * Makefile (tests): Add it.
8102         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
8103         we always define the padding space.
8104         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
8105         stopped supporting its own extensions fully.
8106         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
8107         struct also called `header', so `header.multiple_threads' is the field
8108         name to use on all machines.
8109         * allocatestack.c (allocate_stack): Use `header.' prefix.
8110         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8111         * pthread_create.c (__pthread_create_2_1): Likewise.
8112         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
8113         (THREAD_SELF): Likewise.
8114         * sysdeps/x86_64/tls.h: Likewise.
8115         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
8116         (SINGLE_THREAD_P): Likewise.
8117         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
8118         (SINGLE_THREAD_P): Likewise.
8119         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
8120         (SINGLE_THREAD_P): Likewise.
8122         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
8123         value directly.
8125 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
8127         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
8128         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
8130         * pthread_create.c (start_thread): setjmp is expected to return 0.
8132         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
8133         (THREAD_GETMEM_NC): Likewise.
8135 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
8137         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
8138         and the size of the stack which must be allocated is a multiple,
8139         allocate one more page.
8140         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
8141         MULTI_PAGE_ALIASING.
8143 2003-03-13  Roland McGrath  <roland@redhat.com>
8145         * pthread_create.c (start_thread): Set EXITING_BIT after the
8146         event-reporting (and destructors), not before.
8148 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
8150         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
8151         lll_futex_wake): Declare register variables as long int instead of
8152         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
8153         Make syscall arguments clobbered by the syscall.
8154         (lll_futex_wait): Define using lll_futex_timed_wait.
8156         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
8157         to void *.
8159         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
8160         PPID if [! NDEBUG].
8162         * allocatestack.c (nptl_ncreated): Only declare if
8163         COLORING_INCREMENT != 0.
8165         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
8166         (__libc_enable_asynccancel_2): Remove prototype.
8168         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
8169         ctid to match kernel.
8171 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
8173         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
8174         libc_multiple_threads.
8175         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
8176         __libc_multiple_threads to...
8177         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
8179         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
8180         versioning.
8181         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8182         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8184         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
8185         (__pthread_once_internal): Define.
8187         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
8188         macros instead of .symver directly.
8189         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
8190         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
8192         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
8193         * sysdeps/x86_64/tcb-offsets.sym: New file.
8194         * sysdeps/x86_64/Makefile: New file.
8196         * sysdeps/i386/tcb-offsets.sym: Add SELF.
8197         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
8198         to access own pthread_t in TCB.
8199         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8200         Likewise.
8201         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8202         Likewise.
8203         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8205 2003-03-12  Roland McGrath  <roland@redhat.com>
8207         * pthread-errnos.sym: New file.
8208         * Makefile (gen-as-const-headers): New variable, list that file.
8209         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
8210         header <pthread-errnos.h> instead of defining errno values here.
8211         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
8212         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8213         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8214         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8215         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8216         Likewise.
8217         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8218         Likewise.
8219         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8220         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8221         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8222         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8223         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8224         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8225         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
8226         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
8227         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
8228         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
8229         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
8230         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
8231         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
8232         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
8233         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
8234         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8235         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
8236         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
8237         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
8238         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
8239         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8240         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
8241         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
8242         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
8243         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
8244         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
8245         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
8247         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
8248         CLONE_CHILD_SETTID worked.
8250 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
8252         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
8253         file.
8254         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
8255         file.
8257         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
8258         (pthread_cond_t): Add padding.
8260         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
8261         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
8262         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
8264         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
8265         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
8266         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
8267         (__pthread_rwlock_timedrdlock): Likewise.
8268         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
8269         (__pthread_rwlock_wrlock): Likewise.
8270         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
8271         (__pthread_rwlock_rdlock): Likewise.
8273         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
8275         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
8276         result of lock re-get if it fails.
8278 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8280         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
8281         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
8282         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
8283         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
8284         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
8285         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
8286         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
8287         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
8288         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8289         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8291         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
8292         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
8294         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
8295         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
8296         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
8297         (create_thread): Likewise.
8298         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
8299         * init.c (__pthread_initialize_minimal_internal): Initialize
8300         __libc_multiple_threads_ptr if necessary.
8301         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
8302         __pthread_multiple_threads and __libc_multiple_threads_ptr.
8303         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
8304         __libc_multiple_threads.
8305         (__libc_pthread_init): Return pointer to __libc_pthread_init if
8306         necessary.
8308         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
8309         (THREAD_SETMEM_NC): Likewise.
8311         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
8312         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
8313         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
8314         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
8316         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
8317         Eliminate one entire instruction.
8319         * cancellation.c (__pthread_enable_asynccancel_2): New function.
8320         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
8321         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
8322         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
8323         instead of __pthread_enable_asynccancel.
8324         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8325         (__pthread_cond_wait): Likewise.
8326         * sysdeps/pthread/pthread_cond_timedwait.c
8327         (__pthread_cond_timedwait): Likewise.
8328         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
8330         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8331         (__condvar_cleanup): Wake up all waiters in case we got signaled
8332         after being woken up but before disabling asynchronous
8333         cancellation.
8334         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8335         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
8336         (__condvar_cleanup): Likewise.
8338         * init.c (__NR_set_tid_address): If already defined, don't redefine.
8339         Make it an error if architecture has no #if case.  Add x86-64.
8341         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
8342         pt-initfini.s generation.
8344         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
8345         (TLS_INIT_TP): Fix typo.
8347 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8349         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
8350         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
8352         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
8353         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
8354         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
8355         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
8356         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
8357         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8358         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8359         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8361 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8363         * sysdeps/pthread/pthread_cond_timedwait.c
8364         (__pthread_cond_timedwait): Return the result of the final
8365         locking.  If it succeeds, the regular function return value.
8367         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
8368         Return result of the final locking.
8369         * version.c (__nptl_main): Work around problems with the strange
8370         INTERNAL_SYSCALL macro on ppc32.
8371         * init.c (__pthread_initialize_minimal_internal): Unblock
8372         SIGCANCEL in case the parent blocked it.
8373         Reported by Paul Mackerras <paulus@samba.org>.
8375         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
8376         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
8377         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
8379 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8381         * sysdeps/pthread/pthread_cond_timedwait.c
8382         (__pthread_cond_timedwait): Unlock and fail if
8383         __pthread_mutex_unlock_internal failed.
8385         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
8386         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
8387         Use ARCH_CLONE.
8388         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
8389         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
8390         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
8391         ALLOCATE_STACK): New macros.
8392         (TLS_TPADJ): New macro.
8393         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
8394         (allocate_stack): Handle TLS_DTV_AT_TP and
8395         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
8396         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
8397         Don't set PD->self.
8398         * init.c [__ia64__] (__NR_set_tid_address): Define.
8400         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
8401         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
8402         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
8403         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
8404         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
8405         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
8406         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
8407         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
8408         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
8409         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
8410         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
8411         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
8412         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
8413         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
8414         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
8415         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
8416         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
8417         * sysdeps/ia64/bits/atomic.h: New file.
8418         * sysdeps/ia64/Makefile: New file.
8419         * sysdeps/ia64/pthread_spin_init.c: New file.
8420         * sysdeps/ia64/pthread_spin_lock.c: New file.
8421         * sysdeps/ia64/pthread_spin_trylock.c: New file.
8422         * sysdeps/ia64/pthread_spin_unlock.c: New file.
8423         * sysdeps/ia64/pthreaddef.h: New file.
8424         * sysdeps/ia64/tcb-offsets.sym: New file.
8425         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
8426         * sysdeps/ia64/tls.h: New file.
8428         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
8429         to syscall instead of no arguments.
8431 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
8433         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
8434         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
8435         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
8436         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
8438         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
8439         unused code.
8441         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
8443         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8444         lowlevelbarrier.sym.
8445         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
8446         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
8447         Include lowlevelbarrier.h and don't define offsets locally.
8448         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
8450         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
8451         (__lll_mutex_lock_wait): Reverse order of first two parameters.
8452         (__lll_mutex_timedlock_wait): Likewise.
8453         (lll_mutex_lock): Adjust asm for that.
8454         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
8455         (lll_lock): Adjust asm for operand order change.
8456         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
8457         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
8459         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
8460         Reverse order of parameters.
8461         (__lll_timedwait_tid): Remove regparms attribute.
8462         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
8463         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
8465         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8466         (__lll_timedwait_tid): Remove one unnecessary instruction.
8468         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
8469         __lll_mutex_timedlock_wait only for NOT_IN_libc.
8470         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
8471         lowlevelmutex.S.
8473         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
8474         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
8475         for NOT_IN_libc.
8476         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
8477         lowlevellock.S.
8479         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
8480         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
8481         for libc.so.
8482         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
8483         define LOCK here (if UP is not defined).  The actual code is in
8484         lowlevelmutex.S.
8486         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
8487         LOCK is already defined.  Don't define lll_unlock_wake_cb and
8488         __lll_timedwait_tid for libc.so.
8489         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
8490         define LOCK here (if UP is not defined).  The actual code is in
8491         lowlevellock.S.
8493         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
8494         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
8495         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
8496         instead of lowlevelsem.h.
8497         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8498         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8499         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8501         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8502         lowlevelrwlock.sym.
8503         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
8504         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
8505         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
8507         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
8508         register loading.
8509         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
8510         last changed.  D'oh.
8512         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
8514         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
8515         of __libc_locking_needed.
8516         (lll_trylock): Initialize %eax to zero.
8518         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
8519         pthread_cond_t definition.
8521 2003-03-10  Roland McGrath  <roland@redhat.com>
8523         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
8524         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
8525         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
8526         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
8527         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
8529         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
8530         Instead of setting PD->multiple_threads, set globals
8531         __pthread_multiple_threads and __libc_multiple_threads.
8532         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8533         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
8534         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
8536         * descr.h (struct pthread): Conditionalize first member on
8537         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
8538         containing an anonymous tcbhead_t.  Move `list' member out.
8539         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
8540         * allocatestack.c: Remove use of `header.data.' prefix.
8541         * pthread_create.c: Likewise.
8542         * init.c (__pthread_initialize_minimal_internal): Likewise.
8543         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8544         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
8545         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
8546         * sysdeps/x86_64/tls.h: Likewise.
8547         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
8548         (SINGLE_THREAD_P): Likewise.
8549         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
8550         (SINGLE_THREAD_P): Likewise.
8551         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
8552         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
8554 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
8556         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
8558         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
8559         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8561         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
8562         leftovers from the ia32 code.
8564         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
8565         memory load.
8566         (clear_once_control): Don't load %esi.
8568         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
8569         handling.
8571         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8573         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
8574         * sysdeps/unix/sysv/linux/createthread.c: ...here.
8576         * Makefile (tests): Add tst-cond10.
8577         * tst-cond10.c: New file.
8579 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
8581         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
8582         * tst-signal3.c (do_test): Likewise.
8583         * tst-sem5.c (do_test): Likewise.
8584         * tst-kill6.c (do_test): Likewise.
8585         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
8587         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
8588         of inc/dec.
8589         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
8590         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
8591         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8592         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8593         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8594         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8595         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8596         Likewise.
8597         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8598         Likewise.
8599         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8600         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8601         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8602         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
8603         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
8604         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
8605         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8606         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8608         * allocatestack.c (allocate_stack): If mprotect() fails free the
8609         TLS memory.
8611 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
8613         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
8615         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
8616         lll_wake_tid.  This was used only to work around kernel limits in
8617         the early days.
8618         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
8619         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
8620         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8621         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
8623         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
8624         (__pthread_initialize_minimal_internal): Change initialization of
8625         __static_tls_align_m1 appropriately.
8626         * pthreadP.h (__static_tls_align_m1): Renamed from
8627         __static_tls_align.
8628         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
8629         instead of __static_tls_align-1.
8631 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
8633         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
8635         * pthread_create.c: Define __pthread_keys using nocommon
8636         attribute, not by placing it explicitly in bss.
8637         Remove DEFINE_DEALLOC definition.  Not needed anymore.
8639         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
8640         Use it in mmap call to allocate stacks.
8642         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
8644         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
8645         result of the thread function.
8647 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
8649         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
8650         version is just fine.
8652         * sysdeps/unix/sysv/linux/libc_pthread_init.c
8653         (__pthread_child_handler): Renamed from pthread_child_handler,
8654         exported, and marked hidden.  Change all users.
8655         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
8656         free __pthread_child_handler from child list.
8658 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8660         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
8662         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
8663         Fix handling of cancellation and failing pthread_mutex_unlock call.
8664         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8665         (__pthread_cond_wait): Likewise.
8667         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
8668         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
8669         lll_futex_timed_wait call.
8670         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
8671         (pthread_rwlock_timedwrlock): Likewise.
8673         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
8674         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
8675         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
8677         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
8678         check of lll_futex_wake return value.
8680 2003-03-03  Roland McGrath  <roland@redhat.com>
8682         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
8684         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8685         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
8686         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
8688 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
8690         * sysdeps/pthread/timer_create.c (timer_create): Return correct
8691         error for CPU clocks.
8693         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
8694         _POSIX_MONOTONIC_CLOCK.
8695         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
8697         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
8698         recent kernels.
8700 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8702         * descr.h (struct pthread): Move cleanup field to the front.
8704 2003-03-01  Roland McGrath  <roland@redhat.com>
8706         * sem_open.c (sem_open): Braino fix.
8708 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8710         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
8711         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
8712         __pthread_cleanup_pop functionality.
8713         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8715         * descr.h (struct pthread): Move tid field to the front now that
8716         it is often used.
8718         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
8719         (__lll_mutex_timedlock_wait): Remove.
8720         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8721         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
8722         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8723         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8724         (lll_unlock_wake_cb): Don't save and restore %esi.
8725         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8726         %esi.
8727         (__lll_timedwait_tid): Add alignment.
8728         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
8729         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8730         %esi.
8731         (__lll_timedwait_tid): Removed.
8732         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
8733         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
8734         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
8735         (pthread_barrier_wait): Don't save, load, and restore %esi for
8736         last thread.
8737         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
8738         (__pthread_cond_signal): Don't save, load, and restore %esi.
8739         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
8740         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
8741         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
8742         Don't save, load, and restore %esi.
8744 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
8746         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
8747         Release lock before waking up the waiters.
8749         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
8751         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
8752         (reader_thread): Likewise.
8754         * sysdeps/pthread/pthread_rwlock_unlock.c
8755         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
8756         to wake up readers if there are none.
8758         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
8759         Release internal lock before wake threads.
8761 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
8763         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
8764         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
8765         predefined.
8766         * tst-rwlock9.c: Likewise.
8767         * tst-rwlock10.c: New file.
8768         * tst-rwlock11.c: New file.
8770         * Makefile (tests): Add tst-dlsym1.
8771         * tst-dlsym1.c: New file.
8773         * init.c (__pthread_initialize_minimal_internal): Set
8774         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
8775         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
8777 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
8779         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
8781         * tst-cond2.c: Fix sychronization with child.
8783         * tst-rwlock8.c (reader_thread): Remove unused variable.
8785         * Makefile: Add rules to build and run tst-tls3.
8786         * tst-tls3.c: New file.
8787         * tst-tls3mod.c: New file.
8789         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
8790         * tst-rwlock8.c: New file.
8791         * tst-rwlock9.c: New file.
8792         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
8793         complete broken rwlock implementation.
8794         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8795         Likewise.
8796         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8797         Likewise.
8798         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8799         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8800         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
8801         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
8802         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
8803         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
8804         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
8806 2003-02-23  Roland McGrath  <roland@redhat.com>
8808         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
8810 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
8812         * Makefile (tests): Add tst-context1.
8813         * tst-context1.c: New file.
8815         * Makefile (tests): Add tst-tls1 and tst-tls2.
8816         * tst-tls1.c: New file.
8817         * tst-tls2.c: New file.
8819         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
8820         for failed cmpxchg.
8822         * pthread_create.c (start_thread): Set EXITING_BIT early.
8824         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
8825         (THREAD_GETMEM_NC): Likewise.
8827 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
8829         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
8830         off 3 more bytes by using offset-less instructions when possible.
8832         * Makefile: Add dependency for $(objpfx)version.d.
8834         * eintr.c (eintr_source): Add unnecessary return but the compiler
8835         insists.
8837         * tst-kill3.c: Include <unistd.h>.
8839 2003-02-21  Roland McGrath  <roland@redhat.com>
8841         * pthread_create.c (start_thread): Call __libc_thread_freeres.
8843 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8845         * Makefile (tests): Add tst-eintr1.
8846         (distribute): Add eintr.c.
8847         * tst-eintr1.c: New file.
8848         * eintr.c: New file.
8850         * pthread_cancel.c (pthread_cancel): Use tkill directly.
8852         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
8853         Disallow sending SIGCANCEL.
8855         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
8856         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
8857         * tst-kill1.c: New file.
8858         * tst-kill2.c: New file.
8859         * tst-kill3.c: New file.
8860         * tst-kill5.c: New file.
8861         * tst-kill6.c: New file.
8862         * tst-basic7.c: Renamed to...
8863         * tst-kill4.c: ...this.
8865 2003-02-21  Roland McGrath  <roland@redhat.com>
8867         * Makefile (install-lib-ldscripts): New variable.
8869 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8871         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
8872         * pthread_cancel.c: Use INVALID_TD_P.
8873         * pthread_detach.c: Likewise.
8874         * pthread_getschedparam.c: Likewise.
8875         * pthread_setschedparam.c: Likewise.
8876         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
8877         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
8878         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
8879         * pthread_timedjoin.c: Likewise.
8881         * tst-basic7.c: Include <signal.h>.
8883         * pthread_join.c (pthread_join): Limited checking for invalid
8884         descriptors.
8885         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
8887 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
8889         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
8890         beginning of the loop.  Clear the entire first block of TSD.
8891         * Makefile (tests): Add tst-key4.
8892         * tst-key4.c: New file.
8894 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
8896         * Makefile (tests): Add tst-basic7.
8897         * tst-basic7.c: New file.
8899         * pthread_create.c (deallocate_tsd): Mark as internal_function.
8900         Add some more __builtin_expect.
8902         * pthreadP.h: Define dummy version of DEBUGGING_P.
8904 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
8906         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
8907         _POSIX_THREAD_PRIORITY_SCHEDULING.
8908         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
8909         _XOPEN_REALTIME_THREADS.
8910         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
8912         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
8913         kernel returns EINVAL for PID <= 0, work around it.
8915         * Makefile (tests): Add tst-signal5.
8916         * tst-signal5.c: New file.
8918         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
8919         and LOGIN_NAME_MAX.
8921         * tst-cancel1.c (tf): Block all signals.
8923         * Makefile (tests): Add tst-basic6.
8924         * tst-basic6.c: New file.
8926         * tst-basic1.c: Add test for process ID.
8928         * Makefile (tests): Add tst-cancel10.
8929         * tst-cancel10.c: New file.
8931         * Makefile (tests): Add tst-signal4.
8932         * tst-signal4.c: New file.
8934         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
8935         __sigismember instead of sigismember.  Add __builtin_expect.
8937 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
8939         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
8940         pthread_setcancelstate, and pthread_rwlock_setpshared.
8942         * tst-cancel7.c (do_test): Make sure the pid file exists before
8943         canceling the thread.
8945         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
8946         pthread_rwlock_timedrdlock tests.
8947         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
8948         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8949         Check for invalid tv_nsec field.
8950         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8951         Likewise.
8953         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
8954         recursive mutex of overflow.
8956         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
8958         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
8959         going into an endless loop.
8960         * Makefile (tests): Add tst-cancel9.
8961         * tst-cancel9.c: New file.
8963         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
8965 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
8967         * tst-mutex5.c (do_test): Add more timedlock tests.
8969         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
8970         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
8972         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
8973         use INLINE_SYSCALL.  Error number is returned, not -1.
8975         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
8976         and __deallocate_stack with internal_function.
8977         * pthread_create.c: Adjust definitions appropriately.
8978         * allocatestack.c: Likewise.
8980         * pthread_join.c: Add one more __builtin_expect.
8981         * pthread_timedjoin.c: Likewise.
8983         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
8984         not data of sequence number does not match.
8985         Add one __builtin_expect.
8987         * Makefile (tests): Add tst-clock1.
8988         * tst-clock1.c: New file.
8990         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
8991         negative arguments.
8992         * Makefile (tests): Add tst-basic5.
8993         * tst-basic5.c: New file.
8995 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
8997         * Makefile (tests): Add tst-basic4.
8998         * tst-basic4.c: New file.
9000         * pthreadP.h: Add declaraction for __nptl_nthreads.
9001         * pthread_create.c: Define __nptl_nthreads
9002         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
9003         after thread is done.  If then zero, call exit(0).
9004         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9005         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
9006         * init.c (pthread_functions): Initialize ptr_nthreads.
9007         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
9008         (__reclaim_stacks): Decrement __nptl_nthreads.
9009         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
9010         Define.
9011         * Makefile (tests): Add tst-basic3.
9012         * tst-basic3.c: New file.
9014         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
9015         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
9016         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
9017         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
9018         if asynchronous canceling is enabled.
9019         * pthread_join.c (pthread_join): When recognizing circular joins,
9020         take into account the other thread might be already canceled.
9021         * Makefile (tests): Add tst-join5.
9022         * tst-join5.c: New file.
9024         * Makefile (tests): Add tst-join4.
9025         * tst-join4.c: New file.
9027 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
9029         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
9031 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9033         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
9034         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
9035         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
9036         warning.
9037         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
9038         to avoid warning.
9039         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
9040         error if lll_futex_wake failed.
9042 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
9044         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
9045         handling of cancellation and failung pthread_mutex_unlock call.
9046         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9047         * Makefile (tests): Add tst-cond8 and tst-cond9.
9048         * tst-cond8.c: New file.
9049         * tst-cond9.c: New file.
9051         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
9053         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
9054         non-standard initializers with __USE_GNU.
9056         * Makefile (tests): Add tst-cleanup3.
9057         * tst-cleanup3.c: New file.
9059 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
9061         * Makefile (tests): Add tst-attr1 and tst-attr2.
9062         * tst-attr1.c: New file.
9063         * tst-attr2.c: New file.
9065         * Makefile: Add rules to build and run tst-atfork2 test.
9066         * tst-atfork2.c: New file.
9067         * tst-atfork2mod.c: New file.
9069         * sysdeps/unix/sysv/linux/unregister-atfork.c
9070         (__unregister_atfork): Free the memory allocated for the handlers
9071         after removing them from the lists.
9073         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
9074         cleanup function.
9076         * tst-atfork1.c (do_test): Wait for the child we forked.
9077         Report error in child.
9079         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
9081         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
9083 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
9085         * Makefile (tests): Add tst-cancel8.
9086         * tst-cancel8.c: New file.
9088         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
9089         clearing of control variable.
9090         * Makefile (tests): Add tst-once3 and tst-once4.
9091         * tst-once3.c: New file.
9092         * tst-once4.c: New file.
9094 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
9096         * sysdeps/sh/Makefile: New file.
9097         * sysdeps/sh/bits/atomic.h: New file.
9098         * sysdeps/sh/pthread_spin_init.c: New file.
9099         * sysdeps/sh/pthread_spin_lock.c: New file.
9100         * sysdeps/sh/pthread_spin_trylock.S: New file.
9101         * sysdeps/sh/pthread_spin_unlock.S: New file.
9102         * sysdeps/sh/pthreaddef.h: New file.
9103         * sysdeps/sh/tcb-offsets.sym: New file.
9104         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
9105         * sysdeps/sh/tls.h: New file.
9106         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
9107         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
9108         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
9109         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
9110         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
9111         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
9112         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
9113         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
9114         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
9115         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
9116         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
9117         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
9118         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
9119         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
9120         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
9121         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
9122         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
9123         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
9124         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
9125         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
9126         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
9127         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
9128         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
9129         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
9130         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
9131         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
9132         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
9133         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
9134         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
9135         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
9137 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
9139         * tst-cond2.c: Rearrange code to not rely on behavior undefined
9140         according to POSIX.
9142         * tst-basic2.c (do_test): Lock mutex before creating the thread.
9144 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
9146         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
9147         (TLS_GET_FS): New #define.
9148         (TLS_SET_FS): New #define.
9149         Correct value of __NR_set_thread_area.
9151         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
9153 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
9155         * Makefile (tests): Add tst-popen1.
9156         * tst-popen1.c: New file.
9158         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
9159         but inactive generalization.
9160         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9161         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
9162         Minor optimization, remove one instruction.
9163         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
9165 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9167         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
9169 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9171         * init.c (__NR_set_tid_address): Add #ifdef for s390.
9172         * sysdeps/pthread/pthread_barrier_wait.c: New file.
9173         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
9174         * sysdeps/pthread/pthread_cond_signal.c: New file.
9175         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
9176         * sysdeps/pthread/pthread_cond_wait.c: New file.
9177         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
9178         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
9179         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
9180         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
9181         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
9182         * sysdeps/s390/Makefile: New file.
9183         * sysdeps/s390/bits/atomic.h: New file.
9184         * sysdeps/s390/pthread_spin_init.c: New file.
9185         * sysdeps/s390/pthread_spin_lock.c: New file.
9186         * sysdeps/s390/pthread_spin_trylock.c: New file.
9187         * sysdeps/s390/pthread_spin_unlock.c: New file.
9188         * sysdeps/s390/pthreaddef.h: New file.
9189         * sysdeps/s390/tcb-offsets.sym: New file.
9190         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
9191         * sysdeps/s390/tls.h: New file.
9192         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
9193         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
9194         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
9195         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
9196         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
9197         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
9198         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
9199         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
9200         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
9201         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
9202         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
9203         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
9204         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
9205         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
9206         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
9207         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
9208         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
9209         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
9210         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
9211         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
9212         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
9213         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
9214         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
9216 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
9218         * atomic.h: Add a couple more default implementations.
9219         (atomic_compare_and_exchange_acq): Use
9220         __arch_compare_and_exchange_32_acq in return value definition.  It
9221         always exists.
9222         (atomic_bit_set): Renamed from atomic_set_bit.
9223         Add missing atomic_ prefixes.
9225         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
9226         thread library is available, use correct value to mark initialized
9227         once variable.
9229 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
9231         * allocatestack.c (allocate_stack): Use __getpagesize instead of
9232         __sysconf to determine pagesize.
9234         * pthread_create.c: Include <atomic.h>.
9235         * allocatestack.c (allocate_stack): Implement coloring of the
9236         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
9237         size minus one.  Adjust users.
9238         * sysdeps/i386/i686/Makefile: New file.
9240 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
9242         * allocatestack.c: Improve comment throughout the file.
9244         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9245         (__lll_lock_wait): Add branch prediction.
9246         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
9247         (__lll_lock_wait): Likewise.
9248         (lll_unlock_wake_cb): Removed.
9250 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
9252         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
9253         _POSIX_THREAD_PRIORITY_SCHEDULING.
9255 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
9257         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9258         Fix return type of ptr___pthread_getspecific.
9260 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
9262         * Makefile (tests): Add tst-umask1.
9263         (tst-umask1-ARGS): Define.
9264         * tst-umask1.c: New file.
9266 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
9268         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
9269         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
9270         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
9271         pthread_rwlock_unlock.
9272         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
9273         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
9274         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
9275         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
9276         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9277         New file.
9278         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
9279         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9280         New file.
9281         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
9282         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
9283         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
9284         New file.
9285         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
9286         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
9287         New file.
9288         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
9289         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
9290         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
9291         New file.
9292         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
9293         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
9294         New file.
9295         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
9297         * Makefile (libpthread-routines): Remove lowlevelcond and
9298         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
9299         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
9300         and pthread_cond_broadcast.
9301         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
9302         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
9303         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
9304         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
9305         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
9306         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
9307         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
9308         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
9309         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
9310         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
9311         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
9312         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
9313         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
9314         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
9315         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
9316         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
9317         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
9318         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
9319         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
9320         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
9321         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
9322         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
9323         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
9324         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
9325         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
9326         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
9327         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
9328         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
9329         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
9330         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
9331         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
9333         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
9334         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
9335         of the code is moved to ...
9336         * sysdeps/pthread/createthread.c: ...here.  New file.
9338 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
9340         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
9341         (__new_sem_post): Clear %eax before returning.
9342         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
9344         * Makefile (tests): Add tst-cleanup2.
9345         * tst-cleanup2.c: New file.
9347         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
9348         Interpret first parameter correctly.
9350 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
9352         * Makefile (headers): Add bits/semaphore.h.
9354 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
9356         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
9357         if not SHARED.
9359 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
9361         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
9362         must be used and mapping failed.
9363         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
9365         * Makefile (CFLAGS-pthread_self.os): Define this, not
9366         CFLAGS-pthread_self.c.
9368 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9370         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
9371         lll_unlock_wake_cb.
9373         * Makefile (libpthread-routines): Add version.  Add rules to build
9374         version.os and banner.h.
9375         * version.c: New file.
9377 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
9379         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
9380         the alias unconditional.
9381         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
9383 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9385         * Makefile (CFLAGS-pthread_self.c): New definition.
9387 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9389         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
9390         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
9391         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
9392         * init.c (__pthread_initialize_minimal_internal): Likewise.
9394 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
9396         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
9398         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
9399         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9400         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9401         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
9402         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9403         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9405 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9407         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
9408         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
9409         * tst-cancel-wrappers.sh: Remove all exceptions.
9411 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
9413         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
9414         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
9416         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
9417         Use __libc_pthread_functions array if SHARED.
9419         * pthreadP.h: Move pthread_cond_2_0_t definition to...
9420         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
9422         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
9423         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
9424         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
9425         __libc_ptf_call instead of __libc_maybe_call.
9426         (PTF): New #define.
9427         (__libc_cleanup_region_start): Wrap function name with PTF call.
9428         (__libc_cleanup_region_end): Likewise.
9429         (__libc_cleanup_end): Likewise.
9431         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
9432         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
9433         * pthread_key_create.c: Add __pthread_key_create_internal alias.
9434         * pthreadP.h: Add prototypes.
9436         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
9437         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
9438         __pthread_rwlock_unlock aliases.
9439         * pthreadP.h: Add prototypes for new aliases.
9441         * pthreadP.h (struct pthead_functions): Moved to...
9442         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
9443         * init.c (pthread_functions): Add initializers for new elements.
9445         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
9446         __pthread_cleanup_pop_restore aliases.
9447         * pthreadP.h: Add prototypes.
9449         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
9450         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
9451         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
9452         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
9453         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
9454         * pthreadP.h: Adjust prototypes and callers.
9456 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
9458         * Makefile (tests): Add tst-cancel7.
9459         (tst-cancel7-ARGS): New variable.
9460         * tst-cancel7.c: New file.
9462         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
9463         around gcc defficiencies.
9464         * old_pthread_cond_signal.c: Likewise.
9465         * old_pthread_cond_timedwait.c: Likewise.
9466         * old_pthread_cond_wait.c: Likewise.
9468         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
9470 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9472         * Makefile (tests): Add tst-cond7.
9473         * tst-cond7.c: New file.
9475         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9476         (condvar_cleanup): Get condvar address from the right place.
9478         * atomic.h: Correct definitions of atomic_full_barrier,
9479         atomic_read_barrier, atomic_write_barrier.
9481         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
9482         race-free.
9483         * old_pthread_cond_signal.c: Likewise.
9484         * old_pthread_cond_timedwait.c: Likewise.
9485         * old_pthread_cond_wait.c: Likewise.
9487 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
9489         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
9491 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9493         * pthreadP.h (pthread_cond_2_0_t): New type.
9494         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
9495         Use new type for the 2.0 condvar function prototypes.
9496         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
9497         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
9498         parameter.
9499         * old_pthread_cond_destroy.c: Likewise.
9500         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
9501         * old_pthread_cond_signal.c: Likewise.
9502         * old_pthread_cond_timedwait.c: Likewise.
9503         * old_pthread_cond_wait.c: Likewise.
9505         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9506         (__pthread_cond_wait): Don't save cancellation mode and seq value
9507         in same location.
9509         * herrno.c (__h_errno_location): Don't define as weak.
9511 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9513         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
9514         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
9515         and pthread_cond_wait.
9516         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
9517         Renamed to...
9518         (__pthread_cond_broadcast_2_0): ... this.
9519         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
9520         Renamed to...
9521         (__pthread_cond_destroy_2_0): ... this.
9522         * old_pthread_cond_init.c (__old_pthread_cond_init):
9523         Renamed to...
9524         (__pthread_cond_init_2_0): ... this.
9525         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
9526         Renamed to...
9527         (__pthread_cond_signal_2_0): ... this.
9528         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
9529         Renamed to...
9530         (__pthread_cond_wait_2_0): ... this.
9531         * pthread_cond_destroy.c: Include shlib-compat.h.
9532         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
9533         * pthread_cond_init.c: Include shlib-compat.h.
9534         (pthread_cond_init): Change strong_alias into versioned_symbol.
9535         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
9536         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
9537         fields.
9538         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
9539         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
9540         __pthread_cond_wait_2_0): New prototypes.
9541         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
9542         __old_pthread_cond_init, __old_pthread_cond_signal,
9543         __old_pthread_cond_wait): Removed.
9544         * init.c: Include shlib-compat.h.
9545         (pthread_functions): Guard ptr___pthread_attr_init_2_0
9546         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
9547         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
9548         ptr___pthread_cond_*_2_0 fields.
9549         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
9550         pthread_cond_*@GLIBC_2.0 compatibility symbols.
9552         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
9553         LIBC_SIGACTION was not yet defined.
9554         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
9555         [!defined LIBC_SIGACTION] (__sigaction): New function and
9556         libc_hidden_weak.
9557         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
9558         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
9560 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9562         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
9564 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
9566         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
9567         New, larger type definition.
9568         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
9569         implementation.
9570         * Versions [libpthread]: Add definitions for new pthread_cond_*
9571         interfaces for version GLIBC_2.3.2.
9572         * pthread_cond_init.c: Update initialization for new type definition.
9573         * Makefile (libpthread-routines): Remove pthread_cond_wait,
9574         pthread_cond_timedwait, pthread_cond_signal, and
9575         pthread_cond_broadcast.  Add old_pthread_cond_init,
9576         old_pthread_cond_destroy, old_pthread_cond_wait,
9577         old_pthread_cond_timedwait, old_pthread_cond_signal, and
9578         old_pthread_cond_broadcast.
9579         * old_pthread_cond_broadcast.c: New file.
9580         * old_pthread_cond_destroy.c: New file.
9581         * old_pthread_cond_init.c: New file.
9582         * old_pthread_cond_signal.c: New file.
9583         * old_pthread_cond_timedwait.c: New file.
9584         * old_pthread_cond_wait.c: New file.
9585         * pthreadP.h: Add prototypes for the compatibility interfaces.
9587         * pthread_cond_destroy.c: Don't include <errno.h>.
9589 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
9591         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
9592         unnecessary zero offset when addressing MUTEX.
9594 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9596         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
9597         __register_atfork.
9598         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
9599         for __register_atfork.
9601 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9603         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
9604         instead of ASSEMBLER test macro.
9606         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
9607         __libc_current_sigrtmax): Add libc_hidden_def.
9609         * sysdeps/pthread/list.h: Remove assert.h include.
9611 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9613         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
9614         __pthread_initialize_minimal_internal not
9615         __pthread_initialize_minimal.
9617 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
9619         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
9620         __pthread_initialize_minimal as hidden.
9622         * init.c (__pthread_initialize_minimal_internal): Don't mark as
9623         constructor.
9625 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9627         * Makefile ($(inst_libdir)/libpthread.so): Depend on
9628         $(common-objpfx)format.lds, include that into the output script.
9629         Fix comment.
9630         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
9632 2002-12-28  Andreas Jaeger  <aj@suse.de>
9634         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
9635         nsec resolution changes.
9636         (xstat64_conv): Likewise.
9637         (xstat32_conv): Likewise.
9638         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
9639         struct kernel_stat.
9640         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
9641         structs stat and stat64.
9642         * time/time.h (__timespec_defined): Define for __USE_MISC.
9643         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
9645 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
9647         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
9648         argument.
9649         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
9650         (pthread_exit): Use strong_alias to avoid warnings.
9651         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
9652         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
9653         ptr___pthread_attr_init_2_*.
9654         * init.c (pthread_functions): Adjust.
9656 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
9658         * forward.c: Make all functions available by default again.  It
9659         caused too much trouble.
9661         * pt-siglongjmp.c: Removed.
9663 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
9665         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
9666         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
9667         * sysdeps/i386/Makefile: New file.
9668         * sysdeps/i386/tcb-offsets.sym: New file.
9669         * sysdeps/pthread/tcb-offsets.h: New file.
9670         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9671         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
9673         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
9674         __register_atfork...
9675         (GLIBC_2.3.2): ...here.
9677 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9679         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
9680         pthread_attr_setstackaddr with __attribute_deprecated__.
9682 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9684         * pt-system.c (system): Remove cancellation handling.
9685         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
9686         cancellation routines.
9688 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9690         * descr.h: Include <dl-sysdep.h>.
9691         (struct pthread): Move header.data.list to the back of the struct.
9692         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
9693         (MULTIPLE_THREADS_OFFSET): Adjust offset.
9694         (SYSINFO_OFFSEET): Likewise.
9696 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9698         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
9699         Define.
9700         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
9701         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
9702         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
9703         (USE_DL_SYSINFO): Undef.
9705 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
9707         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
9708         $(common-objpfx)libc.so.
9709         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
9710         it is bigger than pipe buffer size even on arches with bigger
9711         page size.
9712         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
9714 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
9716         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
9717         correct errno access for case that USE___THREAD is not defined.
9719 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
9721         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
9722         Patch by Marijn Ros <marijn@mad.scientist.com>.
9724 2002-12-22  Roland McGrath  <roland@redhat.com>
9726         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
9728 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
9730         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
9732 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
9734         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
9735         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
9736         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
9738         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
9739         of int $0x80.
9740         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9741         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
9742         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
9743         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
9744         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
9745         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
9746         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
9747         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
9749         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
9750         sysenter.
9751         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
9753         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
9755         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
9756         in new TCB.
9757         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
9758         that sysinfo is properly initialized.
9759         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
9760         to 1 only for ld.so.
9762         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
9763         RTLD_CORRECT_DYNAMIC_WEAK.
9765 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
9767         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
9768         Use return 0 as 6th argument to FORWARD4.
9769         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
9771 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9773         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
9774         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
9775         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
9776         (INIT_SYSINFO): New #define.
9777         (TLS_TP_INIT): Use INIT_SYSINFO.
9778         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9779         At test to make sure SYSINFO_OFFSET value is correct.
9780         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
9782 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
9784         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
9785         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
9786         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
9787         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
9788         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
9789         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
9790         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
9792 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9794         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
9795         macro instead of using int $0x80 directly.
9797         * sysdeps/pthread/bits/stdio-lock.h: New file.
9798         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
9799         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
9800         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
9801         * Makefile (routines): Add libc-lowlevelmutex.
9803         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
9804         __i686.get_pc_thunk.dx.
9806 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9808         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
9809         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
9810         ($(objpfx)tst-cancel-wrappers.out): New rule.
9811         * tst-cancel-wrappers.sh: New test.
9812         * tst-locale1.c: Include signal.h.
9813         (uselocale): Test static linking of __libc_current_sigrt*.
9815 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
9817         * Makefile (tests): Add tst-cancel6.
9818         * tst-cancel6.c: New file
9820 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9822         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
9823         Define meaningfully for assembler as well.
9824         * pthreadP.h (struct pthread_functions): Remove
9825         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
9826         and ptr_pthread_attr_init_2_1 fields.
9827         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
9828         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
9829         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
9830         (FORWARD3): Define using FORWARD4.
9831         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
9832         versions.
9833         * pt-system.c: Remove duplicate stdlib.h include.
9835 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
9837         * sem_init.c: Define sem_init@GLIBC_2.0.
9838         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
9839         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
9841         * flockfile.c: Moved to...
9842         * sysdeps/pthread/flockfile.c: ...here.  New file.
9843         * funlockfile.c: Moved to...
9844         * sysdeps/pthread/funlockfile.c: ...here.  New file.
9845         * ftrylockfile.c: Moved to...
9846         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
9848 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
9850         * libc-cancellation.c: Guard both function with
9851         #if !defined NOT_IN_libc.
9852         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
9853         automatically provided pthread wrappers.
9854         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
9855         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
9856         nor in libpthread.
9857         * pt-open.c: Removed.
9858         * pt-fcntl.c: Removed.
9859         * pt-fsync.c: Removed.
9860         * pt-lseek.c: Removed.
9861         * pt-msgrcv.c: Removed.
9862         * pt-msgsnd.c: Removed.
9863         * pt-msync.c: Removed.
9864         * pt-nanosleep.c: Removed.
9865         * pt-open64.c: Removed.
9866         * pt-pause.c: Removed.
9867         * pt-pread.c: Removed.
9868         * pt-pread64.c: Removed.
9869         * pt-pwrite.c: Removed.
9870         * pt-pwrite64.c: Removed.
9871         * pt-read.c: Removed.
9872         * pt-recv.c: Removed.
9873         * pt-recvfrom.c: Removed.
9874         * pt-recvmsg.c: Removed.
9875         * pt-send.c: Removed.
9876         * pt-sendto.c: Removed.
9877         * pt-sigtimedwait.c: Removed.
9878         * pt-sigwait.c: Removed.
9879         * pt-wait.c: Removed.
9880         * pt-waitpid.c: Removed.
9881         * pt-write.c: Removed.
9882         * pt-accept.c: Removed.
9883         * pt-close.c: Removed.
9884         * pt-connect.c: Removed.
9885         * pt-lseek64.c: Removed.
9886         * pt-sendmsg.c: Removed.
9887         * pt-tcdrain.c: Removed.
9889 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
9891         * init.c (__pthread_initialize_minimal_internal): Renamed from
9892         __pthread_initialize_minimal.  Make old name an alias.  This
9893         converts a normal relocation into a relative relocation.
9895         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
9897         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
9898         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
9899         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
9900         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
9901         pt-sigwaitinfo, pt-waitid, and pt-writev.
9902         * pt-creat.c: Removed.
9903         * pt-poll.c: Removed.
9904         * pt-pselect.c: Removed.
9905         * pt-readv.c: Removed.
9906         * pt-select.c: Removed.
9907         * pt-sigpause.c: Removed.
9908         * pt-sigsuspend.c: Removed.
9909         * pt-sigwaitinfo.c: Removed.
9910         * pt-waitid.c: Removed.
9911         * pt-writev.c: Removed.
9913         * init.c (pthread_functions): New variable.
9914         (__pthread_initialize_minimal): Pass pointer to pthread_functions
9915         (or NULL) to __libc_pthread_init.
9916         * forward.c: Rewrite to use __libc:pthread_functions array to get
9917         function addresses.
9918         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
9919         prototype.
9920         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9921         Take new parameter.  Copy content of variable pointed to by it
9922         to __libc_pthread_init.
9924         * pthreadP.h (struct pthread_functions): New type.
9925         (__libc_pthread_init): Declare.
9927         * pthread_attr_destroy.c: Add namespace protected alias.
9928         * pthread_attr_getdetachstate.c: Likewise.
9929         * pthread_attr_getinheritsched.c: Likewise.
9930         * pthread_attr_getschedparam.c: Likewise.
9931         * pthread_attr_getschedpolicy.c: Likewise.
9932         * pthread_attr_getscope.c: Likewise.
9933         * pthread_attr_setdetachstate.c: Likewise.
9934         * pthread_attr_setinheritsched.c: Likewise.
9935         * pthread_attr_setschedparam.c: Likewise.
9936         * pthread_attr_setschedpolicy.c: Likewise.
9937         * pthread_attr_setscope.c: Likewise.
9938         * pthread_cond_broadcast.c: Likewise.
9939         * pthread_cond_destroy.c: Likewise.
9940         * pthread_cond_init.c: Likewise.
9941         * pthread_cond_signal.c: Likewise.
9942         * pthread_cond_wait.c: Likewise.
9943         * pthread_condattr_destroy.c: Likewise.
9944         * pthread_condattr_init.c: Likewise.
9945         * pthread_equal.c: Likewise.
9946         * pthread_exit.c: Likewise.
9947         * pthread_getschedparam.c: Likewise.
9948         * pthread_self.c: Likewise.
9949         * pthread_setcancelstate.c: Likewise.
9950         * pthread_setschedparam.c: Likewise.
9951         * pthread_mutex_destroy.c: Likewise.
9952         * pthread_mutex_init.c: Likewise.
9953         * pthreadP.h: Add prototypes for the aliases.
9955         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
9956         multiple_threads member in correct TCB to 1.
9958         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
9959         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
9960         member of thread decriptor, otherwise return unconditionally 1.
9962 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9964         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
9965         regular Linux version.  Remove file.
9966         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
9967         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
9968         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
9969         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
9970         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
9971         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
9972         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
9973         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
9974         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
9975         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
9976         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
9977         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
9978         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
9979         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
9980         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
9981         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
9982         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
9983         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
9984         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
9985         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
9986         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
9987         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
9988         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
9989         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
9990         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
9991         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
9992         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
9993         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
9994         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
9995         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
9997 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9999         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
10000         * sysdeps/unix/sysv/linux/open.c: Removed.
10001         * sysdeps/unix/sysv/linux/fsync.c: Removed.
10002         * sysdeps/unix/sysv/linux/lseek.c: Removed.
10003         * sysdeps/unix/sysv/linux/msync.c: Removed.
10004         * sysdeps/unix/sysv/linux/read.c: Removed.
10005         * sysdeps/unix/sysv/linux/close.c: Removed.
10006         * sysdeps/unix/sysv/linux/creat.c: Removed.
10007         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
10008         * sysdeps/unix/sysv/linux/pause.c: Removed.
10009         * sysdeps/unix/sysv/linux/select.c: Removed.
10010         * sysdeps/unix/sysv/linux/write.c: Removed.
10012 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
10014         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
10015         element in TCB to see whether locking is needed.
10017         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
10018         MULTIPLE_THREADS_OFFSET value is correct.
10020         * sysdeps/unix/sysv/linux/close.c: New file.
10021         * sysdeps/unix/sysv/linux/connect.S: New file.
10022         * sysdeps/unix/sysv/linux/creat.c: New file.
10023         * sysdeps/unix/sysv/linux/fsync.c: New file.
10024         * sysdeps/unix/sysv/linux/llseek.c: New file.
10025         * sysdeps/unix/sysv/linux/lseek.c: New file.
10026         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
10027         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
10028         * sysdeps/unix/sysv/linux/msync.c: New file.
10029         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
10030         * sysdeps/unix/sysv/linux/open.c: New file.
10031         * sysdeps/unix/sysv/linux/open64.c: New file.
10032         * sysdeps/unix/sysv/linux/pause.c: New file.
10033         * sysdeps/unix/sysv/linux/poll.c: New file.
10034         * sysdeps/unix/sysv/linux/pread.c: New file.
10035         * sysdeps/unix/sysv/linux/pread64.c: New file.
10036         * sysdeps/unix/sysv/linux/pselect.c: New file.
10037         * sysdeps/unix/sysv/linux/pwrite.c: New file.
10038         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
10039         * sysdeps/unix/sysv/linux/readv.c: New file.
10040         * sysdeps/unix/sysv/linux/recv.S: New file.
10041         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
10042         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
10043         * sysdeps/unix/sysv/linux/select.c: New file.
10044         * sysdeps/unix/sysv/linux/send.S: New file.
10045         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
10046         * sysdeps/unix/sysv/linux/sendto.S: New file.
10047         * sysdeps/unix/sysv/linux/sigpause.c: New file.
10048         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
10049         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
10050         * sysdeps/unix/sysv/linux/sigwait.c: New file.
10051         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
10052         * sysdeps/unix/sysv/linux/system.c: New file.
10053         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
10054         * sysdeps/unix/sysv/linux/wait.c: New file.
10055         * sysdeps/unix/sysv/linux/waitid.c: New file.
10056         * sysdeps/unix/sysv/linux/waitpid.c: New file.
10057         * sysdeps/unix/sysv/linux/writev.c: New file.
10058         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
10060         * pt-readv.c: Fix comment.
10062 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
10064         * tst-cleanup1.c: Include stdlib.h.
10066         * tst-cancel5.c: New test.
10067         * Makefile (tests): Add tst-cancel5.
10068         (tst-cancel5): Link against libc.so libpthread.so in that order.
10070 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
10072         * forward.c (test_loaded): Prevent recursive calls.
10074         * Makefile (routines): Add libc-cancellation.
10075         * libc-cancellation.c: New file.
10076         * descr.h (struct pthread): Add multiple_threads field.
10077         * allocatestack.c (allocate_stack): Initialize multiple_header field of
10078         new thread descriptor to 1.
10079         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
10080         Initialize multiple_thread field after successful thread creation.
10081         * cancellation.c (__do_cancel): Move to pthreadP.h.
10082         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
10083         (__pthread_disable_asynccancel): Add internal_function attribute.
10084         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
10085         * pthread_setcancelstate.c: Likewise.
10086         * pthread_setcanceltype.c: Likewise.
10087         * pthread_exit.c: Likewise.
10088         * pthreadP.h (CANCELLATION_P): Likewise.
10089         (__do_cancel): Define as static inline.
10090         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
10091         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
10092         declarations.
10093         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
10094         fields.  Define MULTIPLE_THREADS_OFFSET.
10095         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
10096         declaration.
10097         * sysdeps/unix/sysv/linux/accept.S: New file.
10098         * sysdeps/unix/sysv/linux/read.c: New file.
10099         * sysdeps/unix/sysv/linux/write.c: New file.
10100         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
10101         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
10102         initialization of __libc_locking_needed.
10103         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
10104         __libc_locking_needed, use multiple_threads field in TCB.
10105         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10107 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
10109         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
10110         version.
10111         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
10113         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
10114         access to __libc_locking_needed for PIC.
10116 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
10118         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
10119         declare for libc.so.
10120         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
10121         expression.
10122         (__libc_lock_lock): Put into statement expression.
10123         (__libc_lock_unlock): Remove trailing semicolon.
10124         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
10126 2002-12-12  Roland McGrath  <roland@redhat.com>
10128         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
10129         "m" constraint to refer to __libc_locking_needed.  Declare it here.
10131 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
10133         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
10134         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
10135         Initialize __libc_locking_needed.
10136         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
10137         instead of __register_pthread_fork_handler.
10138         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
10139         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
10140         fork-gen with libc_pthread_init.
10141         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
10142         of __register_pthread_fork_handler.
10143         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
10144         of __register_pthread_fork_handler.
10145         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
10146         __libc_locking_needed to determine whether lock prefix can be avoided.
10147         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10149 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
10151         * Makefile (tests): Add tst-cleanup1.
10152         * tst-cleanup1.c: New file.
10153         * cancellation.c (__cleanup_thread): Removed.
10154         (__do_cancel): Remove call to __cleanup_thread.
10155         * pthreadP.h: Remove __cleanup_thread prorotype.
10157         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
10158         Remember function and argument even if cancellation handler
10159         function is not available.
10160         (__libc_cleanup_region_end): Execute registered function directly if
10161         pthread functions are not available.
10162         (__libc_cleanup_end): Likewise.
10164         * init.c (__pthread_initialize_minimal): Fix initialization in
10165         static lib by preventing gcc from being too clever.
10167 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
10169         * init.c (__pthread_initialize_minimal): Remove unneccesary
10170         sigaddset call.
10172         * Makefile (tests): We can run tst-locale2 now.
10174 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
10176         * Versions: Remove duplicated sigwait entry.
10178 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
10180         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
10181         inside libpthread.
10183         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
10185         * pthreadP.h: Declare __pthread_enable_asynccancel and
10186         __pthread_disable_asynccancel.
10187         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
10188         (CANCEL_RESET): Use __pthread_disable_asynccancel.
10189         * cancellation.c (__pthread_enable_asynccancel): New function.
10190         (__pthread_disable_asynccancel): New function.
10191         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
10192         * pt-close.c: Likewise.
10193         * pt-connect.c: Likewise.
10194         * pt-creat.c: Likewise.
10195         * pt-fcntl.c: Likewise.
10196         * pt-fsync.c: Likewise.
10197         * pt-lseek.c: Likewise.
10198         * pt-lseek64.c: Likewise.
10199         * pt-msgrcv.c: Likewise.
10200         * pt-msgsnd.c: Likewise.
10201         * pt-msync.c: Likewise.
10202         * pt-nanosleep.c: Likewise.
10203         * pt-open.c: Likewise.
10204         * pt-open64.c: Likewise.
10205         * pt-pause.c: Likewise.
10206         * pt-poll.c: Likewise.
10207         * pt-pread.c: Likewise.
10208         * pt-pread64.c: Likewise.
10209         * pt-pselect.c: Likewise.
10210         * pt-pwrite.c: Likewise.
10211         * pt-pwrite64.c: Likewise.
10212         * pt-read.c: Likewise.
10213         * pt-readv.c: Likewise.
10214         * pt-recv.c: Likewise.
10215         * pt-recvfrom.c: Likewise.
10216         * pt-recvmsg.c: Likewise.
10217         * pt-select.c: Likewise.
10218         * pt-send.c: Likewise.
10219         * pt-sendmsg.c: Likewise.
10220         * pt-sendto.c: Likewise.
10221         * pt-sigpause.c: Likewise.
10222         * pt-sigsuspend.c: Likewise.
10223         * pt-sigtimedwait.c: Likewise.
10224         * pt-sigwait.c: Likewise.
10225         * pt-sigwaitinfo.c: Likewise.
10226         * pt-system.c: Likewise.
10227         * pt-tcdrain.c: Likewise.
10228         * pt-wait.c: Likewise.
10229         * pt-waitid.c: Likewise.
10230         * pt-waitpid.c: Likewise.
10231         * pt-write.c: Likewise.
10232         * pt-writev.c: Likewise.
10233         * pthread_join.c: Likewise.
10234         * pthread_timedjoin.c: Likewise.
10236         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
10237         (__xpg_sigpause): New function.
10238         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
10240 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
10242         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
10244         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
10245         _GI_pthread_cleanup_pop to pthreadP.h.
10247         * ftrylockfile.c: Use _IO_lock_trylock instead of
10248         pthread_mutex_trylock.
10250         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
10251         (CANCEL_RESET): Likewise.
10252         (__pthread_setcanceltype_): Declare.
10253         (__pthread_mutex_lock_internal): Declare.
10254         (__pthread_mutex_unlock_internal): Declare.
10255         (__pthread_once_internal): Declare.
10256         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
10257         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
10259         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
10260         and pthread_mutex_unlock.
10261         * pthread_cond_wait.c: Likewise.
10262         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
10263         * pthread_mutex_unlock.c: Likewise.
10265         * pthread_setcanceltype.c: Add additional alias
10266         __pthread_setcanceltype.
10268         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
10269         * sem_open.c (sem_open): Likewise.
10270         Use __libc_open, __libc_write, and __libc_close instead of
10271         open, write, and close respectively.
10273         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
10274         Rewrite as statement expression since it must return a value.
10276         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
10277         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
10278         __pthread_kill.
10280         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
10281         alias __pthread_once_internal.
10283         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
10285 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
10287         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
10288         * tst-stdio1.c: New file.
10289         * tst-stdio2.c: New file.
10291         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
10293         * Makefile (tests): Comment out tst-locale2 for now.
10294         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
10296         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
10297         -D_IO_MTSAFE_IO.
10298         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
10299         Use _IO_lock_init instead of explicit assignment.
10301         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
10302         Define __libc_lock_* and __libc_lock_recursive macros with
10303         lowlevellock macros, not pthread mutexes.
10305         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
10306         of pthread_mutex_lock.
10307         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
10308         instead of pthread_mutex_unlock.
10310 2002-12-06  Roland McGrath  <roland@redhat.com>
10312         * allocatestack.c (__stack_user): Use uninitialized defn.
10313         * init.c (__pthread_initialize_minimal): Initialize it here.
10315 2002-12-05  Roland McGrath  <roland@redhat.com>
10317         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
10318         string.
10319         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
10321         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
10322         missing & here too.
10324 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
10326         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10327         lowlevellock.
10328         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
10329         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
10330         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
10331         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
10332         for __libc_lock_* macros.
10333         * Makefile (routines): Add libc-lowlevellock.
10335 2002-10-09  Roland McGrath  <roland@redhat.com>
10337         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
10338         Under [__PIC__], call the function via the pointer fetched for
10339         comparison rather than a call by name that uses the PLT.
10340         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
10341         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
10342         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
10343         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
10344         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
10346 2002-12-04  Roland McGrath  <roland@redhat.com>
10348         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
10350         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
10351         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
10353         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
10355 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10357         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
10358         a completely opaque, non-integer type.
10359         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
10361 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
10363         * sysdeps/i386/tls.h: Include stdlib.h.
10364         * sysdeps/x86_64/tls.h: Likewise.
10366 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10368         * Makefile (tests): Add tst-locale2.
10369         (tests-static): Likewise.
10370         * tst-locale2.c: New file.
10372         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
10373         volatile and add memory clobbers to lock operations.
10375 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
10377         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
10378         * sysdeps/i386/i486/bits/atomic.h: New file.
10379         * sysdeps/i386/i586/bits/atomic.h: New file.
10380         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
10381         include i486 version.
10382         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
10383         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
10384         Patch by Marijn Ros <marijn@mad.scientist.com>.
10386         * allocatestack.c (get_cached_stack): Don't crash if we first
10387         found a stack with a larger size then needed.
10388         Reported by Hui Huang <hui.huang@sun.com>.
10390         * Makefile (tests): Add tst-sysconf.
10391         * tst-sysconf.c: New file.
10393         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
10394         PTHREAD_THREADS_MAX.
10396 2002-12-02  Roland McGrath  <roland@redhat.com>
10398         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
10399         Declare using hidden_proto instead of attribute_hidden, so there are
10400         non-.hidden static symbols for gdb to find.
10401         (__pthread_keys): Likewise.
10402         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
10403         * allocatestack.c (__stack_user): Likewise.
10404         * pthread_create.c (__pthread_keys): Likewise.
10405         (__nptl_threads_events, __nptl_last_event): Make these static instead
10406         of hidden.
10407         * pthread_key_create.c (__pthread_pthread_keys_max,
10408         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
10410 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
10412         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
10413         statically.
10414         * tst-locale1.c: New file.
10416         * pthread_cond_timedwait.c: Include <stdlib.h>.
10418         * Makefile (tests): Add tst-fork2 and tst-fork3.
10419         * tst-fork2.c: New file.
10420         * tst-fork3.c: New file.
10422 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
10424         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
10426         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
10427         require it to 200112L.
10429         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
10430         instruction only if HAVE_CMOV is defined.
10431         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
10433         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
10435         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
10437         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
10439         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
10441 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
10443         * sysdeps/x86_64/bits/atomic.h: New file.
10445         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
10446         16-bit operations.
10448         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
10449         possible since gettid cannot fail.
10451         * sysdeps/x86_64/pthreaddef.h: New file.
10453         * sysdeps/i386/pthreaddef.h (gettid): Removed.
10455         * sysdeps/x86_64/pthread_spin_init.c: New file.
10456         * sysdeps/x86_64/pthread_spin_lock.c: New file.
10457         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
10458         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
10460         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
10461         Add missing lock prefix.  Minute optimization.
10463         * tst-spin2.c (main): Also check successful trylock call.
10465         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
10466         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
10468         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
10469         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
10471         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
10472         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
10473         value in case of an error.  Add support for INTERNAL_SYSCALL.
10475         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
10476         value in case of an error.
10478         * sysdeps/x86_64/tls.h: New file.
10480 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10482         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
10483         takes the array member name and the index as parameters.
10484         (THREAD_SETMEM_NC): Likewise.
10485         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
10486         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
10487         interfaces.
10489         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
10490         to decide which code to use.
10491         (THREAD_SETMEM_NC): Likewise.
10493         * allocatestack.c (queue_stack): Don't remove stack from list here.
10494         Do it in the caller.  Correct condition to prematurely terminate
10495         loop to free stacks.
10496         (__deallocate_stack): Remove stack from list here.
10498 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10500         * Makefile (tests): Add tst-stack1.
10501         * tst-stack1.c: New file.
10503         * allocatestack.c (allocate_stack): Initialize the TCB on a user
10504         provided stack.
10506         * pthread_attr_getstack.c: Return bottom of the thread area.
10508 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
10510         * Makefile (libpthread-routines): Add pt-allocrtsig and
10511         pthread_kill_other_threads.
10512         * pt-allocrtsig.c: New file.
10513         * pthread_kill_other_threads.c: New file.
10514         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
10515         all three functions.
10516         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10517         allocrtsig.
10518         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
10519         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
10520         and __libc_allocate_rtsig_private.
10521         * Versions (libpthread): Export pthread_kill_other_threads_np,
10522         __libc_current_sigrtmin, and __libc_current_sigrtmax.
10524 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
10526         * allocatestack.c (allocate_stack): stackaddr in attribute points to
10527         the end of the stack.  Adjust computations.
10528         When mprotect call fails dequeue stack and free it.
10529         * pthread_attr_setstack.c: Store top of the stack in stackaddr
10530         attribute.
10531         * pthread_getattr_np.c: Likewise.
10533         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
10534         surprises.
10536 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
10538         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
10539         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10541 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
10543         * pthread_getspecific.c: Optimize access to first 2nd-level array.
10544         * pthread_setspecific.c: Likewise.
10546 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
10548         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
10549         definitions.  Get them from the official place.
10550         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
10552         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
10553         Use new CLONE_ flags in clone() calls.
10555         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
10556         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
10558         * Versions: Add pthread_* functions for libc.
10559         * forward.c: New file.
10561         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
10562         errno-loc.
10563         * herrno.c: New file.
10564         * res.c: New file.
10566         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
10567         sem_trywait, and sem_timedwait.  Add herrno and res.
10568         * sem_init.c: Don't initialize lock and waiters members.
10569         * sem_open.c: Likewise.
10570         * sem_post.c: Removed.
10571         * sem_wait.c: Removed.
10572         * sem_trywait.c: Removed.
10573         * sem_timedwait.c: Removed.
10574         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
10575         Includes full implementations of sem_post, sem_wait, sem_trywait,
10576         and sem_timedwait.
10577         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
10578         for new implementation.
10579         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
10580         and waiters fields.
10582         * tst-sem3.c: Improve error message.
10583         * tst-signal3.c: Likewise.
10585         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
10586         to tell the kernel about the termination futex and to initialize tid
10587         member.  Don't initialize main_thread.
10588         * descr.h (struct pthread): Remove main_thread member.
10589         * cancelllation.c (__do_cancel): Remove code handling main thread.
10590         The main thread is not special anymore.
10592         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
10593         size of the stacks to stack_cache_actsize.
10595         * pt-readv.c: Add missing "defined".
10596         * pt-sigwait.c: Likewise.
10597         * pt-writev.c: Likewise.
10599 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
10601         * Versions: Export __connect from libpthread.
10602         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10604         * Makefile (libpthread-routines): Add pt-raise.
10605         * sysdeps/unix/sysv/linux/raise.c: New file.
10606         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
10607         * sysdeps/generic/pt-raise.c: New file.
10609         * pthread_cond_init.c: Initialize all data elements of the condvar
10610         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10612         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
10613         * pthread_create.c: Likewise.
10615         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
10616         * tst-key1.c: New file.
10617         * tst-key2.c: New file.
10618         * tst-key3.c: New file.
10620         * Versions: Export pthread_detach for version GLIBC_2.0.
10621         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
10623 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
10625         * pthread_key_create.c: Terminate search after an unused key was found.
10626         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10628         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
10629         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10631 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
10633         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
10634         dynamic lookup for errno in PIC.
10636         * allocatestack.c (get_cached_stack): Rearrange code slightly to
10637         release the stack lock as soon as possible.
10638         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
10639         the static TLS block.
10640         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
10642         * cancellation.c: Renamed from cancelation.c.
10643         * Makefile: Adjust accordingly.
10644         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
10645         * cleanup_defer.c: Use CANCELLATION_P.
10646         * pthread_testcancel.c: Likewise.
10647         * descr.h: Fix spelling in comments.
10648         * init.c: Likewise.
10649         * pthread_getattr_np.c: Likewise.
10650         * pthread_getschedparam.c: Likewise.
10651         * pthread_setschedparam.c: Likewise.
10652         * Versions: Likewise.
10654         * pt-pselect.c: New file.
10655         * Makefile (libpthread-routines): Add pt-pselect.
10656         * Versions: Add pselect.
10658         * tst-cancel4.c: New file.
10659         * Makefile (tests): Add tst-cancel4.
10661 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
10663         * pthread_mutex_lock.c: Always record lock ownership.
10664         * pthread_mutex_timedlock.c: Likewise.
10665         * pthread_mutex_trylock.c: Likewise.
10667         * pt-readv.c: New file.
10668         * pt-writev.c: New file.
10669         * pt-creat.c: New file.
10670         * pt-msgrcv.c: New file.
10671         * pt-msgsnd.c: New file.
10672         * pt-poll.c: New file.
10673         * pt-select.c: New file.
10674         * pt-sigpause.c: New file.
10675         * pt-sigsuspend.c: New file.
10676         * pt-sigwait.c: New file.
10677         * pt-sigwaitinfo.c: New file.
10678         * pt-waitid.c: New file.
10679         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
10680         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
10681         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
10682         * Versions: Add all the new functions.
10684         * tst-exit1.c: New file.
10685         * Makefile (tests): Add tst-exit1.
10687         * sem_timedwait.c: Minor optimization for more optimal fastpath.
10689 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
10691         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
10693         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
10694         call.  pthread_join is an official cancellation point.
10695         * pthread_timedjoin.c: Likewise.
10697         * pthread_cond_wait.c: Revert order in which internal lock are dropped
10698         and the condvar's mutex are retrieved.
10699         * pthread_cond_timedwait.c: Likewise.
10700         Reported by dice@saros.East.Sun.COM.
10702 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
10704         * pthreadP.h: Cut out all type definitions and move them...
10705         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
10706         * pthreadP.h: Include <internaltypes.h>.
10708         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
10709         performance tweaks.
10711         * sem_trywait.c: Shuffle #includes around to get right order.
10712         * sem_timedwait.c: Likewise.
10713         * sem_post.c: Likewise.
10714         * sem_wait.c: Likewise.
10716         * nptl 0.3 released.
10718         * Makefile (tests): Add tst-signal3.
10719         * tst-signal3.c: New file.
10721 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
10723         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
10724         the asms modify the sem object.
10725         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
10727         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
10728         the actual members.
10729         * pthreadP.h (struct sem): New type.  Actual semaphore type.
10730         * semaphoreP.h: Include pthreadP.h.
10731         * sem_getvalue.c: Adjust to sem_t change.
10732         * sem_init.c: Likewise.
10733         * sem_open.c: Likewise.
10734         * sem_post.c: Likewise.
10735         * sem_timedwait.c: Likewise.
10736         * sem_trywait.c: Likewise.
10737         * sem_wait.c: Likewise.
10739 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
10741         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
10742         * tst-basic2.c: New file.
10743         * tst-exec1.c: New file.
10744         * tst-exec2.c: New file.
10745         * tst-exec3.c: New file.
10747         * tst-fork1.c: Remove extra */.
10749         * nptl 0.2 released.  The API for IA-32 is complete.