[sh] Fix incorrect location of ifndef for __ASSUME_FUTEX_CLOCK_REALTIME.
[glibc.git] / nptl / ChangeLog
blob49ead511b2178d4e831ee7092370266a6f38badb
1 2010-06-01  Takashi Yoshii  <takashi.yoshii.zj@renesas.com>
3         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Fix incorrect
4         location of ifndef __ASSUME_FUTEX_CLOCK_REALTIME.
6 2010-04-09  Ulrich Drepper  <drepper@redhat.com>
8         [BZ #11390]
9         * sysdeps/unix/sysv/linux/pthread_getname.c: New file.
10         * sysdeps/unix/sysv/linux/pthread_setname.c: New file.
11         * nptl/sysdeps/pthread/pthread.h: Declare pthread_getname and
12         pthread_setname.
13         * Makefile (libpthread-routines): Add pthread_getname and
14         pthread_setname.
15         * Versions: Export pthread_getname and pthread_setname for GLIBC_2.12.
17 2010-04-05  Thomas Schwinge  <thomas@schwinge.name>
19         * sysdeps/pthread/unwind-resume.c: Moved to main tree sysdeps/gnu/.
20         * sysdeps/pthread/rt-unwind-resume.c: Likewise.
21         * sysdeps/pthread/Makefile: Remove csu section and rt section's
22         unwind-resume bits, now in main tree sysdeps/gnu/Makefile instead.
24 2010-03-23  Luis Machado  <luisgpm@br.ibm.com>
26         * pthread_cond_timedwait.c: Add check for
27         HAVE_CLOCK_GETTIME_VSYSCALL to use VDSO whenever possible.
28         (pthread_cond_timedwait): Use INTERNAL_VSYSCALL instead of
29         INTERNAL_SYSCALL.
31 2010-03-09  Ulrich Drepper  <drepper@redhat.com>
33         * pthread_create.c (__pthread_create_2_1): If priorities are incorrect
34         and the call fails wake eventually waiting setxid threads.  Don't free
35         stack here if we try starting a thread.
36         * sysdeps/pthread/createthread.c (do_clone): Only wake setxid waiter
37         if the clone call failed.
39 2010-03-08  Andreas Schwab  <schwab@redhat.com>
41         * pthread_create.c (__pthread_create_2_1): Don't set setxid_futex.
42         * allocatestack.c (get_cached_stack): Set setxid_futex.
43         (allocate_stack): Likewise.
45 2010-03-05  Andreas Schwab  <schwab@redhat.com>
46             Ulrich Drepper  <drepper@redhat.com>
48         * allocatestack.c (setxid_mark_thread): Delay handling of thread if
49         it is creating a thread or it is just being created.
50         * pthread_create.c (start_thread): Wake setxid thread if it is
51         waiting.
52         (__pthread_create_2_1): Initialize setxid_futex.
53         * sysdeps/pthread/createthread.c (do_clone): Wake setxid thread if it
54         is waiting.
56 2010-01-15  Ulrich Drepper  <drepper@redhat.com>
58         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
59         Fix unwind info.
60         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
62 2010-01-15  Michal Schmidt  <mschmidt@redhat.com>
64         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
65         Fix pthread_cond_timedwait with requeue-PI.
66         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
67         Fix pthread_cond_wait with requeue-PI.
69 2010-01-14  Ulrich Drepper  <drepper@redhat.com>
71         * Versions: Add pthread_mutex_consistent, pthread_mutexattr_getrobust,
72         and pthread_mutexattr_setrobust for GLIBC_2.12.
73         * pthread_mutex_consistent.c: Define alias pthread_mutex_consistent.
74         * pthread_mutexattr_getrobust.c: Define alias
75         pthread_mutexattr_getrobust.
76         * pthread_mutexattr_setrobust.c: Define alias
77         pthread_mutexattr_setrobust.
79 2010-01-12  Ulrich Drepper  <drepper@redhat.com>
81         * sysdeps/pthread/pthread.h: Cleanup.  Fix up for XPG7.
83 2010-01-08  Ulrich Drepper  <drepper@redhat.com>
85         * sysdeps/pthread/pthread.h: Fix pthread_mutex_consistent declaration.
87 2009-12-18  Thomas Schwinge  <thomas@codesourcery.com>
89         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c (_init): Don't
90         call __gmon_start__.
91         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c (_init): Likewise.
93 2009-12-17  Ulrich Drepper  <drepper@redhat.com>
95         * pthread_rwlock_init.c (__pthread_rwlock_init): Simplify code by
96         using memset.
98 2009-12-01  Dinakar Guniguntala  <dino@in.ibm.com>
100         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.h: Define
101         FUTEX_WAIT_REQUEUE_PI and FUTEX_CMP_REQUEUE_PI.
102         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: If mutex
103         is a non robust PI mutex, then use FUTEX_CMP_REQUEUE_PI.
104         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
105         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: If mutex
106         is a non robust PI mutex, then use FUTEX_WAIT_REQUEUE_PI.
107         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
109 2009-12-12  Ulrich Drepper  <drepper@redhat.com>
111         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
112         Don't update nwaiters after invalid timeout is recognized.
114 2009-11-27  Thomas Schwinge  <thomas@codesourcery.com>
116         * sysdeps/unix/sysv/linux/sh/pt-initfini.c (_init): Don't call
117         __gmon_start__.
119 2009-11-27  Andreas Schwab  <schwab@redhat.com>
121         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Reload
122         THREAD_SELF->cancelhandling after returning from futex call.
124 2009-11-24  Ulrich Drepper  <drepper@redhat.com>
126         * tst-sem13.c: New file.
127         * Makefile (tests): Add tst-sem13.
129 2009-11-22  Roland McGrath  <roland@redhat.com>
131         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: # include "i686/dl-sysdep.h"
132         instead of recapitulating its contents.
134 2009-11-18  Ulrich Drepper  <drepper@redhat.com>
136         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Minor
137         optimizations and cleanups.
139 2009-11-18  Dinakar Guniguntala  <dino@in.ibm.com>
141         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
142         Remove redundant code. Fix cfi offsets.
143         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
144         Fix cfi offsets.
146 2009-11-17  Ulrich Drepper  <drepper@redhat.com>
148         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Minimally
149         reduce size of unwind info.
151         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Convert to use
152         cfi directives.
153         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
154         Based on a patch by Dinakar Guniguntala <dino@in.ibm.com>.
156 2009-11-03  Andreas Schwab  <schwab@linux-m68k.org>
158         [BZ #4457]
159         * sysdeps/pthread/unwind-resume.c: Include <libgcc_s.h> and use
160         LIBGCC_S_SO.
161         * sysdeps/pthread/unwind-forcedunwind.c: Likewise.
163 2009-10-30  Ulrich Drepper  <drepper@redhat.com>
165         * tst-sem11.c (main): Rewrite to avoid aliasing problems.
167         [BZ #3270]
168         * allocatestack.c (__nptl_setxid): Perform the operation in multiple
169         steps to avoid races with creation and terminations.
170         * nptl-init.c (sighandler_setxid): Adjust.
171         Patch by Daniel Jacobowitz.
173 2009-09-07  Andreas Schwab  <schwab@redhat.com>
175         * sysdeps/pthread/bits/libc-lock.h (BP_SYM): Remove space before paren.
177 2009-09-02  Suzuki K P  <suzuki@in.ibm.com>
178             Joseph Myers  <joseph@codesourcery.com>
180         [BZ #7094]
181         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
182         Initialize the sigev_notify field for newly created timer to make sure
183         the timer gets deleted from the active timer's list upon timer_delete.
185 2009-08-27  Andrew Stubbs  <ams@codesourcery.com>
187         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
188         Correct a logic error.
190 2009-08-25  Ulrich Drepper  <drepper@redhat.com>
192         * sysdeps/x86_64/tls.h (RTLD_ENABLE_FOREIGN_CALL): Store old value
193         of the field in local variables.
194         (RTLD_FINALIZE_FOREIGN_CALL): Restore rtld_must_xmm_save from local
195         variable and don't unconditionally clear it.
197 2009-08-24  Ulrich Drepper  <drepper@redhat.com>
199         * pthread_create.c (start_thread): Hint to the kernel that memory for
200         the stack can be reused.  We do not mark all the memory.  The part
201         still in use and some reserve are kept.
203 2009-08-23  Ulrich Drepper  <drepper@redhat.com>
205         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Clean up namespace.
207 2009-08-11  Ulrich Drepper  <drepper@redhat.com>
209         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Add CFI
210         directives.
212 2009-08-10  Ulrich Drepper  <drepper@redhat.com>
214         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Add CFI
215         directives.
216         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
218 2009-08-10  Andreas Schwab  <schwab@redhat.com>
220         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
221         (__pthread_cond_signal): Don't clobber register used for syscall
222         number.
224 2009-08-08  Ulrich Drepper  <drepper@redhat.com>
226         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
227         Optimize code path used when FUTEX_CLOCK_REALTIME is supported.
229         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
230         (__pthread_cond_wait): Optimize by avoiding use of callee-safe
231         register.
233 2009-08-07  Ulrich Drepper  <drepper@redhat.com>
235         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Little optimizations
236         enabled by the special *_asynccancel functions.
237         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
238         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
240         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Include lowlevellock.h.
242 2009-08-04  Ulrich Drepper  <drepper@redhat.com>
244         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: New file.
245         * sysdeps/unix/sysv/linux/x86_64/libc-cancellation.S: New file.
246         * sysdeps/unix/sysv/linux/x86_64/librt-cancellation.S: New file.
247         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Optimize
248         since we can assume the special __*_{en,dis}able_asynccancel
249         functions.
250         (PUSHARGS_*, POPARGS_*, SAVESTK_*, RESTSTK_*): Removed.
251         * sysdeps/x86_64/tcb-offsets.sym: Add cancellation-related bits
252         and PTHREAD_CANCELED.
254 2009-07-31  Ulrich Drepper  <drepper@redhat.com>
256         * descr.h: Better definition of *_BITMASK macros for cancellation.
258 2009-07-29  Ulrich Drepper  <drepper@redhat.com>
260         * sysdeps/x86_64/tls.h (TLS_TCB_ALIGN): Define explicitly to 32.
262         * sysdeps/x86_64/tls.h (tcbhead_t): Add room for SSE registers the
263         dynamic linker might have to save.
264         Define RTLD_CHECK_FOREIGN_CALL, RTLD_ENABLE_FOREIGN_CALL,
265         RTLD_PREPARE_FOREIGN_CALL, and RTLD_FINALIZE_FOREIGN_CALL.  Pretty
266         printing.
268         * sysdeps/x86_64/tcb-offsets.sym: Add RTLD_SAVESPACE_SSE.
270 2009-07-28  Ulrich Drepper  <drepper@redhat.com>
272         * pthread_mutex_lock.c [NO_INCR] (__pthread_mutex_cond_lock_adjust):
273         New function.
274         * pthreadP.h: Declare __pthread_mutex_cond_lock_adjust.
275         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: Add ROBUST_BIT.
276         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Don't use
277         requeue_pi for robust mutexes.
278         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
279         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
280         Don't only skip __pthread_mutex_cond_lock.  Call instead
281         __pthread_mutex_cond_lock_adjust.
282         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
284         * pthread_mutex_unlock.c (__pthread_mutex_unlock_full): Minor
285         optimization of PI mutex handling.
287 2009-07-27  Ulrich Drepper  <drepper@redhat.com>
289         [BZ #10418]
290         * pthread_mutex_unlock.c (__pthread_mutex_unlock_full): Use _rel
291         instead of of _acq variants of cmpxchg.
293 2009-07-23  Ulrich Drepper  <drepper@redhat.com>
295         * sysdeps/x86_64/configure.in: New file.
297         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix error
298         path when not using absolute timeout futex.
300 2009-07-20  Ulrich Drepper  <drepper@redhat.com>
302         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Minor
303         optimizations of last changes.
304         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
306 2009-07-19  Ulrich Drepper  <drepper@redhat.com>
308         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
309         FUTEX_WAIT_REQUEUE_PI and FUTEX_CMP_REQUEUE_PI.
310         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: If mutex
311         is a PI mutex, then use FUTEX_CMP_REQUEUE_PI.
312         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
313         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: If mutex
314         is a PI mutex, then use FUTEX_WAIT_REQUEUE_PI.
315         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
317         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
318         (__pthread_cond_timedwait): Make more robust.
320 2009-07-18  Ulrich Drepper  <drepper@redhat.com>
322         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
323         (__lll_robust_timedlock_wait): If possible use FUTEX_WAIT_BITSET to
324         directly use absolute timeout.
326         * tst-sem5.c (do_test): Add test for premature timeout.
327         * Makefile: Linu tst-sem5 with librt.
329         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
330         (pthread_rwlock_timedwrlock): If possible use FUTEX_WAIT_BITSET to
331         directly use absolute timeout.
332         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
333         (pthread_rwlock_timedrdlock): Likewise.
335         * tst-cond11.c (run_test): Add test to check that the timeout is
336         long enough.
338         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
339         (__pthread_cond_timedwait): If possible use FUTEX_WAIT_BITSET to
340         directly use absolute timeout.
342         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
343         (__pthread_cond_wait): Convert to using exception handler instead of
344         registered unwind buffer.
345         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
346         (__pthread_cond_timedwait): Likewise.
348 2009-07-17  Ulrich Drepper  <drepper@redhat.com>
350         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
351         If possible use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME to directly
352         use absolute timeout.
354         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Optimize
355         handling of uncontested semaphore.
357         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
358         (__condvar_cleanup): Rewrite to use cfi directives instead of
359         hand-coded unwind tables.
360         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S (__pthread_once):
361         Likewise.
362         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
363         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
364         Likewise.
366 2009-06-12  Ulrich Drepper  <drepper@redhat.com>
368         * Makefile (libpthread-routines): Add pthread_sigqueue.
369         * Versions: Add pthread_sigqueue for GLIBC_2.11.
370         * sysdeps/pthread/bits/sigthread.h: Declare pthread_sigqueue.
371         * sysdeps/unix/sysv/linux/pthread_sigqueue.c: New file.
373 2009-06-11  Ulrich Drepper  <drepper@redhat.com>
375         [BZ #10262]
376         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
377         (LOAD_FUTEX_WAIT_ABS): Fix futex parameter in case private futexes
378         cannot be assumed.
379         Patch by Bryan Kadzban <bz-glibc@kdzbn.homelinux.net>.
381 2009-05-16  Ulrich Drepper  <drepper@redhat.com>
383         * libc-cancellation.c: Move __libc_cleanup_routine to...
384         * libc-cleanup.c: ...here.  New file.
385         * Makefile (routines): Add libc-cleanup.
387         * cancellation.c (__pthread_disable_asynccancel): Remove unnecessary
388         test.
389         * libc-cancellation.c: Use <nptl/cancellation.c: to define the code.
390         * sysdeps/pthread/librt-cancellation.c: Likewise.
392         [BZ #9924]
393         * nptl-init.c: Renamed from init.c.
394         * Makefile: Change all occurences of init.c to nptl-init.c.
396 2009-05-15  Ulrich Drepper  <drepper@redhat.com>
398         * cancellation.c (__pthread_disable_asynccancel): Correct the bits
399         to test when deciding on the delay.
400         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
401         * pthread_cancel.c: Close race between deciding on sending a signal
402         and setting the CANCELING_BIT bit.
404         * cancellation.c (__pthread_disable_asynccancel): Don't return if
405         thread is canceled.
406         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
408 2009-04-27  Ulrich Drepper  <drepper@redhat.com>
410         * cancellation.c (__pthread_disable_asynccancel): Use THREAD_ATOMIC_AND
411         is available.
412         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
413         * sysdeps/x86_64/tls.h: Define THREAD_ATOMIC_AND.
414         * sysdeps/i386/tls.h: Likewise.
415         (tcbhead_t): Add __private_tm member.
417 2009-04-26  Ulrich Drepper  <drepper@redhat.com>
419         * sem_open.c (sem_open): Rewrite initialization of initsem to
420         avoid warnings.
422         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
423         Avoid warning by using may_alias attribute on ptrhack.
425 2009-04-22  Ulrich Drepper  <drepper@redhat.com>
427         [BZ #10090]
428         * pthread_attr_setschedparam.c (__pthread_attr_setschedparam):
429         Check policy and priority for validity.
430         Patch mostly by Zhang Xiliang <zhangxiliang@cn.fujitsu.com>.
432 2009-03-15  Ulrich Drepper  <drepper@redhat.com>
434         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
435         (__pthread_cond_timedwait): Change to use cfi directives instead of
436         hand-coded unwind sections.
438 2009-03-10  Ulrich Drepper  <drepper@redhat.com>
440         * init.c (nptl_freeres): Compile only for SHARED.
442 2009-03-09  Jakub Jelinek  <jakub@redhat.com>
444         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Define
445         FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET, FUTEX_CLOCK_REALTIME and
446         FUTEX_BITSET_MATCH_ANY.
448 2009-02-27  Roland McGrath  <roland@redhat.com>
450         * init.c (__nptl_initial_report_events): Mark __attribute_used__.
451         * pthread_create.c (__nptl_threads_events, __nptl_last_event): Likewise.
453 2009-02-26  Ulrich Drepper  <drepper@redhat.com>
455         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
456         _POSIX_THREAD_ROBUST_PRIO_INHERIT and
457         _POSIX_THREAD_ROBUST_PRIO_PROTECT.  Reset value of macros from
458         200112L to 200809L.
460 2009-02-25  Ulrich Drepper  <drepper@redhat.com>
462         * sysdeps/pthread/pthread.h: The robust mutex functions are in
463         POSIX 2008.
465 2009-02-24  Ulrich Drepper  <drepper@redhat.com>
467         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_BITS_POSIX_OPT_H):
468         Unify name of include protector macro.
470 2009-02-14  SUGIOKA Toshinobu  <sugioka@itonet.co.jp>
472         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
473         LOAD_FUTEX_WAIT_ABS even if (FUTEX_WAIT == 0).
475 2009-01-29  Ulrich Drepper  <drepper@redhat.com>
477         * sysdeps/pthread/unwind-forcedunwind.c: Encrypt all function
478         pointer variables.
480         * allocatestack.c (__free_stacks): Renamed from free_stacks.
481         (__free_stack_cache): Removed.  Change callers to call __free_stacks.
482         * init.c (nptl_freeres): New function.
483         (pthread_functions): Initialize ptr_freeres to nptl_freeres.
484         * pthreadP.h: Don't declare __free_stack_cache.  Declare __free_stacks.
485         * sysdeps/pthread/unwind-forcedunwind.c (libgcc_s_handle): New
486         variable.
487         (pthread_cancel_init): Depend in libgcc_s_handle for decision to
488         load DSO.  Assign last.
489         (__unwind_freeres): New function.
491         * allocatestack.c (__reclaim_stacks): Reset in_flight_stack later
492         for better debugging.  No need to use stack_list_add here.
494 2009-01-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
496         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
497         (__lll_timedlock_wait): Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME
498         instead of computing relative timeout.
499         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
500         FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
502 2009-01-25  Ulrich Drepper  <drepper@redhat.com>
504         * pthread_mutex_lock.c (__pthread_mutex_lock): Remove unused label out.
506 2009-01-08  Ulrich Drepper  <drepper@redhat.com>
508         * sysdeps/pthread/list.h (list_add): Initialize new element first.
509         (list_add_tail): Removed.
511 2009-01-07  Ulrich Drepper  <drepper@redhat.com>
513         * (in_flight_stack): New variable.
514         (stack_list_del): New function.  Use instead of list_del.
515         (stack_list_add): New function.  Use instead of list_add when adding to
516         stack_cache and stack_used lists.
517         (__reclaim_stacks): Complete operations on stack_cache and stack_used lists
518         when the fork call interrupted another thread.
520 2009-01-04  Ulrich Drepper  <drepper@redhat.com>
522         * init.c (__pthread_initialize_minimal_internal): Optimize test
523         FUTEX_CLOCK_REALTIME a bit.
525 2009-01-03  Ulrich Drepper  <drepper@redhat.com>
527         * init.c (__pthread_initialize_minimal_internal): Cheat a bit by
528         only passing five parameters to FUTEX_WAIT_BITSET call.
530         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
531         (__lll_timedlock_wait): Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME
532         instead of computing relative timeout.
534 2009-01-02  Ulrich Drepper  <drepper@redhat.com>
536         * init.c (__pthread_initialize_minimal_internal): Check for
537         FUTEX_CLOCK_REALTIME flag.
538         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
539         Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME instead of computing
540         relative timeout.
542         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
543         FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
544         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
545         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
546         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
547         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
549 2008-12-09  Ulrich Drepper  <drepper@redhat.com>
551         * sysdeps/pthread/pthread.h (pthread_cleanup_pop): Use { } as empty
552         loop body instead of ; to avoid gcc warnings.
553         (pthread_cleanup_pop_restore_np): Likewise.
554         Patch by Caolán McNamara <caolanm@redhat.com>.
556 2008-12-09  Jakub Jelinek  <jakub@redhat.com>
558         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle only the
559         fast path here, for robust/PI/PP mutexes call
560         __pthread_mutex_lock_full.  Don't use switch, instead use a series
561         of ifs according to their probability.
562         (__pthread_mutex_lock_full): New function.
563         * pthread_mutex_unlock.c: Include assert.h.
564         (__pthread_mutex_unlock_usercnt): Handle only the
565         fast path here, for robust/PI/PP mutexes call
566         __pthread_mutex_unlock_full.  Don't use switch, instead use a series
567         of ifs according to their probability.
568         (__pthread_mutex_unlock_full): New function.
569         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c
570         (__pthread_mutex_lock_full): Define.
572 2008-12-08  Ulrich Drepper  <drepper@redhat.com>
574         * sysdeps/x86_64/tls.h (tcbhead_t): Add fields reserved for TM
575         implementation.  Add necessary padding and.
576         * descr.h (struct pthread): Increase padding for tcbhead_t to 24
577         words.
579 2008-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
581         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define FUTEX_WAIT_BITSET
582         and FUTEX_WAKE_BITSET.
584 2008-12-02  Ulrich Drepper  <drepper@redhat.com>
586         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_WAIT_BITSET
587         and FUTEX_WAKE_BITSET.
588         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
589         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
590         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
591         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
593 2008-11-25  Roland McGrath  <roland@redhat.com>
595         * sysdeps/alpha, sysdeps/unix/sysv/linux/alpha:
596         Subdirectories moved to ports repository as
597         sysdeps/.../nptl subdirectories.
599 2008-11-12  Jakub Jelinek  <jakub@redhat.com>
601         [BZ #7008]
602         * pthread_condattr_setclock.c (pthread_condattr_setclock): Fix masking
603         of old value.
604         * pthread_cond_init.c (__pthread_cond_init): Fix
605         cond->__data.__nwaiters initialization.
606         * Makefile (tests): Add tst-cond23.
607         * tst-cond23.c: New test.
609 2008-11-07  Jakub Jelinek  <jakub@redhat.com>
611         * sysdeps/pthread/malloc-machine.h (MALLOC): Adjust __libc_tsd_define
612         arguments.
613         (tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get}
614         arguments.
616 2008-11-01  Ulrich Drepper  <drepper@redhat.com>
618         [BZ #6955]
619         * pthread_mutex_lock.c: Add support for private PI mutexes.
620         * pthread_mutex_timedlock.c: Likewise.
621         * pthread_mutex_trylock.c: Likewise.
622         * pthread_mutex_unlock.c: Likewise.
623         Patch mostly by Ben Jackson <ben@ben.com>.
625 2008-10-31  Ulrich Drepper  <drepper@redhat.com>
627         [BZ #6843]
628         * sysdeps/pthread/gai_misc.h (__gai_create_helper_thread):
629         Increase stack size for helper thread.
631 2008-10-06  Martin Schwidefsky  <schwidefsky@de.ibm.com>
633         * sysdeps/s390/tls.h (THREAD_SET_STACK_GUARD): Add empty inline
634         assembly with a clobber list for access registers a0 and a1.
636 2008-09-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
638         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Add memory barrier
639         to force runp->refcntr to be read from memory.
641 2008-09-08  Richard Guenther  <rguenther@suse.de>
643         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_lock,
644         lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
645         lll_timedlock, lll_robust_timedlock, lll_unlock,
646         lll_robust_unlock): Promote private to int.
648 2008-08-15  Ulrich Drepper  <drepper@redhat.com>
650         * sysdeps/x86_64/pthreaddef.h: Remove ARCH_MAP_FLAGS and
651         ARCH_RETRY_MMAP definitions.
652         * allocatestack.c: Remove definition of ARCH_MAP_FLAGS.
653         Define MAP_STACK when not defined.
654         (allocate_stack): Use MAP_STACK instead of ARCH_MAP_FLAGS.  Remove
655         handling of ARCH_RETRY_MMAP.
657 2008-07-30  Ulrich Drepper  <drepper@redhat.com>
659         * tst-align2.c (f): Print message that f is reached.
661 2008-04-28  Hiroki Kaminaga  <kaminaga@sm.sony.co.jp>
663         [BZ #6740]
664         * sysdeps/powerpc/tcb-offsets.sym (PRIVATE_FUTEX_OFFSET): Guard symbol
665         definition with #ifndef __ASSUME_PRIVATE_FUTEX.
667 2008-07-25  Ulrich Drepper  <drepper@redhat.com>
669         * sysdeps/unix/sysv/linux/mq_notify.c (init_mq_netlink): Use
670         SOCK_CLOEXEC if possible.
672 2008-05-29  Ulrich Drepper  <drepper@redhat.com>
674         * Makefile (tests): Add tst-rwlock2a.
675         * tst-rwlock2.c: Use TYPE macro to decide what rwlock type to use.
676         * tst-rwlock2a.c: New file.
678 2008-06-12  Ulrich Drepper  <drepper@redhat.com>
680         * sysdeps/pthread/pthread.h: Remove inadvertant checkin.
682 2008-05-17  Samuel Thibault  <samuel.thibault@ens-lyon.org>
684         * sysdeps/pthread/pthread.h: Fix typo in comment.
686 2008-05-28  Ulrich Drepper  <drepper@redhat.com>
688         * sysdeps/pthread/createthread.c (do_clone): Pass accurate length
689         of CPU set to the kernel.
691 2008-05-23  Paul Pluzhnikov  <ppluzhnikov@google.com>
693         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Add
694         cfi directives.
695         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
696         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
697         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
698         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
699         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
700         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
702 2008-05-22  Paul Pluzhnikov  <ppluzhnikov@google.com>
704         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S: Add
705         cfi directives.
706         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
707         Likewise.
708         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
709         Likewise.
710         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
711         Likewise.
713 2008-05-26  Ulrich Drepper  <drepper@redhat.com>
715         * tst-typesizes.c: Explicitly check __SIZEOF_PTHREAD_* constants.
717 2008-05-20  Jakub Jelinek  <jakub@redhat.com>
719         David S. Miller  <davem@davemloft.net>
721         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
723 2008-05-10  Ulrich Drepper  <drepper@redhat.com>
725         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Access
726         __pshared correctly.
727         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
728         Likewise.
729         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
730         Likewise.
731         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
732         Likewise.
733         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
734         Likewise.
735         Reported by Clemens Kolbitsch <clemens.kol@gmx.at>.
737 2008-04-14  David S. Miller  <davem@davemloft.net>
739         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
740         (__old_sem_wait): Fix argument to lll_futex_wait().
742 2007-11-26  Daniel Jacobowitz  <dan@codesourcery.com>
744         * pthread_create.c: Require pthread_mutex_trylock and
745         pthread_key_delete for libgcc.
747 2008-04-08  Jakub Jelinek  <jakub@redhat.com>
749         [BZ #6020]
750         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h
751         (lll_futex_wake_unlock): Add private argument to the pre-v9 macro.
752         Patch by Sunil Amitkumar Janki <devel.sjanki@gmail.com>.
754 2008-03-27  Ulrich Drepper  <drepper@redhat.com>
756         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine ARG_MAX if
757         <linux/limits.h> has defined it.
758         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
759         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
760         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
761         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
763 2008-03-18  Jakub Jelinek  <jakub@redhat.com>
765         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Use __ASSEMBLER__ instead
766         of ASSEMBLER.
767         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
768         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Likewise.
770 2008-03-14  Ulrich Drepper  <drepper@redhat.com>
772         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
773         HAVE_DL_DISCOVER_OSVERSION.
774         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
775         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Likewise.
777 2008-03-07  Ulrich Drepper  <drepper@redhat.com>
779         [BZ #5778]
780         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Change
781         _POSIX_CHOWN_RESTRICTED value to zero.
783 2008-01-31  Roland McGrath  <roland@redhat.com>
785         * Makefile (omit-deps): Variable removed.
787 2008-01-30  Ulrich Drepper  <drepper@redhat.com>
789         * sysdeps/unix/sysv/linux/x86_64/sem_post.S (sem_post): Avoid
790         unnecessary addr32 prefix.
792 2008-01-29  Roland McGrath  <roland@redhat.com>
794         * Makeconfig (ptw-CPPFLAGS, sysd-rules-patterns): New variables.
796 2008-01-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
798         * sysdeps/unix/sysv/linux/sh/sem_post.S: Don't overflow value field.
800 2008-01-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
802         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XADD): Use
803         a scratch register.
804         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
805         (__lll_lock_wait_private): Fix typo.
806         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
807         (pthread_barrier_wait): Likewise.  Adjust XADD use.
808         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
809         Adjust XADD use.
810         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
811         (pthread_rwlock_timedrdlock): Return correct return value.
812         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
813         (pthread_rwlock_timedwrlock): Likewise.
815 2008-01-15  Ulrich Drepper  <drepper@redhat.com>
817         * tst-eintr2.c (do_test): make sure that if mutex_lock in main
818         thread returns the program exits with an error code.
820 2008-01-10  Ulrich Drepper  <drepper@redhat.com>
822         * pthread-errnos.sym: Add EOVERFLOW.
823         * sysdeps/unix/sysv/linux/structsem.sym: Add SEM_VALUE_MAX.
824         * sysdeps/unix/sysv/linux/sem_post.c: Don't overflow value field.
825         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
826         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
828 2007-12-14  Ulrich Drepper  <drepper@redhat.com>
830         * sysdeps/x86_64/pthreaddef.h (ARCH_RETRY_MMAP): Take additional
831         parameter.  Passed it as permission to mmap.
832         * allocatestack.c (allocate_stack): Pass prot as second parameter
833         to ARCH_RETRY_MMAP.
835 2007-12-12  Ulrich Drepper  <drepper@redhat.com>
837         * tst-basic7.c: Allocate memory for the stack.
839         [BZ #5465]
840         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S [!SHARED]
841         (__pthread_cond_timedwait): Don't use VDSO.
842         Patch by Michal Januszewski.
844 2007-12-07  Ulrich Drepper  <drepper@redhat.com>
846         [BZ #5455]
847         * sysdeps/pthread/pthread.h [!__EXCEPTIONS] (pthread_cleanup_pop):
848         Allow label before pthread_cleanup_pop.
849         (pthread_cleanup_pop_restore_np): Likewise.
851 2007-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
853         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
854         Store 2 before returning ETIMEDOUT.
856 2007-11-23  Ulrich Drepper  <drepper@redhat.com>
858         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
859         Store 2 before returning ETIMEDOUT.
860         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise
861         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
862         (__lll_lock_wait_private): Optimize.
863         (__lll_lock_wait): Likewise.
865 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
867         * sysdeps/pthread/pthread.h (pthread_cleanup_push,
868         pthread_cleanup_push_defer_np): Add extra (void *) cast to shut up
869         g++ 4.1 and 4.2 -Wstrict-aliasing warnings.
871 2007-11-08  Ulrich Drepper  <drepper@redhat.com>
873         [BZ #5240]
874         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
875         If we time out, try one last time to lock the futex to avoid
876         losing a wakeup signal.
877         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
878         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
880         [BZ #5245]
881         * sysdeps/pthread/createthread.c (do_clone): Translate clone error
882         if necessary.
884 2007-11-07  Ulrich Drepper  <drepper@redhat.com>
886         [BZ #5245]
887         * allocatestack.c (allocate_stack): Change ENOMEM error in case
888         mmap failed to EAGAIN.
889         * Makefile (tests): Add tst-basic7.
890         * tst-basic7.c: New file.
892 2007-11-05  Ulrich Drepper  <drepper@redhat.com>
894         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
895         Use __linkin_atfork.
897 2007-11-03  Mike Frysinger  <vapier@gentoo.org>
899         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (LOAD_FUTEX_WAIT): Add
900         missing line continuations.
901         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S (LOAD_FUTEX_WAIT,
902         LOAD_FUTEX_WAKE): Likewise.  Also add missing 3rd parameter.
904 2007-10-28  Ulrich Drepper  <drepper@redhat.com>
906         [BZ #5220]
907         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Declare
908         __active_timer_sigev_thread and __active_timer_sigev_thread_lock.
909         (struct timer): Add next element.
910         * sysdeps/unix/sysv/linux/timer_create.c: For SIGEV_THREAD timers,
911         enqueue timer structure into __active_timer_sigev_thread list.
912         * sysdeps/unix/sysv/linux/timer_delete.c: For SIGEV_THREAD timers,
913         remove timer struct from __active_timer_sigev_thread.
914         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
915         Before using timer structure make sure it is still on the
916         __active_timer_sigev_thread list.  Keep lock until done.
917         Define __active_timer_sigev_thread and
918         __active_timer_sigev_thread_lock.
920 2007-10-27  Ulrich Drepper  <drepper@redhat.com>
922         * sysdeps/pthread/malloc-machine.h: Define ATFORK_MEM.
923         Redefine thread_atfork for use of ATFORK_MEM.
924         * sysdeps/unix/sysv/linux/fork.h: Define __linkin_atfork.
925         * sysdeps/unix/sysv/linux/register-atfork.c (__linkin_atfork): New
926         function.
927         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
928         Use atomic operation when removing first element of list.
930 2007-10-17  Jakub Jelinek  <jakub@redhat.com>
932         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__old_sem_post): New
933         routine instead of an alias to __new_sem_post.
935 2007-10-15  Jakub Jelinek  <jakub@redhat.com>
937         * init.c (__pthread_initialize_minimal): Initialize word to appease
938         valgrind.
940 2007-10-10  Jakub Jelinek  <jakub@redhat.com>
942         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
943         libc.so just clear NAME.
944         (__libc_rwlock_fini): Nop inside of libc.so.
945         * tst-initializers1.c (main): Test if PTHREAD_RWLOCK_INITIALIZER is
946         all zeros.
948 2007-09-02  Ulrich Drepper  <drepper@redhat.com>
950         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
951         (__pthread_cond_wait): Fix unlocking of internal lock after mutex
952         unlocking failed.
953         Patch by Luca Barbieri <luca.barbieri@gmail.com>.
955 2007-08-21  Ulrich Drepper  <drepper@redhat.com>
957         [BZ #4938]
958         * allocatestack.c (__reclaim_stacks): Clear the TSD in the
959         reclaimed stack if necessary.
960         * Makefile (tests): Add tst-tsd6.
961         * tst-tsd6.c: New file.
963 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
965         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
966         Add private argument.
968 2007-08-20  Ulrich Drepper  <drepper@redhat.com>
970         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
971         (__pthread_cond_timedwait): Use clock_gettime from VDSO if possible.
973 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
975         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h
976         (__lll_robust_timedlock): Pass private as last argument to
977         __lll_robust_timedlock_wait.
978         (__lll_unlock): Fix a pasto.
980 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
982         * sysdeps/unix/sysv/linux/sparc/internaltypes.h (sparc_new_sem,
983         sparc_old_sem): New structs.
984         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
985         (__sem_wait_cleanup): New function.
986         (__new_sem_wait): Use sparc_new_sem structure.  Bump and afterwards
987         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
988         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
989         lll_futex_wait.
990         (__old_sem_wait): New function.
991         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: Include
992         nptl/sysdeps/unix/sysv/linux/sparc version.
993         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c:
994         Likewise.
995         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: Likewise.
996         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
997         (__new_sem_trywait): Use sparc_old_sem structure.
998         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
999         (sem_timedwait): Use sparc_new_sem structure.  Bump and afterwards
1000         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
1001         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
1002         lll_futex_timed_wait.
1003         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c (__new_sem_post):
1004         Use sparc_new_sem structure.  Only wake if nwaiters > 0.  Pass
1005         isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
1006         lll_futex_wake.
1007         (__old_sem_post): New function.
1008         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: New file.
1009         * sysdeps/unix/sysv/linux/sparc/sem_init.c: New file.
1010         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: New file.
1011         * sysdeps/unix/sysv/linux/sparc/sem_post.c: New file.
1012         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: Remove.
1013         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: Remove.
1015 2007-08-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1017         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
1018         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
1019         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1020         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
1021         * sysdeps/unix/sysv/linux/shpthread_cond_signal.S
1022         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
1023         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1024         Use FUTEX_WAKE_OP.
1025         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
1026         kernel-features.h and tcb-offsets.h.
1027         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
1028         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1029         process private.
1030         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
1031         tcb-offsets.h.
1032         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE
1033         to lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1034         process private.
1035         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use #ifdef
1036         __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
1037         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
1038         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1039         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1040         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1041         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1043 2007-08-14  Jakub Jelinek  <jakub@redhat.com>
1045         * sysdeps/unix/sysv/linux/lowlevellock.c: Comment fix.
1046         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
1047         (__lll_timedwait_tid): Pass LLL_SHARED as 4th argument to
1048         lll_futex_timed_wait.
1050         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock,
1051         __lll_robust_unlock): Rewrite as macros instead of inline functions.
1052         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock,
1053         __lll_robust_unlock, __lll_wait_tid): Likewise.
1055 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
1057         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
1058         Fix a pasto.
1059         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
1060         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
1061         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1062         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
1063         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
1064         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
1065         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1066         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Include
1067         kernel-features.h.
1068         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
1069         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1070         process private.  Switch DW_CFA_advance_loc1 and some
1071         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
1072         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1073         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE to
1074         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
1075         process private.  Switch DW_CFA_advance_loc{1,2} and some
1076         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
1077         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use
1078         #ifdef __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
1079         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1080         Likewise.
1081         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1082         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1083         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1084         Likewise.
1085         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1086         (__pthread_cond_broadcast): Compare %r8 instead of
1087         dep_mutex-cond_*(%rdi) with $-1.
1088         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1089         (__pthread_cond_signal): Xor FUTEX_WAKE_OP with FUTEX_WAKE instead
1090         of oring.
1092 2007-08-13  Ulrich Drepper  <drepper@redhat.com>
1094         * sysdeps/unix/sysv/linux/i386/i786/Implies: New file.
1096 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
1098         * allocatestack.c: Include kernel-features.h.
1099         * pthread_create.c: Likewise.
1100         * pthread_mutex_init.c: Likewise.
1101         * init.c: Likewise.
1102         * pthread_cond_timedwait.c: Likewise.
1103         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
1104         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1105         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1106         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1107         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1108         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1109         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1110         Likewise.
1111         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1112         Likewise.
1113         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1114         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1115         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1116         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1118 2007-08-12  Jakub Jelinek  <jakub@redhat.com>
1120         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
1121         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
1122         byte elements.  One of them is the new __shared element.
1123         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
1124         adjust names of other padding elements.
1125         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
1126         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
1127         byte elements.  One of them is the new __shared element.
1128         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
1129         adjust names of other padding elements.
1130         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_rwlock_t):
1131         Renamed __pad1 element to __shared, adjust names of other padding
1132         elements.
1133         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
1134         (pthread_rwlock_t): Likewise.
1135         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock): Fix a
1136         typo.
1138 2007-08-09  Anton Blanchard  <anton@samba.org>
1140         * sysdeps/unix/sysv/linux/powerpc/pthread_spin_unlock.c: New file.
1142 2007-08-12  Ulrich Drepper  <drepper@redhat.com>
1144         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Include
1145         <kernel-features.h>.
1146         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1148 2007-08-11  Ulrich Drepper  <drepper@redhat.com>
1150         * pthreadP.h (PTHREAD_ROBUST_MUTEX_PSHARED): Define.
1151         * pthread_mutex_lock.c: Use it instead of PTHREAD_MUTEX_PSHARED when
1152         dealing with robust mutexes.
1153         * pthread_mutex_timedlock.c: Likewise.
1154         * pthread_mutex_trylock.c: Likewise.
1155         * pthread_mutex_unlock.c: Likewise.
1156         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
1158 2007-08-06  Jakub Jelinek  <jakub@redhat.com>
1160         * pthreadP.h (PTHREAD_MUTEX_PSHARED_BIT): Define.
1161         (PTHREAD_MUTEX_TYPE): Mask __kind with 127.
1162         (PTHREAD_MUTEX_PSHARED): Define.
1163         * pthread_mutex_init.c (__pthread_mutex_init): Set
1164         PTHREAD_MUTEX_PSHARED_BIT for pshared or robust
1165         mutexes.
1166         * pthread_mutex_lock.c (LLL_MUTEX_LOCK): Take mutex as argument
1167         instead of its __data.__lock field, pass PTHREAD_MUTEX_PSHARED
1168         as second argument to lll_lock.
1169         (LLL_MUTEX_TRYLOCK): Take mutex as argument
1170         instead of its __data.__lock field.
1171         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
1172         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
1173         to lll_robust_lock.
1174         (__pthread_mutex_lock): Update LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
1175         LLL_ROBUST_MUTEX_LOCK users, use PTHREAD_MUTEX_TYPE (mutex)
1176         instead of mutex->__data.__kind directly, pass
1177         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock and lll_futex_wait.
1178         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use
1179         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
1180         directly, pass PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock.
1181         (pthread_mutex_timedlock): Pass PTHREAD_MUTEX_PSHARED (mutex)
1182         to lll_timedlock, lll_robust_timedlock, lll_unlock and
1183         lll_futex_timed_wait.  Use PTHREAD_MUTEX_TYPE (mutex) instead
1184         of mutex->__data.__kind directly.
1185         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Pass
1186         PTHREAD_MUTEX_PSHARED (mutex) to lll_timedlock,
1187         lll_robust_timedlock, lll_unlock and lll_futex_timed_wait.  Use
1188         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind directly.
1189         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Pass
1190         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock, lll_robust_unlock
1191         and lll_futex_wake.
1192         * pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Pass
1193         PTHREAD_MUTEX_PSHARED (mutex) to lll_futex_wait and lll_futex_wake.
1194         Use PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
1195         directly.
1196         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK):
1197         Take mutex as argument instead of its __data.__lock field, pass
1198         PTHREAD_MUTEX_PSHARED as second argument to lll_cond_lock.
1199         (LLL_MUTEX_TRYLOCK): Take mutex as argument instead of its
1200         __data.__lock field.
1201         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
1202         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
1203         to lll_robust_cond_lock.
1204         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Add pshared
1205         variable, pass it to lll_lock, lll_unlock, lll_futex_requeue and
1206         lll_futex_wake.  Don't use lll_futex_requeue if dependent mutex
1207         has PTHREAD_MUTEX_PSHARED_BIT bit set in its __data.__kind.
1208         * pthread_cond_destroy.c (__pthread_cond_destroy): Add pshared
1209         variable, pass it to lll_lock, lll_unlock, lll_futex_wake and
1210         lll_futex_wait.
1211         * pthread_cond_signal.c (__pthread_cond_signal): Add pshared
1212         variable, pass it to lll_lock, lll_unlock, lll_futex_wake_unlock and
1213         lll_futex_wake.
1214         * pthread_cond_timedwait.c (__pthread_cond_wait): Add
1215         pshared variable, pass it to lll_lock, lll_unlock,
1216         lll_futex_timedwait and lll_futex_wake.
1217         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait): Add
1218         pshared variable, pass it to lll_lock, lll_unlock, lll_futex_wait
1219         and lll_futex_wake.
1220         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_requeue,
1221         lll_futex_wake_unlock): Add private argument, use __lll_private_flag
1222         macro.
1223         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue,
1224         lll_futex_wake_unlock): Likewise.
1225         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_requeue):
1226         Likewise.
1227         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_futex_requeue,
1228         lll_futex_wake_unlock): Likewise.
1229         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_requeue):
1230         Likewise.
1231         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue,
1232         lll_futex_wake_unlock): Likewise.
1233         (lll_futex_wake): Fix a typo.
1234         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym (PS_BIT): Add.
1235         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1236         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
1237         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1238         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
1239         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1240         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
1241         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1242         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1243         (__pthread_cond_timedwait): Likewise.
1244         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
1245         (__condvar_cleanup, __pthread_cond_wait): Likewise.
1247 2007-08-05  Jakub Jelinek  <jakub@redhat.com>
1249         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
1250         Don't use CGOTSETUP and CGOTRESTORE macros.
1251         (CGOTSETUP, CGOTRESTORE): Remove.
1252         <IS_IN_rtld> (CENABLE, CDISABLE): Don't use JUMPTARGET, branch to
1253         @local symbol.
1255 2007-08-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1257         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Remove
1258         definitions for private futexes.
1259         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Include
1260         kernel-features.h and lowlevellock.h.  Use private futexes if
1261         they are available.
1262         (__lll_lock_wait_private, __lll_unlock_wake_private): New.
1263         (__lll_mutex_lock_wait): Rename to
1264         (__lll_lock_wait): ... this.  Don't compile in for libc.so.
1265         (__lll_mutex_timedlock_wait): Rename to ...
1266         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.
1267         Don't compile in for libc.so.
1268         (__lll_mutex_unlock_wake): Rename to ...
1269         (__lll_unlock_wake): ... this.  Don't compile in for libc.so.
1270         (__lll_timedwait_tid): Use __NR_gettimeofday.
1271         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Allow including
1272         the header from assembler.  Renamed all lll_mutex_* resp.
1273         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
1274         Renamed all LLL_MUTEX_LOCK_* macros to LLL_LOCK_*.
1275         (FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE):
1276         Define.
1277         (__lll_lock_wait_private): Add prototype.
1278         (__lll_lock_wait, __lll_timedlock_wait, __lll_robust_lock_wait,
1279         __lll_robust_timedlock_wait, __lll_unlock_wake_private,
1280         __lll_unlock_wake): Likewise.
1281         (lll_lock): Add private argument.  Call __lll_lock_wait_private
1282         if private is constant LLL_PRIVATE.
1283         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
1284         lll_timedlock, lll_robust_timedlock): Add private argument.
1285         (lll_unlock): Add private argument.  Call __lll_unlock_wake_private
1286         if private is constant LLL_PRIVATE.
1287         (lll_robust_unlock, lll_robust_dead): Add private argument.
1288         (lll_lock_t): Remove.
1289         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1290         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1291         lll_cond_wake, lll_cond_broadcast): Remove.
1292         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: Include
1293         kernel-features.h and lowlevellock.h.
1294         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1295         (LOAD_FUTEX_WAIT): Define.
1296         (__lll_robust_mutex_lock_wait): Rename to ...
1297         (__lll_robust_lock_wait): ... this.  Add private argument.
1298         Use LOAD_FUTEX_WAIT macro.
1299         (__lll_robust_mutex_timedlock_wait): Rename to ...
1300         (__lll_robust_timedlock_wait): ... this.    Add private argument.
1301         Use __NR_gettimeofday.  Use LOAD_FUTEX_WAIT macro.
1302         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Include
1303         lowlevellock.h.
1304         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1305         (pthread_barrier_wait): Use __lll_{lock,unlock}_* instead of
1306         __lll_mutex_{lock,unlock}_*.
1307         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Include
1308         lowlevellock.h and pthread-errnos.h.
1309         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1310         FUTEX_CMP_REQUEUE, EINVAL): Remove.
1311         (__pthread_cond_broadcast): Use __lll_{lock,unlock}_* instead of
1312         __lll_mutex_{lock,unlock}_*.
1313         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Include
1314         lowlevellock.h and pthread-errnos.h.
1315         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE, EINVAL): Remove.
1316         (__pthread_cond_signal): Use __lll_{lock,unlock}_* instead of
1317         __lll_mutex_{lock,unlock}_*.
1318         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
1319         lowlevellock.h.
1320         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE): Remove.
1321         (__pthread_cond_timedwait): Use __lll_{lock,unlock}_* instead of
1322         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1323         (__condvar_tw_cleanup): Likewise.
1324         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
1325         lowlevellock.h.
1326         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1327         (__pthread_cond_wait): Use __lll_{lock,unlock}_* instead of
1328         __lll_mutex_{lock,unlock}_*.
1329         ( __condvar_w_cleanup): Likewise.
1330         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Include lowlevellock.h.
1331         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1332         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Include
1333         lowlevellock.h.
1334         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1335         (__pthread_rwlock_rdlock): Use __lll_{lock,unlock}_* instead of
1336         __lll_mutex_{lock,unlock}_*.
1337         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Include
1338         lowlevellock.h.
1339         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1340         FUTEX_PRIVATE_FLAG): Remove.
1341         (pthread_rwlock_timedrdlock): Use __lll_{lock,unlock}_* instead of
1342         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1343         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Include
1344         lowlevellock.h.
1345         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1346         FUTEX_PRIVATE_FLAG): Remove.
1347         (pthread_rwlock_timedwrlock): Use __lll_{lock,unlock}_* instead of
1348         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1349         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Include
1350         lowlevellock.h.
1351         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1352         (__pthread_rwlock_unlock): Use __lll_{lock,unlock}_* instead of
1353         __lll_mutex_{lock,unlock}_*.
1354         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Include
1355         lowlevellock.h.
1356         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1357         (__pthread_rwlock_wrlock): Use __lll_{lock,unlock}_* instead of
1358         __lll_mutex_{lock,unlock}_*.
1359         * sysdeps/unix/sysv/linux/sh/sem_post.S: Include lowlevellock.h.
1360         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1361         (__new_sem_post): Use standard initial exec code sequences.
1362         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Include
1363         lowlevellock.h.
1364         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1365         FUTEX_PRIVATE_FLAG): Remove.
1366         (sem_timedwait): Use __NR_gettimeofday.  Use standard initial
1367         exec code sequences.
1368         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Include lowlevellock.h.
1369         (__new_sem_trywait): Use standard initial exec code sequences.
1370         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Include lowlevellock.h.
1371         (__new_sem_wait): Use standard initial exec code sequences.
1373 2007-07-31  Anton Blanchard  <anton@samba.org>
1375         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1376         Use __asm __volatile (__lll_acq_instr ::: "memory") instead of
1377         atomic_full_barrier.
1379 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
1381         * allocatestack.c (stack_cache_lock): Change type to int.
1382         (get_cached_stack, allocate_stack, __deallocate_stack,
1383         __make_stacks_executable, __find_thread_by_id, __nptl_setxid,
1384         __pthread_init_static_tls, __wait_lookup_done): Add LLL_PRIVATE
1385         as second argument to lll_lock and lll_unlock macros on
1386         stack_cache_lock.
1387         * pthread_create.c (__find_in_stack_list): Likewise.
1388         (start_thread): Similarly with pd->lock.  Use lll_robust_dead
1389         macro instead of lll_robust_mutex_dead, pass LLL_SHARED to it
1390         as second argument.
1391         * descr.h (struct pthread): Change lock and setxid_futex field
1392         type to int.
1393         * old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0): Use
1394         LLL_LOCK_INITIALIZER instead of LLL_MUTEX_LOCK_INITIALIZER.
1395         * old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
1396         * old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
1397         Likewise.
1398         * old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
1399         * pthread_cond_init.c (__pthread_cond_init): Likewise.
1400         * pthreadP.h (__attr_list_lock): Change type to int.
1401         * pthread_attr_init.c (__attr_list_lock): Likewise.
1402         * pthread_barrier_destroy.c (pthread_barrier_destroy): Pass
1403         ibarrier->private ^ FUTEX_PRIVATE_FLAG as second argument to
1404         lll_{,un}lock.
1405         * pthread_barrier_wait.c (pthread_barrier_wait): Likewise and
1406         also for lll_futex_{wake,wait}.
1407         * pthread_barrier_init.c (pthread_barrier_init): Make iattr
1408         a pointer to const.
1409         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Pass
1410         LLL_SHARED as second argument to lll_{,un}lock.
1411         * pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
1412         * pthread_cond_signal.c (__pthread_cond_singal): Likewise.
1413         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
1414         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait):
1415         Likewise.
1416         * pthread_getattr_np.c (pthread_getattr_np): Add LLL_PRIVATE
1417         as second argument to lll_{,un}lock macros on pd->lock.
1418         * pthread_getschedparam.c (__pthread_getschedparam): Likewise.
1419         * pthread_setschedparam.c (__pthread_setschedparam): Likewise.
1420         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
1421         * tpp.c (__pthread_tpp_change_priority, __pthread_current_priority):
1422         Likewise.
1423         * sysdeps/pthread/createthread.c (do_clone, create_thread):
1424         Likewise.
1425         * pthread_once.c (once_lock): Change type to int.
1426         (__pthread_once): Pass LLL_PRIVATE as second argument to
1427         lll_{,un}lock macros on once_lock.
1428         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Use
1429         lll_{,un}lock macros instead of lll_mutex_{,un}lock, pass
1430         rwlock->__data.__shared as second argument to them and similarly
1431         for lll_futex_w*.
1432         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
1433         Likewise.
1434         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
1435         Likewise.
1436         * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Likewise.
1437         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Likewise.
1438         * pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Likewise.
1439         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1440         * sem_close.c (sem_close): Pass LLL_PRIVATE as second argument
1441         to lll_{,un}lock macros on __sem_mappings_lock.
1442         * sem_open.c (check_add_mapping): Likewise.
1443         (__sem_mappings_lock): Change type to int.
1444         * semaphoreP.h (__sem_mappings_lock): Likewise.
1445         * pthread_mutex_lock.c (LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
1446         LLL_ROBUST_MUTEX_LOCK): Use lll_{,try,robust_}lock macros
1447         instead of lll_*mutex_*, pass LLL_SHARED as last
1448         argument.
1449         (__pthread_mutex_lock): Use lll_unlock instead of lll_mutex_unlock,
1450         pass LLL_SHARED as last argument.
1451         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK,
1452         LLL_MUTEX_TRYLOCK, LLL_ROBUST_MUTEX_LOCK): Use
1453         lll_{cond_,cond_try,robust_cond}lock macros instead of lll_*mutex_*,
1454         pass LLL_SHARED as last argument.
1455         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
1456         lll_{timed,try,robust_timed,un}lock instead of lll_*mutex*, pass
1457         LLL_SHARED as last argument.
1458         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Similarly.
1459         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
1460         Similarly.
1461         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_lock,
1462         __libc_lock_lock_recursive, __libc_lock_unlock,
1463         __libc_lock_unlock_recursive): Pass LLL_PRIVATE as second
1464         argument to lll_{,un}lock.
1465         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_lock,
1466         _IO_lock_unlock): Likewise.
1467         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Don't use
1468         compound literal.
1469         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1470         Pass LLL_PRIVATE as second argument to lll_{,un}lock macros on
1471         __fork_lock.
1472         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork,
1473         free_mem): Likewise.
1474         (__fork_lock): Change type to int.
1475         * sysdeps/unix/sysv/linux/fork.h (__fork_lock): Likewise.
1476         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Pass
1477         isem->private ^ FUTEX_PRIVATE_FLAG as second argument to
1478         lll_futex_wake.
1479         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
1480         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Likewise.
1481         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait_private):
1482         New function.
1483         (__lll_lock_wait, __lll_timedlock_wait): Add private argument and
1484         pass it through to lll_futex_*wait, only compile in when
1485         IS_IN_libpthread.
1486         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
1487         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Add private
1488         argument and pass it through to lll_futex_*wait.
1489         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Renamed all
1490         lll_mutex_* resp. lll_robust_mutex_* macros to lll_* resp.
1491         lll_robust_*.  Renamed all __lll_mutex_* resp. __lll_robust_mutex_*
1492         inline functions to __lll_* resp. __lll_robust_*.
1493         (LLL_MUTEX_LOCK_INITIALIZER): Remove.
1494         (lll_mutex_dead): Add private argument.
1495         (__lll_lock_wait_private): New prototype.
1496         (__lll_lock_wait, __lll_robust_lock_wait, __lll_lock_timedwait,
1497         __lll_robust_lock_timedwait): Add private argument to prototypes.
1498         (__lll_lock): Add private argument, if it is constant LLL_PRIVATE,
1499         call __lll_lock_wait_private, otherwise pass private to
1500         __lll_lock_wait.
1501         (__lll_robust_lock, __lll_cond_lock, __lll_timedlock,
1502         __lll_robust_timedlock): Add private argument, pass it to
1503         __lll_*wait functions.
1504         (__lll_unlock): Add private argument, if it is constant LLL_PRIVATE,
1505         call __lll_unlock_wake_private, otherwise pass private to
1506         __lll_unlock_wake.
1507         (__lll_robust_unlock): Add private argument, pass it to
1508         __lll_robust_unlock_wake.
1509         (lll_lock, lll_robust_lock, lll_cond_lock, lll_timedlock,
1510         lll_robust_timedlock, lll_unlock, lll_robust_unlock): Add private
1511         argument, pass it through to __lll_* inline function.
1512         (__lll_mutex_unlock_force, lll_mutex_unlock_force): Remove.
1513         (lll_lock_t): Remove.
1514         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1515         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1516         lll_cond_wake, lll_cond_broadcast): Remove.
1517         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1518         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1519         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1520         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1521         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Allow including
1522         the header from assembler.  Renamed all lll_mutex_* resp.
1523         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
1524         (LOCK, FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP,
1525         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
1526         (LLL_MUTEX_LOCK_INITIALIZER, LLL_MUTEX_LOCK_INITIALIZER_LOCKED,
1527         LLL_MUTEX_LOCK_INITIALIZER_WAITERS): Remove.
1528         (__lll_mutex_lock_wait, __lll_mutex_timedlock_wait,
1529         __lll_mutex_unlock_wake, __lll_lock_wait, __lll_unlock_wake):
1530         Remove prototype.
1531         (__lll_trylock_asm, __lll_lock_asm_start, __lll_unlock_asm): Define.
1532         (lll_robust_trylock, lll_cond_trylock): Use LLL_LOCK_INITIALIZER*
1533         rather than LLL_MUTEX_LOCK_INITIALIZER* macros.
1534         (lll_trylock): Likewise, use __lll_trylock_asm, pass
1535         MULTIPLE_THREADS_OFFSET as another asm operand.
1536         (lll_lock): Add private argument, use __lll_lock_asm_start, pass
1537         MULTIPLE_THREADS_OFFSET as last asm operand, call
1538         __lll_lock_wait_private if private is constant LLL_PRIVATE,
1539         otherwise pass private as another argument to __lll_lock_wait.
1540         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
1541         lll_timedlock, lll_robust_timedlock): Add private argument, pass
1542         private as another argument to __lll_*lock_wait call.
1543         (lll_unlock): Add private argument, use __lll_unlock_asm, pass
1544         MULTIPLE_THREADS_OFFSET as another asm operand, call
1545         __lll_unlock_wake_private if private is constant LLL_PRIVATE,
1546         otherwise pass private as another argument to __lll_unlock_wake.
1547         (lll_robust_unlock): Add private argument, pass private as another
1548         argument to __lll_unlock_wake.
1549         (lll_robust_dead): Add private argument, use __lll_private_flag
1550         macro.
1551         (lll_islocked): Use LLL_LOCK_INITIALIZER instead of
1552         LLL_MUTEX_LOCK_INITIALIZER.
1553         (lll_lock_t): Remove.
1554         (LLL_LOCK_INITIALIZER_WAITERS): Define.
1555         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1556         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1557         lll_cond_wake, lll_cond_broadcast): Remove.
1558         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1559         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Revert
1560         2007-05-2{3,9} changes.
1561         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Include
1562         kernel-features.h and lowlevellock.h.
1563         (LOAD_PRIVATE_FUTEX_WAIT): Define.
1564         (LOAD_FUTEX_WAIT): Rewritten.
1565         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
1566         define.
1567         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
1568         (__lll_mutex_lock_wait): Rename to ...
1569         (__lll_lock_wait): ... this.  Take futex addr from %edx instead of
1570         %ecx, %ecx is now private argument.  Don't compile in for libc.so.
1571         (__lll_mutex_timedlock_wait): Rename to ...
1572         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.  %esi
1573         contains private argument.  Don't compile in for libc.so.
1574         (__lll_mutex_unlock_wake): Rename to ...
1575         (__lll_unlock_wake): ... this.  %ecx contains private argument.
1576         Don't compile in for libc.so.
1577         (__lll_timedwait_tid): Use __NR_gettimeofday.
1578         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Include
1579         kernel-features.h and lowlevellock.h.
1580         (LOAD_FUTEX_WAIT): Define.
1581         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
1582         define.
1583         (__lll_robust_mutex_lock_wait): Rename to ...
1584         (__lll_robust_lock_wait): ... this.  Futex addr is now in %edx
1585         argument, %ecx argument contains private.  Use LOAD_FUTEX_WAIT
1586         macro.
1587         (__lll_robust_mutex_timedlock_wait): Rename to ...
1588         (__lll_robust_timedlock_wait): ... this.  Use __NR_gettimeofday.
1589         %esi argument contains private, use LOAD_FUTEX_WAIT macro.
1590         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Include
1591         lowlevellock.h.
1592         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1593         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
1594         PRIVATE(%ebx) ^ LLL_SHARED as private argument in %ecx to
1595         __lll_lock_wait and __lll_unlock_wake, pass MUTEX(%ebx) address
1596         to __lll_lock_wait in %edx.
1597         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
1598         Include lowlevellock.h and pthread-errnos.h.
1599         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1600         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
1601         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*, pass
1602         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1603         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1604         __lll_unlock_wake.
1605         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
1606         Include lowlevellock.h and pthread-errnos.h.
1607         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
1608         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
1609         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*, pass
1610         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1611         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1612         __lll_unlock_wake.
1613         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
1614         Include lowlevellock.h.
1615         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1616         Don't define.
1617         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*, pass
1618         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1619         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1620         __lll_unlock_wake.  Use __NR_gettimeofday.
1621         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
1622         Include lowlevellock.h.
1623         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1624         (__pthread_cond_wait, __condvar_w_cleanup): Rename __lll_mutex_*
1625         to __lll_*, pass cond_lock address in %edx rather than %ecx to
1626         __lll_lock_wait, pass LLL_SHARED in %ecx to both __lll_lock_wait
1627         and __lll_unlock_wake.
1628         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S:
1629         Include lowlevellock.h.
1630         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1631         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*, pass
1632         MUTEX(%ebx) address in %edx rather than %ecx to
1633         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
1634         and __lll_unlock_wake.  Move return value from %ecx to %edx
1635         register.
1636         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1637         Include lowlevellock.h.
1638         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1639         Don't define.
1640         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1641         MUTEX(%ebp) address in %edx rather than %ecx to
1642         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
1643         and __lll_unlock_wake.  Move return value from %ecx to %edx
1644         register.  Use __NR_gettimeofday.
1645         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1646         Include lowlevellock.h.
1647         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1648         Don't define.
1649         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1650         MUTEX(%ebp) address in %edx rather than %ecx to
1651         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
1652         and __lll_unlock_wake.  Move return value from %ecx to %edx
1653         register.  Use __NR_gettimeofday.
1654         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
1655         Include lowlevellock.h.
1656         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1657         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*, pass
1658         MUTEX(%edi) address in %edx rather than %ecx to
1659         __lll_lock_wait, pass PSHARED(%edi) in %ecx to both __lll_lock_wait
1660         and __lll_unlock_wake.
1661         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
1662         Include lowlevellock.h.
1663         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1664         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1665         MUTEX(%ebx) address in %edx rather than %ecx to
1666         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
1667         and __lll_unlock_wake.  Move return value from %ecx to %edx
1668         register.
1669         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Include
1670         lowlevellock.h.
1671         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1672         define.
1673         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Include lowlevellock.h.
1674         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1675         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Include
1676         lowlevellock.h.
1677         (LOCK, SYS_futex, SYS_gettimeofday, FUTEX_WAIT): Don't define.
1678         (sem_timedwait): Use __NR_gettimeofday.
1679         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Include
1680         lowlevellock.h.
1681         (LOCK): Don't define.
1682         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include
1683         lowlevellock.h.
1684         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1685         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Wake only when there
1686         are waiters.
1687         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Revert
1688         2007-05-2{3,9} changes.
1689         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Include
1690         kernel-features.h and lowlevellock.h.
1691         (LOAD_PRIVATE_FUTEX_WAIT): Define.
1692         (LOAD_FUTEX_WAIT): Rewritten.
1693         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
1694         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
1695         (__lll_mutex_lock_wait): Rename to ...
1696         (__lll_lock_wait): ... this.  %esi is now private argument.
1697         Don't compile in for libc.so.
1698         (__lll_mutex_timedlock_wait): Rename to ...
1699         (__lll_timedlock_wait): ... this.  %esi contains private argument.
1700         Don't compile in for libc.so.
1701         (__lll_mutex_unlock_wake): Rename to ...
1702         (__lll_unlock_wake): ... this.  %esi contains private argument.
1703         Don't compile in for libc.so.
1704         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Include
1705         kernel-features.h and lowlevellock.h.
1706         (LOAD_FUTEX_WAIT): Define.
1707         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
1708         (__lll_robust_mutex_lock_wait): Rename to ...
1709         (__lll_robust_lock_wait): ... this.  %esi argument contains private.
1710         Use LOAD_FUTEX_WAIT macro.
1711         (__lll_robust_mutex_timedlock_wait): Rename to ...
1712         (__lll_robust_timedlock_wait): ... this. %esi argument contains
1713         private, use LOAD_FUTEX_WAIT macro.
1714         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Include
1715         lowlevellock.h.
1716         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1717         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
1718         PRIVATE(%rdi) ^ LLL_SHARED as private argument in %esi to
1719         __lll_lock_wait and __lll_unlock_wake.
1720         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S:
1721         Include lowlevellock.h and pthread-errnos.h.
1722         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1723         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
1724         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*,
1725         pass LLL_SHARED in %esi to both __lll_lock_wait and
1726         __lll_unlock_wake.
1727         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S:
1728         Include lowlevellock.h and pthread-errnos.h.
1729         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
1730         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
1731         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*,
1732         pass LLL_SHARED in %esi to both __lll_lock_wait and
1733         __lll_unlock_wake.
1734         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:
1735         Include lowlevellock.h.
1736         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1737         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*,
1738         pass LLL_SHARED in %esi to both __lll_lock_wait and
1739         __lll_unlock_wake.
1740         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
1741         Include lowlevellock.h.
1742         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1743         (__pthread_cond_wait, __condvar_cleanup): Rename __lll_mutex_*
1744         to __lll_*, pass LLL_SHARED in %esi to both __lll_lock_wait
1745         and __lll_unlock_wake.
1746         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:
1747         Include lowlevellock.h.
1748         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1749         Don't define.
1750         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*,
1751         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1752         and __lll_unlock_wake.
1753         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1754         Include lowlevellock.h.
1755         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1756         Don't define.
1757         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1758         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1759         and __lll_unlock_wake.
1760         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1761         Include lowlevellock.h.
1762         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1763         Don't define.
1764         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1765         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1766         and __lll_unlock_wake.
1767         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S:
1768         Include lowlevellock.h.
1769         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1770         Don't define.
1771         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*,
1772         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1773         and __lll_unlock_wake.
1774         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:
1775         Include lowlevellock.h.
1776         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1777         Don't define.
1778         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1779         pass PSHARED(%rdi) in %ecx to both __lll_lock_wait
1780         and __lll_unlock_wake.
1781         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Include
1782         lowlevellock.h.
1783         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1784         define.
1785         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Include lowlevellock.h.
1786         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1787         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Include
1788         lowlevellock.h.
1789         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1790         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Include
1791         lowlevellock.h.
1792         (LOCK): Don't define.
1793         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Include
1794         lowlevellock.h.
1795         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1796         * sysdeps/unix/sysv/linux/sparc/internaltypes.h: New file.
1797         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c: New file.
1798         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c: New file.
1799         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c: New file.
1800         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
1801         (__lll_lock_wait_private): New function.
1802         (__lll_lock_wait, __lll_timedlock_wait): Add private argument, pass
1803         it to lll_futex_*wait.  Don't compile in for libc.so.
1804         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c:
1805         Remove.
1806         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
1807         (struct sparc_pthread_barrier): Remove.
1808         (pthread_barrier_wait): Use union sparc_pthread_barrier instead of
1809         struct sparc_pthread_barrier.  Pass
1810         ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE to lll_{,un}lock
1811         and lll_futex_wait macros.
1812         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
1813         Remove.
1814         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1815         Include sparc pthread_barrier_wait.c instead of generic one.
1817 2007-07-30  Jakub Jelinek  <jakub@redhat.com>
1819         * tst-rwlock14.c (do_test): Avoid warnings on 32-bit arches.
1821         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
1822         (pthread_rwlock_timedrdlock): Copy futex retval to %esi rather than
1823         %ecx.
1824         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
1825         (pthread_rwlock_timedwrlock): Likewise.
1826         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
1827         (__pthread_rwlock_unlock): Fix MUTEX != 0 args to __lll_*.
1829 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
1831         * sysdeps/sparc/tls.h (tcbhead_t): Add private_futex field.
1833 2007-07-26  Jakub Jelinek  <jakub@redhat.com>
1835         * tst-locale2.c (useless): Add return statement.
1837 2007-07-24  Jakub Jelinek  <jakub@redhat.com>
1839         * allocatestack.c (__nptl_setxid, __wait_lookup_done): Replace
1840         lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).
1841         * pthread_create.c (start_thread): Likewise.
1842         * init.c (sighandler_setxid): Likewise.
1843         * sysdeps/alpha/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1844         * sysdeps/ia64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1845         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1846         * sysdeps/s390/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1847         * sysdeps/powerpc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1848         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1849         * sysdeps/sparc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1850         * sysdeps/sh/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1851         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY, AIO_MISC_WAIT):
1852         Likewise.
1853         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY, GAI_MISC_WAIT):
1854         Likewise.
1855         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1856         Likewise.
1857         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_waitzero,
1858         __rtld_notify): Likewise.
1859         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Likewise.
1860         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (clear_once_control,
1861         __pthread_once): Likewise.
1862         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (clear_once_control,
1863         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1864         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1865         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1866         (lll_futex_wait): Add private argument, define as wrapper around
1867         lll_futex_timed_wait.
1868         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1869         use __lll_private_flag macro.
1870         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1871         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1872         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (clear_once_control,
1873         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1874         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1875         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1876         (lll_futex_wait): Add private argument, define as wrapper around
1877         lll_futex_timed_wait.
1878         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1879         use __lll_private_flag macro.
1880         (__lll_mutex_unlock, __lll_robust_mutex_unlock, lll_wait_tid,
1881         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1882         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
1883         Define.
1884         (lll_futex_timed_wait, lll_futex_wake): Use it.
1885         (lll_private_futex_wait, lll_private_futex_timed_wait,
1886         lll_private_futex_wake): Removed.
1887         * sysdeps/unix/sysv/linux/s390/pthread_once.c (clear_once_control,
1888         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1889         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1890         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1891         (lll_futex_wait): Add private argument, define as wrapper around
1892         lll_futex_timed_wait.
1893         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1894         use __lll_private_flag macro.
1895         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1896         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1897         to lll_futex_*.
1898         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1899         (lll_private_futex_wait, lll_private_futex_timed_wait,
1900         lll_private_futex_wake): Removed.
1901         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_private_flag):
1902         Fix !__ASSUME_PRIVATE_FUTEX non-constant private case.
1903         (lll_private_futex_wait, lll_private_futex_timed_wait,
1904         lll_private_futex_wake): Removed.
1905         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (clear_once_control,
1906         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1907         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1908         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1909         (lll_futex_wait): Add private argument, define as wrapper around
1910         lll_futex_timed_wait.
1911         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1912         use __lll_private_flag macro.
1913         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1914         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1915         to lll_futex_*.
1916         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (__lll_private_flag):
1917         Define.
1918         (lll_futex_timed_wait, lll_futex_wake): Use it.
1919         (lll_private_futex_wait, lll_private_futex_timed_wait,
1920         lll_private_futex_wake): Removed.
1922 2007-07-27  Jakub Jelinek  <jakub@redhat.com>
1924         * sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
1925         of the structure for sparc32.
1927 2007-07-26  Aurelien Jarno  <aurelien@aurel32.net>
1929         * sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
1931 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1933         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1934         code used when private futexes are assumed.
1935         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1936         Likewise.
1938 2007-07-23  Jakub Jelinek  <jakub@redhat.com>
1940         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1941         (__lll_private_flag): Define.
1942         (lll_futex_wait): Define as a wrapper around lll_futex_timed_wait.
1943         (lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Use
1944         __lll_private_flag.
1945         (lll_private_futex_wait, lll_private_futex_timedwait,
1946         lll_private_futex_wake): Define as wrapper around non-_private
1947         macros.
1948         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1949         (__lll_private_flag): Define.
1950         (lll_futex_timed_wait, lll_futex_wake): Use __lll_private_flag.
1951         (lll_private_futex_wait, lll_private_futex_timedwait,
1952         lll_private_futex_wake): Define as wrapper around non-_private
1953         macros.
1955 2007-07-10  Steven Munroe  <sjmunroe@us.ibm.com>
1957         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Add LLL_SHARED
1958         parameter to lll_futex_wait call.
1959         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1961         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
1962         Replace lll_futex_wait with lll_private_futex_wait.
1963         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1964         Add LLL_SHARED parameter to lll_futex_wake().
1966         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define LLL_PRIVATE
1967         LLL_SHARED, lll_private_futex_wait, lll_private_futex_timed_wait and
1968         lll_private_futex_wake.
1969         (lll_futex_wait): Add private parameter. Adjust FUTEX_PRIVATE_FLAG
1970         bit from private parm before syscall.
1971         (lll_futex_timed_wait): Likewise.
1972         (lll_futex_wake): Likewise.
1973         (lll_futex_wake_unlock): Likewise.
1974         (lll_mutex_unlock): Add LLL_SHARED parm to lll_futex_wake call.
1975         (lll_robust_mutex_unlock): Likewise.
1976         (lll_mutex_unlock_force): Likewise.
1977         (lll_wait_tid): Add LLL_SHARED parm to lll_futex_wait call.
1979 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1981         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1982         compilation when unconditionally using private futexes.
1983         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1984         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1985         Likewise.
1986         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1987         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1989 2007-07-17  Jakub Jelinek  <jakub@redhat.com>
1991         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
1992         Define.
1994 2007-07-06  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1996         * sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and
1997         kernel-features.h.
1999 2007-05-16  Roland McGrath  <roland@redhat.com>
2001         * init.c (__nptl_initial_report_events): New variable.
2002         (__pthread_initialize_minimal_internal): Initialize pd->report_events
2003         to that.
2005 2007-06-22  Jakub Jelinek  <jakub@redhat.com>
2007         * pthread_getattr_np.c (pthread_getattr_np): Clear cpuset and
2008         cpusetsize if pthread_getaffinity_np failed with ENOSYS.
2010 2007-06-19  Ulrich Drepper  <drepper@redhat.com>
2012         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Remove mrlock
2013         implementation.
2015 2007-06-18  Ulrich Drepper  <drepper@redhat.com>
2017         * pthreadP.h: Define PTHREAD_MUTEX_TYPE.
2018         * phtread_mutex_lock.c: Use PTHREAD_MUTEX_TYPE.
2019         * pthread_mutex_timedlock.c: Likewise.
2020         * pthread_mutex_trylock.c: Likewise.
2021         * pthread_mutex_unlock.c: Likewise.
2023 2007-06-17  Andreas Schwab  <schwab@suse.de>
2025         * sysdeps/pthread/pt-initfini.c: Tell gcc about the nonstandard
2026         sections.
2028 2007-06-17  Ulrich Drepper  <drepper@redhat.com>
2030         * allocatestack.c (allocate_stack): Make code compile if
2031         __ASSUME_PRIVATE_FUTEX is set.
2033 2007-06-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2035         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S:
2036         (__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
2037         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
2038         (__pthread_rwlock_wrlock): Likewise.
2039         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
2040         (pthread_rwlock_timedrdlock): Likewise.
2041         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
2042         (pthread_rwlock_timedwrlock): Likewise.
2043         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
2044         (__pthread_rwlock_unlock): Likewise.
2046 2007-06-10  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2048         * sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
2049         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
2050         Split __flags into __flags, __shared, __pad1 and __pad2.
2051         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
2052         futexes if they are available.
2053         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
2054         in libc-lowlevellock.S allow using private futexes.
2055         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
2056         FUTEX_PRIVATE_FLAG.  Add additional parameter to lll_futex_wait,
2057         lll_futex_timed_wait and lll_futex_wake.  Change lll_futex_wait
2058         to call lll_futex_timed_wait.  Add lll_private_futex_wait,
2059         lll_private_futex_timed_wait and lll_private_futex_wake.
2060         (lll_robust_mutex_unlock): Fix typo.
2061         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
2062         field in futex command setup.
2063         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
2064         COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
2065         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
2066         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
2067         if they are available.  Remove clear_once_control.
2068         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
2069         futexes if they are available.
2070         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
2071         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
2072         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
2073         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2074         * sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
2075         Wake only when there are waiters.
2076         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
2077         support.  Indicate that there are waiters.  Remove unnecessary
2078         extra cancellation test.
2079         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.  Removed
2080         left-over duplication of __sem_wait_cleanup.
2082 2007-06-07  Ulrich Drepper  <drepper@redhat.com>
2084         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Add additional
2085         parameter to lll_futex_wait, lll_futex_timed_wait, and
2086         lll_futex_wake.  Change lll_futex_wait to call lll_futex_timed_wait.
2087         Add lll_private_futex_wait, lll_private_futex_timed_wait, and
2088         lll_private_futex_wake.
2089         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2090         * allocatestack.c: Adjust use of lll_futex_* macros.
2091         * init.c: Likewise.
2092         * lowlevellock.h: Likewise.
2093         * pthread_barrier_wait.c: Likewise.
2094         * pthread_cond_broadcast.c: Likewise.
2095         * pthread_cond_destroy.c: Likewise.
2096         * pthread_cond_signal.c: Likewise.
2097         * pthread_cond_timedwait.c: Likewise.
2098         * pthread_cond_wait.c: Likewise.
2099         * pthread_create.c: Likewise.
2100         * pthread_mutex_lock.c: Likewise.
2101         * pthread_mutex_setprioceiling.c: Likewise.
2102         * pthread_mutex_timedlock.c: Likewise.
2103         * pthread_mutex_unlock.c: Likewise.
2104         * pthread_rwlock_timedrdlock.c: Likewise.
2105         * pthread_rwlock_timedwrlock.c: Likewise.
2106         * pthread_rwlock_unlock.c: Likewise.
2107         * sysdeps/alpha/tls.h: Likewise.
2108         * sysdeps/i386/tls.h: Likewise.
2109         * sysdeps/ia64/tls.h: Likewise.
2110         * sysdeps/powerpc/tls.h: Likewise.
2111         * sysdeps/pthread/aio_misc.h: Likewise.
2112         * sysdeps/pthread/gai_misc.h: Likewise.
2113         * sysdeps/s390/tls.h: Likewise.
2114         * sysdeps/sh/tls.h: Likewise.
2115         * sysdeps/sparc/tls.h: Likewise.
2116         * sysdeps/unix/sysv/linux/fork.c: Likewise.
2117         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
2118         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
2119         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Likewise.
2120         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
2121         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
2122         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
2123         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
2124         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
2125         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
2126         Likewise.
2127         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise.
2128         * sysdeps/x86_64/tls.h: Likewise.
2130 2007-05-29  Ulrich Drepper  <drepper@redhat.com>
2132         * pthread_getattr_np.c: No need to install a cancellation handler,
2133         this is no cancellation point.
2134         * pthread_getschedparam.c: Likewise.
2135         * pthread_setschedparam.c: Likewise.
2136         * pthread_setschedprio.c: Likewise.
2137         * sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
2138         lll_unlock_wake_cb.
2139         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2140         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2141         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2142         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2143         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2144         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2145         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
2146         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2147         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2148         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
2149         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
2150         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2152         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
2153         whether there are more than one thread makes no sense here since
2154         we only call the slow path if the locks are taken.
2155         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
2157         * sysdeps/unix/sysv/linux/internaltypes.h: Introduce
2158         COND_NWAITERS_SHIFT.
2159         * pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of
2160         COND_CLOCK_BITS.
2161         * pthread_cond_init.c: Likewise.
2162         * pthread_cond_timedwait.c: Likewise.
2163         * pthread_cond_wait.c: Likewise.
2164         * pthread_condattr_getclock.c: Likewise.
2165         * pthread_condattr_setclock.c: Likewise.
2166         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise.
2167         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2168         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2169         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2170         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2172 2007-05-28  Jakub Jelinek  <jakub@redhat.com>
2174         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
2175         unistd.h.
2177         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
2178         insn suffix.
2179         (THREAD_GSCOPE_GET_FLAG): Remove.
2180         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Remove.
2181         * allocatestack.c (__wait_lookup_done): Revert 2007-05-24
2182         changes.
2183         * sysdeps/powerpc/tls.h (tcbhead_t): Remove gscope_flag.
2184         (THREAD_GSCOPE_GET_FLAG): Remove.
2185         (THREAD_GSCOPE_RESET_FLAG): Use THREAD_SELF->header.gscope_flag
2186         instead of THREAD_GSCOPE_GET_FLAG.
2187         (THREAD_GSCOPE_SET_FLAG): Likewise.  Add atomic_write_barrier after
2188         it.
2189         * sysdeps/s390/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2190         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2191         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2192         THREAD_GSCOPE_WAIT): Define.
2193         * sysdeps/sparc/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2194         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2195         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2196         THREAD_GSCOPE_WAIT): Define.
2197         * sysdeps/sh/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2198         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2199         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2200         THREAD_GSCOPE_WAIT): Define.
2201         * sysdeps/ia64/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2202         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2203         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2204         THREAD_GSCOPE_WAIT): Define.
2206 2007-05-24  Richard Henderson  <rth@redhat.com>
2208         * descr.h (struct pthread): Add header.gscope_flag.
2209         * sysdeps/alpha/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2210         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2211         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2212         THREAD_GSCOPE_WAIT): Define.
2214 2007-05-27  Ulrich Drepper  <drepper@redhat.com>
2216         * init.c: Make it compile with older kernel headers.
2218         * tst-initializers1.c: Show through exit code which test failed.
2220         * pthread_rwlock_init.c: Also initialize __shared field.
2221         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
2222         element in rwlock structure into four byte elements.  One of them is
2223         the new __shared element.
2224         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
2225         Likewise.
2226         [__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
2227         __shared, adjust names of other padding elements.
2228         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2229         * sysdeps/pthread/pthread.h: Adjust rwlock initializers.
2230         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
2231         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
2232         FUTEX_PRIVATE_FLAG.
2233         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
2234         futex to use private operations if possible.
2235         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
2236         Likewise.
2237         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2238         Likewise.
2239         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
2240         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2241         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2242         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2243         Likewise.
2244         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2245         Likewise.
2246         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
2247         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2249 2007-05-26  Ulrich Drepper  <drepper@redhat.com>
2251         * pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
2252         * pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
2253         * pthread_rwlock_timedrdlock.c: Likewise.
2254         * pthread_rwlock_tryrdlock.c: Likewise.
2256         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
2257         optimization.
2259         * sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
2260         * sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
2261         duplication of __sem_wait_cleanup.
2263         * allocatestack.c: Revert last change.
2264         * init.c: Likewise.
2265         * sysdeps/i386/tls.h: Likewise.
2266         * sysdeps/x86_64/tls.h: Likewise.
2267         * descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
2268         header structure.
2269         * sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
2271         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
2272         Add private field.
2273         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
2274         * pthread_barrier_init.c: Set private flag if pshared and private
2275         futexes are supported.
2276         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
2277         private field in futex command setup.
2278         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
2280 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
2282         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
2283         support.
2284         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2285         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2286         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2287         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2288         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2290         * semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
2291         * sem_init.c (__new_sem_init): Rewrite to initialize all three
2292         fields in the structure.
2293         (__old_sem_init): New function.
2294         * sem_open.c: Initialize all fields of the structure.
2295         * sem_getvalue.c: Adjust for renamed element.
2296         * sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
2297         (gen-as-const-headers): Add structsem.sym.
2298         * sysdeps/unix/sysv/linux/structsem.sym: New file.
2299         * sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
2300         struct new_sem.  Add struct old_sem.
2301         * sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
2302         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
2303         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2304         * sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
2305         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2306         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2307         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
2308         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2309         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2310         * Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
2311         * tst-sem10.c: New file.
2312         * tst-sem11.c: New file.
2313         * tst-sem12.c: New file.
2314         * tst-typesizes.c: Test struct new_sem and struct old_sem instead
2315         of struct sem.
2317 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
2318             Jakub Jelinek  <jakub@redhat.com>
2320         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
2321         Move __pthread_enable_asynccancel right before futex syscall.
2322         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
2323         Likewise.
2325 2007-05-24  Jakub Jelinek  <jakub@redhat.com>
2327         * sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
2328         THREAD_COPY_PRIVATE_FUTEX): Define.
2329         * sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
2330         THREAD_COPY_PRIVATE_FUTEX): Define.
2331         * allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
2332         * init.c (__pthread_initialize_minimal_internal): Use
2333         THREAD_SET_PRIVATE_FUTEX.
2335         * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
2336         (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
2337         THREAD_GSCOPE_FLAG_WAIT): Define.
2338         (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG,
2339         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define.
2340         * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use
2341         PTR_DEMANGLE.
2342         (THREAD_GSCOPE_GET_FLAG): Define.
2343         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define.
2344         * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
2345         instead of ->header.gscope_flag directly.
2347 2007-05-23  Ulrich Drepper  <drepper@redhat.com>
2349         * init.c (__pthread_initialize_minimal_internal): Check whether
2350         private futexes are available.
2351         * allocatestack.c (allocate_stack): Copy private_futex field from
2352         current thread into the new stack.
2353         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
2354         futexes if they are available.
2355         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
2356         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
2357         in libc-lowlevellock.S allow using private futexes.
2358         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2359         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
2360         FUTEX_PRIVATE_FLAG.
2361         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2362         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
2363         if they are available.
2364         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
2365         * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
2366         * sysdeps/i386/tcb-offsets.sym: Likewise.
2367         * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
2368         * sysdeps/i386/tls.h (tcbhead_t): Likewise.
2370 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
2372         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2373         Remove ptr_wait_lookup_done again.
2374         * init.c (pthread_functions): Don't add .ptr_wait_lookup_done here.
2375         (__pthread_initialize_minimal_internal): Initialize
2376         _dl_wait_lookup_done pointer in _rtld_global directly.
2377         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
2378         Remove code to code _dl_wait_lookup_done.
2379         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
2380         encrypted for now.
2382 2007-05-21  Jakub Jelinek  <jakub@redhat.com>
2384         * tst-robust9.c (do_test): Don't fail if ENABLE_PI and
2385         pthread_mutex_init failed with ENOTSUP.
2387 2007-05-19  Ulrich Drepper  <drepper@redhat.com>
2389         * allocatestack.c (__wait_lookup_done): New function.
2390         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2391         Add ptr_wait_lookup_done.
2392         * init.c (pthread_functions): Initialize .ptr_wait_lookup_done.
2393         * pthreadP.h: Declare __wait_lookup_done.
2394         * sysdeps/i386/tls.h (tcbhead_t): Add gscope_flag.
2395         Define macros to implement reference handling of global scope.
2396         * sysdeps/x86_64/tls.h: Likewise.
2397         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
2398         Initialize GL(dl_wait_lookup_done).
2400 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
2402         [BZ #4512]
2403         * pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
2404         is detected.
2405         * pthread_mutex_timedlock.c: Likewise.
2406         * pthread_mutex_trylock.c: Likewise.
2407         Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
2409         * Makefile (tests): Add tst-robust9 and tst-robustpi9.
2410         * tst-robust9.c: New file.
2411         * tst-robustpi9.c: New file.
2413         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
2414         unnecessary extra cancellation test.
2416 2007-05-14  Ulrich Drepper  <drepper@redhat.com>
2418         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
2419         extra cancellation test.
2420         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2422 2007-05-10  Ulrich Drepper  <drepper@redhat.com>
2424         * descr.h (struct pthread): Rearrange members to fill hole in
2425         64-bit layout.
2427         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2428         (__pthread_setaffinity_new): If syscall was successful and
2429         RESET_VGETCPU_CACHE is defined, use it before returning.
2430         * sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
2432 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
2434         [BZ #4455]
2435         * tst-align2.c: Include stackinfo.h.
2436         * tst-getpid1.c: Likewise.
2438 2007-05-02  Carlos O'Donell  <carlos@systemhalted.org>
2440         [BZ #4455]
2441         * tst-align2.c (do_test): Add _STACK_GROWS_UP case.
2442         * tst-getpid1.c (do_test): Likewise.
2444         [BZ #4456]
2445         * allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
2446         (allocate_stack): Likewise.
2448 2007-05-07  Ulrich Drepper  <drepper@redhat.com>
2450         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
2451         (__lll_robust_lock_wait): Fix race caused by reloading of futex value.
2452         (__lll_robust_timedlock_wait): Likewise.
2453         Reported by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
2455 2007-05-06  Mike Frysinger  <vapier@gentoo.org>
2457         [BZ #4465]
2458         * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
2459         * tst-cancel4.c (tf_fdatasync): New test.
2461 2007-04-27  Ulrich Drepper  <drepper@redhat.com>
2463         [BZ #4392]
2464         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Treat error
2465         check mutexes like normal mutexes.
2467         [BZ #4306]
2468         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
2469         Initialize the whole sigevent structure to appease valgrind.
2471 2007-04-25  Ulrich Drepper  <drepper@redhat.com>
2473         * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
2474         * sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
2476 2007-04-06  Ulrich Drepper  <drepper@redhat.com>
2478         * tst-locale1.c: Avoid warnings.
2479         * tst-locale2.c: Likewise.
2481 2007-03-19  Steven Munroe  <sjmunroe@us.ibm.com>
2483         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2484         (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
2486 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
2488         * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
2489         __extern_always_inline where appropriate.
2490         * sysdeps/pthread/pthread.h: Likewise.
2492 2007-03-13  Richard Henderson  <rth@redhat.com>
2494         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
2495         separate cfi regions for the two subsections.
2497 2007-02-25  Ulrich Drepper  <drepper@redhat.com>
2499         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
2500         new thread, don't just decrement it.
2501         Patch by Suzuki K P <suzuki@in.ibm.com>.
2503 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
2505         * sysdeps/pthread/pthread-functions.h: Correct last patch, correct
2506         PTHFCT_CALL definition.
2508 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
2510         * sysdeps/pthread/pthread-functions.h: If PTR_DEMANGLE is not
2511         available, don't use it.
2513 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
2515         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2516         (__lll_mutex_timedlock_wait): Use correct pointer when we don't
2517         call into the kernel to delay.
2519 2007-01-18  Ulrich Drepper  <drepper@redhat.com>
2521         * tst-initializers1.c: We want to test the initializers as seen
2522         outside of libc, so undefined _LIBC.
2524         * pthread_join.c (cleanup): Avoid warning.
2526 2007-01-17  Ulrich Drepper  <drepper@redhat.com>
2528         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2529         (__lll_timedwait_tid): Add unwind info.
2531         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Don't just copy the
2532         function table, mangle the pointers.
2533         * sysdeps/pthread/pthread-functions.h: Define PTHFCT_CALL.
2534         * forward.c: Use PTHFCT_CALL and __libc_pthread_functions_init.
2535         * sysdeps/pthread/bits/libc-lock.h: When using __libc_pthread_functions
2536         demangle pointers before use.
2537         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Use PTHFCT_CALL to
2538         demangle pointer.
2539         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
2540         * sysdeps/pthread/setxid.h: Likewise.
2542 2007-01-12  Ulrich Drepper  <drepper@redhat.com>
2544         * tst-rwlock7.c: Show some more information in case of correct
2545         behavior.
2547 2007-01-11  Ulrich Drepper  <drepper@redhat.com>
2549         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2550         (lll_futex_timed_wait): Undo part of last change, don't negate
2551         return value.
2553 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
2555         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups.  Define
2556         FUTEX_CMP_REQUEUE and lll_futex_requeue.
2558 2006-12-28  David S. Miller  <davem@davemloft.net>
2560         * shlib-versions: Fix sparc64 linux target specification.
2562 2007-01-10  Jakub Jelinek  <jakub@redhat.com>
2564         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2565         Adjust include path for pthread_barrier_wait.c move.
2567 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
2569         * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
2570         tid isn't reread from pd->tid in between ESRCH test and the syscall.
2572 2006-12-06  Jakub Jelinek  <jakub@redhat.com>
2574         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
2575         6 argument cancellable syscalls.
2576         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
2577         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
2578         6 argument cancellable syscalls.
2579         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
2581 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
2583         * sysdeps/unix/sysv/linux/rtld-lowlevel.h
2584         (__rtld_mrlock_initialize): Add missing closing parenthesis.
2586 2006-10-30  Jakub Jelinek  <jakub@redhat.com>
2588         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
2589         __sync_lock_release instead of __sync_lock_release_si.
2591 2006-10-29  Jakub Jelinek  <jakub@redhat.com>
2593         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P):
2594         Define.
2595         (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld.
2596         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
2597         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
2598         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
2599         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
2600         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2601         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
2602         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
2603         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2604         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2605         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
2607 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
2609         * sysdeps/pthread/pthread_barrier_wait.c: Move to...
2610         * pthread_barrier_wait.c: ...here.
2611         * sysdeps/pthread/pthread_cond_broadcast.c: Move to...
2612         * pthread_cond_broadcast.c: ...here.
2613         * sysdeps/pthread/pthread_cond_signal.c: Move to...
2614         * pthread_cond_signal.c: ...here.
2615         * sysdeps/pthread/pthread_cond_timedwait.c: Move to...
2616         * pthread_cond_timedwait.c: ...here.
2617         * sysdeps/pthread/pthread_cond_wait.c: Move to...
2618         * pthread_cond_wait.c: ...here.
2619         * sysdeps/pthread/pthread_once.c: Move to...
2620         * pthread_once.c: ...here.
2621         * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to...
2622         * pthread_rwlock_rdlock.c: ...here.
2623         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to...
2624         * pthread_rwlock_timedrdlock.c: ...here.
2625         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to...
2626         * pthread_rwlock_timedwrlock.c: ...here.
2627         * sysdeps/pthread/pthread_rwlock_unlock.c: Move to...
2628         * pthread_rwlock_unlock.c: ...here.
2629         * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to...
2630         * pthread_rwlock_wrlock.c: ...here.
2631         * sysdeps/pthread/pthread_spin_destroy.c: Move to...
2632         * pthread_spin_destroy.c: ...here.
2633         * sysdeps/pthread/pthread_spin_init.c: Move to...
2634         * pthread_spin_init.c: ...here.
2635         * sysdeps/pthread/pthread_spin_unlock.c: Move to...
2636         * pthread_spin_unlock.c: ...here.
2637         * sysdeps/pthread/pthread_getcpuclockid.c: Move to...
2638         * pthread_getcpuclockid.c: ...here.
2640         * init.c: USE_TLS support is now always enabled.
2641         * tst-tls5.h: Likewise.
2642         * sysdeps/alpha/tls.h: Likewise.
2643         * sysdeps/i386/tls.h: Likewise.
2644         * sysdeps/ia64/tls.h: Likewise.
2645         * sysdeps/powerpc/tls.h: Likewise.
2646         * sysdeps/s390/tls.h: Likewise.
2647         * sysdeps/sh/tls.h: Likewise.
2648         * sysdeps/sparc/tls.h: Likewise.
2649         * sysdeps/x86_64/tls.h: Likewise.
2651 2006-10-27  Jakub Jelinek  <jakub@redhat.com>
2653         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
2654         __rtld_mrlock_change): Update oldval if atomic compare and exchange
2655         failed.
2657         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
2658         Define to THREAD_SELF->header.multiple_threads.
2659         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
2660         Likewise.
2661         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
2662         Likewise.
2663         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
2664         (SINGLE_THREAD_P): Likewise.
2665         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
2666         (SINGLE_THREAD_P): Likewise.
2667         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2668         (SINGLE_THREAD_P): Likewise.
2669         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
2670         (SINGLE_THREAD_P): Likewise.
2671         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P):
2672         Likewise.
2673         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
2674         (SINGLE_THREAD_P): Likewise.
2675         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
2676         (SINGLE_THREAD_P): Likewise.
2677         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P):
2678         Likewise.
2680 2006-10-26  Jakub Jelinek  <jakub@redhat.com>
2682         * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3
2683         by default rather than 2_3_3.
2685 2006-10-17  Jakub Jelinek  <jakub@redhat.com>
2687         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
2688         __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
2689         atomic_* instead of catomic_* macros.
2691 2006-10-12  Ulrich Drepper  <drepper@redhat.com>
2693         [BZ #3285]
2694         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX.
2695         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
2696         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
2697         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
2698         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
2699         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX.
2700         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
2701         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
2702         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
2703         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise.
2704         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
2705         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
2706         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
2708 2006-10-11  Ulrich Drepper  <drepper@redhat.com>
2710         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for
2711         cancelable syscalls with six parameters.
2713         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
2714         operations instead of atomic_*.
2716 2006-10-09  Ulrich Drepper  <drepper@redhat.com>
2718         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
2720 2006-10-07  Ulrich Drepper  <drepper@redhat.com>
2722         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file.
2723         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file.
2724         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c:
2725         New file.
2726         * pthread_attr_setstack.c: Allow overwriting the version number of the
2727         new symbol.
2728         * pthread_attr_setstacksize.c: Likewise.
2729         (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use
2730         it.
2731         * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add
2732         pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6.
2734 2006-09-24  Ulrich Drepper  <drepper@redhat.com>
2736         [BZ #3251]
2737         * descr.h (ENQUEUE_MUTEX_BOTH): Add cast to avoid warning.
2738         Patch by Petr Baudis.
2740 2006-09-18  Jakub Jelinek  <jakub@redhat.com>
2742         * tst-kill4.c (do_test): Explicitly set tf thread's stack size.
2744         * tst-cancel2.c (tf): Loop as long as something was written.
2746 2006-09-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2748         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: For PI
2749         mutexes wake all mutexes.
2750         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Don't increment
2751         WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2752         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2754 2006-09-12  Ulrich Drepper  <drepper@redhat.com>
2756         * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use
2757         to guarantee the thread is always canceled.
2759 2006-09-08  Jakub Jelinek  <jakub@redhat.com>
2761         * tst-cond22.c: Include pthread.h instead of pthreadP.h.
2762         Include stdlib.h.
2763         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Only
2764         increase FUTEX if increasing WAKEUP_SEQ.  Fix comment typo.
2765         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2766         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2767         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2769 2006-09-08  Ulrich Drepper  <drepper@redhat.com>
2771         [BZ #3123]
2772         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Don't
2773         increment WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2774         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2775         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2776         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2777         * Makefile (tests): Add tst-cond22.
2778         * tst-cond22.c: New file.
2780 2006-09-05  Ulrich Drepper  <drepper@redhat.com>
2782         [BZ #3124]
2783         * descr.h (struct pthread): Add parent_cancelhandling.
2784         * sysdeps/pthread/createthread.c (create_thread): Pass parent
2785         cancelhandling value to child.
2786         * pthread_create.c (start_thread): If parent thread was canceled
2787         reset the SIGCANCEL mask.
2788         * Makefile (tests): Add tst-cancel25.
2789         * tst-cancel25.c: New file.
2791 2006-09-05  Jakub Jelinek  <jakub@redhat.com>
2792             Ulrich Drepper  <drepper@redhat.com>
2794         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
2795         counterp if it is already zero.
2796         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
2798 2006-03-04  Jakub Jelinek  <jakub@redhat.com>
2799             Roland McGrath  <roland@redhat.com>
2801         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2802         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2803         LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
2804         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2805         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2806         lll_robust_mutex_timedlock, lll_mutex_unlock,
2807         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2808         Add _L_*_ symbols around the subsection.
2809         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
2810         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2812 2006-03-03  Jakub Jelinek  <jakub@redhat.com>
2813             Roland McGrath  <roland@redhat.com>
2815         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2816         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2817         LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
2818         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2819         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2820         lll_robust_mutex_timedlock, lll_mutex_unlock,
2821         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2822         Add _L_*_ symbols around the subsection.
2823         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
2824         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2826 2006-08-31  Ulrich Drepper  <drepper@redhat.com>
2828         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Undo last
2829         change because it can disturb too much existing code.  If real hard
2830         reader preference is needed we'll introduce another type.
2831         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2832         (pthread_rwlock_timedwrlock): Likewise.
2833         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2834         Likewise.
2836 2006-08-30  Ulrich Drepper  <drepper@redhat.com>
2838         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Respect
2839         reader preference.
2840         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2841         (pthread_rwlock_timedwrlock): Likewise.
2842         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2843         Likewise.
2845 2006-08-25  Jakub Jelinek  <jakub@redhat.com>
2847         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
2848         Only define ifdef SHARED.
2850 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
2852         * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
2853         (free_stacks): ...here.
2854         (__free_stack_cache): New function.
2855         * pthreadP.h: Declare __free_stack_cache.
2856         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
2857         ptr_freeres.
2858         * init.c (pthread_functions): Initialize ptr_freeres.
2859         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
2860         New freeres function.
2862 2006-07-30  Joseph S. Myers  <joseph@codesourcery.com>
2864         [BZ #3018]
2865         * Makefile (extra-objs): Add modules to extra-test-objs instead.
2867 2006-08-20  Ulrich Drepper  <drepper@redhat.com>
2869         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2870         _XOPEN_REALTIME_THREADS.
2872 2006-08-15  Jakub Jelinek  <jakub@redhat.com>
2874         * sysdeps/unix/sysv/linux/clock_settime.c (INTERNAL_VSYSCALL): Use
2875         HAVE_CLOCK_GETRES_VSYSCALL as guard macro rather than
2876         HAVE_CLOCK_GETTIME_VSYSCALL.
2877         (maybe_syscall_settime_cpu): Use plain INTERNAL_VSYSCALL here.
2879 2006-08-14  Jakub Jelinek  <jakub@redhat.com>
2881         * sysdeps/unix/sysv/linux/bits/posix_opt.h
2882         (_POSIX_THREAD_PRIO_PROTECT): Define to 200112L.
2883         * descr.h (struct priority_protection_data): New type.
2884         (struct pthread): Add tpp field.
2885         * pthreadP.h (PTHREAD_MUTEX_PP_NORMAL_NP,
2886         PTHREAD_MUTEX_PP_RECURSIVE_NP, PTHREAD_MUTEX_PP_ERRORCHECK_NP,
2887         PTHREAD_MUTEX_PP_ADAPTIVE_NP): New enum values.
2888         * pthread_mutex_init.c (__pthread_mutex_init): Handle non-robust
2889         TPP mutexes.
2890         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle TPP mutexes.
2891         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
2892         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
2893         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
2894         * tpp.c: New file.
2895         * pthread_setschedparam.c (__pthread_setschedparam): Handle priority
2896         boosted by TPP.
2897         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
2898         * pthread_mutexattr_getprioceiling.c
2899         (pthread_mutexattr_getprioceiling): If ceiling is 0, ensure it is
2900         in the SCHED_FIFO priority range.
2901         * pthread_mutexattr_setprioceiling.c
2902         (pthread_mutexattr_setprioceiling): Fix prioceiling validation.
2903         * pthread_mutex_getprioceiling.c (pthread_mutex_getprioceiling): Fail
2904         if mutex is not TPP.  Ceiling is now in __data.__lock.
2905         * pthread_mutex_setprioceiling.c: Include stdbool.h.
2906         (pthread_mutex_setprioceiling): Fix prioceiling validation.  Ceiling
2907         is now in __data.__lock.  Add locking.
2908         * pthread_create.c (__free_tcb): Free pd->tpp structure.
2909         * Makefile (libpthread-routines): Add tpp.
2910         (xtests): Add tst-mutexpp1, tst-mutexpp6 and tst-mutexpp10.
2911         * tst-tpp.h: New file.
2912         * tst-mutexpp1.c: New file.
2913         * tst-mutexpp6.c: New file.
2914         * tst-mutexpp10.c: New file.
2915         * tst-mutex1.c (TEST_FUNCTION): Don't redefine if already defined.
2916         * tst-mutex6.c (TEST_FUNCTION): Likewise.
2918 2006-08-12  Ulrich Drepper  <drepper@redhat.com>
2920         [BZ #2843]
2921         * pthread_join.c (pthread_join): Account for self being canceled
2922         when checking for deadlocks.
2923         * tst-join5.c: Cleanups.  Allow to be used in tst-join6.
2924         (tf1): Don't print anything after pthread_join returns, this would be
2925         another cancellation point.
2926         (tf2): Likewise.
2927         * tst-join6.c: New file.
2928         * Makefile (tests): Add tst-join6.
2930 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
2932         [BZ #2892]
2933         * pthread_setspecific.c (__pthread_setspecific): Check
2934         out-of-range index before checking for unused key.
2936         * sysdeps/pthread/gai_misc.h: New file.
2938 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
2940         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
2941         file.  Don't use sysctl.
2942         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
2943         overwrite the file if this is likely not true.
2945 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
2947         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
2948         * Makefile (tests): Add tst-getpid3.
2949         * tst-getpid3.c: New file.
2951 2006-07-30  Roland McGrath  <roland@redhat.com>
2953         * Makefile (libpthread-routines): Add ptw-sigsuspend.
2955         * sysdeps/unix/sysv/linux/i386/not-cancel.h
2956         (pause_not_cancel): New macro.
2957         (nanosleep_not_cancel): New macro.
2958         (sigsuspend_not_cancel): New macro.
2959         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
2960         nanosleep_not_cancel macro from <not-cancel.h>.
2961         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
2962         macro from <not-cancel.h>.
2964 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
2965             Jakub Jelinek  <jakub@redhat.com>
2967         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
2968         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
2969         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
2970         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
2971         * pthread_mutex_init.c: Add support for priority inheritance mutex.
2972         * pthread_mutex_lock.c: Likewise.
2973         * pthread_mutex_timedlock.c: Likewise.
2974         * pthread_mutex_trylock.c: Likewise.
2975         * pthread_mutex_unlock.c: Likewise.
2976         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
2977         all mutexes.
2978         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
2979         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
2980         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
2981         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
2982         pthread-pi-defines.sym.
2983         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
2984         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
2985         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2986         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2987         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2988         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2989         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2990         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2991         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2992         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2993         _POSIX_THREAD_PRIO_INHERIT to 200112L.
2994         * tst-mutex1.c: Adjust to allow use in PI mutex test.
2995         * tst-mutex2.c: Likewise.
2996         * tst-mutex3.c: Likewise.
2997         * tst-mutex4.c: Likewise.
2998         * tst-mutex5.c: Likewise.
2999         * tst-mutex6.c: Likewise.
3000         * tst-mutex7.c: Likewise.
3001         * tst-mutex7a.c: Likewise.
3002         * tst-mutex8.c: Likewise.
3003         * tst-mutex9.c: Likewise.
3004         * tst-robust1.c: Likewise.
3005         * tst-robust7.c: Likewise.
3006         * tst-robust8.c: Likewise.
3007         * tst-mutexpi1.c: New file.
3008         * tst-mutexpi2.c: New file.
3009         * tst-mutexpi3.c: New file.
3010         * tst-mutexpi4.c: New file.
3011         * tst-mutexpi5.c: New file.
3012         * tst-mutexpi6.c: New file.
3013         * tst-mutexpi7.c: New file.
3014         * tst-mutexpi7a.c: New file.
3015         * tst-mutexpi8.c: New file.
3016         * tst-mutexpi9.c: New file.
3017         * tst-robust1.c: New file.
3018         * tst-robust2.c: New file.
3019         * tst-robust3.c: New file.
3020         * tst-robust4.c: New file.
3021         * tst-robust5.c: New file.
3022         * tst-robust6.c: New file.
3023         * tst-robust7.c: New file.
3024         * tst-robust8.c: New file.
3025         * Makefile (tests): Add the new tests.
3027         * pthread_create.c (start_thread): Add some casts to avoid warnings.
3028         * pthread_mutex_destroy.c: Remove unneeded label.
3030 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
3032         * pthread_mutex_init.c (__pthread_mutex_init): Move some
3033         computations to compile time.
3035 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
3037         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
3039 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
3041         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
3043 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
3045         * pthread_key_create.c (__pthread_key_create): Do away with
3046         __pthread_keys_lock.
3048         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
3049         (__kernel_cpumask_size): Mark as hidden.
3050         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
3052         * sem_open.c (__sem_mappings_lock): Mark as hidden.
3053         * semaphoreP.h (__sem_mappings_lock): Likewise.
3055 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
3057         * pthread_atfork.c: Mark __dso_handle as hidden.
3059 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
3061         [BZ #2644]
3062         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
3063         the reload problem.  Change the one path in pthread_cancel_init
3064         which causes the problem.  Force gcc to reload.  Simplify callers.
3065         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
3066         (_Unwind_GetBSP): Undo last patch.
3068 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
3070         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
3071         function pointer is reloaded after pthread_cancel_init calls.
3073         [BZ #2644]
3074         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
3075         pointers are reloaded after pthread_cancel_init calls.
3077 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
3079         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
3080         __always_inline.
3082 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
3084         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3085         Allocate new object which is passed to timer_sigev_thread so that
3086         the timer can be deleted before the new thread is scheduled.
3088 2006-04-26  Roland McGrath  <roland@redhat.com>
3090         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
3092 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
3094         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
3095         suffix for conditional jumps.
3096         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
3097         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
3098         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
3099         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
3100         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
3101         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
3103         * init.c (sigcancel_handler): Compare with correct PID even if the
3104         thread is in the middle of a fork call.
3105         (sighandler_setxid): Likewise.
3106         Reported by Suzuki K P <suzuki@in.ibm.com> .
3108 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
3110         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
3112 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
3114         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
3115         fails [Coverity CID 105].
3117 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
3119         * sysdeps/pthread/pthread.h: Add nonnull attributes.
3121 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
3123         [BZ #2505]
3124         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
3125         Define __lll_rel_instr using lwsync.
3127 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
3129         * allocatestack.c (allocate_stack): Always initialize robust_head.
3130         * descr.h: Define struct robust_list_head.
3131         (struct pthread): Use robust_list_head in robust mutex list definition.
3132         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
3133         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
3134         (__pthread_initialize_minimal_internal): Register robust_list with
3135         the kernel.
3136         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
3137         Declare __set_robust_list_avail.
3138         * pthread_create.c (start_thread): Register robust_list of new thread.
3139         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
3140         waiters.
3141         * pthread_mutex_destroy.c: For robust mutexes don't look at the
3142         number of users, it's unreliable.
3143         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
3144         set_robust_list syscall is available.
3145         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
3146         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
3147         Set robust_head.list_op_pending before trying to lock a robust mutex.
3148         * pthread_mutex_timedlock.c: Likewise.
3149         * pthread_mutex_trylock.c: Likewise.
3150         * pthread_mutex_unlock.c: Likewise for unlocking.
3151         * Makefile (tests): Add tst-robust8.
3152         * tst-robust8.c: New file.
3154 2006-03-08  Andreas Schwab  <schwab@suse.de>
3156         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
3157         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
3159 2006-03-05  Roland McGrath  <roland@redhat.com>
3161         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
3162         and $config_os doesn't match *linux*.
3164 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
3166         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
3167         Use __syscall_error.
3168         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
3169         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
3170         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
3171         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
3172         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
3173         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
3175 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
3177         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
3179 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
3181         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
3182         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
3183         mutex.
3184         (__lll_robust_timedlock_wait): Likewise.
3185         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
3186         (__lll_robust_lock_wait): Likewise.
3187         (__lll_robust_timedlock_wait): Likewise.
3188         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
3189         (__lll_robust_lock_wait): Likewise.
3190         (__lll_robust_timedlock_wait): Likewise.
3192 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
3194         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
3195         lll_robust_mutex_trylock, lll_robust_mutex_lock,
3196         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
3197         lll_robust_mutex_unlock): Define.
3198         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
3200 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
3202         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
3203         instead of <clone.S>.
3205 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
3207         * Makefile (libpthread-routines): Add
3208         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
3209         and pthread_mutex_[sg]etprioceiling.
3210         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
3211         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
3212         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
3213         pthread_mutex_setprioceiling.
3214         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
3215         PTHREAD_PRIO_PROTECT): New enum values.
3216         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
3217         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
3218         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
3219         prototypes.
3220         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
3221         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
3222         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
3223         Define.
3224         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
3225         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
3226         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
3227         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
3228         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
3229         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
3230         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
3231         protocol mutexes.
3232         * pthread_mutex_getprioceiling.c: New file.
3233         * pthread_mutex_setprioceiling.c: New file.
3234         * pthread_mutexattr_getprioceiling.c: New file.
3235         * pthread_mutexattr_setprioceiling.c: New file.
3236         * pthread_mutexattr_getprotocol.c: New file.
3237         * pthread_mutexattr_setprotocol.c: New file.
3239 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
3241         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
3243 2006-02-27  Roland McGrath  <roland@redhat.com>
3245         * sysdeps/pthread/Subdirs: List nptl here too.
3246         * configure (libc_add_on_canonical): New variable.
3248         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
3250         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
3251         self to get main source tree's file.
3252         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
3253         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
3254         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
3255         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
3256         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
3257         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
3258         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
3259         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
3260         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
3261         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
3262         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
3263         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
3264         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
3266         * Makefile: Use $(sysdirs) in vpath directive.
3268         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
3269         (CPPFLAGS-timer_routines.c): Likewise.
3271         * Makeconfig (includes): Variable removed.
3273 2006-02-26  Roland McGrath  <roland@redhat.com>
3275         * sysdeps/generic/pt-raise.c: Moved to ...
3276         * pt-raise.c: ... here.
3277         * sysdeps/generic/lowlevellock.h: Moved to ...
3278         * lowlevellock.h: ... here.
3280 2006-02-23  Roland McGrath  <roland@redhat.com>
3282         * descr.h (struct pthread): Add final member `end_padding'.
3283         (PTHREAD_STRUCT_END_PADDING): Use it.
3285 2006-02-20  Roland McGrath  <roland@redhat.com>
3287         * sysdeps/mips: Directory removed, saved in ports repository.
3288         * sysdeps/unix/sysv/linux/mips: Likewise.
3290 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
3292         * tst-robust1.c: Add second mutex to check that the mutex list is
3293         handled correctly.
3295 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
3297         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
3298         lll_robust_mutex_trylock, lll_robust_mutex_lock,
3299         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
3300         lll_robust_mutex_unlock): New macros.
3301         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
3302         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
3303         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3304         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3305         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
3307 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3309         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
3310         definitions.
3311         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
3313 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
3315         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
3316         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
3317         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
3318         (lll_robust_mutex_unlock): Likewise.
3320 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
3322         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
3323         Set robust_list.__next rather than robust_list.
3324         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
3325         (__pthread_list_t): New typedef.
3326         (pthread_mutex_t): Replace __next and __prev fields with __list.
3327         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
3328         (__pthread_list_t): New typedef.
3329         (pthread_mutex_t): Replace __next and __prev fields with __list.
3330         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3331         (__pthread_list_t, __pthread_slist_t): New typedefs.
3332         (pthread_mutex_t): Replace __next and __prev fields with __list.
3333         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
3334         (__pthread_list_t, __pthread_slist_t): New typedefs.
3335         (pthread_mutex_t): Replace __next and __prev fields with __list.
3336         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
3337         (__pthread_list_t, __pthread_slist_t): New typedefs.
3338         (pthread_mutex_t): Replace __next and __prev fields with __list.
3339         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
3340         (__pthread_slist_t): New typedef.
3341         (pthread_mutex_t): Replace __next field with __list.
3343 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
3345         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
3346         PTHREAD_MUTEX_OWNERDEAD.
3347         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
3348         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
3349         * Makefile (libpthread-routines): Add lowlevelrobustlock.
3350         * pthread_create.c (start_thread): Very much simplify robust_list loop.
3351         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
3352         to PTHREAD_MUTEX_INCONSISTENT.
3353         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
3354         * pthread_mutex_lock.c: Reimplement robust mutex handling.
3355         * pthread_mutex_trylock.c: Likewise.
3356         * pthread_mutex_timedlock.c: Likewise.
3357         * pthread_mutex_unlock.c: Likewise.
3358         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
3359         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
3360         lowlevelrobustlock.sym.
3361         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
3362         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
3363         definitions.
3364         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3365         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
3366         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
3367         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
3368         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
3370 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
3372         * allocatestack.c (allocate_stack): Initialize robust_list.
3373         * init.c (__pthread_initialize_minimal_internal): Likewise.
3374         * descr.h (struct xid_command): Pretty printing.
3375         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
3376         robust_list.  Adjust macros.
3377         * pthread_create.c (start_thread): Adjust robust_list handling.
3378         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
3379         but the owner for all robust mutex types.
3380         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
3381         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
3382         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3383         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
3385         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
3386         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
3388 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
3390         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
3391         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
3393 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3395         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
3396         Return status.
3397         (lll_futex_timed_wait): Define.
3399 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
3401         * tst-cancel4.c: Test ppoll.
3403 2006-01-18  Andreas Jaeger  <aj@suse.de>
3405         [BZ #2167]
3406         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
3407         (pthread_mutex_t): Follow changes for other archs.  Based on patch
3408         by Jim Gifford <patches@jg555.com>.
3410 2006-01-13  Richard Henderson  <rth@redhat.com>
3412         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
3414 2006-01-10  Roland McGrath  <roland@redhat.com>
3416         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
3417         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
3418         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
3419         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3420         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3421         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3422         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3423         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
3424         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
3425         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3427 2006-01-09  Roland McGrath  <roland@redhat.com>
3429         * tst-initializers1-c89.c: New file.
3430         * tst-initializers1-c99.c: New file.
3431         * tst-initializers1-gnu89.c: New file.
3432         * tst-initializers1-gnu99.c: New file.
3433         * Makefile (tests): Add them.
3434         (CFLAGS-tst-initializers1-c89.c): New variable.
3435         (CFLAGS-tst-initializers1-c99.c): New variable.
3436         (CFLAGS-tst-initializers1-gnu89.c): New variable.
3437         (CFLAGS-tst-initializers1-gnu99.c): New variable.
3439         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3440         Use __extension__ on anonymous union definition.
3441         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3442         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3443         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3444         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3445         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3447 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
3449         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
3450         Don't give the union a name because it changes the mangled name.
3451         Instead name the struct for __data.
3452         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
3453         Likewise.
3454         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
3455         Likewise.
3457 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
3459         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
3460         stack bias to mc_ftp field.
3462 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
3464         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
3465         being too clever and reloading the futex value where it shouldn't.
3467 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
3469         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
3470         correct type.
3472 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
3474         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
3475         Add cfi directives.
3477 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
3479         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
3480         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
3481         rename in tcbhead_t.
3483         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3484         Don't give the union a name because it changes the mangled name.
3485         Instead name the struct for __data.
3486         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3487         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3488         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3489         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3490         * pthread_create.c (start_thread): Adjust robust mutex free loop.
3491         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
3493 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
3495         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
3496         Return status.
3497         (lll_futex_timed_wait): Define.
3498         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3499         * sysdeps/pthread/aio_misc.h: New file.
3501 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
3503         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
3505 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
3507         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3508         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
3509         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
3511 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
3513         * tst-cancel24.cc: Use C headers instead of C++ headers.
3515 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
3517         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
3518         sparc-linux configured glibc.
3519         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
3520         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
3521         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
3522         atomic_compare_and_exchange_val_24_acq instead of
3523         atomic_compare_and_exchange_val_acq.
3524         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
3525         instead of atomic_exchange_rel.
3526         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
3527         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
3528         file.
3529         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
3530         file.
3531         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
3532         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
3533         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
3534         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
3535         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
3536         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
3537         New file.
3538         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
3539         New file.
3540         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
3541         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
3542         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
3543         file.
3544         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
3545         file.
3546         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
3548 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
3550         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
3551         mutex initializers.
3553 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
3555         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
3556         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3557         THREAD_COPY_POINTER_GUARD): Define.
3558         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
3559         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
3561 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
3563         * version.c: Update copyright year.
3565 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3567         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
3568         .eh_frame section, use cfi_* directives.
3569         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
3571 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
3573         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
3574         now.
3576 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
3578         * sysdeps/pthread/sigaction.c: Removed.
3579         * sigaction.c: New file.
3580         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
3582 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
3584         * Makefile (tests): Add tst-signal7.
3585         * tst-signal7.c: New file.
3587 2005-12-27  Roland McGrath  <roland@redhat.com>
3589         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
3590         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
3591         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
3592         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
3593         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
3594         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3595         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3596         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3597         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3598         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
3599         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3601 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
3603         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
3604         and __prev field to pthread_mutex_t.
3605         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3606         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3607         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3608         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3609         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
3610         to pthread_mutex_t.
3612 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
3614         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
3615         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
3616         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
3617         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
3618         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
3619         and PTHREAD_MUTEXATTR_FLAG_BITS.
3620         * descr.h (struct pthread): Add robust_list field and define
3621         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
3622         * pthread_mutexattr_getrobust.c: New file.
3623         * pthread_mutexattr_setrobust.c: New file.
3624         * pthread_mutex_consistent.c: New file.
3625         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
3626         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
3627         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
3628         Adjust pthread_mutex_t initializers.
3629         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
3630         field to pthread_mutex_t.
3631         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
3632         and __prev field to pthread_mutex_t.
3633         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
3634         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
3635         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
3636         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
3637         * pthread_mutexattr_gettype.c: Likewise.
3638         * pthread_mutexattr_setpshared.c: Likewise.
3639         * pthread_mutexattr_settype.c: Likewise.
3640         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
3641         Initialize mutex kind according to robust flag.
3642         * pthread_mutex_lock.c: Implement local robust mutex.
3643         * pthread_mutex_timedlock.c: Likewise.
3644         * pthread_mutex_trylock.c: Likewise.
3645         * pthread_mutex_unlock.c: Likewise.
3646         * pthread_create.c (start_thread): Mark robust mutexes which remained
3647         locked as dead.
3648         * tst-robust1.c: New file.
3649         * tst-robust2.c: New file.
3650         * tst-robust3.c: New file.
3651         * tst-robust4.c: New file.
3652         * tst-robust5.c: New file.
3653         * tst-robust6.c: New file.
3654         * tst-robust7.c: New file.
3655         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
3656         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
3657         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
3658         tst-robust5, tst-robust6, and tst-robust7.
3660         * tst-typesizes.c: New file.
3661         * Makefile (tests): Add tst-typesizes.
3663         * tst-once3.c: More debug output.
3665 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
3667         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
3668         missing after last change.
3670         * version.c: Update copyright year.
3672 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
3674         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
3675         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
3676         * pthread_mutex_trylock.c: Likewise.
3677         * pthread_mutex_timedlock.c: Likewise.
3678         * pthread_mutex_unlock.c: Likewise.
3680 2005-12-22  Roland McGrath  <roland@redhat.com>
3682         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
3683         so that #include_next's search location is not reset to the -I..
3684         directory where <nptl/...> can be found.
3686 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
3688         [BZ #1913]
3689         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3690         Fix unwind info.  Remove useless branch prediction prefix.
3691         * tst-cancel24.cc: New file.
3692         * Makefile: Add rules to build and run tst-cancel24.
3694 2005-12-21  Roland McGrath  <roland@redhat.com>
3696         * libc-cancellation.c: Use <> rather than "" #includes.
3697         * pt-cleanup.c: Likewise.
3698         * pthread_create.c: Likewise.
3699         * pthread_join.c: Likewise.
3700         * pthread_timedjoin.c: Likewise.
3701         * pthread_tryjoin.c: Likewise.
3702         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
3703         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
3704         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
3705         * unwind.c: Likewise.
3707 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3709         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
3710         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
3711         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3712         THREAD_COPY_POINTER_GUARD): Define.
3714 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
3716         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
3717         rather than one.
3718         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3719         THREAD_COPY_POINTER_GUARD): Define.
3720         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
3721         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
3722         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3723         THREAD_COPY_POINTER_GUARD): Define.
3724         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
3725         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
3726         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
3727         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
3728         Use PTR_DEMANGLE for B0 if defined.
3730 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
3732         * pthread_create.c (__pthread_create_2_1): Use
3733         THREAD_COPY_POINTER_GUARD if available.
3734         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
3735         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3736         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
3737         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
3738         * sysdeps/x86_64/tls.h: Likewise.
3740 2005-12-15  Roland McGrath  <roland@redhat.com>
3742         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
3744 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
3746         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
3747         sysdeps/generic.
3748         * errno-loc.c: New file.
3750 2005-12-12  Roland McGrath  <roland@redhat.com>
3752         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
3753         adjustments before choosing stack size.  Update minimum stack size
3754         calculation to match allocate_stack change.
3756 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
3758         * allocatestack.c (allocate_stack): Don't demand that there is an
3759         additional full page available on the stack beside guard, TLS, the
3760         minimum stack.
3762 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
3764         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3765         (__cleanup_fct_attribute): Use __regparm__ not regparm.
3767         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
3768         compiling 32-bit code we must define __cleanup_fct_attribute.
3770 005-11-24  Jakub Jelinek  <jakub@redhat.com>
3772         [BZ #1920]
3773         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
3774         __attribute__ instead of __attribute.
3775         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3776         (__cleanup_fct_attribute): Likewise.
3778 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
3780         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
3781         a write barrier before writing libgcc_s_getcfa.
3783 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
3785         * sysdeps/unix/sysv/linux/configure: Removed.
3787 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
3789         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
3790         optional init_array/fini_array support.
3792 2005-10-24  Roland McGrath  <roland@redhat.com>
3794         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
3795         versioned_symbol use.
3797 2005-10-16  Roland McGrath  <roland@redhat.com>
3799         * init.c (__pthread_initialize_minimal_internal): Even when using a
3800         compile-time default stack size, apply the minimum that allocate_stack
3801         will require, and round up to page size.
3803 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
3805         * Makefile ($(test-modules)): Remove static pattern rule.
3807 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
3808             Ulrich Drepper  <drepper@redhat.com>
3810         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
3811         alignment in callback function.
3812         * Makefile: Add rules to build and run tst-align3.
3813         * tst-align3.c: New file.
3815 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
3817         * allocatestack.c (setxid_signal_thread): Add
3818         INTERNAL_SYSCALL_DECL (err).
3820 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
3822         * allocatestack.c (setxid_signal_thread): Need to use
3823         atomic_compare_and_exchange_bool_acq.
3825 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
3826             Jakub Jelinek  <jakub@redhat.com>
3828         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
3829         CANCEL_RESTMASK.
3830         (struct pthread): Move specific_used field to avoid padding.
3831         Add setxid_futex field.
3832         * init.c (sighandler_setxid): Reset setxid flag and release the
3833         setxid futex.
3834         * allocatestack.c (setxid_signal_thread): New function.  Broken
3835         out of the bodies of the two loops in __nptl_setxid.  For undetached
3836         threads check whether they are exiting and if yes, don't send a signal.
3837         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
3838         * pthread_create.c (start_thread): For undetached threads, check
3839         whether setxid bit is set.  If yes, wait until signal has been
3840         processed.
3842         * allocatestack.c (STACK_VARIABLES): Initialize them.
3843         * pthread_create.c (__pthread_create_2_1): Initialize pd.
3845 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
3847         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
3848         waiters, awake all waiters on the associated mutex.
3850 2005-09-22  Roland McGrath  <roland@redhat.com>
3852         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
3853         ../sysdeps/x86_64/hp-timing.h).
3855 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
3857         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
3858         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3859         (lll_futex_wake_unlock): Define.
3860         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
3861         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3862         (lll_futex_wake_unlock): Define.
3863         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
3864         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3865         (lll_futex_wake_unlock): Define.
3866         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
3867         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3868         (lll_futex_wake_unlock): Define.
3869         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
3870         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3871         (lll_futex_wake_unlock): Define.
3872         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
3873         lll_futex_wake_unlock.
3874         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3875         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3876         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3877         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
3878         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3879         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3881 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3883         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
3884         Fix typo in register name.
3886 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
3888         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3889         Use __sigfillset.  Document that sigfillset does the right thing wrt
3890         to SIGSETXID.
3892 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3894         [BZ #1102]
3895         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
3896         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
3897         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
3898         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
3899         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
3900         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
3901         in the structure.
3902         * Makefile (tests): Add tst-initializers1.
3903         (CFLAGS-tst-initializers1.c): Set.
3904         * tst-initializers1.c: New test.
3906 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3908         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
3909         Make sure __flags are located at offset 48 from the start of the
3910         structure.
3912 2005-07-02  Roland McGrath  <roland@redhat.com>
3914         * Makeconfig: Comment fix.
3916 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
3918         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
3919         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
3920         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
3921         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
3922         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3923         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3924         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
3925         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
3926         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
3927         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3929 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
3931         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
3932         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3933         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
3934         fields.
3935         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3936         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
3937         field.  Put in sysinfo field unconditionally.
3938         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3939         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
3940         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3941         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
3942         fields.
3943         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3944         * pthread_create.c (__pthread_create_2_1): Use
3945         THREAD_COPY_STACK_GUARD macro.
3946         * Makefile: Add rules to build and run tst-stackguard1{,-static}
3947         tests.
3948         * tst-stackguard1.c: New file.
3949         * tst-stackguard1-static.c: New file.
3951 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
3953         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
3954         Invoke CGOTSETUP and CGOTRESTORE.
3955         (CGOTSETUP, CGOTRESTORE): Define.
3957 2005-05-29  Richard Henderson  <rth@redhat.com>
3959         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
3960         (tf_write, tf_writev): Use it.
3961         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
3962         the system minimum.
3964 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
3966         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3967         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
3968         __librt_*_asynccancel@local.
3970 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
3972         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
3973         all occurrences of JUMPTARGET.  Instead append @local to labels.
3975 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
3977         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
3978         size/alignment of struct pthread rather than tcbhead_t.
3979         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3980         Likewise.
3981         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3982         Likewise.
3983         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3984         Likewise.
3986 2005-05-19  Richard Henderson  <rth@redhat.com>
3988         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
3989         __sync_val_compare_and_swap, not explicit _si variant.
3990         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
3992 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
3994         [BZ #915]
3995         * sysdeps/pthread/pthread.h: Avoid empty initializers.
3997 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
3999         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
4000         .eh_frame section, use cfi_* directives.
4002 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
4004         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
4005         of "" includes.
4007 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
4009         [BZ #1075]
4010         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
4011         aio_write blocks.
4013 2005-04-27  Roland McGrath  <roland@redhat.com>
4015         * Makefile (tests): Remove tst-clock2.
4017         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
4018         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
4019         translating to the kernel clockid_t for our own process/thread clock.
4021         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
4023 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
4025         * old_pthread_cond_init.c: Include <errno.h>.
4026         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
4027         process shared or uses clock other than CLOCK_REALTIME.
4028         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
4030 2005-04-13  David S. Miller  <davem@davemloft.net>
4032         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
4033         * sysdeps/sparc/sparc64/clone.S: New file.
4035 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
4037         [BZ #1102]
4038         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
4039         __inline instead of inline.
4040         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
4042 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
4044         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
4045         functionally equivalent, but shorter instructions.
4046         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
4047         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4048         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
4049         Likewise.
4050         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
4051         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
4052         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4053         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
4054         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4055         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
4056         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
4057         Likewise.
4058         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
4059         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
4060         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4061         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
4062         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
4064 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
4066         * sysdeps/mips/Makefile: New file.
4067         * sysdeps/mips/nptl-sysdep.S: New file.
4068         * sysdeps/mips/tcb-offsets.sym: New file.
4069         * sysdeps/mips/pthread_spin_lock.S: New file.
4070         * sysdeps/mips/pthread_spin_trylock.S: New file.
4071         * sysdeps/mips/pthreaddef.h: New file.
4072         * sysdeps/mips/tls.h: New file.
4073         * sysdeps/mips/jmpbuf-unwind.h: New file.
4074         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
4075         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
4076         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
4077         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
4078         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
4079         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
4080         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
4081         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
4082         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
4083         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
4085 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
4087         [BZ #1112]
4088         * pthread_create.c (__pthread_create_2_1): Rename syscall error
4089         variable to scerr.
4091 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
4093         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
4095 2005-02-25  Roland McGrath  <roland@redhat.com>
4097         * alloca_cutoff.c: Correct license text.
4098         * tst-unload.c: Likewise.
4099         * sysdeps/pthread/allocalim.h: Likewise.
4100         * sysdeps/pthread/pt-initfini.c: Likewise.
4101         * sysdeps/pthread/bits/libc-lock.h: Likewise.
4102         * sysdeps/pthread/bits/sigthread.h: Likewise.
4103         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
4104         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
4106 2005-02-16  Roland McGrath  <roland@redhat.com>
4108         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
4109         Use unsigned int * for ptr_nthreads.
4111 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
4113         [BZ #721]
4114         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
4115         gcc4.
4117 2005-02-07  Richard Henderson  <rth@redhat.com>
4119         [BZ #787]
4120         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
4121         argument.
4123 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
4125         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
4126         order of arguments in invocation of atomic_add_zero.
4128 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
4130         [BZ #737]
4131         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
4132         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
4133         at least gotntpoff relocation and addition.
4134         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
4135         Likewise.
4136         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
4137         Likewise.
4138         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
4139         Likewise.
4141 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
4143         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
4144         entry for static tls deallocation fix.
4145         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
4146         also contains information whether the memory pointed to is static
4147         TLS or not.
4148         * sysdeps/i386/tls.h: Likewise.
4149         * sysdeps/ia64/tls.h: Likewise.
4150         * sysdeps/powerpc/tls.h: Likewise.
4151         * sysdeps/s390/tls.h: Likewise.
4152         * sysdeps/sh/tls.h: Likewise.
4153         * sysdeps/sparc/tls.h: Likewise.
4154         * sysdeps/x86_64/tls.h: Likewise.
4156 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
4158         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
4160 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
4162         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
4163         %esp.
4164         * Makefile (tests): Add tst-align2.
4165         * tst-align2.c: New test.
4166         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
4167         -mpreferred-stack-boundary=4.
4169 2004-12-18  Roland McGrath  <roland@redhat.com>
4171         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
4172         New file removed withdrawn for the moment.
4174 2004-12-17  Richard Henderson  <rth@redhat.com>
4176         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
4177         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
4179 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
4181         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
4182         Increased PTHREAD_STACK_MIN.
4184         * tst-context1.c (stacks): Use bigger stack size.
4186 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
4188         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
4189         * sysdeps/sparc/tcb-offsets.sym: Add TID.
4191 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
4193         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
4194         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
4195         * sysdeps/s390/tcb-offsets.sym (TID): Add.
4197 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
4199         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
4201 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
4203         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
4204         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
4206         * tst-getpid1.c: If child crashes, report this first.  Print which
4207         signal.
4209 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
4211         * init.c (__pthread_initialize_minimal_internal): Also unblock
4212         SIGSETXID.
4214 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4216         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
4217         _POSIX_THREAD_CPUTIME): Define to 0.
4218         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
4219         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
4220         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
4221         __timer_signal_thread_tclk): Remove.
4222         (init_module): Remove their initialization.
4223         (thread_cleanup): Remove their cleanup assertions.
4224         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
4225         __timer_signal_thread_tclk): Remove.
4226         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
4227         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
4228         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
4230 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
4232         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
4233         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
4235         * Makefile (tests): Add tst-getpid2.
4236         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
4237         (do_test): Use it.  Use __clone2 instead of clone on ia64.
4238         * tst-getpid2.c: New test.
4240 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4242         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
4244 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
4246         * Makefile (tests): Add tst-getpid1.
4247         * tst-getpid1.c: New file.
4248         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
4249         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
4251 2004-12-02  Roland McGrath  <roland@redhat.com>
4253         * Makefile (libpthread-nonshared): Variable removed.
4254         ($(objpfx)libpthread_nonshared.a): Target removed.
4255         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
4256         These are now handled by generic magic from
4257         libpthread-static-only-routines being set.
4259 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
4261         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
4262         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
4263         _POSIX_THREAD_PRIO_PROTECT): Define.
4264         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4265         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4266         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
4268 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
4270         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
4271         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
4272         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
4273         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
4274         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4275         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4276         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
4278 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
4280         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
4282         * Makefile (libpthread-routines): Add pthread_setschedprio.
4283         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
4284         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
4285         * pthread_setschedprio.c: New file.
4287 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
4289         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
4290         * pthread_cancel.c (pthread_create): Likewise.
4292         * Makefile (libpthread-routines): Add vars.
4293         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
4294         * init.c (__default_stacksize, __is_smp): Remove.
4295         * vars.c: New file.
4296         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
4297         and define a wrapper macro.
4298         (PTHREAD_STATIC_FN_REQUIRE): Define.
4299         * allocatestack.c (__find_thread_by_id): Undefine.
4300         * pthread_create (__pthread_keys): Remove.
4301         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
4302         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
4303         PTHREAD_STATIC_FN_REQUIRE.
4305 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4307         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
4308         parameter to REGISTER macro.
4310 2004-11-17  Roland McGrath  <roland@redhat.com>
4312         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
4313         Make sure SIGCANCEL is blocked as well.
4315 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
4317         * sysdeps/pthread/setxid.h: New file.
4318         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
4319         (struct xid_command): Add forward decl.
4320         (struct pthread_functions): Change return type of __nptl_setxid hook
4321         to int.
4322         * pthreadP.h (__nptl_setxid): Change return type to int.
4323         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
4324         calling thread, return its return value and set errno on failure.
4325         * descr.h (struct xid_command): Change id type to long array.
4327         * Makefile: Add rules to build and test tst-setuid1 and
4328         tst-setuid1-static.
4329         * tst-setuid1.c: New test.
4330         * tst-setuid1-static.c: New test.
4332 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
4334         * Makefile (tests): Add tst-exit3.
4335         * tst-exit3.c: New test.
4337 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
4339         * Makefile (tests): Add tst-exit2.
4340         * tst-exit2.c: New file.
4342 2004-11-09  Roland McGrath  <roland@redhat.com>
4344         [BZ #530]
4345         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
4346         here, before calling clone.
4347         * pthread_create.c (start_thread): Don't do it here.
4349 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
4351         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
4353 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
4355         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
4356         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
4357         assembler warning.
4359 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
4361         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
4362         if sched_priority is not between minprio and maxprio.
4364 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4366         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4367         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
4369         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
4370         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
4372 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
4374         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
4375         not-cancelable I/O functions.
4377 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4379         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
4380         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
4381         make sure 2 is stored in the futex and we looked at the old value.
4382         Fix a few other problems to return the correct value.
4384 2004-10-14  Richard Henderson  <rth@redhat.com>
4386         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
4387         make gcc4 happy.
4389 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
4391         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
4392         of pthread-functions.h and pthreaddef.h.
4393         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
4395         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4396         Change __data.__nwaiters from int to unsigned int.
4398         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
4399         sysconf (_SC_THREAD_CPUTIME) returns negative value.
4401         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
4402         before return type.
4404         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
4405         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
4407 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
4409         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
4410         test fails, remove message queue.
4411         (tf_msgsnd): Likewise.
4413 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
4415         * tst-clock1.c: Change #ifdef to #if defined.
4416         * tst-clock2.c: Likewise.
4417         * tst-cond11.c: Likewise.
4419         * sysdeps/pthread/timer_create.c (timer_create): Use
4420         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
4421         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
4422         THREAD_CPUTIME.
4424 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
4426         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
4427         _POSIX_THREAD_CPUTIME): Define to 0.
4429 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
4431         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
4432         and _POSIX_THREAD_CPUTIME to zero.
4433         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4434         * tst-barrier2.c: Fix testing for POSIX feature.
4435         * tst-clock1.c: Likewise.
4436         * tst-clock2.c: Likewise.
4437         * tst-cond11.c: Likewise.
4438         * tst-cond4.c: Likewise.
4439         * tst-cond6.c: Likewise.
4440         * tst-flock2.c: Likewise.
4441         * tst-mutex4.c: Likewise.
4442         * tst-mutex9.c: Likewise.
4443         * tst-rwlock12.c: Likewise.
4444         * tst-rwlock4.c: Likewise.
4445         * tst-signal1.c: Likewise.
4446         * tst-spin2.c: Likewise.
4447         * sysdeps/pthread/posix-timer.h: Likewise.
4448         * sysdeps/pthread/timer_create.c: Likewise.
4449         * sysdeps/pthread/timer_routines.c: Likewise.
4451 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
4453         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4454         (__lll_mutex_timedlock_wait): Address futex correctly.
4456         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4457         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
4458         make sure 2 is stored in the futex and we looked at the old value.
4459         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4460         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
4461         which might very well made the code not working at all before.
4462         [BZ #417]
4464 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
4466         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
4467         allow SIGSETXID to be sent.
4468         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
4469         for SIGSETXID to be defined.
4470         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
4471         SIGSETXID cannot be blocked.
4473         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4474         Add __extension__ to long long types.
4475         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4476         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4477         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4478         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4479         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
4480         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4481         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4483 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
4485         * descr.h (struct pthread): Add stopped_start field.
4486         * sysdeps/pthread/createthread.c (create_thread): Set
4487         start_stopped flag in descriptor for new thread appropriately.
4488         * pthread_create.c (start_thread): Only take lock to be stopped on
4489         startup if stopped_start flag says so.
4491 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
4493         * pthread_create.c (__pthread_create_2_1): Remember whether thread
4494         is created detached and if yes, do not try to free the stack in case
4495         the thread creation failed.
4496         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
4497         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
4498         case there has been no error.  [BZ #405]
4500         * pthread_create.c (start_thread): Don't wait for scheduler data
4501         etc to be set at the beginning of the function.  The cancellation
4502         infrastructure must have been set up.  And enable async
4503         cancellation before potentially going to sleep.  [BZ #401]
4505 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
4507         * Versions: Remove exports for pthread_set*id_np functions.
4508         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
4509         for now.
4510         * Makefile: Don't build pthread_set*id code for now.
4512 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
4514         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
4515         internal use.
4516         * allocatestack.c (__nptl_setxid): New function.
4517         * descr.h (struct xid_command): Define type.
4518         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
4519         (sighandler_setxid): New function.
4520         (__pthread_initialize_minimal): Register sighandler_setxid for
4521         SIGCANCEL.
4522         * pt-allocrtsig.c: Update comment.
4523         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
4524         Declare __nptl_setxid.
4525         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
4526         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
4527         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
4528         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
4529         and pthread_setresuid_np.
4530         * pthread_setgid_np.c: New file.
4531         * pthread_setuid_np.c: New file.
4532         * pthread_setegid_np.c: New file.
4533         * pthread_seteuid_np.c: New file.
4534         * pthread_setregid_np.c: New file.
4535         * pthread_setreuid_np.c: New file.
4536         * pthread_setresgid_np.c: New file.
4537         * pthread_setresuid_np.c: New file.
4538         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
4539         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
4540         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
4541         and pthread_setresuid_np.
4542         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
4543         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
4544         pthread_setregid, and pthread_setresgid.
4546 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
4548         * allocatestack.c (allocate_stack): Return EAGAIN instead of
4549         ENOMEM when out of memory.
4551 2004-09-10  Roland McGrath  <roland@redhat.com>
4553         [BZ #379]
4554         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
4555         code, since we don't try to use the broken CLONE_STOPPED any more.
4556         * pthread_create.c (start_thread): Likewise.
4558 2004-09-15  Richard Henderson  <rth@redhat.com>
4560         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
4562 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
4564         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
4565         (__libc_unwind_longjmp): Delete macro and declare as function.
4566         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
4567         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
4568         nptl directory.
4569         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
4570         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
4571         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
4573 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
4575         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
4576         for __USE_XOPEN2K.
4577         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
4578         types also for __USE_XOPEN2K.
4579         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4580         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4581         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4582         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4583         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4584         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4585         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4586         [BZ #320]
4588 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
4590         * sysdeps/pthread/pthread.h
4591         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
4592         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
4593         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
4594         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
4595         [BZ #375]
4597 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
4599         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
4600         PSEUDO to be used with . prefix.
4602         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
4603         Use atomic_increment instead of atomic_exchange_and_add.
4604         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
4605         Likewise.
4606         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
4607         Likewise.
4608         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
4609         Likewise.
4611         * allocatestack.c (allocate_stack): Use atomic_increment_val
4612         instead of atomic_exchange_and_add.
4613         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
4614         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
4615         Likewise.
4616         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4617         Likewise.
4619         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
4620         the initialization function might throw.
4622 2005-09-05  Richard Henderson  <rth@redhat.com>
4624         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
4625         Move definition inside libpthread, libc, librt check.  Provide
4626         definition for rtld.
4628 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
4630         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
4631         * sysdeps/i386/jmpbuf-unwind.h: Likewise
4632         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
4633         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
4634         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
4635         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
4636         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
4637         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
4638         * unwind.c: Use it.
4640         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4641         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
4642         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4643         Likewise.
4644         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4645         Decrement __nwaiters.  If pthread_cond_destroy has been called and
4646         this is the last waiter, signal pthread_cond_destroy caller and
4647         avoid using the pthread_cond_t structure after unlock.
4648         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4649         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4650         Read clock type from the least significant bits of __nwaiters instead
4651         of __clock.
4652         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4653         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
4655 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
4657         [BZ #342]
4658         * Makefile (tests): Add tst-cond20 and tst-cond21.
4659         * tst-cond20.c: New test.
4660         * tst-cond21.c: New test.
4661         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
4662         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
4663         it unsigned int.
4664         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4665         Likewise.
4666         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4667         (pthread_cond_t): Likewise.
4668         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4669         Likewise.
4670         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4671         Likewise.
4672         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4673         Likewise.
4674         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
4675         (cond_nwaiters): New.
4676         (clock_bits): New.
4677         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
4678         if there are waiters not signalled yet.
4679         Wait until all already signalled waiters wake up.
4680         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
4681         __nwaiters.  If pthread_cond_destroy has been called and this is the
4682         last waiter, signal pthread_cond_destroy caller and avoid using
4683         the pthread_cond_t structure after unlock.
4684         (__pthread_cond_wait): Increment __nwaiters in the beginning,
4685         decrement it when leaving.  If pthread_cond_destroy has been called
4686         and this is the last waiter, signal pthread_cond_destroy caller.
4687         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4688         Likewise.  Read clock type from the least significant bits of
4689         __nwaiters instead of __clock.
4690         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
4691         whether clock ID can be encoded in COND_CLOCK_BITS bits.
4692         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
4693         clock type just from the last COND_CLOCK_BITS bits of value.
4694         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
4695         instead of __clock, just from second bit of condattr's value.
4697 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
4699         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
4700         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
4701         != 64.
4702         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4704 2004-08-15  Roland McGrath  <roland@frob.com>
4706         * pthread_atfork.c: Update copyright terms including special exception
4707         for these trivial files, which are statically linked into executables
4708         that use dynamic linking for the significant library code.
4710 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
4712         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
4713         pthread_rwlock_rdlock.
4714         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
4715         Decrease __nr_readers_queued after reacquiring lock.
4716         * sysdeps/pthread/pthread_rwlock_timedrdlock
4717         (pthread_rwlock_timedrdlock): Likewise.
4718         Reported by Bob Cook <bobcook47@hotmail.com>.
4720 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
4722         * tst-rwlock14.c (tf): Read main thread handle from *ARG
4723         before pthread_barrier_wait.
4725 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
4727         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
4728         Remove unnecessary exception handling data.
4730 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
4732         [BZ #284]
4733         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
4734         instead of clockid_t.
4736 2004-07-21  Roland McGrath  <roland@redhat.com>
4738         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
4740 2004-07-19  Roland McGrath  <roland@redhat.com>
4742         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
4744 2004-07-02  Roland McGrath  <roland@redhat.com>
4746         * configure: Don't exit.
4748 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4750         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4751         (__pthread_cond_timedwait): Check for invalid nanosecond in
4752         timeout value.
4754 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
4756         * Makefile: Add rules to build and run tst-fini1.
4757         * tst-fini1.c: New file.
4758         * tst-fini1mod.c: New file.
4760 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
4762         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
4763         if no cancellation support is needed.
4764         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
4765         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
4766         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4767         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
4768         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
4769         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
4770         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
4771         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
4772         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
4774         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
4775         only if not already defined.
4777 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
4779         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
4780         constraint "m" instead of "0" for futex.
4782         * shlib-versions: Add powerpc64-.*-linux.*.
4784 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
4786         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
4787         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
4788         for valid tv_nsec.
4789         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
4790         1 billion and 64-bit tv_nsec which is valid when truncated to 32
4791         bits.
4793 2004-06-29  Roland McGrath  <roland@redhat.com>
4795         * Banner: NPTL no longer has its own version number.
4796         * Makefile (nptl-version): Variable removed.
4797         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
4798         using $(version), the glibc version number.
4800 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4802         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4803         Fix branch offset for a PLT entry.
4804         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
4805         Likewise.
4806         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
4807         Likewise.
4808         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
4809         Likewise.
4810         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
4811         Likewise.
4813 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4815         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
4816         unconditionally.
4818 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4820         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
4821         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
4822         instead of tv_sec.
4823         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
4824         (pthread_rwlock_timedrdlock): Likewise.
4826 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
4828         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4829         Set __r7 to val, not mutex.
4831 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
4833         * Makefile: Add rules to build tst-rwlock14.
4834         * tst-rwlock14.c: New file.
4836 2004-06-24  Boris Hu  <boris.hu@intel.com>
4838         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
4839         check.
4840         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
4842 2004-06-19  Andreas Jaeger  <aj@suse.de>
4844         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
4845         assembler in last patch.
4847 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
4849         * sysdeps/pthread/pthread_cond_timedwait.c
4850         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
4851         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4852         (__pthread_cond_timedwait): Check for invalid nanosecond in
4853         timeout value.
4854         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4855         * tst-cond19.c: New file.
4856         * Makefile: Add rules to build and run tst-cond19.
4858 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
4860         * tst-context1.c (GUARD_PATTERN): Defined.
4861         (tst_context_t): Define struct containing ucontext_t & guard words.
4862         (ctx): Declare as an array of tst_context_t.
4863         (fct): Verify uc_link & guard words are still valid.
4864         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
4866 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4868         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4869         Add __data.__futex field, reshuffle __data.__clock.
4870         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
4871         (__pthread_cond_signal): Increment __futex at the same time as
4872         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4873         address of low 32-bits of __wakeup_seq to futex syscall.
4874         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4875         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4876         releasing internal lock to FUTEX_WAIT.
4877         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4878         (__pthread_cond_timedwait): Likewise.
4879         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4880         (FUTEX_CMP_REQUEUE): Define.
4881         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4882         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4883         Pass __futex value from before the unlock and __futex address instead
4884         of address of low 32-bits of __wakeup_seq to futex syscall.
4885         Fallback to FUTEX_WAKE all on any errors.
4887 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
4889         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
4890         comment typo.
4891         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
4892         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
4893         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
4894         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
4895         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
4897 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4899         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
4900         Add memory clobber to inline assembly.
4901         (__lll_mutex_trylock): Likewise.
4902         (__lll_mutex_cond_trylock): Likewise.
4904 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4906         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4907         Pass val argument as 6th system call argument in %r7.
4909 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4911         * Makefile (tests): Add tst-cond16.
4912         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
4913         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
4914         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4915         Add __data.__futex field, reshuffle __data.__clock.
4916         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
4917         (__pthread_cond_signal): Increment __futex at the same time as
4918         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4919         address of low 32-bits of __wakeup_seq to futex syscall.
4920         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
4921         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4922         releasing internal lock to FUTEX_WAIT.
4923         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
4924         (__pthread_cond_timedwait): Likewise.
4925         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
4926         (FUTEX_CMP_REQUEUE): Define.
4927         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4928         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4929         Pass __futex value from before the unlock and __futex address instead
4930         of address of low 32-bits of __wakeup_seq to futex syscall.
4931         Fallback to FUTEX_WAKE all on any errors.
4932         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
4933         Define.
4934         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4935         internally.  Return non-zero if error, zero if success.
4936         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4937         Add __data.__futex field, reshuffle __data.__clock.
4938         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
4939         Define.
4940         (lll_futex_requeue): Add val argument, return 1 unconditionally
4941         for the time being.
4942         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4943         Add __data.__futex field, reshuffle __data.__clock.
4944         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4945         Define.
4946         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4947         internally.  Return non-zero if error, zero if success.
4948         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4949         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
4950         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4951         Define.
4952         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4953         internally.  Return non-zero if error, zero if success.
4954         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4955         Add __data.__futex field, reshuffle __data.__clock.
4956         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
4957         Define.
4958         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4959         internally.  Return non-zero if error, zero if success.
4960         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4961         Add __data.__futex field, reshuffle __data.__clock.
4962         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4963         Add __data.__futex field, reshuffle __data.__clock.
4964         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
4965         Increment __futex at the same time as __wakeup_seq or __total_seq.
4966         Pass address of __futex instead of address of low 32-bits of
4967         __wakeup_seq to futex syscall.
4968         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4969         Pass __futex value from before releasing internal lock
4970         to FUTEX_WAIT.
4971         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4972         Likewise.  Avoid unnecessary shadowing of variables.
4973         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
4974         Set __futex to 2 * __total_seq.  Pass __futex value from before the
4975         unlock and __futex address instead of address of low 32-bits of
4976         __wakeup_seq to futex_requeue macro, adjust for new return value
4977         meaning.
4978         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
4979         (__pthread_cond_signal): Increment __futex at the same time as
4980         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4981         address of low 32-bits of __wakeup_seq to futex syscall.
4982         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
4983         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4984         releasing internal lock to FUTEX_WAIT.
4985         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4986         (__pthread_cond_timedwait): Likewise.
4987         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4988         (FUTEX_CMP_REQUEUE): Define.
4989         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4990         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4991         Pass __futex value from before the unlock and __futex address instead
4992         of address of low 32-bits of __wakeup_seq to futex syscall.
4993         Fallback to FUTEX_WAKE all on any errors.
4995 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4997         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
4998         Add nop to align the end of critical section.
4999         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
5001 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5003         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
5004         Add __broadcast_seq field.
5005         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
5006         all waiters as woken with woken_seq and bump broadcast counter.
5007         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
5008         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
5009         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5010         Comment typo fixes.  Avoid returning -ETIMEDOUT.
5012 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
5014         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5015         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
5016         Reported by Kaz Kojima.
5018 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
5020         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
5022 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
5024         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
5025         __broadcast_seq with bc_seq after acquiring internal lock instead of
5026         before it.
5028 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
5030         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
5031         compilation.
5032         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5033         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
5034         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
5035         (pthread_cond_t): Add __data.__broadcast_seq field.
5036         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5037         (FRAME_SIZE): Define.
5038         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
5039         Comment typo fixes.
5040         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
5041         Define.
5042         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
5043         typo fixes.
5044         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5045         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
5046         fixes.
5048 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
5050         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
5051         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
5052         Add __broadcast_seq field.
5053         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5054         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5055         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5056         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5057         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5058         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
5059         all waiters as woken with woken_seq and bump broadcast counter.
5060         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
5061         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
5062         __broadcast_seq field.
5063         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5064         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
5065         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
5066         * pthread_cond_init.c: Initialize __broadcast_seq field.
5067         * Makefile (tests): Add tst-cond17 and tst-cond18.
5068         Add .NOTPARALLEL goal.
5069         * tst-cond16.c: New file.  From Jakub.
5070         * tst-cond17.c: New file.  From Jakub.
5071         * tst-cond18.c: New file.  From Jakub.
5073 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
5075         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
5076         unwind info.
5078         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
5079         Parametrize frame size.  Correct some unwind info.
5080         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5082 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
5084         * tst-stack3.c: Note testing functionality beyond POSIX.
5086 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
5088         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
5089         Change conditional from ifdef to if.
5091 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
5093         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
5094         SYSDEP_CANCEL_ERROR): Define.
5095         (PSEUDO): Use it.
5097 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
5099         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
5101 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
5103         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
5105 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5107         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
5108         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
5109         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
5110         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
5112 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
5114         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
5115         thread has all signals blocked.
5117 2004-04-18  Andreas Jaeger  <aj@suse.de>
5119         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
5120         (SEM_VALUE_MAX): Add missing brace.
5122 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
5124         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
5125         in rt subdir.
5126         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
5127         * sysdeps/pthread/tst-mqueue8x.c: New test.
5128         * tst-cancel4.c: Update comment about message queues.
5130         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
5131         return it_value { 0, 0 }.
5132         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
5133         like SIGEV_SIGNAL.
5134         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
5135         assertion for SIGEV_NONE.
5136         (thread_attr_compare): Compare all attributes, not just a partial
5137         subset.
5139 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
5141         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
5143 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
5145         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
5146         Just use a plain number.
5147         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
5148         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
5149         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
5150         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
5151         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
5152         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
5153         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
5155 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5157         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
5158         frame info.
5159         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5161 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
5163         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
5164         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
5165         of calling sigwaitinfo.
5167 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
5169         * allocatestack.c (allocate_stack): Set reported_guardsize
5170         unconditionally.
5171         * pthread_getattr_np.c (pthread_getattr_np): Use
5172         reported_guardsize instead of guardsize.
5173         * descr.h (struct pthread): Add reported_guardsize field.
5175 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
5177         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
5179 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
5181         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
5183 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
5185         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
5186         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
5187         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
5188         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
5189         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
5190         Define.
5191         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
5192         (_POSIX_MESSAGE_PASSING): Define.
5193         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
5194         (_POSIX_MESSAGE_PASSING): Define.
5195         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
5196         (_POSIX_MESSAGE_PASSING): Define.
5198 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
5200         * tst-context1.c (fct): Check whether correct stack is used.
5202 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
5204         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
5205         matching constraints for asm mem parameters.
5207         * tst-clock2.c (tf): Don't define unless needed.
5209 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
5211         * Makefile (link-libc-static): Use $(static-gnulib) instead of
5212         $(gnulib).
5214 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
5216         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
5217         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
5218         * pthreadP.h: Declare __nptl_deallocate_tsd.
5219         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
5220         Adjust caller.
5222         * Makefile (tests): Add tst-tsd5.
5223         * tst-tsd5.c: New file.
5225 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
5227         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5228         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
5229         is SHLIB_COMPAT check.
5230         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
5231         (__pthread_attr_getaffinity_old): Likewise.
5232         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5233         (__pthread_getaffinity_old): Likewise.
5234         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5235         (__pthread_setaffinity_old): Likewise.
5237 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
5239         * allocatestack.c (_make_stacks_executable): Call
5240         _dl_make_stack_executable first.
5242 2004-03-24  Roland McGrath  <roland@redhat.com>
5244         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
5245         constraint instead of "0".
5247 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
5249         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
5250         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
5252         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
5253         code to avoid warning.
5255 2004-03-24  Andreas Jaeger  <aj@suse.de>
5257         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5258         (__pthread_attr_setaffinity_old): Remove const.
5260 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
5262         * sysdeps/unix/sysv/linux/smp.h: New file.
5263         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
5264         * init.c: Define __is_smp.
5265         (__pthread_initialize_minimal_internal): Call is_smp_system to
5266         initialize __is_smp.
5267         * pthreadP.h: Declare __is_smp.
5268         Define MAX_ADAPTIVE_COUNT is necessary.
5269         * pthread_mutex_init.c: Add comment regarding __spins field.
5270         * pthread_mutex_lock.c: Implement adaptive mutex type.
5271         * pthread_mutex_timedlock.c: Likewise.
5272         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
5273         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
5274         Add __spins field.
5275         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5276         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5277         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5278         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5279         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5280         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5281         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
5282         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
5283         lll_mutex_cond_trylock.
5284         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5285         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5286         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5287         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5288         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5289         Define BUSY_WAIT_NOP.
5290         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5291         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
5293         * tst-mutex5.c: Add support for testing adaptive mutexes.
5294         * tst-mutex7.c: Likewise.
5295         * tst-mutex5a.c: New file.
5296         * tst-mutex7a.c: New file.
5297         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
5299         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5300         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
5301         vgettimeofday call might destroy the content.
5303         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
5304         @pause in the loop.
5306         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
5307         No need to restrict type of ret.  Make it int.  Add comment.
5309         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
5310         Remove unnecessary setne instruction.
5312 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
5314         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5315         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
5316         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
5317         If realloc fails, break out of the loop.
5319 2004-03-20  Andreas Jaeger  <aj@suse.de>
5321         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5322         (__pthread_setaffinity_old): Fix interface.
5323         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5324         (__pthread_getaffinity_old): Likewise.
5326         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5327         (__pthread_setaffinity_new): Remove duplicate declaration.
5329 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5331         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
5332         the return value to a safe register.
5333         (CDISABLE): Set the function argument correctly.
5335 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5337         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
5338         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
5339         Rewrite so that only one locked memory operation per round is needed.
5340         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
5341         (pthread_barrier_wait): After wakeup, release lock only when the
5342         last thread stopped using the barrier object.
5343         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
5344         (__pthread_cond_wait): Don't store mutex address if the current
5345         value is ~0l.  Add correct cleanup support and unwind info.
5346         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5347         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
5348         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
5349         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
5350         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
5351         Add correct cleanup support and unwind info.
5352         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
5353         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
5354         information for syscall wrappers.
5356 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
5358         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
5359         cpusetsize field, remove next.
5360         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
5361         parameter for size of the CPU set.
5362         (pthread_setaffinity_np): Likewise.
5363         (pthread_attr_getaffinity_np): Likewise.
5364         (pthread_attr_setaffinity_np): Likewise.
5365         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
5366         interface change, keep compatibility code.
5367         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
5368         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
5369         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
5370         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
5371         __pthread_getaffinity_np.
5372         * Versions: Add version for changed interfaces.
5373         * tst-attr3.c: Adjust test for interface change.
5374         * pthread_getattr_np.c: Query the kernel about the affinity mask with
5375         increasing buffer sizes.
5376         * pthread_attr_destroy.c: Remove unused list handling.
5377         * pthread_attr_init.c: Likewise.
5379 2004-03-17  Roland McGrath  <roland@redhat.com>
5381         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
5382         first argument to clock_getres so we ever enable kernel timers.
5384 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
5386         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
5388 2004-03-12  Richard Henderson  <rth@redhat.com>
5390         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
5391         oldvalue from CENABLE to CDISABLE.
5393 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
5395         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
5396         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
5397         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
5398         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
5400 2004-03-11  Richard Henderson  <rth@redhat.com>
5402         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
5403         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
5404         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
5406 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
5408         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
5409         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
5410         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
5412 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
5414         * forward.c (__pthread_cond_broadcast_2_0,
5415         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
5416         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
5417         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
5419 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5421         * sysdeps/sh/tcb-offsets.sym: Add PID.
5422         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
5423         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
5425 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
5427         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
5428         include <sysdep-cancel.h>, vfork is no cancellation point.
5429         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
5430         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
5431         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
5433 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
5435         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
5436         libc_hidden_def.
5437         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
5438         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
5439         Likewise.
5440         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
5441         Likewise.
5442         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
5443         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
5444         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
5445         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
5446         of DO_CALL_VIA_BREAK.  Work around a gas problem.
5448         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
5449         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
5450         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
5451         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
5452         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
5453         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
5455         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
5456         a local register for saving old PID.  Negate PID in parent upon exit.
5458         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
5459         tcb-offsets.h.
5460         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
5461         before syscall, set to the old value in the parent afterwards.
5462         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
5463         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
5464         tcb-offsets.h.
5465         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
5466         before syscall, set to the old value in the parent afterwards.
5467         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
5468         * sysdeps/s390/tcb-offsets.sym: Add PID.
5470         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
5471         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
5472         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
5473         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
5474         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
5475         * sysdeps/sparc/tcb-offsets.sym: Add PID.
5477 2004-03-10  Andreas Schwab  <schwab@suse.de>
5479         * sysdeps/ia64/tcb-offsets.sym: Add PID.
5480         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
5481         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
5483 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
5485         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
5486         * tst-cancel21.c (do_one_test): Likewise.
5487         Reported by Gordon Jin <gordon.jin@intel.com>.
5489 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
5491         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
5492         if non-zero and set to INT_MIN if zero.
5493         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
5494         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
5495         (SAVE_PID, RESTORE_PID): Define.
5496         (__vfork): Use it.
5497         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
5498         Use relative path to avoid including NPTL i386/vfork.S.
5499         (SAVE_PID, RESTORE_PID): Define.
5500         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
5501         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
5502         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
5503         tst-vfork2x.
5504         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
5505         * tst-vfork1.c: New test.
5506         * tst-vfork2.c: New test.
5507         * tst-vfork1x.c: New test.
5508         * tst-vfork2x.c: New test.
5510 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
5512         * sysdeps/i386/tcb-offsets.sym: Add PID.
5513         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
5514         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
5515         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
5517 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
5519         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
5521 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
5523         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
5524         _rtld_global_ro.
5526 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
5528         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
5529         _rtld_global_ro.
5531         * tst-once4.c: Remove unnecessary macro definition.
5533         * tst-mutex7.c (do_test): Limit thread stack size.
5534         * tst-once2.c (do_test): Likewise.
5535         * tst-tls3.c (do_test): Likewise.
5536         * tst-tls1.c (do_test): Likewise.
5537         * tst-signal3.c (do_test): Likewise.
5538         * tst-kill6.c (do_test): Likewise.
5539         * tst-key4.c (do_test): Likewise.
5540         * tst-join4.c (do_test): Likewise.
5541         * tst-fork1.c (do_test): Likewise.
5542         * tst-context1.c (do_test): Likewise.
5543         * tst-cond2.c (do_test): Likewise.
5544         * tst-cond10.c (do_test): Likewise.
5545         * tst-clock2.c (do_test): Likewise.
5546         * tst-cancel10.c (do_test): Likewise.
5547         * tst-basic2.c (do_test): Likewise.
5548         * tst-barrier4.c (do_test): Likewise.
5550 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
5552         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
5554 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
5556         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5557         (__pthread_cond_timedwait): Optimize wakeup test.
5558         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5559         (__pthread_cond_wait): Likewise.
5560         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
5561         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5562         Likewise.
5564 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
5566         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5567         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
5568         the atomic instruction needed.
5569         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5570         (__lll_mutex_lock_wait): Likewise.
5572 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
5574         * Makefile (tests): Add tst-cond14 and tst-cond15.
5575         * tst-cond14.c: New file.
5576         * tst-cond15.c: New file.
5578 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
5580         * sysdeps/pthread/createthread.c (create_thread): Remove use of
5581         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
5582         needs to be implemented differently to be useful.
5584 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
5586         * pthread_attr_setschedparam.c: Don't test priority against limits
5587         here.  Set ATTR_FLAG_SCHED_SET flag.
5588         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
5589         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
5590         from parent thread to child.  If attribute is used and scheduling
5591         parameters are not inherited, copy parameters from attribute or
5592         compute them.  Check priority value.
5593         * pthread_getschedparam.c: If the parameters aren't known yet get
5594         them from the kernel.
5595         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
5596         ATTR_FLAG_POLICY_SET flag for thread.
5597         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
5598         and ATTR_FLAG_POLICY_SET.
5600         * sysdeps/pthread/createthread.c: Use tgkill if possible.
5602         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
5603         fail if stack address hasn't been set.  Just return 0.
5605 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
5607         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
5608         libpthread for the files in this list.
5609         (CFLAGS-tst-unload): Removed.
5610         * tst-unload.c (do_test): Don't use complete path for
5611         LIBPHREAD_SO.
5613         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
5614         tst-_res1mod2.
5616 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
5618         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5619         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
5620         operation per round is needed.
5621         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5622         (__lll_mutex_lock_wait): Likewise.
5624 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
5626         * tst-cancel9.c (cleanup): Don't print to stderr.
5628 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5630         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
5632 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
5634         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
5635         (__syscall_error_handler2): Call CDISABLE.
5636         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
5637         (__syscall_error_handler2): Call CDISABLE.
5639         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5640         Release lock before the loop, don't reacquire it.
5642         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
5644 2004-02-19  Andreas Schwab  <schwab@suse.de>
5646         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5647         Fix last change.
5649 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
5651         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
5652         (pthread_barrier_wait): After wakeup, release lock only when the
5653         last thread stopped using the barrier object.
5654         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
5655         (pthread_barrier_wait): Likewise.
5656         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5657         Likewise.
5658         * Makefile (tests): Add tst-barrier4.
5659         * tst-barrier4.c: New file.
5661         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5662         (__pthread_cond_timedwait): Perform timeout test while holding
5663         internal lock to prevent wakeup race.
5664         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
5665         * sysdeps/pthread/pthread_cond_timedwait.c
5666         (__pthread_cond_timedwait): Likewise.
5667         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5668         (__pthread_cond_timedwait): Likewise.
5670 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
5672         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
5673         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
5674         * Makefile (tests): Add tst-rwlock13.
5675         * tst-rwlock13.c: New test.
5677 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
5679         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5680         (__condvar_tw_cleanup): Little optimization.
5681         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
5683 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
5685         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
5686         libpthread as "lib" parameter to SHLIB_COMPAT.
5687         (__novmx_siglongjmp): Fix typo in function name.
5688         (__novmx_longjmp): Fix typo in function name.
5690 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
5692         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
5693         __builtin_expect.
5695         * sysdeps/generic/pt-longjmp.c: Moved to...
5696         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
5698 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
5700         * Makefile (libpthread-routines): Add pt-cleanup.
5701         * pt-longjmp.c: Removed.
5702         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
5703         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
5704         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
5705         Version longjmp, siglongjmp for GLIBC_2.3.4.
5706         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
5708 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
5710         * sysdeps/pthread/pthread_cond_timedwait.c
5711         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
5712         Reuse code.  Add __builtin_expects.
5714         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5715         (__pthread_cond_timedwait): Get internal lock in case timeout has
5716         passed before the futex syscall.
5717         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5719 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
5721         * allocatestack.c: Pretty printing.
5723         * sysdeps/pthread/createthread.c (create_thread): Don't add
5724         CLONE_DETACHED bit if it is not necessary.
5726 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
5728         * pthread_getattr_np.c: Include ldsodefs.h.
5730 2004-01-16  Richard Henderson  <rth@redhat.com>
5732         * allocatestack.c: Don't declare __libc_stack_end.
5733         * init.c (__pthread_initialize_minimal_internal): Likewise.
5734         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
5736 2004-01-15  Richard Henderson  <rth@redhat.com>
5738         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
5739         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
5740         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
5741         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
5742         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
5743         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
5744         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
5745         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
5747 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
5749         * init.c (pthread_functions): Make array const.
5751 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
5753         * allocatestack.c (__make_stacks_executable): Change interface.
5754         Check parameters.  Pass parameter on to libc counterpart.
5755         * pthreadP.h: Change declaration.
5757 2004-01-13  Richard Henderson  <rth@redhat.com>
5759         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
5760         prototype form.
5761         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
5762         Likewise.
5764         * sysdeps/alpha/Makefile: New file.
5765         * sysdeps/alpha/tcb-offsets.sym: New file.
5766         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
5767         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
5769         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
5770         on powerpc version.
5772 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
5774         * Makefile (tests): Add tst-backtrace1.
5775         * tst-backtrace1.c: New test.
5777 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
5779         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
5780         register as second parameter to the REGISTER macro.
5781         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
5782         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
5783         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
5784         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
5785         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
5786         of thread register as second parameter to REGISTER macro in 64 case.
5788 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
5790         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
5791         (CFLAGS-getpid.o): Defined.
5792         (CFLAGS-getpid.os): Defined.
5794 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
5796         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
5797         returned for main thread does not overlap with any other VMA.
5798         Patch by Jakub Jelinek.
5800 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
5802         * tst-raise1.c: Include stdio.h.
5804 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
5806         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
5807         setting with __ASSUME_TGKILL || defined __NR_tgkill.
5808         If pid is 0, set it to selftid.
5809         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
5810         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
5811         != 0, return self->tid without doing a syscall.
5812         * descr.h (struct pthread): Move pid field after tid.
5814         * Makefile (tests): Add tst-raise1.
5815         * tst-raise1.c: New file.
5817 2003-12-23  Roland McGrath  <roland@redhat.com>
5819         * tst-oddstacklimit.c: New file.
5820         * Makefile (tests): Add it.
5821         (tst-oddstacklimit-ENV): New variable.
5823         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
5824         value up to page size for __default_stacksize.
5826 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
5828         * Makefile (tests): Add tst-eintr5.
5829         * tst-eintr5.c: New file.
5831         * eintr.c (eintr_source): Prevent sending signal to self.
5833         * tst-eintr2.c (tf1): Improve error message.
5835 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
5837         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
5838         * sysdeps/unix/sysv/linux/getpid.c: New file.
5839         * pthread_cancel.c: Add comment explaining use of PID field.
5840         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
5841         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
5842         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
5843         temporarily to signal the field must not be relied on and updated
5844         by getpid().
5845         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
5846         temporarily negative.
5847         * sysdeps/unix/sysv/linux/raise.c: Likewise.
5849 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
5851         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
5852         (eintr_source): If ARG != NULL, use pthread_kill.
5853         * tst-eintr1.c: Adjust for this change.
5854         * tst-eintr2.c: Likewise.
5855         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
5856         * tst-eintr3.c: New file.
5857         * tst-eintr4.c: New file.
5859 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
5861         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
5862         if CANCELSTATE_BITMASK is set.
5863         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
5864         Likewise.
5866         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
5867         (tests-reverse): Add tst-cancel23.
5868         * tst-cancel22.c: New test.
5869         * tst-cancel23.c: New test.
5871 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
5873         * tst-eintr1.c: Better error messages.
5875         * Makefile (tests): Add tst-eintr2.
5876         * tst-eintr2.c: New file.
5878 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
5880         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
5881         (CFLAGS-tst-cancelx21.c): Set.
5882         * tst-cancel21.c: New test.
5883         * tst-cancelx21.c: New test.
5885         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
5886         comparison operand.
5887         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
5888         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
5889         * pt-longjmp.c: Include jmpbuf-unwind.h.
5890         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
5891         _JMPBUF_UNWINDS.  Adjust compared pointers.
5892         * init.c (__pthread_initialize_minimal_internal): Initialize
5893         pd->stackblock_size.
5894         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
5895         * sysdeps/alpha/jmpbuf-unwind.h: New file.
5896         * sysdeps/i386/jmpbuf-unwind.h: New file.
5897         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
5898         * sysdeps/s390/jmpbuf-unwind.h: New file.
5899         * sysdeps/sh/jmpbuf-unwind.h: New file.
5900         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
5901         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
5902         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
5903         (_JMPBUF_CFA_UNWINDS): Remove.
5904         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
5906 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
5908         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
5909         (CFLAGS-tst-cancelx20.c): Set.
5910         * tst-cancel20.c: New test.
5911         * tst-cancelx20.c: New test.
5913 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
5915         * init.c (__pthread_initialize_minimal_internal): Don't treat
5916         architectures with separate register stack special here when
5917         computing default stack size.
5919 2003-12-17  Roland McGrath  <roland@redhat.com>
5921         * Makefile (tst-cancelx7-ARGS): New variable.
5922         Reportd by Greg Schafer <gschafer@zip.com.au>.
5924 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
5926         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
5927         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
5928         (tst-stack3-ENV): Set.
5929         ($(objpfx)tst-stack3-mem): New.
5930         * tst-stack3.c: New test.
5932 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
5934         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
5935         Add unwind directives.  Drop unused .regstk directive.
5936         (_fini_EPILOG_BEGINS): Add unwind directives.
5938 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
5940         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
5941         Assume parameter is a pointer.
5942         (lll_futex_wake): Likewise.
5943         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
5944         Likewise.
5945         (lll_futex_wake): Likewise.
5946         Reported by Boris Hu.
5947         * sysdeps/unix/sysv/linux/unregister-atfork.c
5948         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
5950         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
5952 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
5954         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
5955         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
5956         __rtld_lock_initialize for ld.so lock.
5957         Patch in part by Adam Li <adam.li@intel.com>.
5959 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
5961         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
5962         in $(gnulib).  Also, remove stale comment.
5964 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
5966         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
5967         advantage of new syscall stub and optimize accordingly.
5969         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
5970         from SYS_futex, to match expectations of
5971         sysdep.h:DO_INLINE_SYSCALL.
5972         (lll_futex_clobbers): Remove.
5973         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
5974         (lll_futex_wake): Likewise.
5975         (lll_futex_requeue): Likewise.
5976         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
5977         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
5978         Jelinek).
5979         (__lll_mutex_lock): Likewise.
5980         (__lll_mutex_cond_lock): Likewise.
5981         (__lll_mutex_timed_lock): Likewise.
5982         (__lll_mutex_unlock): Likewise.
5983         (__lll_mutex_unlock_force): Likewise.
5985         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
5986         comes before the include of <sysdep.h>.
5987         (THREAD_SELF_SYSINFO): New macro.
5988         (THREAD_SYSINFO): Likewise.
5989         (INIT_SYSINFO): New macro.
5990         (TLS_INIT_TP): Call INIT_SYSINFO.
5992         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
5994         * sysdeps/pthread/createthread.c (create_thread): Use
5995         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
5996         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
5997         THREAD_SELF_SYSINFO instead of open code.
5998         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
5999         (THREAD_SYSINFO): Likewise.
6001         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
6003         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
6005 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
6007         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
6008         instead of .init.  Patch by David Mosberger.
6010 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
6012         * sysdeps/pthread/configure.in: Remove broken declaration in C
6013         cleanup handling check.
6015 2003-11-30  Andreas Jaeger  <aj@suse.de>
6017         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
6018         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
6019         Likewise.
6021 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
6023         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
6024         * pthread_attr_destroy.c: Include shlib-compat.h.
6025         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
6026         is set in iattr->flags.
6027         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
6029 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
6031         * Makefile (distribute): Add tst-cleanup4aux.c.
6033         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
6034         include.
6036 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
6038         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
6039         pthread_cond_signal.
6041         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
6042         store mutex address if the current value is ~0l.
6043         * sysdeps/pthread/pthread_cond_timedwait.c
6044         (__pthread_cond_timedwait): Likewise.
6045         * sysdeps/pthread/pthread_cond_broadcast.c
6046         (__pthread_cond_broadcast): Don't use requeue for pshared
6047         condvars.
6049         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
6050         (__pthread_cond_wait): Don't store mutex address if the current
6051         value is ~0l.
6052         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
6053         (__pthread_cond_timedwait): Likewise.
6054         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
6055         (__pthread_cond_broadcast): Don't use requeue for pshared
6056         condvars.
6058         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
6059         element with ~0l for pshared condvars, with NULL otherwise.
6061         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
6062         (__pthread_cond_wait): Don't store mutex address if the current
6063         value is ~0l.
6064         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6065         (__pthread_cond_timedwait): Likewise.
6066         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
6067         (__pthread_cond_broadcast): Don't use requeue for pshared
6068         condvars.
6070         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
6071         * tst-cond12.c: New file.
6072         * tst-cond13.c: New file.
6074 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
6076         * sysdeps/pthread/configure.in: Make missing forced unwind support
6077         fatal.
6079 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
6081         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
6083 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
6085         * Makefile: Add magic to clean up correctly.
6087 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
6089         * unwind.c (FRAME_LEFT): Define.
6090         (unwind_stop): Handle old style cleanups here.
6091         (__pthread_unwind): Handle old style cleanups only if
6092         !HAVE_FORCED_UNWIND.
6093         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
6094         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
6095         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
6096         ($(objpfx)tst-cleanupx4): Likewise.
6097         * tst-cleanup4.c: New test.
6098         * tst-cleanup4aux.c: New.
6099         * tst-cleanupx4.c: New test.
6101 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
6103         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
6104         lll_mutex_*lock macros to skip atomic operations on some archs.
6106 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
6108         * sysdeps/pthread/tst-timer.c (main): Initialize
6109         sigev2.sigev_value as well.
6111 2003-10-15  Roland McGrath  <roland@redhat.com>
6113         * sysdeps/pthread/configure.in: Barf if visibility attribute support
6114         is missing.
6115         * sysdeps/pthread/configure: Regenerated.
6117 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6119         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
6120         locking macros.  No distinction between normal and mutex locking
6121         anymore.
6122         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
6123         Merge bits from lowlevelmutex.S we still need.
6124         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
6125         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
6126         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
6127         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
6128         new mutex implementation.
6129         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
6130         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
6131         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6132         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
6133         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
6134         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
6135         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
6136         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
6137         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6138         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
6139         symbol for entry point to avoid cancellation.
6141 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
6143         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
6144         changes.
6145         (SAVE_OLDTYPE_0): Fix a typo.
6147 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
6149         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
6150         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
6152 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
6154         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
6155         correct offset.
6157 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
6159         * Makefile (tests): Add tst-cancel19.
6160         * tst-cancel19.c: New test.
6162 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
6164         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
6165         restoring of the old cancellation type.
6167 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
6169         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
6171 2003-09-27  Wolfram Gloger  <wg@malloc.de>
6173         * sysdeps/pthread/malloc-machine.h: New file
6175 2003-09-24  Roland McGrath  <roland@redhat.com>
6177         * allocatestack.c (__make_stacks_executable): Don't ignore return
6178         value from _dl_make_stack_executable.
6180 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
6182         * allocatestack.c (__make_stacks_executable): Also change
6183         permission of the currently unused stacks.
6185         * allocatestack.c (change_stack_perm): Split out from
6186         __make_stacks_executable.
6187         (allocate_stack): If the required permission changed between the time
6188         we started preparing the stack and queueing it, change the permission.
6189         (__make_stacks_executable): Call change_stack_perm.
6191         * Makefile: Build tst-execstack-mod locally.
6192         * tst-execstack-mod.c: New file.
6194 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
6196         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
6198 2003-09-23  Roland McGrath  <roland@redhat.com>
6200         * tst-execstack.c: New file.
6201         * Makefile (tests): Add it.
6202         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
6203         (LDFLAGS-tst-execstack): New variable.
6205         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
6206         whether to use PROT_EXEC for stack mmap.
6207         (__make_stacks_executable): New function.
6208         * pthreadP.h: Declare it.
6209         * init.c (__pthread_initialize_minimal_internal): Set
6210         GL(dl_make_stack_executable_hook) to that.
6212 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
6214         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
6215         recommendation from AMD re avoidance of lock prefix.
6217 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
6219         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
6220         lll_futex_timed_wait instead of lll_futex_wait.
6221         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
6222         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
6223         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
6224         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
6225         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
6226         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
6227         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
6228         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
6229         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
6230         Completely revamp the locking macros.  No distinction between
6231         normal and mutex locking anymore.
6232         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
6233         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
6234         __lll_lock_timedwait): Fix prototypes.
6235         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
6236         __lll_lock_timedwait): Likewise.
6237         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
6238         macros, add __builtin_expect.
6239         (lll_mutex_timedlock): Likewise.  Fix return value.
6240         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
6241         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
6242         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
6243         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
6244         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
6245         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
6246         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
6247         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
6249 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
6251         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
6252         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
6253         operation if possible.
6255         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
6256         like jumping over the lock prefix.
6258 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
6260         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
6261         locking macros.  No distinction between normal and mutex locking
6262         anymore.
6263         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6264         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
6265         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
6266         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
6267         locking.  Merge bits from lowlevelmutex.S we still need.
6268         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
6269         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
6270         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
6271         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
6272         * Makefile (routines): Remove libc-lowlevelmutex.
6273         (libpthread-rountines): Remove lowlevelmutex.
6274         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
6275         for new mutex implementation.
6276         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6277         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6278         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6279         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6280         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6281         Likewise.
6282         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6283         Likewise.
6284         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
6285         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6286         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
6287         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
6288         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6289         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6290         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
6291         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
6292         Likewise.
6293         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
6294         Likewise.
6295         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
6296         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
6297         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6298         Don't use requeue.
6299         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
6300         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
6302 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
6304         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
6305         in parameters of asm with output parameters.
6307         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
6308         type of DECR parameter to int.
6309         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
6311 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
6313         * tst-attr3.c (tf, do_test): Print stack start/end/size and
6314         guardsize for each thread.
6316 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
6318         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
6319         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
6320         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
6322         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
6323         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
6324         NULL.
6325         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
6326         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
6327         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
6328         (pthread_getaffinity_np): Add hidden_def.
6330         * Makefile (tests): Add tst-attr3.
6331         * tst-attr3.c: New test.
6333         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
6335 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
6337         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
6338         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
6340 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
6342         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
6343         * tst-align.c: Include tst-stack-align.h.
6344         (tf, do_test): Use TEST_STACK_ALIGN macro.
6346 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
6348         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
6349         variable.
6351 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
6353         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
6354         stack-related values for the initial thread.
6356 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
6358         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
6360 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
6362         * pthread_mutex_lock.c: Minor code rearrangements.
6364 2003-09-05  Roland McGrath  <roland@redhat.com>
6366         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
6367         Instead, include ../nptl_db/db_info.c to do its magic.
6368         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
6369         (__pthread_pthread_key_2ndlevel_size): Likewise.
6370         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
6371         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
6372         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
6373         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
6374         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
6375         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
6376         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
6377         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
6378         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
6379         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
6380         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
6381         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
6382         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
6383         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
6384         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
6385         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
6386         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
6388 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
6390         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
6391         of pthread_t to be compatible with LT.
6392         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
6393         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6394         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6395         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6396         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
6397         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6398         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
6400 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
6402         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
6404 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
6406         * unwind-forcedunwind.c: Move to...
6407         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
6408         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
6409         * sysdeps/pthread/jmpbuf-unwind.h: New file.
6410         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
6411         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
6412         * unwind.c: Include jmpbuf-unwind.h.
6413         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
6415 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
6417         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
6418         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
6419         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
6420         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
6421         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
6422         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
6423         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
6424         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
6425         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
6426         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
6427         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
6428         function.
6429         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
6430         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
6431         * Makefile (tests): Add tst-stack2.
6432         * tst-stack2.c: New test.
6433         * tst-stack1.c: Include limits.h and sys/param.h.
6434         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
6436         * pthread_condattr_setpshared.c: Include errno.h.
6437         (pthread_condattr_setpshared): Return EINVAL if pshared
6438         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
6440         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
6441         defined symbol for entry point to avoid cancellation.
6442         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
6443         Likewise.
6444         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
6445         Likewise.
6446         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
6447         Likewise.
6448         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
6449         Likewise.
6450         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
6451         Likewise.
6452         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
6453         __close_nocancel, __read_nocancel, __write_nocancel,
6454         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
6455         libpthread.so or librt.so, define to corresponding function
6456         without _nocancel suffix.
6457         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
6458         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
6459         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
6461         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
6463 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
6465         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
6466         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
6468         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
6469         in subsections has a symbol associated with it.
6471         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
6472         defined symbol for entry point to avoid cancellation.
6473         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
6475 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
6477         * Makefile (tests): Add tst-tls5.
6478         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
6479         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
6480         ($(objpfx)tst-tls5): New.
6481         ($(objpfx)tst-tls6.out): Likewise.
6482         (tests): Depend on $(objpfx)tst-tls6.out.
6483         * tst-tls3.c: Include stdint.h and pthreaddef.h.
6484         (do_test): Check pthread_self () return value alignment.
6485         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
6486         (tf): Check pthread_self () return value alignment.
6487         * tst-tls5.c: New test.
6488         * tst-tls5.h: New.
6489         * tst-tls5mod.c: New.
6490         * tst-tls5moda.c: New.
6491         * tst-tls5modb.c: New.
6492         * tst-tls5modc.c: New.
6493         * tst-tls5modd.c: New.
6494         * tst-tls5mode.c: New.
6495         * tst-tls5modf.c: New.
6496         * tst-tls6.sh: New test.
6498         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
6499         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
6500         * init.c (pthread_functions): Initialize them.
6501         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
6502         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
6503         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
6504         pthread_cond_timedwait@@GLIBC_2.3.2.
6506 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
6508         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
6509         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
6510         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
6511         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
6512         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
6513         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
6515         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
6517         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
6518         _POSIX_THREAD_PRIORITY_SCHEDULING.
6519         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
6521 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
6523         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
6524         nested function, use static inline function from libio.h.
6525         Code by Richard Henderson.
6527         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
6528         weak.
6530 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
6532         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
6533         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
6534         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
6535         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
6536         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
6537         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
6538         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
6539         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
6540         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
6541         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
6542         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
6543         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
6544         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
6545         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
6546         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
6547         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
6548         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
6549         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
6550         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
6551         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
6552         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
6553         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
6554         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
6555         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
6556         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
6557         * sysdeps/sparc/tls.h: New file.
6558         * sysdeps/sparc/tcb-offsets.sym: New file.
6559         * sysdeps/sparc/Makefile: New file.
6560         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
6561         * init.c [__sparc__] (__NR_set_tid_address): Define.
6563 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
6565         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
6566         _IO_release_lock): Define.
6568 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
6570         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
6571         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
6573 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
6575         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
6576         (__pthread_cleanup_class): Add missing return types of member
6577         functions.
6579 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
6581         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6582         (lll_mutex_unlock_force): Add memory barrier between store and futex
6583         syscall.
6585 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
6587         * tst-cancel4.c (do_test): Also unlink tempfname and remove
6588         tempmsg in first loop.
6590 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
6592         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
6593         _POSIX_THREAD_PRIORITY_SCHEDULING.
6594         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
6596 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
6598         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
6599         (__rtld_lock_default_lock_recursive,
6600         __rtld_lock_default_unlock_recursive): Define.
6601         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
6602         __rtld_lock_unlock_recursive): Define using
6603         GL(_dl_rtld_*lock_recursive).
6604         * init.c (__pthread_initialize_minimal_internal): Initialize
6605         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
6606         Lock GL(_dl_load_lock) the same number of times as
6607         GL(_dl_load_lock) using non-mt implementation was nested.
6609         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
6610         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
6612 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
6614         * tst-cancel17.c (do_test): Make len2 maximum of page size and
6615         PIPE_BUF.
6617 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
6619         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
6621 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
6623         * sysdeps/pthread/createthread.c (do_clone): Move error handling
6624         to first syscall error check.  Move syscall error check for tkill
6625         into __ASSUME_CLONE_STOPPED #ifdef.
6627 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
6629         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
6630         is not defined, do explicit synchronization.
6631         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
6632         is not defined also unlock pd->lock for non-debugging case in case
6633         it is necessary.
6634         * pthread_create.c (start_thread): Always get and release pd->lock
6635         if __ASSUME_CLONE_STOPPED is not defined.
6636         (start_thread_debug): Removed.  Adjust users.
6637         * allocatestack.c (allocate_stack): Always initialize lock if
6638         __ASSUME_CLONE_STOPPED is not defined.
6639         * Makefile (tests): Add tst-sched1.
6640         * tst-sched1.c: New file.
6642         * sysdeps/pthread/createthread.c (do_clone): Only use
6643         sched_setschduler and pass correct parameters.
6645 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6647         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
6648         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
6649         PTHREAD_STACK_MIN in comments.
6651 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6653         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
6654         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
6655         argument.
6656         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
6657         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
6658         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
6659         (__pthread_cleanup_upto): Fix prototype.
6660         (_longjmp_unwind): Adjust caller.
6661         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
6662         Change second argument to const struct pointer.
6663         * tst-sem8.c (main): Remove unused s2 and s3 variables.
6664         * tst-sem9.c (main): Likewise.
6665         * unwind.c: Include string.h for strlen prototype.
6667 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
6669         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6670         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
6671         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
6672         Define HAVE_CMOV.
6673         Patch by Nicholas Miell <nmiell@attbi.com>.
6675 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
6677         * init.c (__pthread_initialize_minimal_internal): Initialize
6678         GL(dl_init_static_tls).
6679         * pthreadP.h (__pthread_init_static_tls): New prototype.
6680         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
6681         New functions.
6682         * Makefile (tests): Add tst-tls4.
6683         (modules-names): Add tst-tls4moda and tst-tls4modb.
6684         ($(objpfx)tst-tls4): Link against libdl and libpthread.
6685         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
6686         tst-tls4modb.so.
6687         * tst-tls4.c: New file.
6688         * tst-tls4moda.c: New file.
6689         * tst-tls4modb.c: New file.
6691 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
6693         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
6694         before __timer_dealloc.
6695         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
6696         Don't call list_unlink.
6698 2003-07-29  Roland McGrath  <roland@redhat.com>
6700         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
6702 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
6704         * tst-cancel17.c (do_test): Check if aio_cancel failed.
6705         Don't reuse struct aiocb A if it failed.
6706         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
6707         not just one byte, as that does not block.
6709 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
6711         * sysdeps/pthread/unwind-resume.c: New file.
6712         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
6713         unwind-resume in csu subdir.
6714         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
6715         exceptions.
6716         (librt-sysdep_routines, librt-shared-only-routines): Add
6717         rt-unwind-resume.
6718         * sysdeps/pthread/rt-unwind-resume.c: New file.
6719         * unwind-forcedunwind.c: New file.
6720         * Makefile (libpthread-routines): Add unwind-forcedunwind.
6721         (libpthread-shared-only-routines): Likewise.
6722         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
6723         * pthreadP.h (pthread_cancel_init): New prototype.
6724         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
6726         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
6727         attr argument const struct pthread_attr *.
6729         * res.c (__res_state): Return __resp.
6730         * descr.h: Include resolv.h.
6731         (struct pthread): Add res field.
6732         * pthread_create.c: Include resolv.h.
6733         (start_thread): Initialize __resp.
6734         * Makefile (tests): Add tst-_res1.
6735         (module-names): Add tst-_res1mod1, tst-_res1mod2.
6736         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
6737         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
6738         libpthread.
6739         * tst-_res1.c: New file.
6740         * tst-_res1mod1.c: New file.
6741         * tst-_res1mod2.c: New file.
6743 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
6745         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
6747         * Makefile: Define various *-no-z-defs variables for test DSOs
6748         which has undefined symbols.
6750 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
6752         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
6753         Retry if the stwcx fails to store once_control.
6755 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
6757         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
6758         pthread_attr_setaffinity.
6759         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
6760         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
6761         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
6762         * pthread_attr_destroy.c: Free cpuset element if allocated.
6763         * pthread_create.c: Pass iattr as additional parameter to
6764         create_thread.
6765         * sysdeps/pthread/createthread.c: If attribute is provided and
6766         a new thread is created with affinity set or scheduling parameters,
6767         start thread with CLONE_STOPPED.
6768         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
6769         pthread_attr_setaffinity.
6770         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
6771         cpuset element.
6773 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
6775         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
6777 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
6779         * sysdeps/pthread/configure.in: Require CFI directives also for
6780         ppc and s390.
6782 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
6784         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
6785         Add cfi directives.
6787 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6789         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
6790         CLEANUP_JMP_BUF.
6791         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
6792         registers as variables.  Call __pthread_mutex_unlock_usercnt.
6793         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6794         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
6795         not self pointer in __writer.  Compare with TID to determine
6796         deadlocks.
6797         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6798         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
6799         Likewise.
6800         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
6801         Likewise.
6802         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
6803         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
6804         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
6805         macros also when compiling librt.
6807 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
6809         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
6810         -fasynchronous-unwind-tables.
6811         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
6812         (PSEUDO): Add cfi directives.
6813         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
6814         Likewise.
6815         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
6816         Likewise.
6818 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
6820         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
6821         __pthread_unregister_cancel): Add prototypes and hidden_proto.
6822         * unwind.c (__pthread_unwind_next): Add hidden_def.
6823         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
6824         Likewise.
6825         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
6826         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
6827         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
6828         Likewise.
6829         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
6830         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
6831         Likewise.
6832         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
6833         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
6834         __pthread_unregister_cancel and __pthread_unwind_next.
6836 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
6838         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
6839         different symbol for the cancellation syscall wrapper and
6840         non-cancellation syscall wrapper.
6841         (PSEUDO_END): Define.
6843 2003-07-05  Richard Henderson  <rth@redhat.com>
6845         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
6846         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
6847         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6848         return actual return value from the syscall, not 0.
6850 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
6852         * descr.h (struct pthread): Add pid field.
6853         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
6854         (__reclaim_stacks): Likewise.
6855         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
6856         also check for PID of the signal source.
6857         (__pthread_initialize_minimal_internal): Also initialize pid field
6858         of initial thread's descriptor.
6859         * pthread_cancel.c: Use tgkill instead of tkill if possible.
6860         * sysdeps/unix/sysv/linux/fork.c: Likewise.
6861         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
6862         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
6863         * sysdeps/unix/sysv/linux/raise.c: Likewise.
6865 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
6867         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
6868         Fix use of parameter.
6869         (__libc_cleanup_pop): Likewise.
6871 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
6873         * init.c (sigcancel_handler): Change parameters to match handler
6874         for SA_SIGACTION.  Check signal number and code to recognize
6875         invalid invocations.
6877 2003-07-03  Roland McGrath  <roland@redhat.com>
6879         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
6880         Apply sizeof (struct pthread) bias to r13 value.
6882 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
6884         * sysdeps/pthread/configure.in: Require CFI directives.
6886         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
6887         definition.
6888         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
6889         libpthread compilation.
6890         * unwind.c (__pthread_unwind): Add hidden_def.
6891         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
6893 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6895         * libc-cancellation.c (__libc_cleanup_routine): Define.
6896         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
6897         (__pthread_cleanup_pop): Define.
6899 2003-07-01  Richard Henderson  <rth@redhat.com>
6901         * sysdeps/alpha/elf/pt-initfini.c: New file.
6902         * sysdeps/alpha/pthread_spin_lock.S: New file.
6903         * sysdeps/alpha/pthread_spin_trylock.S: New file.
6904         * sysdeps/alpha/pthreaddef.h: New file.
6905         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
6906         * sysdeps/alpha/tls.h: New file.
6907         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
6908         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
6909         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
6910         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
6911         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
6912         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
6913         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
6914         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
6915         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
6916         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
6918 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6920         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
6921         cleanup support and unwind info.
6923 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
6925         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
6926         Use correct cleanup handler registration.  Add unwind info.
6927         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
6928         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
6929         * tst-once3.c: Add cleanup handler and check it is called.
6930         * tst-once4.c: Likewise.
6931         * tst-oncex3.c: New file.
6932         * tst-oncex4.c: New file.
6933         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
6935 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
6937         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
6939 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
6941         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
6942         (tf_msgsnd): Likewise.
6944         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
6945         premature returns a bit more.
6947 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
6949         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
6950         definition to the front.
6952         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
6953         the cleanup functions to make the names unique.  Fix dwarf opcode
6954         un unwind table.
6955         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
6956         functions to make the names unique.  Fix CFA offset for two blocks.
6958 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
6960         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
6961         missing closing braces.
6962         Patch by Christophe Saout <christophe@saout.de>.
6964 2003-06-24  Roland McGrath  <roland@redhat.com>
6966         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
6968 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
6970         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
6971         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
6973         * pthreadP.h: Declare __find_thread_by_id.
6974         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
6975         * pthread_clock_gettime.c: Allow using other thread's clock.
6976         * pthread_clock_settime.c: Likewise.
6977         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
6978         * Makefile: Add rules to build and run tst-clock2.
6979         * tst-clock2.c: New file.
6981 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
6983         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
6984         to use exception-based cleanup handler.
6985         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6987         * tst-cond8.c (ch): Announce that we are done.
6989         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
6991         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
6992         Also test aio_suspend with timeout value.
6994 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
6996         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
6997         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
6998         attribute_hidden.
7000         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
7001         (__pthread_mutex_lock_internal): Likewise.
7002         (__pthread_mutex_unlock_internal): Likewise.
7003         (__pthread_mutex_unlock_usercnt): Declare.
7004         * pthread_mutex_destroy.c: Always fail if used in any way.
7005         * pthread_mutex_init.c: Update comment.
7006         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
7007         * pthread_mutex_timedlock.c: Adjust __nusers.
7008         * pthread_mutex_trylock.c: Adjust __nusers.
7009         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
7010         and public interfaces are wrapper with pass additional parameter.
7011         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
7012         parameter zero.
7013         * tst-mutex8.c: New file.
7014         * Makefile (tests): Add tst-mutex8.
7015         * sysdeps/pthread/pthread_cond_timedwait.c: Call
7016         __pthread_mutex_unlock_usercnt.
7017         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7018         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7019         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7020         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7021         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7022         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
7023         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
7024         Add __nusers.
7025         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7026         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7027         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7028         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7029         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7031         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
7032         * pthread_mutex_timedlock.c: Likewise.
7033         * pthread_mutex_trylock.c: Adjust __nusers.
7034         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
7035         * tst-mutex9.c: New file.
7036         * Makefile (tests): Add tst-mutex9.
7037         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
7038         * sysdeps/ia64/tls.h: Likewise.
7039         * sysdeps/powerpc/tls.h: Likewise.
7040         * sysdeps/s390/tls.h: Likewise.
7041         * sysdeps/sh/tls.h: Likewise.
7042         * sysdeps/x86_64/tls.h: Likewise.
7043         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
7044         Change type of __owner.
7045         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7046         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7047         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7048         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7049         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7051 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
7053         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
7054         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
7056         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
7057         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
7058         instead of nr to lll_futex_wake.  Only set errno and return -1
7059         if err < 0.
7061         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
7062         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
7063         return actual return value from the syscall, not 0.
7065 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
7067         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
7068         find a random value.
7069         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
7070         errno==EIDRM.
7072         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
7073         compat_timer_settime.
7074         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
7075         compat_timer_gettime.
7076         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
7077         compat_timer_getoverrun.
7078         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
7079         compat_timer_delete.
7081         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
7082         error-checking mutex detect busy mutexes.
7084 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
7086         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
7087         Add ax to clobber list.
7088         (lll_mutex_cond_lock): Likewise.
7089         (lll_mutex_unlock): Likewise.
7090         (lll_lock): Likewise.
7091         (lll_unlock): Likewise.
7093         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
7094         * tst-cancel18.c: New file.
7095         * tst-cancelx18.c: New file.
7097         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
7098         and tcdrain.
7100         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
7101         * tst-cancel17.c: New file.
7102         * tst-cancelx17.c: New file.
7104         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
7105         * sysdeps/unix/sysv/linux/sigwait.c: New file.
7106         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
7108         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
7110 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
7112         * sysdeps/pthread/createthread.c (create_thread): Set
7113         header.multiple_threads unconditionally.
7114         * allocatestack.c (allocate_stack): Likewise.
7115         * descr.h (struct pthread): Add header.multiple_threads
7116         unconditionally.
7117         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
7118         Define for librt.  #error if neither libpthread, libc nor librt.
7119         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
7120         Likewise.
7121         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
7122         CDISABLE): Likewise.
7123         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
7124         CDISABLE): Likewise.
7125         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
7126         CDISABLE): Likewise.
7127         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
7128         CDISABLE): Likewise.  Access header.multiple_threads outside of
7129         libc and libpthread.
7130         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
7131         Likewise.
7132         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
7133         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
7135 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
7137         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
7138         Also test early cancellation before the thread reaches the cancellation
7139         point.
7141         * Makefile: Compile forward.c with exceptions.
7143         * sysdeps/unix/sysv/linux/sleep.c: New file.
7145 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
7147         * Makefile: Add CFLAGS definition to compile function wrappers
7148         duplicated from libc with exceptions.
7149         * tst-cancel4.c: Also check cancellation handlers.
7151         * Makefile: Add rules to build and run tst-cancel16 and
7152         tst-cancelx16.  Add missing CFLAGS definitions.
7153         * tst-cancel16.c: New file.
7154         * tst-cancelx16.c: New file.
7156 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
7158         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
7159         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
7160         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
7161         (DL_SYSINFO_IMPLEMENTATION): Likewise.
7163         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
7164         (LIBC_CANCEL_RESET): Likewise.
7165         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
7166         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
7167         librt-cancellation.
7168         (CFLAGS-libcrt-cancellation.c): Define.
7169         * sysdeps/pthread/librt-cancellation.c: New file.
7170         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
7171         macros also when compiling librt.
7172         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
7173         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
7174         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
7175         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
7176         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
7177         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
7178         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
7180         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
7181         compat_timer_create.
7183 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
7185         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
7187         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
7188         __register_atfork.
7189         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
7190         Add libc_hidden_def.
7192 2003-06-13  Roland McGrath  <roland@redhat.com>
7194         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
7195         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
7197 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
7199         * allocatestack.c (queue_stack): Always inline.
7200         * ptreadhP.h (__do_cancel): Likewise.
7202 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
7204         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
7205         a typo.
7207 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
7209         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7210         (__pthread_cond_signal): Remove incorrect second addition for
7211         cond_lock!=0.
7213 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
7215         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7216         (__pthread_cond_signal): Use correct futex pointer in
7217         __lll_mutex_lock_wait call.
7219         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7220         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
7222 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
7224         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
7225         cancelable.
7226         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
7227         Likewise.
7229         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
7230         hand-written CFI generation code.  Since ENTRY/END also initiated
7231         CFI frames this caused two CFI sets to be generated.
7233 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
7235         * cleanup_routine.c: New file.
7236         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
7237         * sysdeps/pthread/pthread.h: Add support for fully exception-based
7238         cleanup handling.
7239         * Makefile (libpthread-routines): Add cleanup_routine.
7240         Add more CFLAGS variables to compile with exceptions.  Add comments
7241         why which file needs unwind tables.
7242         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
7243         tests.
7244         * tst-cancelx1.c: New file.
7245         * tst-cancelx2.c: New file.
7246         * tst-cancelx3.c: New file.
7247         * tst-cancelx4.c: New file.
7248         * tst-cancelx5.c: New file.
7249         * tst-cancelx6.c: New file.
7250         * tst-cancelx7.c: New file.
7251         * tst-cancelx8.c: New file.
7252         * tst-cancelx9.c: New file.
7253         * tst-cancelx10.c: New file.
7254         * tst-cancelx11.c: New file.
7255         * tst-cancelx12.c: New file.
7256         * tst-cancelx13.c: New file.
7257         * tst-cancelx14.c: New file.
7258         * tst-cancelx15.c: New file.
7259         * tst-cleanupx0.c: New file.
7260         * tst-cleanupx0.expect: New file.
7261         * tst-cleanupx1.c: New file.
7262         * tst-cleanupx2.c: New file.
7263         * tst-cleanupx3.c: New file.
7265         * tst-cleanup0.c: Make standard compliant.
7266         * tst-cleanup1.c: Likewise.
7268         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
7269         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
7270         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
7271         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
7272         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7273         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7274         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
7275         CLEANUP_JMP_BUF.
7276         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7277         * tst-cancel12.c: New file.
7278         * tst-cancel13.c: New file.
7279         * tst-cancel14.c: New file.
7280         * tst-cancel15.c: New file.
7281         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
7282         and tst-cancel15.
7284         * tst-cancel1.c: Add some comments.
7286         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
7287         timeout correctly.
7289 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
7291         * Makefile (CFLAGS-pthread_cancel.c): Define.
7293 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
7295         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
7296         Change type of __writer element to int.
7297         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7298         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7299         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7300         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7301         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7302         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
7303         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7304         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
7305         Compare with TID to determine deadlocks.
7306         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
7307         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
7308         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
7309         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
7310         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
7311         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7312         Likewise.
7313         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7314         Likewise.
7315         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7316         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
7317         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
7318         Likewise.
7319         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
7320         Likewise.
7321         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
7322         * Makefile (tests): Add tst-rwlock12.
7323         * tst-rwlock12.c: New file.
7325 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
7327         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
7328         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
7329         Remove bogus hidden_proto.
7330         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
7331         Likewise.
7332         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
7333         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
7334         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
7335         ___lll_mutex_timedlock): Likewise.
7337 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
7339         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7340         (__pthread_cond_signal): Add some code to eventually handle
7341         cond_lock!=0.
7343 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
7345         * Makefile (tests): Add tst-exec4.
7346         (tst-exec4-ARGS): Define.
7347         * tst-exec4.c: New file.
7349 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
7351         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
7352         Also fail if tv_nsec < 0.
7353         (__lll_timedwait_tid): Likewise.
7354         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
7355         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
7356         Likewise.
7357         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
7358         Likewise.
7359         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
7360         Likewise.
7361         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
7362         Likewise.
7363         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
7364         Likewise.
7365         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
7366         Likewise.
7368         * Makefile (tests): Add tst-sem8 and tst-sem9.
7369         * tst-sem8.c: New file.
7370         * tst-sem9.c: New file.
7371         * sem_open.c: Fix creation of in_use record if the file exists but
7372         no internal record.
7374         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
7375         definitions.
7377         * sysdeps/pthread/timer_create.c (timer_create): In case
7378         evp==NULL, assign timer ID to sival_ptr.
7380         * descr.h (struct pthread_unwind_buf): Change type of prev element to
7381         struct pthread_unwind_buf *.
7382         (struct pthread): Likewise for cleanup_jmp_buf element.
7384         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
7385         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
7386         * unwind.c (__pthread_unwind_next): Likewise.
7388 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
7390         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7391         (lll_futex_timed_wait): Use int for futex value parameter.
7392         (lll_futex_wake): Likewise.
7393         (lll_futex_requeue): Likewise.
7395         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
7396         Replace one memory operation with one register operation.
7398         * tst-join4.c (do_test): Fix error message.
7400         * tst-rwlock6.c (do_test): Use correct format specifier.
7402         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
7403         (__lll_mutex_lock_wait): Replace one memory operation with one
7404         register operation.
7405         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
7406         (__lll_mutex_lock_wait): Likewise.
7408         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7409         (__lll_mutex_cond_lock): Add one to value parameter of
7410         __lll_lock_wait to reflect reality in the futex syscall.
7411         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
7412         (lll_mutex_cond_lock): Likewise.
7414 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
7416         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
7417         New function.
7418         (lll_mutex_cond_lock): Define.
7420 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
7422         * Makefile (tests): Add tst-signal6.
7423         * tst-signal6.c: New file.
7425         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
7426         (__lll_mutex_unlock_force): New function
7427         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
7429         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7430         (__lll_mutex_unlock_force): New function.
7431         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
7433         * tst-rwlock7.c (do_test): Use correct format specifier.
7435         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
7436         Find break parameter in correct asm argument.
7438 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
7440         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
7441         Remove out4.
7442         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
7443         error occured.
7444         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
7445         Add __mutex.
7446         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
7447         lll_futex_requeue, lll_mutex_unlock_force): Define.
7449 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
7451         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7452         (pthread_cond_t): Add __mutex.
7453         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
7454         lll_futex_requeue, lll_mutex_unlock_force): Define.
7456 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7458         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
7459         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
7460         Add __mutex field.
7461         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
7462         Define.
7463         (lll_futex_wait, lll_futex_wake): Define.
7464         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
7465         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
7466         FUTEX_REQUEUE instead of FUTEX_WAIT.
7467         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
7468         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
7469         mutex which was used in condvar structure.  Call
7470         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
7471         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
7473         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
7474         include tcb-offsets.h.  Read wakeup value in locked region.
7475         Use the value of gbr register as THREAD_ID.
7476         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7477         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7478         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7480         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
7481         macros.
7483 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
7485         * sysdeps/pthread/pthread_cond_broadcast.c
7486         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
7488 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
7490         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
7491         typo in register name.
7492         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
7493         correctly.  Actually use requeue.  Little optimization.
7494         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
7495         mutex address early.  Handle cancellation state as 32-bit value.
7496         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7497         Remove unnecessary label.
7499 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
7501         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
7502         instead of FUTEX_WAIT.
7503         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
7504         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
7505         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
7506         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
7507         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
7508         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
7509         used in condvar structure.  Call __pthread_mutex_cond_lock instead
7510         of __pthread_mutex_lock_internal.
7511         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7512         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7513         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7514         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
7515         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7516         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7517         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
7518         Add pthread_mutex_cond_lock.
7519         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
7520         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
7521         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
7522         lll_mutex_cond_lock.
7523         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
7524         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7525         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
7526         Add __mutex field.
7527         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7528         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7530         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
7531         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7533         * pthreadP.h: Declare __pthread_mutex_cond_lock.
7534         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
7535         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
7536         macro don't define aliases.
7538         * cancellation.c: Remove __pthread_enable_asynccancel_2.
7539         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
7540         * sysdeps/pthread/pthread_cond_timedwait.c: Use
7541         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
7542         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7543         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7544         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7545         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7546         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7548 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
7550         * sem_open.c: Fix one endless loop.  Implement correct semantics
7551         wrt opening the same semaphore more then once.
7552         * sem_close.c: Adjust for sem_open change.
7553         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
7554         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
7555         * Makefile (tests): Add tst-sem7.
7556         * tst-sem7.c: New file.
7558 2003-05-16  Roland McGrath  <roland@redhat.com>
7560         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
7561         uninitialized variable braino.
7563 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
7565         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
7566         test for syscall availability.
7568         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
7569         __no_posix_timers to -1 if the syscalls don't exist.
7571         * pthread_join.c (pthread_join): Set tid field of the joined
7572         thread to -1.  This isn't necessary but helps to recognize some
7573         error conditions with almost no cost.
7575         * allocatestack.c (FREE_P): Also negative values indicate an
7576         unused stack.
7578         * unwind.c: Include <unistd.h>.
7580 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
7582         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
7584 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
7586         * Makefile (crti-objs, crtn-objs): New variables.
7587         (omit-deps, extra-objs): Add crtn.
7588         ($(objpfx)libpthread.so): Depend on both crti and crtn
7589         and links to them in multidir.
7590         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
7592 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
7594         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
7595         (lll_mutex_unlock): Use atomic_exchange_rel.
7597 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
7599         * cond-perf.c (cons): Add missing locking around setting of alldone.
7601 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
7603         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
7604         related macros.
7605         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7607 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
7609         * tst-sem6.c: New file.
7610         * Makefile (tests): Add tst-sem6.
7612         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
7613         Use atomic_exchange_rel instead of atomic_exchange.
7614         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
7615         Likewise.
7617         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
7618         code for lll_futex_wait and lll_futex_wake in static apps.  Use
7619         vsyscall is possible.
7621         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
7622         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
7623         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
7624         pthread_setaffinity_np.
7625         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
7626         and pthread_setaffinity_np.
7627         * Makefile (libpthread-routines): Add pthread_getaffinity and
7628         pthread_setaffinity.
7630         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
7631         use it in case mmap to allocate the stack fails.
7632         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
7633         ARCH_MAP_FLAGS here.
7634         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
7635         ARCH_RETRY_MMAP.
7637 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
7639         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
7640         handler implementation.  It is now lockless in fork().
7641         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
7642         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
7643         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
7644         declare the __fork_*_lists.
7645         (struct fork_handler): Include pointers to all three functions.
7646         Add next, refcntr and need_signal elements.
7647         (__fork_handlers): New declaration.
7648         (__register_atfork_malloc): Remove declaration.
7649         (HAVE_register_atfork_malloc): Remove definition.
7650         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
7651         __pthread_child_handler variable.
7652         (__libc_pthread_init): Use __register_atfork instead of explicitly
7653         adding to the list.
7654         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
7655         and lll_futex_wake.
7656         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7658         * unwind.c (unwind_cleanup): Print error message and then abort.  This
7659         function must never be reached.
7661         * cond-perf.c: New file.
7663 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
7665         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
7667 2003-05-04  Roland McGrath  <roland@redhat.com>
7669         * Makefile ($(objpfx)../libc.so): New target.
7671 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
7673         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7674         (pthread_condattr_t): Size is only an int, don't use long for
7675         alignment.
7676         (pthread_mutexattr_t): Likewise.
7677         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7678         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7679         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7681 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
7683         * sysdeps/i386/tls.h: Define THREAD_ID.
7684         * sysdeps/ia64/tls.h: Likewise.
7685         * sysdeps/powerpc/tls.h: Likewise.
7686         * sysdeps/s390/tls.h: Likewise.
7687         * sysdeps/sh/tls.h: Likewise.
7688         * sysdeps/x86_64/tls.h: Likewise.
7689         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
7690         record ownership.
7691         * pthread_mutex_timedlock.c: Likewise.
7692         * pthread_mutex_trylock.c: Likewise.
7693         * pthread_mutex_unlock.c: Likewise.
7694         * pthread_rwlock_trywrlock.c: Likewise.
7695         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
7696         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
7697         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
7698         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
7700         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
7701         flag.
7703 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
7705         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7706         (__SIZEOF_PTHREAD_COND_T): Define to 48.
7707         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
7708         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
7709         Make __align long long instead of long.
7710         (pthread_rwlock_t): Formatting.
7711         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
7712         (pthread_rwlock_t): Formatting.
7713         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7714         (pthread_cond_t): Make __align long long instead of long.
7715         (pthread_rwlock_t): Move __flags field to the same position as in
7716         linuxthreads.
7718 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
7720         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
7721         * tst-rwlock7.c (do_test): Likewise.
7723 2003-04-26  Roland McGrath  <roland@redhat.com>
7725         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
7727 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
7729         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
7730         sizeof (struct pthread).
7731         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
7732         1 struct pthread.
7733         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
7734         to 0.
7735         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
7736         struct pthread.
7737         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
7738         to 32-bit bytes.
7739         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
7740         tcbp.
7741         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
7742         unneccessarily.
7743         (NO_TLS_OFFSET): Define.
7744         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
7745         add TLS_TCB_SIZE unnecessarily.
7747 2003-04-22  Roland McGrath  <roland@redhat.com>
7749         * Makeconfig (shared-thread-library): Reverse link order to work
7750         around linker bug.
7752 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
7754         * semaphore.h: Fix typo in comment.
7756 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
7758         * sysdeps/pthread/sigfillset.c: New file.
7760         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
7761         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
7762         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
7763         * sysdeps/pthread/sigaction.c: Likewise.
7764         * sysdeps/pthread/sigprocmask.c: New file.
7765         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
7766         __SIGRTMIN+1.
7767         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7768         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
7769         in this case.
7771 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
7773         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
7774         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
7776         * sysdeps/unix/sysv/linux/unregister-atfork.c
7777         (__unregister_atfork): Don't free memory not allocated dynamically.
7779         * semaphore.h: Remove __THROW marker from cancellation points.
7780         * nptl/sysdeps/pthread/pthread.h: Likewise.
7782 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
7784         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
7785         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
7786         __THROW.
7788 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
7790         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
7792 2003-04-15  Roland McGrath  <roland@redhat.com>
7794         * forward.c (__pthread_unwind): Tweak to avoid warning.
7796 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
7798         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
7800 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
7802         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
7803         overflow CFA advance instructions.
7804         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7806 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
7808         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
7809         * sysdeps/i386/pthread_spin_lock.c: Likewise.
7810         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
7811         defined.
7813         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
7814         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
7815         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
7816         DW_CFA_advance_loc for .Laddl-.Lsubl.
7818 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
7820         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
7821         position-independent unwind data for static libraries.
7822         Add missing unwind info.  Add comments.
7824         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
7825         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7826         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7827         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7829 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
7831         * Makefile: Make sure all cancellation points are compiled with
7832         exception and asynchronous unwind tables.
7834         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
7835         which mishandles loading of global object addresses in PIC.
7836         (THREAD_SETMEM_NC): Likewise.
7838 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7840         * pthread.h: Define new data structure for cleanup buffer.  Declare
7841         new cleanup handler interfaces.
7842         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
7843         (struct pthread): Add cleanup_jmp_buf pointer.  Define
7844         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
7845         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
7846         it.  Declare old cleanup handler installation functions.
7847         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
7848         handling.
7849         * cleanup_defer.c: Likewise.
7850         * cleanup_compat.c: New file.  Old cleanup code.
7851         * cleanup_def_compat.c: New file.  Old cleanup code.
7852         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
7853         if own thread descriptor.
7854         * unwind.c: New file.
7855         * forward.c: Add __pthread_unwind.
7856         * init.c (pthread_functions): Add __pthread_unwind.
7857         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
7858         Add ptr___pthread_unwind.
7859         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
7860         and unwind function.
7861         * Makefile (libpthread-routines): Add cleanup_compat,
7862         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
7863         table generation if necessary.
7864         * version.c: Record whether unwind support is compiled in.
7865         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
7866         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
7867         handler interfaces.
7868         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
7869         complication to generate unwind information for syscall wrappers.
7870         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
7871         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
7872         __cleanup_fct_attribute.
7874         * Makefile: Add rules to build and run tst-cleanup0.
7875         * tst-cleanup0.c: New file.
7876         * tst-cleanup0.expect: New file.
7878         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
7879         caller.  Optimize to avoid often unecessary local variable.
7881 2003-04-11  Roland McGrath  <roland@redhat.com>
7883         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
7884         sets variable `multidir'; include that.
7885         (generated): Add it.
7886         ($(objpfx)$(multidir)/crti.o): New target.
7887         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
7889 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7891         * tst-attr2.c (do_test): Add cast to avoid warning.
7892         * tst-mutex4.c (do_test): Likewise.
7894 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
7896         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
7897         in child.
7899 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
7901         * Makefile (tests): Add tst-detach1.
7902         * tst-detach1.c: New file.
7904 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
7906         * sysdeps/pthread/pthread.h: Remove duplicate
7907         pthread_cleanup_{push,pop} definitions.
7909         * tst-barrier2.c: Eliminate warnings.
7910         * tst-cancel4.c: Likewise.
7911         * tst-cond4.c: Likewise.
7912         * tst-cond6.c: Likewise.
7913         * tst-detach1.c: Likewise.
7914         * tst-rwlock4.c: Likewise.
7915         * tst-rwlock6.c: Likewise.
7916         * tst-rwlock7.c: Likewise.
7917         * tst-sem3.c: Likewise.
7918         * tst-spin2.c: Likewise.
7919         * tst-umask1.c: Likewise.
7921 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
7923         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
7925 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
7927         * descr.h (struct pthread): Move cancelhandling member to the front.
7929 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
7931         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
7932         malloc_parent, and malloc_child statically.
7933         (__register_atfork_malloc): New function.
7934         (free_mem): Don't free any of the malloc_* variables on the list.
7935         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
7936         Define HAVE_register_atfork_malloc.
7938 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
7940         * sysdeps/pthread/createthread.c (create_thread): Add some more
7941         comments explaining when to set multiple_threads and when not.
7943         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7944         THREAD_ATOMIC_BIT_SET if not already defined.
7945         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7946         THREAD_ATOMIC_BIT_SET:
7947         * sysdeps/x86_64/tls.h: Likewise.
7948         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
7949         THREAD_ATOMIC_CMPXCHG_VAL.
7950         (_pthread_cleanup_pop_restore): Likewise.
7951         * cancellation.c (__pthread_enable_asynccancel): Likewise.
7952         (__pthread_enable_asynccancel_2): Likewise.
7953         (__pthread_disable_asynccancel): Likewise.
7954         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7955         (__libc_disable_asynccancel): Likewise.
7956         * init.c (sigcancel_handler): Likewise.
7957         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
7958         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
7960 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
7962         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
7963         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7964         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
7965         * Makefile (tests): Add tst-cancel11.
7966         * tst-cancel11.c: New file.
7968 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
7970         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
7971         round, not the first.  Use specific_used flag instead of local
7972         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
7973         (__free_tcb): Don't call deallocate_tsd here.
7974         (start_thread): Call deallocate_tsd here.
7975         * pthread_setspecific.c: Set specific_used flag really only when
7976         needed.
7977         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
7978         * tst-tsd3.c: New file.
7979         * tst-tsd4.c: New file.
7981 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7983         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
7984         Use atomic_exchange_and_add instead of __lll_add.
7985         (__lll_mutex_timedlock): Likewise.
7986         Patch by Ian Wienand.
7988 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
7990         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7991         (SINGLE_THREAD_P): Fix typo.
7992         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
7994 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7996         * Makefile (tests): Add tst-align.
7997         * tst-align.c: New file.
7998         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
8000         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
8001         function correctly.
8003         * tst-tsd2.c: Add casts to avoid warnings.
8005 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
8007         * descr.h (struct pthread): Move most often used elements to the front.
8009 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
8011         * Makefile (libpthread-routines): Add pthread_atfork.
8012         (libpthread-static-only-routines): Add pthread_atfork.
8014 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
8016         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
8017         of TLS_DTV_AT_TP.
8018         (INSTALL_DTV): Add parens.
8019         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
8020         Use passed descr instead of THREAD_SELF.
8021         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
8022         (__lll_mutex_timedlock_wait): Correct expected value after
8023         spurious wakeup.
8024         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
8025         Release lock before waking up the waiters.
8026         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
8027         criteria.  Reorderstruct passed to cleanup handler.  Fix
8028         handling of cancellation and failung pthread_mutex_unlock call.
8029         Use __pthread_enable_asynccancel_2 instead of
8030         __pthread_enable_asynccancel.
8031         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
8032         Return result of lock re-get if it fails.
8033         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
8034         for __pthread_cleanup_push.
8035         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
8036         completely broken rwlock implementation.
8037         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8038         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
8039         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
8040         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
8041         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8042         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
8043         versioned_symbol macro.
8044         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
8045         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
8047 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
8049         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
8050         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
8051         and __helper_tid.
8052         (struct timer): Remove th and bar field.
8053         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
8054         debugging code.  Create only one helper thread.
8055         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
8056         helper thread.
8057         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
8058         Renamed.  Define statically.  Use thread info from siginfo.
8059         (__helper_once): New variable.
8060         (__helper_tid): New variable.
8061         (__reset_helper_control): New function.
8062         (__start_helper_thread): New function.
8064         * pthread_create.c (start_thread): Don't use setjmp inside
8065         __builtin_expect to work around gcc bug.
8067         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
8068         timer_delete syscall fails, but not with ENOSYS, set
8069         __no_posix_timers.
8071         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
8072         (timer_settime): Fix typo.
8073         * sysdeps/unix/sysv/linux/timer_getoverr.c
8074         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
8076 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
8078         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
8079         offset of cleanupbuf.__prev.
8081 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
8083         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
8084         of included file.
8086 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
8088         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
8089         NULL provide default definition to syscall.
8091 2003-03-25  Roland McGrath  <roland@redhat.com>
8093         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
8094         (timer_id2ptr): Fix typo.
8096 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
8098         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
8099         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
8100         * sysdeps/ia64/pthreaddef.h: Likewise.
8101         * sysdeps/powerpc/pthreaddef.h: Likewise.
8102         * sysdeps/s390/pthreaddef.h: Likewise.
8103         * sysdeps/sh/pthreaddef.h: Likewise.
8104         * sysdeps/x86_64/pthreaddef.h: Likewise.
8105         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
8106         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
8107         being changed.
8108         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
8109         SIGTIMER is not unblocked.
8110         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
8111         RT signal taken.
8112         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
8113         be send.
8114         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
8115         pass pointer through as ID.
8116         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
8117         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
8118         * sysdeps/unix/sysv/linux/timer_create.c: New file.
8119         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
8120         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
8121         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
8122         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
8123         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
8124         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
8125         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
8126         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
8127         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
8128         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
8129         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
8130         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
8131         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
8132         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
8133         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
8134         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
8135         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
8136         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
8137         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
8138         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
8139         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
8140         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
8141         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
8142         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
8143         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
8144         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
8145         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
8146         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
8147         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
8148         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
8150         * pthreadP.h: Remove FRAME_LEFT definition.
8151         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
8152         already left frame.  Programs which have this problem are not POSIX
8153         compliant.
8154         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
8156 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
8158         * sysdeps/pthread/tst-timer.c: Check return values of the
8159         functions we test.
8161 2003-03-23  Roland McGrath  <roland@redhat.com>
8163         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
8164         * tst-tls3mod.c: Likewise.
8165         * tst-tls1.c: Likewise.
8166         * tst-tls2.c: Likewise.
8168         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
8169         undefined behavior.
8171         * tst-join5.c (tf1, tf2): Add a cast.
8173         * Makeconfig (includes): Append -I$(..)nptl to this variable.
8175         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
8176         Don't test anything.
8177         * tst-cond4.c: Likewise.
8178         * tst-cond6.c: Likewise.
8179         * tst-flock2.c: Likewise.
8180         * tst-mutex4.c: Likewise.
8181         * tst-rwlock4.c: Likewise.
8182         * tst-signal1.c: Likewise.
8183         * tst-spin2.c: Likewise.
8184         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
8186         * tst-mutex4.c: Use test-skeleton.c.
8187         * tst-spin2.c: Likewise.
8188         * tst-sysconf.c: Likewise.
8189         * tst-barrier2.c: Likewise.
8190         * tst-cond4.c: Likewise.
8191         * tst-cond6.c: Likewise.
8192         * tst-rwlock4.c: Likewise.
8193         * tst-unload.c: Likewise.
8194         * tst-flock2.c (do_test): Use return instead of exit.
8196 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
8198         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
8200 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
8202         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
8203         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
8204         instead of __lll_compare_and_swap.
8205         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
8206         Likewise.
8207         Removed definition if __lll_compare_and_swap.
8209         * cancellation.c: Adjust for new form of compare&exchange macros.
8210         * cleanup_defer.c: Likewise.
8211         * init.c: Likewise.
8212         * libc-cancellation.c: Likewise.
8213         * old_pthread_cond_broadcast.c: Likewise.
8214         * old_pthread_cond_signal.c: Likewise.
8215         * old_pthread_cond_timedwait.c: Likewise.
8216         * old_pthread_cond_wait.c: Likewise.
8217         * pthread_cancel.c: Likewise.
8218         * pthread_create.c: Likewise.
8219         * pthread_detach.c: Likewise.
8220         * pthread_join.c: Likewise.
8221         * pthread_key_delete.c: Likewise.
8222         * pthread_setcancelstate.c: Likewise.
8223         * pthread_setcanceltype.c: Likewise.
8224         * pthread_timedjoin.c: Likewise.
8225         * pthread_tryjoin.c: Likewise.
8226         * sysdeps/pthread/createthread.c: Likewise.
8228 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
8230         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
8231         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
8232         definitions.  Replace uses with calls to atomic_* functions.
8233         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
8234         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
8235         __lll_test_and_set calls with atomic_exchange_and_add and
8236         atomic_exchange calls respectively.
8237         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
8238         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
8239         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
8240         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
8241         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
8242         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
8243         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
8245         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
8246         returns the old value.
8248 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
8250         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
8251         int for variable OLDVAL and correct inline assembler contraint.
8252         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
8253         type int for variable OLD.
8255         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
8256         only for s390-32.
8257         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
8258         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
8259         instead of multiple_threads field in the TCB.
8261 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
8263         * sysdeps/i386/i686/bits/atomic.h: Removed.
8264         * sysdeps/i386/i586/bits/atomic.h: Removed.
8265         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
8266         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
8267         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
8268         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
8269         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
8270         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
8271         * atomic.h: Removed.  Moved to glibc.
8273         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
8274         support for clock selection.
8276         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
8277         signalling waiters.
8279 2003-03-18  Roland McGrath  <roland@redhat.com>
8281         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
8282         Add __lll_rel_instr first.  Add memory clobber.
8283         (lll_mutex_unlock): Use __lll_test_and_set.
8284         From Paul Mackerras <paulus@samba.org>.
8286         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
8287         unconditionally.
8288         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
8289         (SINGLE_THREAD_P):  Add `header.' prefix.
8290         From Paul Mackerras <paulus@samba.org>.
8292         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
8293         pthread_timedjoin_np to ...
8294         (libpthread: GLIBC_2.3.3): ... here.
8295         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
8297         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
8298         Avoid shadowing VAL variable.
8300         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
8301         New macro.
8303 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
8305         * Makefile (tests): Add tst-cond11.
8306         * tst-cond11.c: New file.
8308         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
8309         struct passed to cleanup handler to eliminate one more
8310         instruction.
8311         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8313         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
8314         (pthrad_cond_t): Replace __unused field with __clock.
8316         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
8317         waken all waiters in cleanup handler.
8318         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
8319         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8321         * pthread_condattr_getclock.c: New file.
8322         * pthread_condattr_setclock.c: New file.
8323         * sysdeps/pthread/pthread.h: Declare these new functions.
8324         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
8325         * Makefile (libpthread-routines): Add the new functions.
8326         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
8327         Renamed field to value.  Document use of the bits.
8328         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
8329         change.
8330         * pthread_condattr_setpshared.c: Likewise.
8331         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
8332         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
8333         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
8334         Add __clock field.
8335         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
8336         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
8337         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
8338         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
8339         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
8340         Implement clock selection.
8341         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
8342         * pthread-errnos.sym: Add ENOSYS.
8343         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
8344         _POSIX_CLOCK_SELECTION.
8345         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
8347         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
8348         invalid .size directive.
8350 2003-03-17  Roland McGrath  <roland@redhat.com>
8352         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
8353         Formatting tweaks.
8355 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
8357         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
8358         Use __lll_add instead of spelling it out.  Use protected symbol names.
8359         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
8360         Use __lll_add.
8361         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
8362         Renamed from lll_compare_and_swap.  Use new name where necessary.
8363         (__lll_add): Defined.
8364         (__lll_dec_if_positive): Defined.
8365         (__lll_test_and_set): Defined.
8366         * sysdeps/ia64/pthread_spin_init.c: Removed.
8367         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
8368         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
8369         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
8370         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
8371         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
8372         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
8373         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
8374         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
8375         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
8376         __sync_lock_release_si.
8377         Patch by Jakub Jelinek.
8379         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
8380         Fix timeout handling.
8381         (__lll_timedwait_tid): Likewise.
8382         (lll_unlock_wake_cb): Wake up other waiters if necessary.
8383         Patch by Jakub Jelinek.
8385         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
8387 2003-03-17  Roland McGrath  <roland@redhat.com>
8389         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
8390         * sysdeps/pthread/pthread_spin_init.c: New file.
8391         * sysdeps/pthread/pthread_spin_unlock.c: New file.
8392         * sysdeps/powerpc/Makefile: New file.
8393         * sysdeps/powerpc/pthread_spin_lock.c: New file.
8394         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
8395         * sysdeps/powerpc/pthreaddef.h: New file.
8396         * sysdeps/powerpc/tcb-offsets.sym: New file.
8397         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
8398         * sysdeps/powerpc/tls.h: New file.
8399         * sysdeps/powerpc/bits/atomic.h: New file.
8400         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
8401         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
8402         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
8404         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
8405         * sysdeps/unix/sysv/linux/sem_post.c: New file.
8406         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
8407         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
8408         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
8409         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
8410         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
8411         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
8412         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
8413         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
8414         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
8415         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
8416         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
8417         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
8418         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
8420         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
8421         not gettimeofday.
8422         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
8423         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
8424         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
8425         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
8426         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8428 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
8430         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
8431         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
8432         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8433         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8434         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
8436 2003-03-16  Roland McGrath  <roland@redhat.com>
8438         * tst-fork4.c: Include <string.h>.
8439         * tst-signal2.c: Likewise.
8440         * tst-mutex5.c (do_test): exit -> return.
8441         * tst-mutex2.c: Include <stdlib.h>.
8443 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
8445         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
8446         (__lll_mutex_timedlock_wait): Correct expected value after
8447         spurious wakeup.  Otherwise we would never wait again.
8449         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
8450         zone versus inline asm stupidity.  Use correct instructions.
8452         * tst-rwlock6.c: Add some more status output.
8454 2003-03-15  Roland McGrath  <roland@redhat.com>
8456         * sysdeps/pthread/configure.in: New file.
8457         * sysdeps/pthread/configure: New file (generated).
8459 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
8461         * allocatestack.c (allocate_stack): Store the exact stack size of
8462         user allocated stacks.
8464 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
8466         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
8467         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
8468         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
8469         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
8470         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
8471         Use `header.' prefix.
8472         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
8474 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
8476         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
8477         __builtin_frame_address, use stack pointer.
8479         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
8480         instead of __builtin_frame_pointer.
8482 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
8484         * tst-basic1.c (do_test): Add cast to avoid warning.
8485         * tst-basic2.c (do_test): Likewise.
8487         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
8488         amount of stack correction.
8490         * tst-fork4.c: Use test-skeleton.c.
8492 2003-03-14  Roland McGrath  <roland@redhat.com>
8494         * init.c: Fix typo "#eli" for "#else".
8496 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
8498         * allocatestack.c (__stack_user): Use hidden_data_def.
8499         * pthread_create.c (__pthread_keys): Likewise.
8501         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
8503 2003-03-14  Roland McGrath  <roland@redhat.com>
8505         * tst-fork4.c: New file.
8506         * Makefile (tests): Add it.
8508         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
8509         we always define the padding space.
8510         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
8511         stopped supporting its own extensions fully.
8512         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
8513         struct also called `header', so `header.multiple_threads' is the field
8514         name to use on all machines.
8515         * allocatestack.c (allocate_stack): Use `header.' prefix.
8516         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8517         * pthread_create.c (__pthread_create_2_1): Likewise.
8518         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
8519         (THREAD_SELF): Likewise.
8520         * sysdeps/x86_64/tls.h: Likewise.
8521         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
8522         (SINGLE_THREAD_P): Likewise.
8523         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
8524         (SINGLE_THREAD_P): Likewise.
8525         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
8526         (SINGLE_THREAD_P): Likewise.
8528         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
8529         value directly.
8531 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
8533         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
8534         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
8536         * pthread_create.c (start_thread): setjmp is expected to return 0.
8538         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
8539         (THREAD_GETMEM_NC): Likewise.
8541 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
8543         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
8544         and the size of the stack which must be allocated is a multiple,
8545         allocate one more page.
8546         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
8547         MULTI_PAGE_ALIASING.
8549 2003-03-13  Roland McGrath  <roland@redhat.com>
8551         * pthread_create.c (start_thread): Set EXITING_BIT after the
8552         event-reporting (and destructors), not before.
8554 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
8556         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
8557         lll_futex_wake): Declare register variables as long int instead of
8558         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
8559         Make syscall arguments clobbered by the syscall.
8560         (lll_futex_wait): Define using lll_futex_timed_wait.
8562         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
8563         to void *.
8565         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
8566         PPID if [! NDEBUG].
8568         * allocatestack.c (nptl_ncreated): Only declare if
8569         COLORING_INCREMENT != 0.
8571         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
8572         (__libc_enable_asynccancel_2): Remove prototype.
8574         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
8575         ctid to match kernel.
8577 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
8579         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
8580         libc_multiple_threads.
8581         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
8582         __libc_multiple_threads to...
8583         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
8585         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
8586         versioning.
8587         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8588         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8590         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
8591         (__pthread_once_internal): Define.
8593         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
8594         macros instead of .symver directly.
8595         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
8596         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
8598         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
8599         * sysdeps/x86_64/tcb-offsets.sym: New file.
8600         * sysdeps/x86_64/Makefile: New file.
8602         * sysdeps/i386/tcb-offsets.sym: Add SELF.
8603         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
8604         to access own pthread_t in TCB.
8605         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8606         Likewise.
8607         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8608         Likewise.
8609         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8611 2003-03-12  Roland McGrath  <roland@redhat.com>
8613         * pthread-errnos.sym: New file.
8614         * Makefile (gen-as-const-headers): New variable, list that file.
8615         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
8616         header <pthread-errnos.h> instead of defining errno values here.
8617         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
8618         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8619         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8620         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8621         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8622         Likewise.
8623         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8624         Likewise.
8625         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8626         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8627         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8628         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8629         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8630         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8631         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
8632         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
8633         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
8634         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
8635         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
8636         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
8637         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
8638         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
8639         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
8640         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8641         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
8642         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
8643         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
8644         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
8645         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8646         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
8647         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
8648         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
8649         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
8650         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
8651         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
8653         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
8654         CLONE_CHILD_SETTID worked.
8656 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
8658         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
8659         file.
8660         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
8661         file.
8663         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
8664         (pthread_cond_t): Add padding.
8666         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
8667         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
8668         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
8670         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
8671         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
8672         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
8673         (__pthread_rwlock_timedrdlock): Likewise.
8674         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
8675         (__pthread_rwlock_wrlock): Likewise.
8676         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
8677         (__pthread_rwlock_rdlock): Likewise.
8679         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
8681         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
8682         result of lock re-get if it fails.
8684 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8686         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
8687         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
8688         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
8689         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
8690         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
8691         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
8692         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
8693         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
8694         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8695         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8697         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
8698         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
8700         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
8701         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
8702         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
8703         (create_thread): Likewise.
8704         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
8705         * init.c (__pthread_initialize_minimal_internal): Initialize
8706         __libc_multiple_threads_ptr if necessary.
8707         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
8708         __pthread_multiple_threads and __libc_multiple_threads_ptr.
8709         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
8710         __libc_multiple_threads.
8711         (__libc_pthread_init): Return pointer to __libc_pthread_init if
8712         necessary.
8714         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
8715         (THREAD_SETMEM_NC): Likewise.
8717         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
8718         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
8719         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
8720         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
8722         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
8723         Eliminate one entire instruction.
8725         * cancellation.c (__pthread_enable_asynccancel_2): New function.
8726         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
8727         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
8728         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
8729         instead of __pthread_enable_asynccancel.
8730         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8731         (__pthread_cond_wait): Likewise.
8732         * sysdeps/pthread/pthread_cond_timedwait.c
8733         (__pthread_cond_timedwait): Likewise.
8734         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
8736         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8737         (__condvar_cleanup): Wake up all waiters in case we got signaled
8738         after being woken up but before disabling asynchronous
8739         cancellation.
8740         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8741         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
8742         (__condvar_cleanup): Likewise.
8744         * init.c (__NR_set_tid_address): If already defined, don't redefine.
8745         Make it an error if architecture has no #if case.  Add x86-64.
8747         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
8748         pt-initfini.s generation.
8750         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
8751         (TLS_INIT_TP): Fix typo.
8753 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8755         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
8756         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
8758         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
8759         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
8760         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
8761         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
8762         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
8763         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8764         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8765         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8767 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8769         * sysdeps/pthread/pthread_cond_timedwait.c
8770         (__pthread_cond_timedwait): Return the result of the final
8771         locking.  If it succeeds, the regular function return value.
8773         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
8774         Return result of the final locking.
8775         * version.c (__nptl_main): Work around problems with the strange
8776         INTERNAL_SYSCALL macro on ppc32.
8777         * init.c (__pthread_initialize_minimal_internal): Unblock
8778         SIGCANCEL in case the parent blocked it.
8779         Reported by Paul Mackerras <paulus@samba.org>.
8781         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
8782         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
8783         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
8785 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8787         * sysdeps/pthread/pthread_cond_timedwait.c
8788         (__pthread_cond_timedwait): Unlock and fail if
8789         __pthread_mutex_unlock_internal failed.
8791         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
8792         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
8793         Use ARCH_CLONE.
8794         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
8795         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
8796         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
8797         ALLOCATE_STACK): New macros.
8798         (TLS_TPADJ): New macro.
8799         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
8800         (allocate_stack): Handle TLS_DTV_AT_TP and
8801         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
8802         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
8803         Don't set PD->self.
8804         * init.c [__ia64__] (__NR_set_tid_address): Define.
8806         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
8807         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
8808         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
8809         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
8810         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
8811         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
8812         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
8813         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
8814         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
8815         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
8816         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
8817         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
8818         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
8819         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
8820         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
8821         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
8822         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
8823         * sysdeps/ia64/bits/atomic.h: New file.
8824         * sysdeps/ia64/Makefile: New file.
8825         * sysdeps/ia64/pthread_spin_init.c: New file.
8826         * sysdeps/ia64/pthread_spin_lock.c: New file.
8827         * sysdeps/ia64/pthread_spin_trylock.c: New file.
8828         * sysdeps/ia64/pthread_spin_unlock.c: New file.
8829         * sysdeps/ia64/pthreaddef.h: New file.
8830         * sysdeps/ia64/tcb-offsets.sym: New file.
8831         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
8832         * sysdeps/ia64/tls.h: New file.
8834         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
8835         to syscall instead of no arguments.
8837 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
8839         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
8840         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
8841         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
8842         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
8844         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
8845         unused code.
8847         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
8849         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8850         lowlevelbarrier.sym.
8851         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
8852         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
8853         Include lowlevelbarrier.h and don't define offsets locally.
8854         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
8856         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
8857         (__lll_mutex_lock_wait): Reverse order of first two parameters.
8858         (__lll_mutex_timedlock_wait): Likewise.
8859         (lll_mutex_lock): Adjust asm for that.
8860         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
8861         (lll_lock): Adjust asm for operand order change.
8862         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
8863         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
8865         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
8866         Reverse order of parameters.
8867         (__lll_timedwait_tid): Remove regparms attribute.
8868         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
8869         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
8871         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8872         (__lll_timedwait_tid): Remove one unnecessary instruction.
8874         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
8875         __lll_mutex_timedlock_wait only for NOT_IN_libc.
8876         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
8877         lowlevelmutex.S.
8879         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
8880         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
8881         for NOT_IN_libc.
8882         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
8883         lowlevellock.S.
8885         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
8886         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
8887         for libc.so.
8888         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
8889         define LOCK here (if UP is not defined).  The actual code is in
8890         lowlevelmutex.S.
8892         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
8893         LOCK is already defined.  Don't define lll_unlock_wake_cb and
8894         __lll_timedwait_tid for libc.so.
8895         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
8896         define LOCK here (if UP is not defined).  The actual code is in
8897         lowlevellock.S.
8899         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
8900         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
8901         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
8902         instead of lowlevelsem.h.
8903         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8904         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8905         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8907         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8908         lowlevelrwlock.sym.
8909         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
8910         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
8911         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
8913         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
8914         register loading.
8915         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
8916         last changed.  D'oh.
8918         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
8920         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
8921         of __libc_locking_needed.
8922         (lll_trylock): Initialize %eax to zero.
8924         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
8925         pthread_cond_t definition.
8927 2003-03-10  Roland McGrath  <roland@redhat.com>
8929         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
8930         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
8931         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
8932         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
8933         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
8935         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
8936         Instead of setting PD->multiple_threads, set globals
8937         __pthread_multiple_threads and __libc_multiple_threads.
8938         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8939         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
8940         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
8942         * descr.h (struct pthread): Conditionalize first member on
8943         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
8944         containing an anonymous tcbhead_t.  Move `list' member out.
8945         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
8946         * allocatestack.c: Remove use of `header.data.' prefix.
8947         * pthread_create.c: Likewise.
8948         * init.c (__pthread_initialize_minimal_internal): Likewise.
8949         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8950         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
8951         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
8952         * sysdeps/x86_64/tls.h: Likewise.
8953         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
8954         (SINGLE_THREAD_P): Likewise.
8955         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
8956         (SINGLE_THREAD_P): Likewise.
8957         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
8958         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
8960 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
8962         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
8964         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
8965         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8967         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
8968         leftovers from the ia32 code.
8970         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
8971         memory load.
8972         (clear_once_control): Don't load %esi.
8974         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
8975         handling.
8977         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8979         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
8980         * sysdeps/unix/sysv/linux/createthread.c: ...here.
8982         * Makefile (tests): Add tst-cond10.
8983         * tst-cond10.c: New file.
8985 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
8987         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
8988         * tst-signal3.c (do_test): Likewise.
8989         * tst-sem5.c (do_test): Likewise.
8990         * tst-kill6.c (do_test): Likewise.
8991         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
8993         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
8994         of inc/dec.
8995         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
8996         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
8997         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8998         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8999         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
9000         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
9001         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9002         Likewise.
9003         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9004         Likewise.
9005         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
9006         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
9007         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9008         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
9009         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
9010         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
9011         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
9012         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
9014         * allocatestack.c (allocate_stack): If mprotect() fails free the
9015         TLS memory.
9017 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
9019         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
9021         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
9022         lll_wake_tid.  This was used only to work around kernel limits in
9023         the early days.
9024         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
9025         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
9026         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
9027         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
9029         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
9030         (__pthread_initialize_minimal_internal): Change initialization of
9031         __static_tls_align_m1 appropriately.
9032         * pthreadP.h (__static_tls_align_m1): Renamed from
9033         __static_tls_align.
9034         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
9035         instead of __static_tls_align-1.
9037 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
9039         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
9041         * pthread_create.c: Define __pthread_keys using nocommon
9042         attribute, not by placing it explicitly in bss.
9043         Remove DEFINE_DEALLOC definition.  Not needed anymore.
9045         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
9046         Use it in mmap call to allocate stacks.
9048         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
9050         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
9051         result of the thread function.
9053 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
9055         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
9056         version is just fine.
9058         * sysdeps/unix/sysv/linux/libc_pthread_init.c
9059         (__pthread_child_handler): Renamed from pthread_child_handler,
9060         exported, and marked hidden.  Change all users.
9061         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
9062         free __pthread_child_handler from child list.
9064 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9066         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
9068         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
9069         Fix handling of cancellation and failing pthread_mutex_unlock call.
9070         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
9071         (__pthread_cond_wait): Likewise.
9073         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
9074         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
9075         lll_futex_timed_wait call.
9076         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
9077         (pthread_rwlock_timedwrlock): Likewise.
9079         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
9080         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
9081         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
9083         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
9084         check of lll_futex_wake return value.
9086 2003-03-03  Roland McGrath  <roland@redhat.com>
9088         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
9090         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9091         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
9092         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
9094 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
9096         * sysdeps/pthread/timer_create.c (timer_create): Return correct
9097         error for CPU clocks.
9099         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
9100         _POSIX_MONOTONIC_CLOCK.
9101         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
9103         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
9104         recent kernels.
9106 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
9108         * descr.h (struct pthread): Move cleanup field to the front.
9110 2003-03-01  Roland McGrath  <roland@redhat.com>
9112         * sem_open.c (sem_open): Braino fix.
9114 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
9116         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
9117         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
9118         __pthread_cleanup_pop functionality.
9119         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9121         * descr.h (struct pthread): Move tid field to the front now that
9122         it is often used.
9124         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
9125         (__lll_mutex_timedlock_wait): Remove.
9126         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
9127         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
9128         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
9129         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9130         (lll_unlock_wake_cb): Don't save and restore %esi.
9131         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
9132         %esi.
9133         (__lll_timedwait_tid): Add alignment.
9134         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
9135         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
9136         %esi.
9137         (__lll_timedwait_tid): Removed.
9138         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
9139         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
9140         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
9141         (pthread_barrier_wait): Don't save, load, and restore %esi for
9142         last thread.
9143         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
9144         (__pthread_cond_signal): Don't save, load, and restore %esi.
9145         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
9146         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
9147         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
9148         Don't save, load, and restore %esi.
9150 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
9152         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
9153         Release lock before waking up the waiters.
9155         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
9157         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
9158         (reader_thread): Likewise.
9160         * sysdeps/pthread/pthread_rwlock_unlock.c
9161         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
9162         to wake up readers if there are none.
9164         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
9165         Release internal lock before wake threads.
9167 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
9169         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
9170         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
9171         predefined.
9172         * tst-rwlock9.c: Likewise.
9173         * tst-rwlock10.c: New file.
9174         * tst-rwlock11.c: New file.
9176         * Makefile (tests): Add tst-dlsym1.
9177         * tst-dlsym1.c: New file.
9179         * init.c (__pthread_initialize_minimal_internal): Set
9180         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
9181         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
9183 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
9185         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
9187         * tst-cond2.c: Fix sychronization with child.
9189         * tst-rwlock8.c (reader_thread): Remove unused variable.
9191         * Makefile: Add rules to build and run tst-tls3.
9192         * tst-tls3.c: New file.
9193         * tst-tls3mod.c: New file.
9195         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
9196         * tst-rwlock8.c: New file.
9197         * tst-rwlock9.c: New file.
9198         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
9199         complete broken rwlock implementation.
9200         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9201         Likewise.
9202         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9203         Likewise.
9204         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
9205         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
9206         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
9207         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
9208         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
9209         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
9210         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
9212 2003-02-23  Roland McGrath  <roland@redhat.com>
9214         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
9216 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
9218         * Makefile (tests): Add tst-context1.
9219         * tst-context1.c: New file.
9221         * Makefile (tests): Add tst-tls1 and tst-tls2.
9222         * tst-tls1.c: New file.
9223         * tst-tls2.c: New file.
9225         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
9226         for failed cmpxchg.
9228         * pthread_create.c (start_thread): Set EXITING_BIT early.
9230         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
9231         (THREAD_GETMEM_NC): Likewise.
9233 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
9235         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
9236         off 3 more bytes by using offset-less instructions when possible.
9238         * Makefile: Add dependency for $(objpfx)version.d.
9240         * eintr.c (eintr_source): Add unnecessary return but the compiler
9241         insists.
9243         * tst-kill3.c: Include <unistd.h>.
9245 2003-02-21  Roland McGrath  <roland@redhat.com>
9247         * pthread_create.c (start_thread): Call __libc_thread_freeres.
9249 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
9251         * Makefile (tests): Add tst-eintr1.
9252         (distribute): Add eintr.c.
9253         * tst-eintr1.c: New file.
9254         * eintr.c: New file.
9256         * pthread_cancel.c (pthread_cancel): Use tkill directly.
9258         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
9259         Disallow sending SIGCANCEL.
9261         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
9262         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
9263         * tst-kill1.c: New file.
9264         * tst-kill2.c: New file.
9265         * tst-kill3.c: New file.
9266         * tst-kill5.c: New file.
9267         * tst-kill6.c: New file.
9268         * tst-basic7.c: Renamed to...
9269         * tst-kill4.c: ...this.
9271 2003-02-21  Roland McGrath  <roland@redhat.com>
9273         * Makefile (install-lib-ldscripts): New variable.
9275 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
9277         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
9278         * pthread_cancel.c: Use INVALID_TD_P.
9279         * pthread_detach.c: Likewise.
9280         * pthread_getschedparam.c: Likewise.
9281         * pthread_setschedparam.c: Likewise.
9282         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
9283         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
9284         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
9285         * pthread_timedjoin.c: Likewise.
9287         * tst-basic7.c: Include <signal.h>.
9289         * pthread_join.c (pthread_join): Limited checking for invalid
9290         descriptors.
9291         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
9293 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
9295         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
9296         beginning of the loop.  Clear the entire first block of TSD.
9297         * Makefile (tests): Add tst-key4.
9298         * tst-key4.c: New file.
9300 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
9302         * Makefile (tests): Add tst-basic7.
9303         * tst-basic7.c: New file.
9305         * pthread_create.c (deallocate_tsd): Mark as internal_function.
9306         Add some more __builtin_expect.
9308         * pthreadP.h: Define dummy version of DEBUGGING_P.
9310 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
9312         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
9313         _POSIX_THREAD_PRIORITY_SCHEDULING.
9314         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
9315         _XOPEN_REALTIME_THREADS.
9316         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
9318         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
9319         kernel returns EINVAL for PID <= 0, work around it.
9321         * Makefile (tests): Add tst-signal5.
9322         * tst-signal5.c: New file.
9324         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
9325         and LOGIN_NAME_MAX.
9327         * tst-cancel1.c (tf): Block all signals.
9329         * Makefile (tests): Add tst-basic6.
9330         * tst-basic6.c: New file.
9332         * tst-basic1.c: Add test for process ID.
9334         * Makefile (tests): Add tst-cancel10.
9335         * tst-cancel10.c: New file.
9337         * Makefile (tests): Add tst-signal4.
9338         * tst-signal4.c: New file.
9340         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
9341         __sigismember instead of sigismember.  Add __builtin_expect.
9343 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
9345         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
9346         pthread_setcancelstate, and pthread_rwlock_setpshared.
9348         * tst-cancel7.c (do_test): Make sure the pid file exists before
9349         canceling the thread.
9351         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
9352         pthread_rwlock_timedrdlock tests.
9353         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
9354         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9355         Check for invalid tv_nsec field.
9356         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9357         Likewise.
9359         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
9360         recursive mutex of overflow.
9362         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
9364         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
9365         going into an endless loop.
9366         * Makefile (tests): Add tst-cancel9.
9367         * tst-cancel9.c: New file.
9369         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
9371 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
9373         * tst-mutex5.c (do_test): Add more timedlock tests.
9375         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
9376         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
9378         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
9379         use INLINE_SYSCALL.  Error number is returned, not -1.
9381         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
9382         and __deallocate_stack with internal_function.
9383         * pthread_create.c: Adjust definitions appropriately.
9384         * allocatestack.c: Likewise.
9386         * pthread_join.c: Add one more __builtin_expect.
9387         * pthread_timedjoin.c: Likewise.
9389         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
9390         not data of sequence number does not match.
9391         Add one __builtin_expect.
9393         * Makefile (tests): Add tst-clock1.
9394         * tst-clock1.c: New file.
9396         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
9397         negative arguments.
9398         * Makefile (tests): Add tst-basic5.
9399         * tst-basic5.c: New file.
9401 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
9403         * Makefile (tests): Add tst-basic4.
9404         * tst-basic4.c: New file.
9406         * pthreadP.h: Add declaraction for __nptl_nthreads.
9407         * pthread_create.c: Define __nptl_nthreads
9408         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
9409         after thread is done.  If then zero, call exit(0).
9410         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9411         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
9412         * init.c (pthread_functions): Initialize ptr_nthreads.
9413         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
9414         (__reclaim_stacks): Decrement __nptl_nthreads.
9415         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
9416         Define.
9417         * Makefile (tests): Add tst-basic3.
9418         * tst-basic3.c: New file.
9420         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
9421         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
9422         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
9423         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
9424         if asynchronous canceling is enabled.
9425         * pthread_join.c (pthread_join): When recognizing circular joins,
9426         take into account the other thread might be already canceled.
9427         * Makefile (tests): Add tst-join5.
9428         * tst-join5.c: New file.
9430         * Makefile (tests): Add tst-join4.
9431         * tst-join4.c: New file.
9433 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
9435         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
9437 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9439         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
9440         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
9441         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
9442         warning.
9443         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
9444         to avoid warning.
9445         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
9446         error if lll_futex_wake failed.
9448 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
9450         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
9451         handling of cancellation and failung pthread_mutex_unlock call.
9452         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9453         * Makefile (tests): Add tst-cond8 and tst-cond9.
9454         * tst-cond8.c: New file.
9455         * tst-cond9.c: New file.
9457         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
9459         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
9460         non-standard initializers with __USE_GNU.
9462         * Makefile (tests): Add tst-cleanup3.
9463         * tst-cleanup3.c: New file.
9465 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
9467         * Makefile (tests): Add tst-attr1 and tst-attr2.
9468         * tst-attr1.c: New file.
9469         * tst-attr2.c: New file.
9471         * Makefile: Add rules to build and run tst-atfork2 test.
9472         * tst-atfork2.c: New file.
9473         * tst-atfork2mod.c: New file.
9475         * sysdeps/unix/sysv/linux/unregister-atfork.c
9476         (__unregister_atfork): Free the memory allocated for the handlers
9477         after removing them from the lists.
9479         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
9480         cleanup function.
9482         * tst-atfork1.c (do_test): Wait for the child we forked.
9483         Report error in child.
9485         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
9487         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
9489 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
9491         * Makefile (tests): Add tst-cancel8.
9492         * tst-cancel8.c: New file.
9494         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
9495         clearing of control variable.
9496         * Makefile (tests): Add tst-once3 and tst-once4.
9497         * tst-once3.c: New file.
9498         * tst-once4.c: New file.
9500 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
9502         * sysdeps/sh/Makefile: New file.
9503         * sysdeps/sh/bits/atomic.h: New file.
9504         * sysdeps/sh/pthread_spin_init.c: New file.
9505         * sysdeps/sh/pthread_spin_lock.c: New file.
9506         * sysdeps/sh/pthread_spin_trylock.S: New file.
9507         * sysdeps/sh/pthread_spin_unlock.S: New file.
9508         * sysdeps/sh/pthreaddef.h: New file.
9509         * sysdeps/sh/tcb-offsets.sym: New file.
9510         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
9511         * sysdeps/sh/tls.h: New file.
9512         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
9513         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
9514         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
9515         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
9516         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
9517         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
9518         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
9519         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
9520         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
9521         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
9522         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
9523         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
9524         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
9525         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
9526         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
9527         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
9528         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
9529         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
9530         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
9531         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
9532         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
9533         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
9534         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
9535         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
9536         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
9537         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
9538         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
9539         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
9540         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
9541         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
9543 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
9545         * tst-cond2.c: Rearrange code to not rely on behavior undefined
9546         according to POSIX.
9548         * tst-basic2.c (do_test): Lock mutex before creating the thread.
9550 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
9552         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
9553         (TLS_GET_FS): New #define.
9554         (TLS_SET_FS): New #define.
9555         Correct value of __NR_set_thread_area.
9557         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
9559 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
9561         * Makefile (tests): Add tst-popen1.
9562         * tst-popen1.c: New file.
9564         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
9565         but inactive generalization.
9566         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9567         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
9568         Minor optimization, remove one instruction.
9569         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
9571 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9573         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
9575 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9577         * init.c (__NR_set_tid_address): Add #ifdef for s390.
9578         * sysdeps/pthread/pthread_barrier_wait.c: New file.
9579         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
9580         * sysdeps/pthread/pthread_cond_signal.c: New file.
9581         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
9582         * sysdeps/pthread/pthread_cond_wait.c: New file.
9583         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
9584         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
9585         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
9586         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
9587         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
9588         * sysdeps/s390/Makefile: New file.
9589         * sysdeps/s390/bits/atomic.h: New file.
9590         * sysdeps/s390/pthread_spin_init.c: New file.
9591         * sysdeps/s390/pthread_spin_lock.c: New file.
9592         * sysdeps/s390/pthread_spin_trylock.c: New file.
9593         * sysdeps/s390/pthread_spin_unlock.c: New file.
9594         * sysdeps/s390/pthreaddef.h: New file.
9595         * sysdeps/s390/tcb-offsets.sym: New file.
9596         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
9597         * sysdeps/s390/tls.h: New file.
9598         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
9599         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
9600         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
9601         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
9602         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
9603         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
9604         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
9605         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
9606         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
9607         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
9608         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
9609         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
9610         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
9611         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
9612         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
9613         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
9614         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
9615         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
9616         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
9617         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
9618         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
9619         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
9620         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
9622 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
9624         * atomic.h: Add a couple more default implementations.
9625         (atomic_compare_and_exchange_acq): Use
9626         __arch_compare_and_exchange_32_acq in return value definition.  It
9627         always exists.
9628         (atomic_bit_set): Renamed from atomic_set_bit.
9629         Add missing atomic_ prefixes.
9631         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
9632         thread library is available, use correct value to mark initialized
9633         once variable.
9635 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
9637         * allocatestack.c (allocate_stack): Use __getpagesize instead of
9638         __sysconf to determine pagesize.
9640         * pthread_create.c: Include <atomic.h>.
9641         * allocatestack.c (allocate_stack): Implement coloring of the
9642         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
9643         size minus one.  Adjust users.
9644         * sysdeps/i386/i686/Makefile: New file.
9646 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
9648         * allocatestack.c: Improve comment throughout the file.
9650         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9651         (__lll_lock_wait): Add branch prediction.
9652         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
9653         (__lll_lock_wait): Likewise.
9654         (lll_unlock_wake_cb): Removed.
9656 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
9658         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
9659         _POSIX_THREAD_PRIORITY_SCHEDULING.
9661 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
9663         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9664         Fix return type of ptr___pthread_getspecific.
9666 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
9668         * Makefile (tests): Add tst-umask1.
9669         (tst-umask1-ARGS): Define.
9670         * tst-umask1.c: New file.
9672 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
9674         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
9675         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
9676         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
9677         pthread_rwlock_unlock.
9678         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
9679         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
9680         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
9681         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
9682         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9683         New file.
9684         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
9685         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9686         New file.
9687         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
9688         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
9689         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
9690         New file.
9691         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
9692         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
9693         New file.
9694         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
9695         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
9696         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
9697         New file.
9698         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
9699         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
9700         New file.
9701         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
9703         * Makefile (libpthread-routines): Remove lowlevelcond and
9704         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
9705         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
9706         and pthread_cond_broadcast.
9707         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
9708         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
9709         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
9710         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
9711         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
9712         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
9713         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
9714         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
9715         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
9716         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
9717         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
9718         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
9719         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
9720         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
9721         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
9722         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
9723         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
9724         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
9725         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
9726         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
9727         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
9728         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
9729         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
9730         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
9731         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
9732         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
9733         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
9734         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
9735         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
9736         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
9737         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
9739         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
9740         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
9741         of the code is moved to ...
9742         * sysdeps/pthread/createthread.c: ...here.  New file.
9744 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
9746         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
9747         (__new_sem_post): Clear %eax before returning.
9748         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
9750         * Makefile (tests): Add tst-cleanup2.
9751         * tst-cleanup2.c: New file.
9753         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
9754         Interpret first parameter correctly.
9756 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
9758         * Makefile (headers): Add bits/semaphore.h.
9760 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
9762         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
9763         if not SHARED.
9765 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
9767         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
9768         must be used and mapping failed.
9769         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
9771         * Makefile (CFLAGS-pthread_self.os): Define this, not
9772         CFLAGS-pthread_self.c.
9774 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9776         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
9777         lll_unlock_wake_cb.
9779         * Makefile (libpthread-routines): Add version.  Add rules to build
9780         version.os and banner.h.
9781         * version.c: New file.
9783 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
9785         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
9786         the alias unconditional.
9787         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
9789 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9791         * Makefile (CFLAGS-pthread_self.c): New definition.
9793 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9795         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
9796         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
9797         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
9798         * init.c (__pthread_initialize_minimal_internal): Likewise.
9800 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
9802         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
9804         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
9805         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9806         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9807         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
9808         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9809         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9811 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9813         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
9814         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
9815         * tst-cancel-wrappers.sh: Remove all exceptions.
9817 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
9819         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
9820         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
9822         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
9823         Use __libc_pthread_functions array if SHARED.
9825         * pthreadP.h: Move pthread_cond_2_0_t definition to...
9826         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
9828         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
9829         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
9830         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
9831         __libc_ptf_call instead of __libc_maybe_call.
9832         (PTF): New #define.
9833         (__libc_cleanup_region_start): Wrap function name with PTF call.
9834         (__libc_cleanup_region_end): Likewise.
9835         (__libc_cleanup_end): Likewise.
9837         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
9838         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
9839         * pthread_key_create.c: Add __pthread_key_create_internal alias.
9840         * pthreadP.h: Add prototypes.
9842         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
9843         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
9844         __pthread_rwlock_unlock aliases.
9845         * pthreadP.h: Add prototypes for new aliases.
9847         * pthreadP.h (struct pthead_functions): Moved to...
9848         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
9849         * init.c (pthread_functions): Add initializers for new elements.
9851         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
9852         __pthread_cleanup_pop_restore aliases.
9853         * pthreadP.h: Add prototypes.
9855         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
9856         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
9857         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
9858         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
9859         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
9860         * pthreadP.h: Adjust prototypes and callers.
9862 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
9864         * Makefile (tests): Add tst-cancel7.
9865         (tst-cancel7-ARGS): New variable.
9866         * tst-cancel7.c: New file.
9868         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
9869         around gcc defficiencies.
9870         * old_pthread_cond_signal.c: Likewise.
9871         * old_pthread_cond_timedwait.c: Likewise.
9872         * old_pthread_cond_wait.c: Likewise.
9874         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
9876 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9878         * Makefile (tests): Add tst-cond7.
9879         * tst-cond7.c: New file.
9881         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9882         (condvar_cleanup): Get condvar address from the right place.
9884         * atomic.h: Correct definitions of atomic_full_barrier,
9885         atomic_read_barrier, atomic_write_barrier.
9887         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
9888         race-free.
9889         * old_pthread_cond_signal.c: Likewise.
9890         * old_pthread_cond_timedwait.c: Likewise.
9891         * old_pthread_cond_wait.c: Likewise.
9893 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
9895         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
9897 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9899         * pthreadP.h (pthread_cond_2_0_t): New type.
9900         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
9901         Use new type for the 2.0 condvar function prototypes.
9902         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
9903         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
9904         parameter.
9905         * old_pthread_cond_destroy.c: Likewise.
9906         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
9907         * old_pthread_cond_signal.c: Likewise.
9908         * old_pthread_cond_timedwait.c: Likewise.
9909         * old_pthread_cond_wait.c: Likewise.
9911         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9912         (__pthread_cond_wait): Don't save cancellation mode and seq value
9913         in same location.
9915         * herrno.c (__h_errno_location): Don't define as weak.
9917 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9919         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
9920         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
9921         and pthread_cond_wait.
9922         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
9923         Renamed to...
9924         (__pthread_cond_broadcast_2_0): ... this.
9925         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
9926         Renamed to...
9927         (__pthread_cond_destroy_2_0): ... this.
9928         * old_pthread_cond_init.c (__old_pthread_cond_init):
9929         Renamed to...
9930         (__pthread_cond_init_2_0): ... this.
9931         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
9932         Renamed to...
9933         (__pthread_cond_signal_2_0): ... this.
9934         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
9935         Renamed to...
9936         (__pthread_cond_wait_2_0): ... this.
9937         * pthread_cond_destroy.c: Include shlib-compat.h.
9938         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
9939         * pthread_cond_init.c: Include shlib-compat.h.
9940         (pthread_cond_init): Change strong_alias into versioned_symbol.
9941         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
9942         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
9943         fields.
9944         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
9945         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
9946         __pthread_cond_wait_2_0): New prototypes.
9947         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
9948         __old_pthread_cond_init, __old_pthread_cond_signal,
9949         __old_pthread_cond_wait): Removed.
9950         * init.c: Include shlib-compat.h.
9951         (pthread_functions): Guard ptr___pthread_attr_init_2_0
9952         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
9953         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
9954         ptr___pthread_cond_*_2_0 fields.
9955         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
9956         pthread_cond_*@GLIBC_2.0 compatibility symbols.
9958         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
9959         LIBC_SIGACTION was not yet defined.
9960         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
9961         [!defined LIBC_SIGACTION] (__sigaction): New function and
9962         libc_hidden_weak.
9963         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
9964         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
9966 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9968         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
9970 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
9972         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
9973         New, larger type definition.
9974         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
9975         implementation.
9976         * Versions [libpthread]: Add definitions for new pthread_cond_*
9977         interfaces for version GLIBC_2.3.2.
9978         * pthread_cond_init.c: Update initialization for new type definition.
9979         * Makefile (libpthread-routines): Remove pthread_cond_wait,
9980         pthread_cond_timedwait, pthread_cond_signal, and
9981         pthread_cond_broadcast.  Add old_pthread_cond_init,
9982         old_pthread_cond_destroy, old_pthread_cond_wait,
9983         old_pthread_cond_timedwait, old_pthread_cond_signal, and
9984         old_pthread_cond_broadcast.
9985         * old_pthread_cond_broadcast.c: New file.
9986         * old_pthread_cond_destroy.c: New file.
9987         * old_pthread_cond_init.c: New file.
9988         * old_pthread_cond_signal.c: New file.
9989         * old_pthread_cond_timedwait.c: New file.
9990         * old_pthread_cond_wait.c: New file.
9991         * pthreadP.h: Add prototypes for the compatibility interfaces.
9993         * pthread_cond_destroy.c: Don't include <errno.h>.
9995 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
9997         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
9998         unnecessary zero offset when addressing MUTEX.
10000 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
10002         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
10003         __register_atfork.
10004         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
10005         for __register_atfork.
10007 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
10009         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
10010         instead of ASSEMBLER test macro.
10012         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
10013         __libc_current_sigrtmax): Add libc_hidden_def.
10015         * sysdeps/pthread/list.h: Remove assert.h include.
10017 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
10019         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
10020         __pthread_initialize_minimal_internal not
10021         __pthread_initialize_minimal.
10023 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
10025         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
10026         __pthread_initialize_minimal as hidden.
10028         * init.c (__pthread_initialize_minimal_internal): Don't mark as
10029         constructor.
10031 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
10033         * Makefile ($(inst_libdir)/libpthread.so): Depend on
10034         $(common-objpfx)format.lds, include that into the output script.
10035         Fix comment.
10036         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
10038 2002-12-28  Andreas Jaeger  <aj@suse.de>
10040         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
10041         nsec resolution changes.
10042         (xstat64_conv): Likewise.
10043         (xstat32_conv): Likewise.
10044         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
10045         struct kernel_stat.
10046         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
10047         structs stat and stat64.
10048         * time/time.h (__timespec_defined): Define for __USE_MISC.
10049         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
10051 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
10053         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
10054         argument.
10055         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
10056         (pthread_exit): Use strong_alias to avoid warnings.
10057         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
10058         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
10059         ptr___pthread_attr_init_2_*.
10060         * init.c (pthread_functions): Adjust.
10062 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
10064         * forward.c: Make all functions available by default again.  It
10065         caused too much trouble.
10067         * pt-siglongjmp.c: Removed.
10069 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
10071         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
10072         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
10073         * sysdeps/i386/Makefile: New file.
10074         * sysdeps/i386/tcb-offsets.sym: New file.
10075         * sysdeps/pthread/tcb-offsets.h: New file.
10076         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10077         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
10079         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
10080         __register_atfork...
10081         (GLIBC_2.3.2): ...here.
10083 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
10085         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
10086         pthread_attr_setstackaddr with __attribute_deprecated__.
10088 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
10090         * pt-system.c (system): Remove cancellation handling.
10091         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
10092         cancellation routines.
10094 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
10096         * descr.h: Include <dl-sysdep.h>.
10097         (struct pthread): Move header.data.list to the back of the struct.
10098         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
10099         (MULTIPLE_THREADS_OFFSET): Adjust offset.
10100         (SYSINFO_OFFSEET): Likewise.
10102 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
10104         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
10105         Define.
10106         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
10107         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
10108         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
10109         (USE_DL_SYSINFO): Undef.
10111 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
10113         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
10114         $(common-objpfx)libc.so.
10115         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
10116         it is bigger than pipe buffer size even on arches with bigger
10117         page size.
10118         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
10120 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
10122         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
10123         correct errno access for case that USE___THREAD is not defined.
10125 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
10127         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
10128         Patch by Marijn Ros <marijn@mad.scientist.com>.
10130 2002-12-22  Roland McGrath  <roland@redhat.com>
10132         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
10134 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
10136         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
10138 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
10140         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
10141         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
10142         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
10144         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
10145         of int $0x80.
10146         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10147         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
10148         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
10149         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
10150         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
10151         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
10152         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
10153         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
10155         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
10156         sysenter.
10157         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
10159         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
10161         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
10162         in new TCB.
10163         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
10164         that sysinfo is properly initialized.
10165         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
10166         to 1 only for ld.so.
10168         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
10169         RTLD_CORRECT_DYNAMIC_WEAK.
10171 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
10173         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
10174         Use return 0 as 6th argument to FORWARD4.
10175         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
10177 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
10179         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
10180         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
10181         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
10182         (INIT_SYSINFO): New #define.
10183         (TLS_TP_INIT): Use INIT_SYSINFO.
10184         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10185         At test to make sure SYSINFO_OFFSET value is correct.
10186         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
10188 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
10190         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
10191         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
10192         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
10193         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
10194         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
10195         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
10196         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
10198 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
10200         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
10201         macro instead of using int $0x80 directly.
10203         * sysdeps/pthread/bits/stdio-lock.h: New file.
10204         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
10205         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
10206         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
10207         * Makefile (routines): Add libc-lowlevelmutex.
10209         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
10210         __i686.get_pc_thunk.dx.
10212 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
10214         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
10215         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
10216         ($(objpfx)tst-cancel-wrappers.out): New rule.
10217         * tst-cancel-wrappers.sh: New test.
10218         * tst-locale1.c: Include signal.h.
10219         (uselocale): Test static linking of __libc_current_sigrt*.
10221 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
10223         * Makefile (tests): Add tst-cancel6.
10224         * tst-cancel6.c: New file
10226 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
10228         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
10229         Define meaningfully for assembler as well.
10230         * pthreadP.h (struct pthread_functions): Remove
10231         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
10232         and ptr_pthread_attr_init_2_1 fields.
10233         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
10234         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
10235         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
10236         (FORWARD3): Define using FORWARD4.
10237         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
10238         versions.
10239         * pt-system.c: Remove duplicate stdlib.h include.
10241 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
10243         * sem_init.c: Define sem_init@GLIBC_2.0.
10244         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
10245         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
10247         * flockfile.c: Moved to...
10248         * sysdeps/pthread/flockfile.c: ...here.  New file.
10249         * funlockfile.c: Moved to...
10250         * sysdeps/pthread/funlockfile.c: ...here.  New file.
10251         * ftrylockfile.c: Moved to...
10252         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
10254 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
10256         * libc-cancellation.c: Guard both function with
10257         #if !defined NOT_IN_libc.
10258         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
10259         automatically provided pthread wrappers.
10260         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
10261         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
10262         nor in libpthread.
10263         * pt-open.c: Removed.
10264         * pt-fcntl.c: Removed.
10265         * pt-fsync.c: Removed.
10266         * pt-lseek.c: Removed.
10267         * pt-msgrcv.c: Removed.
10268         * pt-msgsnd.c: Removed.
10269         * pt-msync.c: Removed.
10270         * pt-nanosleep.c: Removed.
10271         * pt-open64.c: Removed.
10272         * pt-pause.c: Removed.
10273         * pt-pread.c: Removed.
10274         * pt-pread64.c: Removed.
10275         * pt-pwrite.c: Removed.
10276         * pt-pwrite64.c: Removed.
10277         * pt-read.c: Removed.
10278         * pt-recv.c: Removed.
10279         * pt-recvfrom.c: Removed.
10280         * pt-recvmsg.c: Removed.
10281         * pt-send.c: Removed.
10282         * pt-sendto.c: Removed.
10283         * pt-sigtimedwait.c: Removed.
10284         * pt-sigwait.c: Removed.
10285         * pt-wait.c: Removed.
10286         * pt-waitpid.c: Removed.
10287         * pt-write.c: Removed.
10288         * pt-accept.c: Removed.
10289         * pt-close.c: Removed.
10290         * pt-connect.c: Removed.
10291         * pt-lseek64.c: Removed.
10292         * pt-sendmsg.c: Removed.
10293         * pt-tcdrain.c: Removed.
10295 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
10297         * init.c (__pthread_initialize_minimal_internal): Renamed from
10298         __pthread_initialize_minimal.  Make old name an alias.  This
10299         converts a normal relocation into a relative relocation.
10301         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
10303         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
10304         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
10305         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
10306         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
10307         pt-sigwaitinfo, pt-waitid, and pt-writev.
10308         * pt-creat.c: Removed.
10309         * pt-poll.c: Removed.
10310         * pt-pselect.c: Removed.
10311         * pt-readv.c: Removed.
10312         * pt-select.c: Removed.
10313         * pt-sigpause.c: Removed.
10314         * pt-sigsuspend.c: Removed.
10315         * pt-sigwaitinfo.c: Removed.
10316         * pt-waitid.c: Removed.
10317         * pt-writev.c: Removed.
10319         * init.c (pthread_functions): New variable.
10320         (__pthread_initialize_minimal): Pass pointer to pthread_functions
10321         (or NULL) to __libc_pthread_init.
10322         * forward.c: Rewrite to use __libc:pthread_functions array to get
10323         function addresses.
10324         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
10325         prototype.
10326         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10327         Take new parameter.  Copy content of variable pointed to by it
10328         to __libc_pthread_init.
10330         * pthreadP.h (struct pthread_functions): New type.
10331         (__libc_pthread_init): Declare.
10333         * pthread_attr_destroy.c: Add namespace protected alias.
10334         * pthread_attr_getdetachstate.c: Likewise.
10335         * pthread_attr_getinheritsched.c: Likewise.
10336         * pthread_attr_getschedparam.c: Likewise.
10337         * pthread_attr_getschedpolicy.c: Likewise.
10338         * pthread_attr_getscope.c: Likewise.
10339         * pthread_attr_setdetachstate.c: Likewise.
10340         * pthread_attr_setinheritsched.c: Likewise.
10341         * pthread_attr_setschedparam.c: Likewise.
10342         * pthread_attr_setschedpolicy.c: Likewise.
10343         * pthread_attr_setscope.c: Likewise.
10344         * pthread_cond_broadcast.c: Likewise.
10345         * pthread_cond_destroy.c: Likewise.
10346         * pthread_cond_init.c: Likewise.
10347         * pthread_cond_signal.c: Likewise.
10348         * pthread_cond_wait.c: Likewise.
10349         * pthread_condattr_destroy.c: Likewise.
10350         * pthread_condattr_init.c: Likewise.
10351         * pthread_equal.c: Likewise.
10352         * pthread_exit.c: Likewise.
10353         * pthread_getschedparam.c: Likewise.
10354         * pthread_self.c: Likewise.
10355         * pthread_setcancelstate.c: Likewise.
10356         * pthread_setschedparam.c: Likewise.
10357         * pthread_mutex_destroy.c: Likewise.
10358         * pthread_mutex_init.c: Likewise.
10359         * pthreadP.h: Add prototypes for the aliases.
10361         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
10362         multiple_threads member in correct TCB to 1.
10364         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
10365         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
10366         member of thread decriptor, otherwise return unconditionally 1.
10368 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
10370         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
10371         regular Linux version.  Remove file.
10372         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
10373         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
10374         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
10375         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
10376         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
10377         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
10378         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
10379         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
10380         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
10381         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
10382         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
10383         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
10384         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
10385         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
10386         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
10387         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
10388         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
10389         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
10390         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
10391         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
10392         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
10393         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
10394         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
10395         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
10396         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
10397         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
10398         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
10399         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
10400         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
10401         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
10403 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
10405         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
10406         * sysdeps/unix/sysv/linux/open.c: Removed.
10407         * sysdeps/unix/sysv/linux/fsync.c: Removed.
10408         * sysdeps/unix/sysv/linux/lseek.c: Removed.
10409         * sysdeps/unix/sysv/linux/msync.c: Removed.
10410         * sysdeps/unix/sysv/linux/read.c: Removed.
10411         * sysdeps/unix/sysv/linux/close.c: Removed.
10412         * sysdeps/unix/sysv/linux/creat.c: Removed.
10413         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
10414         * sysdeps/unix/sysv/linux/pause.c: Removed.
10415         * sysdeps/unix/sysv/linux/select.c: Removed.
10416         * sysdeps/unix/sysv/linux/write.c: Removed.
10418 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
10420         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
10421         element in TCB to see whether locking is needed.
10423         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
10424         MULTIPLE_THREADS_OFFSET value is correct.
10426         * sysdeps/unix/sysv/linux/close.c: New file.
10427         * sysdeps/unix/sysv/linux/connect.S: New file.
10428         * sysdeps/unix/sysv/linux/creat.c: New file.
10429         * sysdeps/unix/sysv/linux/fsync.c: New file.
10430         * sysdeps/unix/sysv/linux/llseek.c: New file.
10431         * sysdeps/unix/sysv/linux/lseek.c: New file.
10432         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
10433         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
10434         * sysdeps/unix/sysv/linux/msync.c: New file.
10435         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
10436         * sysdeps/unix/sysv/linux/open.c: New file.
10437         * sysdeps/unix/sysv/linux/open64.c: New file.
10438         * sysdeps/unix/sysv/linux/pause.c: New file.
10439         * sysdeps/unix/sysv/linux/poll.c: New file.
10440         * sysdeps/unix/sysv/linux/pread.c: New file.
10441         * sysdeps/unix/sysv/linux/pread64.c: New file.
10442         * sysdeps/unix/sysv/linux/pselect.c: New file.
10443         * sysdeps/unix/sysv/linux/pwrite.c: New file.
10444         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
10445         * sysdeps/unix/sysv/linux/readv.c: New file.
10446         * sysdeps/unix/sysv/linux/recv.S: New file.
10447         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
10448         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
10449         * sysdeps/unix/sysv/linux/select.c: New file.
10450         * sysdeps/unix/sysv/linux/send.S: New file.
10451         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
10452         * sysdeps/unix/sysv/linux/sendto.S: New file.
10453         * sysdeps/unix/sysv/linux/sigpause.c: New file.
10454         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
10455         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
10456         * sysdeps/unix/sysv/linux/sigwait.c: New file.
10457         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
10458         * sysdeps/unix/sysv/linux/system.c: New file.
10459         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
10460         * sysdeps/unix/sysv/linux/wait.c: New file.
10461         * sysdeps/unix/sysv/linux/waitid.c: New file.
10462         * sysdeps/unix/sysv/linux/waitpid.c: New file.
10463         * sysdeps/unix/sysv/linux/writev.c: New file.
10464         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
10466         * pt-readv.c: Fix comment.
10468 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
10470         * tst-cleanup1.c: Include stdlib.h.
10472         * tst-cancel5.c: New test.
10473         * Makefile (tests): Add tst-cancel5.
10474         (tst-cancel5): Link against libc.so libpthread.so in that order.
10476 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
10478         * forward.c (test_loaded): Prevent recursive calls.
10480         * Makefile (routines): Add libc-cancellation.
10481         * libc-cancellation.c: New file.
10482         * descr.h (struct pthread): Add multiple_threads field.
10483         * allocatestack.c (allocate_stack): Initialize multiple_header field of
10484         new thread descriptor to 1.
10485         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
10486         Initialize multiple_thread field after successful thread creation.
10487         * cancellation.c (__do_cancel): Move to pthreadP.h.
10488         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
10489         (__pthread_disable_asynccancel): Add internal_function attribute.
10490         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
10491         * pthread_setcancelstate.c: Likewise.
10492         * pthread_setcanceltype.c: Likewise.
10493         * pthread_exit.c: Likewise.
10494         * pthreadP.h (CANCELLATION_P): Likewise.
10495         (__do_cancel): Define as static inline.
10496         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
10497         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
10498         declarations.
10499         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
10500         fields.  Define MULTIPLE_THREADS_OFFSET.
10501         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
10502         declaration.
10503         * sysdeps/unix/sysv/linux/accept.S: New file.
10504         * sysdeps/unix/sysv/linux/read.c: New file.
10505         * sysdeps/unix/sysv/linux/write.c: New file.
10506         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
10507         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
10508         initialization of __libc_locking_needed.
10509         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
10510         __libc_locking_needed, use multiple_threads field in TCB.
10511         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10513 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
10515         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
10516         version.
10517         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
10519         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
10520         access to __libc_locking_needed for PIC.
10522 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
10524         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
10525         declare for libc.so.
10526         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
10527         expression.
10528         (__libc_lock_lock): Put into statement expression.
10529         (__libc_lock_unlock): Remove trailing semicolon.
10530         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
10532 2002-12-12  Roland McGrath  <roland@redhat.com>
10534         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
10535         "m" constraint to refer to __libc_locking_needed.  Declare it here.
10537 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
10539         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
10540         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
10541         Initialize __libc_locking_needed.
10542         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
10543         instead of __register_pthread_fork_handler.
10544         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
10545         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
10546         fork-gen with libc_pthread_init.
10547         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
10548         of __register_pthread_fork_handler.
10549         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
10550         of __register_pthread_fork_handler.
10551         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
10552         __libc_locking_needed to determine whether lock prefix can be avoided.
10553         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10555 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
10557         * Makefile (tests): Add tst-cleanup1.
10558         * tst-cleanup1.c: New file.
10559         * cancellation.c (__cleanup_thread): Removed.
10560         (__do_cancel): Remove call to __cleanup_thread.
10561         * pthreadP.h: Remove __cleanup_thread prorotype.
10563         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
10564         Remember function and argument even if cancellation handler
10565         function is not available.
10566         (__libc_cleanup_region_end): Execute registered function directly if
10567         pthread functions are not available.
10568         (__libc_cleanup_end): Likewise.
10570         * init.c (__pthread_initialize_minimal): Fix initialization in
10571         static lib by preventing gcc from being too clever.
10573 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
10575         * init.c (__pthread_initialize_minimal): Remove unneccesary
10576         sigaddset call.
10578         * Makefile (tests): We can run tst-locale2 now.
10580 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
10582         * Versions: Remove duplicated sigwait entry.
10584 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
10586         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
10587         inside libpthread.
10589         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
10591         * pthreadP.h: Declare __pthread_enable_asynccancel and
10592         __pthread_disable_asynccancel.
10593         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
10594         (CANCEL_RESET): Use __pthread_disable_asynccancel.
10595         * cancellation.c (__pthread_enable_asynccancel): New function.
10596         (__pthread_disable_asynccancel): New function.
10597         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
10598         * pt-close.c: Likewise.
10599         * pt-connect.c: Likewise.
10600         * pt-creat.c: Likewise.
10601         * pt-fcntl.c: Likewise.
10602         * pt-fsync.c: Likewise.
10603         * pt-lseek.c: Likewise.
10604         * pt-lseek64.c: Likewise.
10605         * pt-msgrcv.c: Likewise.
10606         * pt-msgsnd.c: Likewise.
10607         * pt-msync.c: Likewise.
10608         * pt-nanosleep.c: Likewise.
10609         * pt-open.c: Likewise.
10610         * pt-open64.c: Likewise.
10611         * pt-pause.c: Likewise.
10612         * pt-poll.c: Likewise.
10613         * pt-pread.c: Likewise.
10614         * pt-pread64.c: Likewise.
10615         * pt-pselect.c: Likewise.
10616         * pt-pwrite.c: Likewise.
10617         * pt-pwrite64.c: Likewise.
10618         * pt-read.c: Likewise.
10619         * pt-readv.c: Likewise.
10620         * pt-recv.c: Likewise.
10621         * pt-recvfrom.c: Likewise.
10622         * pt-recvmsg.c: Likewise.
10623         * pt-select.c: Likewise.
10624         * pt-send.c: Likewise.
10625         * pt-sendmsg.c: Likewise.
10626         * pt-sendto.c: Likewise.
10627         * pt-sigpause.c: Likewise.
10628         * pt-sigsuspend.c: Likewise.
10629         * pt-sigtimedwait.c: Likewise.
10630         * pt-sigwait.c: Likewise.
10631         * pt-sigwaitinfo.c: Likewise.
10632         * pt-system.c: Likewise.
10633         * pt-tcdrain.c: Likewise.
10634         * pt-wait.c: Likewise.
10635         * pt-waitid.c: Likewise.
10636         * pt-waitpid.c: Likewise.
10637         * pt-write.c: Likewise.
10638         * pt-writev.c: Likewise.
10639         * pthread_join.c: Likewise.
10640         * pthread_timedjoin.c: Likewise.
10642         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
10643         (__xpg_sigpause): New function.
10644         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
10646 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
10648         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
10650         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
10651         _GI_pthread_cleanup_pop to pthreadP.h.
10653         * ftrylockfile.c: Use _IO_lock_trylock instead of
10654         pthread_mutex_trylock.
10656         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
10657         (CANCEL_RESET): Likewise.
10658         (__pthread_setcanceltype_): Declare.
10659         (__pthread_mutex_lock_internal): Declare.
10660         (__pthread_mutex_unlock_internal): Declare.
10661         (__pthread_once_internal): Declare.
10662         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
10663         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
10665         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
10666         and pthread_mutex_unlock.
10667         * pthread_cond_wait.c: Likewise.
10668         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
10669         * pthread_mutex_unlock.c: Likewise.
10671         * pthread_setcanceltype.c: Add additional alias
10672         __pthread_setcanceltype.
10674         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
10675         * sem_open.c (sem_open): Likewise.
10676         Use __libc_open, __libc_write, and __libc_close instead of
10677         open, write, and close respectively.
10679         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
10680         Rewrite as statement expression since it must return a value.
10682         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
10683         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
10684         __pthread_kill.
10686         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
10687         alias __pthread_once_internal.
10689         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
10691 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
10693         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
10694         * tst-stdio1.c: New file.
10695         * tst-stdio2.c: New file.
10697         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
10699         * Makefile (tests): Comment out tst-locale2 for now.
10700         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
10702         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
10703         -D_IO_MTSAFE_IO.
10704         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
10705         Use _IO_lock_init instead of explicit assignment.
10707         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
10708         Define __libc_lock_* and __libc_lock_recursive macros with
10709         lowlevellock macros, not pthread mutexes.
10711         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
10712         of pthread_mutex_lock.
10713         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
10714         instead of pthread_mutex_unlock.
10716 2002-12-06  Roland McGrath  <roland@redhat.com>
10718         * allocatestack.c (__stack_user): Use uninitialized defn.
10719         * init.c (__pthread_initialize_minimal): Initialize it here.
10721 2002-12-05  Roland McGrath  <roland@redhat.com>
10723         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
10724         string.
10725         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
10727         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
10728         missing & here too.
10730 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
10732         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10733         lowlevellock.
10734         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
10735         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
10736         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
10737         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
10738         for __libc_lock_* macros.
10739         * Makefile (routines): Add libc-lowlevellock.
10741 2002-10-09  Roland McGrath  <roland@redhat.com>
10743         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
10744         Under [__PIC__], call the function via the pointer fetched for
10745         comparison rather than a call by name that uses the PLT.
10746         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
10747         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
10748         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
10749         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
10750         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
10752 2002-12-04  Roland McGrath  <roland@redhat.com>
10754         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
10756         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
10757         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
10759         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
10761 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10763         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
10764         a completely opaque, non-integer type.
10765         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
10767 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
10769         * sysdeps/i386/tls.h: Include stdlib.h.
10770         * sysdeps/x86_64/tls.h: Likewise.
10772 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10774         * Makefile (tests): Add tst-locale2.
10775         (tests-static): Likewise.
10776         * tst-locale2.c: New file.
10778         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
10779         volatile and add memory clobbers to lock operations.
10781 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
10783         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
10784         * sysdeps/i386/i486/bits/atomic.h: New file.
10785         * sysdeps/i386/i586/bits/atomic.h: New file.
10786         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
10787         include i486 version.
10788         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
10789         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
10790         Patch by Marijn Ros <marijn@mad.scientist.com>.
10792         * allocatestack.c (get_cached_stack): Don't crash if we first
10793         found a stack with a larger size then needed.
10794         Reported by Hui Huang <hui.huang@sun.com>.
10796         * Makefile (tests): Add tst-sysconf.
10797         * tst-sysconf.c: New file.
10799         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
10800         PTHREAD_THREADS_MAX.
10802 2002-12-02  Roland McGrath  <roland@redhat.com>
10804         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
10805         Declare using hidden_proto instead of attribute_hidden, so there are
10806         non-.hidden static symbols for gdb to find.
10807         (__pthread_keys): Likewise.
10808         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
10809         * allocatestack.c (__stack_user): Likewise.
10810         * pthread_create.c (__pthread_keys): Likewise.
10811         (__nptl_threads_events, __nptl_last_event): Make these static instead
10812         of hidden.
10813         * pthread_key_create.c (__pthread_pthread_keys_max,
10814         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
10816 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
10818         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
10819         statically.
10820         * tst-locale1.c: New file.
10822         * pthread_cond_timedwait.c: Include <stdlib.h>.
10824         * Makefile (tests): Add tst-fork2 and tst-fork3.
10825         * tst-fork2.c: New file.
10826         * tst-fork3.c: New file.
10828 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
10830         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
10832         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
10833         require it to 200112L.
10835         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
10836         instruction only if HAVE_CMOV is defined.
10837         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
10839         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
10841         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
10843         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
10845         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
10847 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
10849         * sysdeps/x86_64/bits/atomic.h: New file.
10851         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
10852         16-bit operations.
10854         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
10855         possible since gettid cannot fail.
10857         * sysdeps/x86_64/pthreaddef.h: New file.
10859         * sysdeps/i386/pthreaddef.h (gettid): Removed.
10861         * sysdeps/x86_64/pthread_spin_init.c: New file.
10862         * sysdeps/x86_64/pthread_spin_lock.c: New file.
10863         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
10864         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
10866         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
10867         Add missing lock prefix.  Minute optimization.
10869         * tst-spin2.c (main): Also check successful trylock call.
10871         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
10872         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
10874         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
10875         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
10877         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
10878         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
10879         value in case of an error.  Add support for INTERNAL_SYSCALL.
10881         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
10882         value in case of an error.
10884         * sysdeps/x86_64/tls.h: New file.
10886 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10888         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
10889         takes the array member name and the index as parameters.
10890         (THREAD_SETMEM_NC): Likewise.
10891         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
10892         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
10893         interfaces.
10895         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
10896         to decide which code to use.
10897         (THREAD_SETMEM_NC): Likewise.
10899         * allocatestack.c (queue_stack): Don't remove stack from list here.
10900         Do it in the caller.  Correct condition to prematurely terminate
10901         loop to free stacks.
10902         (__deallocate_stack): Remove stack from list here.
10904 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10906         * Makefile (tests): Add tst-stack1.
10907         * tst-stack1.c: New file.
10909         * allocatestack.c (allocate_stack): Initialize the TCB on a user
10910         provided stack.
10912         * pthread_attr_getstack.c: Return bottom of the thread area.
10914 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
10916         * Makefile (libpthread-routines): Add pt-allocrtsig and
10917         pthread_kill_other_threads.
10918         * pt-allocrtsig.c: New file.
10919         * pthread_kill_other_threads.c: New file.
10920         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
10921         all three functions.
10922         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10923         allocrtsig.
10924         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
10925         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
10926         and __libc_allocate_rtsig_private.
10927         * Versions (libpthread): Export pthread_kill_other_threads_np,
10928         __libc_current_sigrtmin, and __libc_current_sigrtmax.
10930 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
10932         * allocatestack.c (allocate_stack): stackaddr in attribute points to
10933         the end of the stack.  Adjust computations.
10934         When mprotect call fails dequeue stack and free it.
10935         * pthread_attr_setstack.c: Store top of the stack in stackaddr
10936         attribute.
10937         * pthread_getattr_np.c: Likewise.
10939         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
10940         surprises.
10942 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
10944         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
10945         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10947 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
10949         * pthread_getspecific.c: Optimize access to first 2nd-level array.
10950         * pthread_setspecific.c: Likewise.
10952 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
10954         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
10955         definitions.  Get them from the official place.
10956         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
10958         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
10959         Use new CLONE_ flags in clone() calls.
10961         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
10962         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
10964         * Versions: Add pthread_* functions for libc.
10965         * forward.c: New file.
10967         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
10968         errno-loc.
10969         * herrno.c: New file.
10970         * res.c: New file.
10972         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
10973         sem_trywait, and sem_timedwait.  Add herrno and res.
10974         * sem_init.c: Don't initialize lock and waiters members.
10975         * sem_open.c: Likewise.
10976         * sem_post.c: Removed.
10977         * sem_wait.c: Removed.
10978         * sem_trywait.c: Removed.
10979         * sem_timedwait.c: Removed.
10980         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
10981         Includes full implementations of sem_post, sem_wait, sem_trywait,
10982         and sem_timedwait.
10983         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
10984         for new implementation.
10985         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
10986         and waiters fields.
10988         * tst-sem3.c: Improve error message.
10989         * tst-signal3.c: Likewise.
10991         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
10992         to tell the kernel about the termination futex and to initialize tid
10993         member.  Don't initialize main_thread.
10994         * descr.h (struct pthread): Remove main_thread member.
10995         * cancelllation.c (__do_cancel): Remove code handling main thread.
10996         The main thread is not special anymore.
10998         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
10999         size of the stacks to stack_cache_actsize.
11001         * pt-readv.c: Add missing "defined".
11002         * pt-sigwait.c: Likewise.
11003         * pt-writev.c: Likewise.
11005 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
11007         * Versions: Export __connect from libpthread.
11008         Patch by Luca Barbieri <ldb@ldb.ods.org>.
11010         * Makefile (libpthread-routines): Add pt-raise.
11011         * sysdeps/unix/sysv/linux/raise.c: New file.
11012         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
11013         * sysdeps/generic/pt-raise.c: New file.
11015         * pthread_cond_init.c: Initialize all data elements of the condvar
11016         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
11018         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
11019         * pthread_create.c: Likewise.
11021         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
11022         * tst-key1.c: New file.
11023         * tst-key2.c: New file.
11024         * tst-key3.c: New file.
11026         * Versions: Export pthread_detach for version GLIBC_2.0.
11027         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
11029 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
11031         * pthread_key_create.c: Terminate search after an unused key was found.
11032         Patch by Luca Barbieri <ldb@ldb.ods.org>.
11034         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
11035         Patch by Luca Barbieri <ldb@ldb.ods.org>.
11037 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
11039         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
11040         dynamic lookup for errno in PIC.
11042         * allocatestack.c (get_cached_stack): Rearrange code slightly to
11043         release the stack lock as soon as possible.
11044         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
11045         the static TLS block.
11046         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
11048         * cancellation.c: Renamed from cancelation.c.
11049         * Makefile: Adjust accordingly.
11050         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
11051         * cleanup_defer.c: Use CANCELLATION_P.
11052         * pthread_testcancel.c: Likewise.
11053         * descr.h: Fix spelling in comments.
11054         * init.c: Likewise.
11055         * pthread_getattr_np.c: Likewise.
11056         * pthread_getschedparam.c: Likewise.
11057         * pthread_setschedparam.c: Likewise.
11058         * Versions: Likewise.
11060         * pt-pselect.c: New file.
11061         * Makefile (libpthread-routines): Add pt-pselect.
11062         * Versions: Add pselect.
11064         * tst-cancel4.c: New file.
11065         * Makefile (tests): Add tst-cancel4.
11067 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
11069         * pthread_mutex_lock.c: Always record lock ownership.
11070         * pthread_mutex_timedlock.c: Likewise.
11071         * pthread_mutex_trylock.c: Likewise.
11073         * pt-readv.c: New file.
11074         * pt-writev.c: New file.
11075         * pt-creat.c: New file.
11076         * pt-msgrcv.c: New file.
11077         * pt-msgsnd.c: New file.
11078         * pt-poll.c: New file.
11079         * pt-select.c: New file.
11080         * pt-sigpause.c: New file.
11081         * pt-sigsuspend.c: New file.
11082         * pt-sigwait.c: New file.
11083         * pt-sigwaitinfo.c: New file.
11084         * pt-waitid.c: New file.
11085         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
11086         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
11087         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
11088         * Versions: Add all the new functions.
11090         * tst-exit1.c: New file.
11091         * Makefile (tests): Add tst-exit1.
11093         * sem_timedwait.c: Minor optimization for more optimal fastpath.
11095 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
11097         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
11099         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
11100         call.  pthread_join is an official cancellation point.
11101         * pthread_timedjoin.c: Likewise.
11103         * pthread_cond_wait.c: Revert order in which internal lock are dropped
11104         and the condvar's mutex are retrieved.
11105         * pthread_cond_timedwait.c: Likewise.
11106         Reported by dice@saros.East.Sun.COM.
11108 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
11110         * pthreadP.h: Cut out all type definitions and move them...
11111         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
11112         * pthreadP.h: Include <internaltypes.h>.
11114         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
11115         performance tweaks.
11117         * sem_trywait.c: Shuffle #includes around to get right order.
11118         * sem_timedwait.c: Likewise.
11119         * sem_post.c: Likewise.
11120         * sem_wait.c: Likewise.
11122         * nptl 0.3 released.
11124         * Makefile (tests): Add tst-signal3.
11125         * tst-signal3.c: New file.
11127 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
11129         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
11130         the asms modify the sem object.
11131         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
11133         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
11134         the actual members.
11135         * pthreadP.h (struct sem): New type.  Actual semaphore type.
11136         * semaphoreP.h: Include pthreadP.h.
11137         * sem_getvalue.c: Adjust to sem_t change.
11138         * sem_init.c: Likewise.
11139         * sem_open.c: Likewise.
11140         * sem_post.c: Likewise.
11141         * sem_timedwait.c: Likewise.
11142         * sem_trywait.c: Likewise.
11143         * sem_wait.c: Likewise.
11145 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
11147         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
11148         * tst-basic2.c: New file.
11149         * tst-exec1.c: New file.
11150         * tst-exec2.c: New file.
11151         * tst-exec3.c: New file.
11153         * tst-fork1.c: Remove extra */.
11155         * nptl 0.2 released.  The API for IA-32 is complete.