Fix up sched.h for XPG7.
[glibc.git] / nptl / ChangeLog
blobafa7790ddef2c51dd1b4775c213e6cd1e2edafd5
1 2010-01-08  Ulrich Drepper  <drepper@redhat.com>
3         * sysdeps/pthread/pthread.h: Fix pthread_mutex_consistent declaration.
5 2009-12-18  Thomas Schwinge  <thomas@codesourcery.com>
7         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c (_init): Don't
8         call __gmon_start__.
9         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c (_init): Likewise.
11 2009-12-17  Ulrich Drepper  <drepper@redhat.com>
13         * pthread_rwlock_init.c (__pthread_rwlock_init): Simplify code by
14         using memset.
16 2009-12-01  Dinakar Guniguntala  <dino@in.ibm.com>
18         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.h: Define
19         FUTEX_WAIT_REQUEUE_PI and FUTEX_CMP_REQUEUE_PI.
20         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: If mutex
21         is a non robust PI mutex, then use FUTEX_CMP_REQUEUE_PI.
22         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
23         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: If mutex
24         is a non robust PI mutex, then use FUTEX_WAIT_REQUEUE_PI.
25         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
27 2009-12-12  Ulrich Drepper  <drepper@redhat.com>
29         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
30         Don't update nwaiters after invalid timeout is recognized.
32 2009-11-27  Thomas Schwinge  <thomas@codesourcery.com>
34         * sysdeps/unix/sysv/linux/sh/pt-initfini.c (_init): Don't call
35         __gmon_start__.
37 2009-11-27  Andreas Schwab  <schwab@redhat.com>
39         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Reload
40         THREAD_SELF->cancelhandling after returning from futex call.
42 2009-11-24  Ulrich Drepper  <drepper@redhat.com>
44         * tst-sem13.c: New file.
45         * Makefile (tests): Add tst-sem13.
47 2009-11-22  Roland McGrath  <roland@redhat.com>
49         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: # include "i686/dl-sysdep.h"
50         instead of recapitulating its contents.
52 2009-11-18  Ulrich Drepper  <drepper@redhat.com>
54         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Minor
55         optimizations and cleanups.
57 2009-11-18  Dinakar Guniguntala  <dino@in.ibm.com>
59         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
60         Remove redundant code. Fix cfi offsets.
61         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
62         Fix cfi offsets.
64 2009-11-17  Ulrich Drepper  <drepper@redhat.com>
66         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Minimally
67         reduce size of unwind info.
69         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Convert to use
70         cfi directives.
71         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
72         Based on a patch by Dinakar Guniguntala <dino@in.ibm.com>.
74 2009-11-03  Andreas Schwab  <schwab@linux-m68k.org>
76         [BZ #4457]
77         * sysdeps/pthread/unwind-resume.c: Include <libgcc_s.h> and use
78         LIBGCC_S_SO.
79         * sysdeps/pthread/unwind-forcedunwind.c: Likewise.
81 2009-10-30  Ulrich Drepper  <drepper@redhat.com>
83         * tst-sem11.c (main): Rewrite to avoid aliasing problems.
85         [BZ #3270]
86         * allocatestack.c (__nptl_setxid): Perform the operation in multiple
87         steps to avoid races with creation and terminations.
88         * nptl-init.c (sighandler_setxid): Adjust.
89         Patch by Daniel Jacobowitz.
91 2009-09-07  Andreas Schwab  <schwab@redhat.com>
93         * sysdeps/pthread/bits/libc-lock.h (BP_SYM): Remove space before paren.
95 2009-09-02  Suzuki K P  <suzuki@in.ibm.com>
96             Joseph Myers  <joseph@codesourcery.com>
98         [BZ #7094]
99         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
100         Initialize the sigev_notify field for newly created timer to make sure
101         the timer gets deleted from the active timer's list upon timer_delete.
103 2009-08-27  Andrew Stubbs  <ams@codesourcery.com>
105         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
106         Correct a logic error.
108 2009-08-25  Ulrich Drepper  <drepper@redhat.com>
110         * sysdeps/x86_64/tls.h (RTLD_ENABLE_FOREIGN_CALL): Store old value
111         of the field in local variables.
112         (RTLD_FINALIZE_FOREIGN_CALL): Restore rtld_must_xmm_save from local
113         variable and don't unconditionally clear it.
115 2009-08-24  Ulrich Drepper  <drepper@redhat.com>
117         * pthread_create.c (start_thread): Hint to the kernel that memory for
118         the stack can be reused.  We do not mark all the memory.  The part
119         still in use and some reserve are kept.
121 2009-08-23  Ulrich Drepper  <drepper@redhat.com>
123         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Clean up namespace.
125 2009-08-11  Ulrich Drepper  <drepper@redhat.com>
127         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Add CFI
128         directives.
130 2009-08-10  Ulrich Drepper  <drepper@redhat.com>
132         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Add CFI
133         directives.
134         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
136 2009-08-10  Andreas Schwab  <schwab@redhat.com>
138         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
139         (__pthread_cond_signal): Don't clobber register used for syscall
140         number.
142 2009-08-08  Ulrich Drepper  <drepper@redhat.com>
144         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
145         Optimize code path used when FUTEX_CLOCK_REALTIME is supported.
147         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
148         (__pthread_cond_wait): Optimize by avoiding use of callee-safe
149         register.
151 2009-08-07  Ulrich Drepper  <drepper@redhat.com>
153         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Little optimizations
154         enabled by the special *_asynccancel functions.
155         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
156         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
158         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Include lowlevellock.h.
160 2009-08-04  Ulrich Drepper  <drepper@redhat.com>
162         * sysdeps/unix/sysv/linux/x86_64/cancellation.S: New file.
163         * sysdeps/unix/sysv/linux/x86_64/libc-cancellation.S: New file.
164         * sysdeps/unix/sysv/linux/x86_64/librt-cancellation.S: New file.
165         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Optimize
166         since we can assume the special __*_{en,dis}able_asynccancel
167         functions.
168         (PUSHARGS_*, POPARGS_*, SAVESTK_*, RESTSTK_*): Removed.
169         * sysdeps/x86_64/tcb-offsets.sym: Add cancellation-related bits
170         and PTHREAD_CANCELED.
172 2009-07-31  Ulrich Drepper  <drepper@redhat.com>
174         * descr.h: Better definition of *_BITMASK macros for cancellation.
176 2009-07-29  Ulrich Drepper  <drepper@redhat.com>
178         * sysdeps/x86_64/tls.h (TLS_TCB_ALIGN): Define explicitly to 32.
180         * sysdeps/x86_64/tls.h (tcbhead_t): Add room for SSE registers the
181         dynamic linker might have to save.
182         Define RTLD_CHECK_FOREIGN_CALL, RTLD_ENABLE_FOREIGN_CALL,
183         RTLD_PREPARE_FOREIGN_CALL, and RTLD_FINALIZE_FOREIGN_CALL.  Pretty
184         printing.
186         * sysdeps/x86_64/tcb-offsets.sym: Add RTLD_SAVESPACE_SSE.
188 2009-07-28  Ulrich Drepper  <drepper@redhat.com>
190         * pthread_mutex_lock.c [NO_INCR] (__pthread_mutex_cond_lock_adjust):
191         New function.
192         * pthreadP.h: Declare __pthread_mutex_cond_lock_adjust.
193         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: Add ROBUST_BIT.
194         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Don't use
195         requeue_pi for robust mutexes.
196         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
197         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
198         Don't only skip __pthread_mutex_cond_lock.  Call instead
199         __pthread_mutex_cond_lock_adjust.
200         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
202         * pthread_mutex_unlock.c (__pthread_mutex_unlock_full): Minor
203         optimization of PI mutex handling.
205 2009-07-27  Ulrich Drepper  <drepper@redhat.com>
207         [BZ #10418]
208         * pthread_mutex_unlock.c (__pthread_mutex_unlock_full): Use _rel
209         instead of of _acq variants of cmpxchg.
211 2009-07-23  Ulrich Drepper  <drepper@redhat.com>
213         * sysdeps/x86_64/configure.in: New file.
215         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix error
216         path when not using absolute timeout futex.
218 2009-07-20  Ulrich Drepper  <drepper@redhat.com>
220         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Minor
221         optimizations of last changes.
222         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
224 2009-07-19  Ulrich Drepper  <drepper@redhat.com>
226         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
227         FUTEX_WAIT_REQUEUE_PI and FUTEX_CMP_REQUEUE_PI.
228         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: If mutex
229         is a PI mutex, then use FUTEX_CMP_REQUEUE_PI.
230         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
231         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: If mutex
232         is a PI mutex, then use FUTEX_WAIT_REQUEUE_PI.
233         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
235         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
236         (__pthread_cond_timedwait): Make more robust.
238 2009-07-18  Ulrich Drepper  <drepper@redhat.com>
240         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
241         (__lll_robust_timedlock_wait): If possible use FUTEX_WAIT_BITSET to
242         directly use absolute timeout.
244         * tst-sem5.c (do_test): Add test for premature timeout.
245         * Makefile: Linu tst-sem5 with librt.
247         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
248         (pthread_rwlock_timedwrlock): If possible use FUTEX_WAIT_BITSET to
249         directly use absolute timeout.
250         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
251         (pthread_rwlock_timedrdlock): Likewise.
253         * tst-cond11.c (run_test): Add test to check that the timeout is
254         long enough.
256         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
257         (__pthread_cond_timedwait): If possible use FUTEX_WAIT_BITSET to
258         directly use absolute timeout.
260         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
261         (__pthread_cond_wait): Convert to using exception handler instead of
262         registered unwind buffer.
263         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
264         (__pthread_cond_timedwait): Likewise.
266 2009-07-17  Ulrich Drepper  <drepper@redhat.com>
268         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
269         If possible use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME to directly
270         use absolute timeout.
272         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Optimize
273         handling of uncontested semaphore.
275         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
276         (__condvar_cleanup): Rewrite to use cfi directives instead of
277         hand-coded unwind tables.
278         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S (__pthread_once):
279         Likewise.
280         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
281         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
282         Likewise.
284 2009-06-12  Ulrich Drepper  <drepper@redhat.com>
286         * Makefile (libpthread-routines): Add pthread_sigqueue.
287         * Versions: Add pthread_sigqueue for GLIBC_2.11.
288         * sysdeps/pthread/bits/sigthread.h: Declare pthread_sigqueue.
289         * sysdeps/unix/sysv/linux/pthread_sigqueue.c: New file.
291 2009-06-11  Ulrich Drepper  <drepper@redhat.com>
293         [BZ #10262]
294         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
295         (LOAD_FUTEX_WAIT_ABS): Fix futex parameter in case private futexes
296         cannot be assumed.
297         Patch by Bryan Kadzban <bz-glibc@kdzbn.homelinux.net>.
299 2009-05-16  Ulrich Drepper  <drepper@redhat.com>
301         * libc-cancellation.c: Move __libc_cleanup_routine to...
302         * libc-cleanup.c: ...here.  New file.
303         * Makefile (routines): Add libc-cleanup.
305         * cancellation.c (__pthread_disable_asynccancel): Remove unnecessary
306         test.
307         * libc-cancellation.c: Use <nptl/cancellation.c: to define the code.
308         * sysdeps/pthread/librt-cancellation.c: Likewise.
310         [BZ #9924]
311         * nptl-init.c: Renamed from init.c.
312         * Makefile: Change all occurences of init.c to nptl-init.c.
314 2009-05-15  Ulrich Drepper  <drepper@redhat.com>
316         * cancellation.c (__pthread_disable_asynccancel): Correct the bits
317         to test when deciding on the delay.
318         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
319         * pthread_cancel.c: Close race between deciding on sending a signal
320         and setting the CANCELING_BIT bit.
322         * cancellation.c (__pthread_disable_asynccancel): Don't return if
323         thread is canceled.
324         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
326 2009-04-27  Ulrich Drepper  <drepper@redhat.com>
328         * cancellation.c (__pthread_disable_asynccancel): Use THREAD_ATOMIC_AND
329         is available.
330         * libc-cancellation.c (__libc_disable_asynccancel): Likewise.
331         * sysdeps/x86_64/tls.h: Define THREAD_ATOMIC_AND.
332         * sysdeps/i386/tls.h: Likewise.
333         (tcbhead_t): Add __private_tm member.
335 2009-04-26  Ulrich Drepper  <drepper@redhat.com>
337         * sem_open.c (sem_open): Rewrite initialization of initsem to
338         avoid warnings.
340         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
341         Avoid warning by using may_alias attribute on ptrhack.
343 2009-04-22  Ulrich Drepper  <drepper@redhat.com>
345         [BZ #10090]
346         * pthread_attr_setschedparam.c (__pthread_attr_setschedparam):
347         Check policy and priority for validity.
348         Patch mostly by Zhang Xiliang <zhangxiliang@cn.fujitsu.com>.
350 2009-03-15  Ulrich Drepper  <drepper@redhat.com>
352         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
353         (__pthread_cond_timedwait): Change to use cfi directives instead of
354         hand-coded unwind sections.
356 2009-03-10  Ulrich Drepper  <drepper@redhat.com>
358         * init.c (nptl_freeres): Compile only for SHARED.
360 2009-03-09  Jakub Jelinek  <jakub@redhat.com>
362         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Define
363         FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET, FUTEX_CLOCK_REALTIME and
364         FUTEX_BITSET_MATCH_ANY.
366 2009-02-27  Roland McGrath  <roland@redhat.com>
368         * init.c (__nptl_initial_report_events): Mark __attribute_used__.
369         * pthread_create.c (__nptl_threads_events, __nptl_last_event): Likewise.
371 2009-02-26  Ulrich Drepper  <drepper@redhat.com>
373         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
374         _POSIX_THREAD_ROBUST_PRIO_INHERIT and
375         _POSIX_THREAD_ROBUST_PRIO_PROTECT.  Reset value of macros from
376         200112L to 200809L.
378 2009-02-25  Ulrich Drepper  <drepper@redhat.com>
380         * sysdeps/pthread/pthread.h: The robust mutex functions are in
381         POSIX 2008.
383 2009-02-24  Ulrich Drepper  <drepper@redhat.com>
385         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_BITS_POSIX_OPT_H):
386         Unify name of include protector macro.
388 2009-02-14  SUGIOKA Toshinobu  <sugioka@itonet.co.jp>
390         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
391         LOAD_FUTEX_WAIT_ABS even if (FUTEX_WAIT == 0).
393 2009-01-29  Ulrich Drepper  <drepper@redhat.com>
395         * sysdeps/pthread/unwind-forcedunwind.c: Encrypt all function
396         pointer variables.
398         * allocatestack.c (__free_stacks): Renamed from free_stacks.
399         (__free_stack_cache): Removed.  Change callers to call __free_stacks.
400         * init.c (nptl_freeres): New function.
401         (pthread_functions): Initialize ptr_freeres to nptl_freeres.
402         * pthreadP.h: Don't declare __free_stack_cache.  Declare __free_stacks.
403         * sysdeps/pthread/unwind-forcedunwind.c (libgcc_s_handle): New
404         variable.
405         (pthread_cancel_init): Depend in libgcc_s_handle for decision to
406         load DSO.  Assign last.
407         (__unwind_freeres): New function.
409         * allocatestack.c (__reclaim_stacks): Reset in_flight_stack later
410         for better debugging.  No need to use stack_list_add here.
412 2009-01-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
414         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
415         (__lll_timedlock_wait): Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME
416         instead of computing relative timeout.
417         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
418         FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
420 2009-01-25  Ulrich Drepper  <drepper@redhat.com>
422         * pthread_mutex_lock.c (__pthread_mutex_lock): Remove unused label out.
424 2009-01-08  Ulrich Drepper  <drepper@redhat.com>
426         * sysdeps/pthread/list.h (list_add): Initialize new element first.
427         (list_add_tail): Removed.
429 2009-01-07  Ulrich Drepper  <drepper@redhat.com>
431         * (in_flight_stack): New variable.
432         (stack_list_del): New function.  Use instead of list_del.
433         (stack_list_add): New function.  Use instead of list_add when adding to
434         stack_cache and stack_used lists.
435         (__reclaim_stacks): Complete operations on stack_cache and stack_used lists
436         when the fork call interrupted another thread.
438 2009-01-04  Ulrich Drepper  <drepper@redhat.com>
440         * init.c (__pthread_initialize_minimal_internal): Optimize test
441         FUTEX_CLOCK_REALTIME a bit.
443 2009-01-03  Ulrich Drepper  <drepper@redhat.com>
445         * init.c (__pthread_initialize_minimal_internal): Cheat a bit by
446         only passing five parameters to FUTEX_WAIT_BITSET call.
448         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
449         (__lll_timedlock_wait): Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME
450         instead of computing relative timeout.
452 2009-01-02  Ulrich Drepper  <drepper@redhat.com>
454         * init.c (__pthread_initialize_minimal_internal): Check for
455         FUTEX_CLOCK_REALTIME flag.
456         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
457         Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME instead of computing
458         relative timeout.
460         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
461         FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
462         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
463         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
464         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
465         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
467 2008-12-09  Ulrich Drepper  <drepper@redhat.com>
469         * sysdeps/pthread/pthread.h (pthread_cleanup_pop): Use { } as empty
470         loop body instead of ; to avoid gcc warnings.
471         (pthread_cleanup_pop_restore_np): Likewise.
472         Patch by Caolán McNamara <caolanm@redhat.com>.
474 2008-12-09  Jakub Jelinek  <jakub@redhat.com>
476         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle only the
477         fast path here, for robust/PI/PP mutexes call
478         __pthread_mutex_lock_full.  Don't use switch, instead use a series
479         of ifs according to their probability.
480         (__pthread_mutex_lock_full): New function.
481         * pthread_mutex_unlock.c: Include assert.h.
482         (__pthread_mutex_unlock_usercnt): Handle only the
483         fast path here, for robust/PI/PP mutexes call
484         __pthread_mutex_unlock_full.  Don't use switch, instead use a series
485         of ifs according to their probability.
486         (__pthread_mutex_unlock_full): New function.
487         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c
488         (__pthread_mutex_lock_full): Define.
490 2008-12-08  Ulrich Drepper  <drepper@redhat.com>
492         * sysdeps/x86_64/tls.h (tcbhead_t): Add fields reserved for TM
493         implementation.  Add necessary padding and.
494         * descr.h (struct pthread): Increase padding for tcbhead_t to 24
495         words.
497 2008-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
499         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define FUTEX_WAIT_BITSET
500         and FUTEX_WAKE_BITSET.
502 2008-12-02  Ulrich Drepper  <drepper@redhat.com>
504         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_WAIT_BITSET
505         and FUTEX_WAKE_BITSET.
506         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
507         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
508         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
509         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
511 2008-11-25  Roland McGrath  <roland@redhat.com>
513         * sysdeps/alpha, sysdeps/unix/sysv/linux/alpha:
514         Subdirectories moved to ports repository as
515         sysdeps/.../nptl subdirectories.
517 2008-11-12  Jakub Jelinek  <jakub@redhat.com>
519         [BZ #7008]
520         * pthread_condattr_setclock.c (pthread_condattr_setclock): Fix masking
521         of old value.
522         * pthread_cond_init.c (__pthread_cond_init): Fix
523         cond->__data.__nwaiters initialization.
524         * Makefile (tests): Add tst-cond23.
525         * tst-cond23.c: New test.
527 2008-11-07  Jakub Jelinek  <jakub@redhat.com>
529         * sysdeps/pthread/malloc-machine.h (MALLOC): Adjust __libc_tsd_define
530         arguments.
531         (tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get}
532         arguments.
534 2008-11-01  Ulrich Drepper  <drepper@redhat.com>
536         [BZ #6955]
537         * pthread_mutex_lock.c: Add support for private PI mutexes.
538         * pthread_mutex_timedlock.c: Likewise.
539         * pthread_mutex_trylock.c: Likewise.
540         * pthread_mutex_unlock.c: Likewise.
541         Patch mostly by Ben Jackson <ben@ben.com>.
543 2008-10-31  Ulrich Drepper  <drepper@redhat.com>
545         [BZ #6843]
546         * sysdeps/pthread/gai_misc.h (__gai_create_helper_thread):
547         Increase stack size for helper thread.
549 2008-10-06  Martin Schwidefsky  <schwidefsky@de.ibm.com>
551         * sysdeps/s390/tls.h (THREAD_SET_STACK_GUARD): Add empty inline
552         assembly with a clobber list for access registers a0 and a1.
554 2008-09-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
556         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Add memory barrier
557         to force runp->refcntr to be read from memory.
559 2008-09-08  Richard Guenther  <rguenther@suse.de>
561         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_lock,
562         lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
563         lll_timedlock, lll_robust_timedlock, lll_unlock,
564         lll_robust_unlock): Promote private to int.
566 2008-08-15  Ulrich Drepper  <drepper@redhat.com>
568         * sysdeps/x86_64/pthreaddef.h: Remove ARCH_MAP_FLAGS and
569         ARCH_RETRY_MMAP definitions.
570         * allocatestack.c: Remove definition of ARCH_MAP_FLAGS.
571         Define MAP_STACK when not defined.
572         (allocate_stack): Use MAP_STACK instead of ARCH_MAP_FLAGS.  Remove
573         handling of ARCH_RETRY_MMAP.
575 2008-07-30  Ulrich Drepper  <drepper@redhat.com>
577         * tst-align2.c (f): Print message that f is reached.
579 2008-04-28  Hiroki Kaminaga  <kaminaga@sm.sony.co.jp>
581         [BZ #6740]
582         * sysdeps/powerpc/tcb-offsets.sym (PRIVATE_FUTEX_OFFSET): Guard symbol
583         definition with #ifndef __ASSUME_PRIVATE_FUTEX.
585 2008-07-25  Ulrich Drepper  <drepper@redhat.com>
587         * sysdeps/unix/sysv/linux/mq_notify.c (init_mq_netlink): Use
588         SOCK_CLOEXEC if possible.
590 2008-05-29  Ulrich Drepper  <drepper@redhat.com>
592         * Makefile (tests): Add tst-rwlock2a.
593         * tst-rwlock2.c: Use TYPE macro to decide what rwlock type to use.
594         * tst-rwlock2a.c: New file.
596 2008-06-12  Ulrich Drepper  <drepper@redhat.com>
598         * sysdeps/pthread/pthread.h: Remove inadvertant checkin.
600 2008-05-17  Samuel Thibault  <samuel.thibault@ens-lyon.org>
602         * sysdeps/pthread/pthread.h: Fix typo in comment.
604 2008-05-28  Ulrich Drepper  <drepper@redhat.com>
606         * sysdeps/pthread/createthread.c (do_clone): Pass accurate length
607         of CPU set to the kernel.
609 2008-05-23  Paul Pluzhnikov  <ppluzhnikov@google.com>
611         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Add
612         cfi directives.
613         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
614         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
615         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
616         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
617         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
618         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
620 2008-05-22  Paul Pluzhnikov  <ppluzhnikov@google.com>
622         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S: Add
623         cfi directives.
624         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
625         Likewise.
626         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
627         Likewise.
628         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
629         Likewise.
631 2008-05-26  Ulrich Drepper  <drepper@redhat.com>
633         * tst-typesizes.c: Explicitly check __SIZEOF_PTHREAD_* constants.
635 2008-05-20  Jakub Jelinek  <jakub@redhat.com>
637         David S. Miller  <davem@davemloft.net>
639         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
641 2008-05-10  Ulrich Drepper  <drepper@redhat.com>
643         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Access
644         __pshared correctly.
645         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
646         Likewise.
647         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
648         Likewise.
649         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
650         Likewise.
651         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
652         Likewise.
653         Reported by Clemens Kolbitsch <clemens.kol@gmx.at>.
655 2008-04-14  David S. Miller  <davem@davemloft.net>
657         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
658         (__old_sem_wait): Fix argument to lll_futex_wait().
660 2007-11-26  Daniel Jacobowitz  <dan@codesourcery.com>
662         * pthread_create.c: Require pthread_mutex_trylock and
663         pthread_key_delete for libgcc.
665 2008-04-08  Jakub Jelinek  <jakub@redhat.com>
667         [BZ #6020]
668         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h
669         (lll_futex_wake_unlock): Add private argument to the pre-v9 macro.
670         Patch by Sunil Amitkumar Janki <devel.sjanki@gmail.com>.
672 2008-03-27  Ulrich Drepper  <drepper@redhat.com>
674         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine ARG_MAX if
675         <linux/limits.h> has defined it.
676         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
677         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
678         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
679         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
681 2008-03-18  Jakub Jelinek  <jakub@redhat.com>
683         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Use __ASSEMBLER__ instead
684         of ASSEMBLER.
685         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
686         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Likewise.
688 2008-03-14  Ulrich Drepper  <drepper@redhat.com>
690         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
691         HAVE_DL_DISCOVER_OSVERSION.
692         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
693         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Likewise.
695 2008-03-07  Ulrich Drepper  <drepper@redhat.com>
697         [BZ #5778]
698         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Change
699         _POSIX_CHOWN_RESTRICTED value to zero.
701 2008-01-31  Roland McGrath  <roland@redhat.com>
703         * Makefile (omit-deps): Variable removed.
705 2008-01-30  Ulrich Drepper  <drepper@redhat.com>
707         * sysdeps/unix/sysv/linux/x86_64/sem_post.S (sem_post): Avoid
708         unnecessary addr32 prefix.
710 2008-01-29  Roland McGrath  <roland@redhat.com>
712         * Makeconfig (ptw-CPPFLAGS, sysd-rules-patterns): New variables.
714 2008-01-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
716         * sysdeps/unix/sysv/linux/sh/sem_post.S: Don't overflow value field.
718 2008-01-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
720         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XADD): Use
721         a scratch register.
722         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
723         (__lll_lock_wait_private): Fix typo.
724         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
725         (pthread_barrier_wait): Likewise.  Adjust XADD use.
726         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
727         Adjust XADD use.
728         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
729         (pthread_rwlock_timedrdlock): Return correct return value.
730         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
731         (pthread_rwlock_timedwrlock): Likewise.
733 2008-01-15  Ulrich Drepper  <drepper@redhat.com>
735         * tst-eintr2.c (do_test): make sure that if mutex_lock in main
736         thread returns the program exits with an error code.
738 2008-01-10  Ulrich Drepper  <drepper@redhat.com>
740         * pthread-errnos.sym: Add EOVERFLOW.
741         * sysdeps/unix/sysv/linux/structsem.sym: Add SEM_VALUE_MAX.
742         * sysdeps/unix/sysv/linux/sem_post.c: Don't overflow value field.
743         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
744         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
746 2007-12-14  Ulrich Drepper  <drepper@redhat.com>
748         * sysdeps/x86_64/pthreaddef.h (ARCH_RETRY_MMAP): Take additional
749         parameter.  Passed it as permission to mmap.
750         * allocatestack.c (allocate_stack): Pass prot as second parameter
751         to ARCH_RETRY_MMAP.
753 2007-12-12  Ulrich Drepper  <drepper@redhat.com>
755         * tst-basic7.c: Allocate memory for the stack.
757         [BZ #5465]
758         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S [!SHARED]
759         (__pthread_cond_timedwait): Don't use VDSO.
760         Patch by Michal Januszewski.
762 2007-12-07  Ulrich Drepper  <drepper@redhat.com>
764         [BZ #5455]
765         * sysdeps/pthread/pthread.h [!__EXCEPTIONS] (pthread_cleanup_pop):
766         Allow label before pthread_cleanup_pop.
767         (pthread_cleanup_pop_restore_np): Likewise.
769 2007-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
771         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
772         Store 2 before returning ETIMEDOUT.
774 2007-11-23  Ulrich Drepper  <drepper@redhat.com>
776         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
777         Store 2 before returning ETIMEDOUT.
778         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise
779         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
780         (__lll_lock_wait_private): Optimize.
781         (__lll_lock_wait): Likewise.
783 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
785         * sysdeps/pthread/pthread.h (pthread_cleanup_push,
786         pthread_cleanup_push_defer_np): Add extra (void *) cast to shut up
787         g++ 4.1 and 4.2 -Wstrict-aliasing warnings.
789 2007-11-08  Ulrich Drepper  <drepper@redhat.com>
791         [BZ #5240]
792         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
793         If we time out, try one last time to lock the futex to avoid
794         losing a wakeup signal.
795         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
796         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
798         [BZ #5245]
799         * sysdeps/pthread/createthread.c (do_clone): Translate clone error
800         if necessary.
802 2007-11-07  Ulrich Drepper  <drepper@redhat.com>
804         [BZ #5245]
805         * allocatestack.c (allocate_stack): Change ENOMEM error in case
806         mmap failed to EAGAIN.
807         * Makefile (tests): Add tst-basic7.
808         * tst-basic7.c: New file.
810 2007-11-05  Ulrich Drepper  <drepper@redhat.com>
812         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
813         Use __linkin_atfork.
815 2007-11-03  Mike Frysinger  <vapier@gentoo.org>
817         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (LOAD_FUTEX_WAIT): Add
818         missing line continuations.
819         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S (LOAD_FUTEX_WAIT,
820         LOAD_FUTEX_WAKE): Likewise.  Also add missing 3rd parameter.
822 2007-10-28  Ulrich Drepper  <drepper@redhat.com>
824         [BZ #5220]
825         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Declare
826         __active_timer_sigev_thread and __active_timer_sigev_thread_lock.
827         (struct timer): Add next element.
828         * sysdeps/unix/sysv/linux/timer_create.c: For SIGEV_THREAD timers,
829         enqueue timer structure into __active_timer_sigev_thread list.
830         * sysdeps/unix/sysv/linux/timer_delete.c: For SIGEV_THREAD timers,
831         remove timer struct from __active_timer_sigev_thread.
832         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
833         Before using timer structure make sure it is still on the
834         __active_timer_sigev_thread list.  Keep lock until done.
835         Define __active_timer_sigev_thread and
836         __active_timer_sigev_thread_lock.
838 2007-10-27  Ulrich Drepper  <drepper@redhat.com>
840         * sysdeps/pthread/malloc-machine.h: Define ATFORK_MEM.
841         Redefine thread_atfork for use of ATFORK_MEM.
842         * sysdeps/unix/sysv/linux/fork.h: Define __linkin_atfork.
843         * sysdeps/unix/sysv/linux/register-atfork.c (__linkin_atfork): New
844         function.
845         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
846         Use atomic operation when removing first element of list.
848 2007-10-17  Jakub Jelinek  <jakub@redhat.com>
850         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__old_sem_post): New
851         routine instead of an alias to __new_sem_post.
853 2007-10-15  Jakub Jelinek  <jakub@redhat.com>
855         * init.c (__pthread_initialize_minimal): Initialize word to appease
856         valgrind.
858 2007-10-10  Jakub Jelinek  <jakub@redhat.com>
860         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
861         libc.so just clear NAME.
862         (__libc_rwlock_fini): Nop inside of libc.so.
863         * tst-initializers1.c (main): Test if PTHREAD_RWLOCK_INITIALIZER is
864         all zeros.
866 2007-09-02  Ulrich Drepper  <drepper@redhat.com>
868         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
869         (__pthread_cond_wait): Fix unlocking of internal lock after mutex
870         unlocking failed.
871         Patch by Luca Barbieri <luca.barbieri@gmail.com>.
873 2007-08-21  Ulrich Drepper  <drepper@redhat.com>
875         [BZ #4938]
876         * allocatestack.c (__reclaim_stacks): Clear the TSD in the
877         reclaimed stack if necessary.
878         * Makefile (tests): Add tst-tsd6.
879         * tst-tsd6.c: New file.
881 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
883         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
884         Add private argument.
886 2007-08-20  Ulrich Drepper  <drepper@redhat.com>
888         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
889         (__pthread_cond_timedwait): Use clock_gettime from VDSO if possible.
891 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
893         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h
894         (__lll_robust_timedlock): Pass private as last argument to
895         __lll_robust_timedlock_wait.
896         (__lll_unlock): Fix a pasto.
898 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
900         * sysdeps/unix/sysv/linux/sparc/internaltypes.h (sparc_new_sem,
901         sparc_old_sem): New structs.
902         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
903         (__sem_wait_cleanup): New function.
904         (__new_sem_wait): Use sparc_new_sem structure.  Bump and afterwards
905         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
906         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
907         lll_futex_wait.
908         (__old_sem_wait): New function.
909         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: Include
910         nptl/sysdeps/unix/sysv/linux/sparc version.
911         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c:
912         Likewise.
913         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: Likewise.
914         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
915         (__new_sem_trywait): Use sparc_old_sem structure.
916         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
917         (sem_timedwait): Use sparc_new_sem structure.  Bump and afterwards
918         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
919         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
920         lll_futex_timed_wait.
921         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c (__new_sem_post):
922         Use sparc_new_sem structure.  Only wake if nwaiters > 0.  Pass
923         isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
924         lll_futex_wake.
925         (__old_sem_post): New function.
926         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: New file.
927         * sysdeps/unix/sysv/linux/sparc/sem_init.c: New file.
928         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: New file.
929         * sysdeps/unix/sysv/linux/sparc/sem_post.c: New file.
930         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: Remove.
931         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: Remove.
933 2007-08-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
935         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
936         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
937         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
938         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
939         * sysdeps/unix/sysv/linux/shpthread_cond_signal.S
940         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
941         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
942         Use FUTEX_WAKE_OP.
943         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
944         kernel-features.h and tcb-offsets.h.
945         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
946         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
947         process private.
948         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
949         tcb-offsets.h.
950         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE
951         to lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
952         process private.
953         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use #ifdef
954         __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
955         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
956         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
957         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
958         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
959         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
961 2007-08-14  Jakub Jelinek  <jakub@redhat.com>
963         * sysdeps/unix/sysv/linux/lowlevellock.c: Comment fix.
964         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
965         (__lll_timedwait_tid): Pass LLL_SHARED as 4th argument to
966         lll_futex_timed_wait.
968         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock,
969         __lll_robust_unlock): Rewrite as macros instead of inline functions.
970         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock,
971         __lll_robust_unlock, __lll_wait_tid): Likewise.
973 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
975         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
976         Fix a pasto.
977         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
978         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
979         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
980         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
981         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
982         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
983         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
984         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Include
985         kernel-features.h.
986         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
987         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
988         process private.  Switch DW_CFA_advance_loc1 and some
989         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
990         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
991         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE to
992         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
993         process private.  Switch DW_CFA_advance_loc{1,2} and some
994         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
995         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use
996         #ifdef __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
997         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
998         Likewise.
999         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1000         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1001         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1002         Likewise.
1003         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1004         (__pthread_cond_broadcast): Compare %r8 instead of
1005         dep_mutex-cond_*(%rdi) with $-1.
1006         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1007         (__pthread_cond_signal): Xor FUTEX_WAKE_OP with FUTEX_WAKE instead
1008         of oring.
1010 2007-08-13  Ulrich Drepper  <drepper@redhat.com>
1012         * sysdeps/unix/sysv/linux/i386/i786/Implies: New file.
1014 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
1016         * allocatestack.c: Include kernel-features.h.
1017         * pthread_create.c: Likewise.
1018         * pthread_mutex_init.c: Likewise.
1019         * init.c: Likewise.
1020         * pthread_cond_timedwait.c: Likewise.
1021         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
1022         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1023         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1024         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1025         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1026         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1027         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1028         Likewise.
1029         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1030         Likewise.
1031         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1032         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1033         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1034         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1036 2007-08-12  Jakub Jelinek  <jakub@redhat.com>
1038         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
1039         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
1040         byte elements.  One of them is the new __shared element.
1041         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
1042         adjust names of other padding elements.
1043         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
1044         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
1045         byte elements.  One of them is the new __shared element.
1046         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
1047         adjust names of other padding elements.
1048         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_rwlock_t):
1049         Renamed __pad1 element to __shared, adjust names of other padding
1050         elements.
1051         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
1052         (pthread_rwlock_t): Likewise.
1053         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock): Fix a
1054         typo.
1056 2007-08-09  Anton Blanchard  <anton@samba.org>
1058         * sysdeps/unix/sysv/linux/powerpc/pthread_spin_unlock.c: New file.
1060 2007-08-12  Ulrich Drepper  <drepper@redhat.com>
1062         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Include
1063         <kernel-features.h>.
1064         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1066 2007-08-11  Ulrich Drepper  <drepper@redhat.com>
1068         * pthreadP.h (PTHREAD_ROBUST_MUTEX_PSHARED): Define.
1069         * pthread_mutex_lock.c: Use it instead of PTHREAD_MUTEX_PSHARED when
1070         dealing with robust mutexes.
1071         * pthread_mutex_timedlock.c: Likewise.
1072         * pthread_mutex_trylock.c: Likewise.
1073         * pthread_mutex_unlock.c: Likewise.
1074         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
1076 2007-08-06  Jakub Jelinek  <jakub@redhat.com>
1078         * pthreadP.h (PTHREAD_MUTEX_PSHARED_BIT): Define.
1079         (PTHREAD_MUTEX_TYPE): Mask __kind with 127.
1080         (PTHREAD_MUTEX_PSHARED): Define.
1081         * pthread_mutex_init.c (__pthread_mutex_init): Set
1082         PTHREAD_MUTEX_PSHARED_BIT for pshared or robust
1083         mutexes.
1084         * pthread_mutex_lock.c (LLL_MUTEX_LOCK): Take mutex as argument
1085         instead of its __data.__lock field, pass PTHREAD_MUTEX_PSHARED
1086         as second argument to lll_lock.
1087         (LLL_MUTEX_TRYLOCK): Take mutex as argument
1088         instead of its __data.__lock field.
1089         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
1090         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
1091         to lll_robust_lock.
1092         (__pthread_mutex_lock): Update LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
1093         LLL_ROBUST_MUTEX_LOCK users, use PTHREAD_MUTEX_TYPE (mutex)
1094         instead of mutex->__data.__kind directly, pass
1095         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock and lll_futex_wait.
1096         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use
1097         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
1098         directly, pass PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock.
1099         (pthread_mutex_timedlock): Pass PTHREAD_MUTEX_PSHARED (mutex)
1100         to lll_timedlock, lll_robust_timedlock, lll_unlock and
1101         lll_futex_timed_wait.  Use PTHREAD_MUTEX_TYPE (mutex) instead
1102         of mutex->__data.__kind directly.
1103         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Pass
1104         PTHREAD_MUTEX_PSHARED (mutex) to lll_timedlock,
1105         lll_robust_timedlock, lll_unlock and lll_futex_timed_wait.  Use
1106         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind directly.
1107         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Pass
1108         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock, lll_robust_unlock
1109         and lll_futex_wake.
1110         * pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Pass
1111         PTHREAD_MUTEX_PSHARED (mutex) to lll_futex_wait and lll_futex_wake.
1112         Use PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
1113         directly.
1114         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK):
1115         Take mutex as argument instead of its __data.__lock field, pass
1116         PTHREAD_MUTEX_PSHARED as second argument to lll_cond_lock.
1117         (LLL_MUTEX_TRYLOCK): Take mutex as argument instead of its
1118         __data.__lock field.
1119         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
1120         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
1121         to lll_robust_cond_lock.
1122         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Add pshared
1123         variable, pass it to lll_lock, lll_unlock, lll_futex_requeue and
1124         lll_futex_wake.  Don't use lll_futex_requeue if dependent mutex
1125         has PTHREAD_MUTEX_PSHARED_BIT bit set in its __data.__kind.
1126         * pthread_cond_destroy.c (__pthread_cond_destroy): Add pshared
1127         variable, pass it to lll_lock, lll_unlock, lll_futex_wake and
1128         lll_futex_wait.
1129         * pthread_cond_signal.c (__pthread_cond_signal): Add pshared
1130         variable, pass it to lll_lock, lll_unlock, lll_futex_wake_unlock and
1131         lll_futex_wake.
1132         * pthread_cond_timedwait.c (__pthread_cond_wait): Add
1133         pshared variable, pass it to lll_lock, lll_unlock,
1134         lll_futex_timedwait and lll_futex_wake.
1135         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait): Add
1136         pshared variable, pass it to lll_lock, lll_unlock, lll_futex_wait
1137         and lll_futex_wake.
1138         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_requeue,
1139         lll_futex_wake_unlock): Add private argument, use __lll_private_flag
1140         macro.
1141         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue,
1142         lll_futex_wake_unlock): Likewise.
1143         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_requeue):
1144         Likewise.
1145         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_futex_requeue,
1146         lll_futex_wake_unlock): Likewise.
1147         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_requeue):
1148         Likewise.
1149         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue,
1150         lll_futex_wake_unlock): Likewise.
1151         (lll_futex_wake): Fix a typo.
1152         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym (PS_BIT): Add.
1153         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1154         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
1155         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1156         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
1157         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1158         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
1159         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
1160         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1161         (__pthread_cond_timedwait): Likewise.
1162         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
1163         (__condvar_cleanup, __pthread_cond_wait): Likewise.
1165 2007-08-05  Jakub Jelinek  <jakub@redhat.com>
1167         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
1168         Don't use CGOTSETUP and CGOTRESTORE macros.
1169         (CGOTSETUP, CGOTRESTORE): Remove.
1170         <IS_IN_rtld> (CENABLE, CDISABLE): Don't use JUMPTARGET, branch to
1171         @local symbol.
1173 2007-08-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1175         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Remove
1176         definitions for private futexes.
1177         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Include
1178         kernel-features.h and lowlevellock.h.  Use private futexes if
1179         they are available.
1180         (__lll_lock_wait_private, __lll_unlock_wake_private): New.
1181         (__lll_mutex_lock_wait): Rename to
1182         (__lll_lock_wait): ... this.  Don't compile in for libc.so.
1183         (__lll_mutex_timedlock_wait): Rename to ...
1184         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.
1185         Don't compile in for libc.so.
1186         (__lll_mutex_unlock_wake): Rename to ...
1187         (__lll_unlock_wake): ... this.  Don't compile in for libc.so.
1188         (__lll_timedwait_tid): Use __NR_gettimeofday.
1189         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Allow including
1190         the header from assembler.  Renamed all lll_mutex_* resp.
1191         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
1192         Renamed all LLL_MUTEX_LOCK_* macros to LLL_LOCK_*.
1193         (FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE):
1194         Define.
1195         (__lll_lock_wait_private): Add prototype.
1196         (__lll_lock_wait, __lll_timedlock_wait, __lll_robust_lock_wait,
1197         __lll_robust_timedlock_wait, __lll_unlock_wake_private,
1198         __lll_unlock_wake): Likewise.
1199         (lll_lock): Add private argument.  Call __lll_lock_wait_private
1200         if private is constant LLL_PRIVATE.
1201         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
1202         lll_timedlock, lll_robust_timedlock): Add private argument.
1203         (lll_unlock): Add private argument.  Call __lll_unlock_wake_private
1204         if private is constant LLL_PRIVATE.
1205         (lll_robust_unlock, lll_robust_dead): Add private argument.
1206         (lll_lock_t): Remove.
1207         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1208         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1209         lll_cond_wake, lll_cond_broadcast): Remove.
1210         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: Include
1211         kernel-features.h and lowlevellock.h.
1212         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1213         (LOAD_FUTEX_WAIT): Define.
1214         (__lll_robust_mutex_lock_wait): Rename to ...
1215         (__lll_robust_lock_wait): ... this.  Add private argument.
1216         Use LOAD_FUTEX_WAIT macro.
1217         (__lll_robust_mutex_timedlock_wait): Rename to ...
1218         (__lll_robust_timedlock_wait): ... this.    Add private argument.
1219         Use __NR_gettimeofday.  Use LOAD_FUTEX_WAIT macro.
1220         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Include
1221         lowlevellock.h.
1222         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1223         (pthread_barrier_wait): Use __lll_{lock,unlock}_* instead of
1224         __lll_mutex_{lock,unlock}_*.
1225         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Include
1226         lowlevellock.h and pthread-errnos.h.
1227         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1228         FUTEX_CMP_REQUEUE, EINVAL): Remove.
1229         (__pthread_cond_broadcast): Use __lll_{lock,unlock}_* instead of
1230         __lll_mutex_{lock,unlock}_*.
1231         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Include
1232         lowlevellock.h and pthread-errnos.h.
1233         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE, EINVAL): Remove.
1234         (__pthread_cond_signal): Use __lll_{lock,unlock}_* instead of
1235         __lll_mutex_{lock,unlock}_*.
1236         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
1237         lowlevellock.h.
1238         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE): Remove.
1239         (__pthread_cond_timedwait): Use __lll_{lock,unlock}_* instead of
1240         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1241         (__condvar_tw_cleanup): Likewise.
1242         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
1243         lowlevellock.h.
1244         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
1245         (__pthread_cond_wait): Use __lll_{lock,unlock}_* instead of
1246         __lll_mutex_{lock,unlock}_*.
1247         ( __condvar_w_cleanup): Likewise.
1248         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Include lowlevellock.h.
1249         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1250         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Include
1251         lowlevellock.h.
1252         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1253         (__pthread_rwlock_rdlock): Use __lll_{lock,unlock}_* instead of
1254         __lll_mutex_{lock,unlock}_*.
1255         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Include
1256         lowlevellock.h.
1257         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1258         FUTEX_PRIVATE_FLAG): Remove.
1259         (pthread_rwlock_timedrdlock): Use __lll_{lock,unlock}_* instead of
1260         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1261         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Include
1262         lowlevellock.h.
1263         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1264         FUTEX_PRIVATE_FLAG): Remove.
1265         (pthread_rwlock_timedwrlock): Use __lll_{lock,unlock}_* instead of
1266         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
1267         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Include
1268         lowlevellock.h.
1269         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1270         (__pthread_rwlock_unlock): Use __lll_{lock,unlock}_* instead of
1271         __lll_mutex_{lock,unlock}_*.
1272         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Include
1273         lowlevellock.h.
1274         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1275         (__pthread_rwlock_wrlock): Use __lll_{lock,unlock}_* instead of
1276         __lll_mutex_{lock,unlock}_*.
1277         * sysdeps/unix/sysv/linux/sh/sem_post.S: Include lowlevellock.h.
1278         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
1279         (__new_sem_post): Use standard initial exec code sequences.
1280         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Include
1281         lowlevellock.h.
1282         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
1283         FUTEX_PRIVATE_FLAG): Remove.
1284         (sem_timedwait): Use __NR_gettimeofday.  Use standard initial
1285         exec code sequences.
1286         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Include lowlevellock.h.
1287         (__new_sem_trywait): Use standard initial exec code sequences.
1288         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Include lowlevellock.h.
1289         (__new_sem_wait): Use standard initial exec code sequences.
1291 2007-07-31  Anton Blanchard  <anton@samba.org>
1293         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1294         Use __asm __volatile (__lll_acq_instr ::: "memory") instead of
1295         atomic_full_barrier.
1297 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
1299         * allocatestack.c (stack_cache_lock): Change type to int.
1300         (get_cached_stack, allocate_stack, __deallocate_stack,
1301         __make_stacks_executable, __find_thread_by_id, __nptl_setxid,
1302         __pthread_init_static_tls, __wait_lookup_done): Add LLL_PRIVATE
1303         as second argument to lll_lock and lll_unlock macros on
1304         stack_cache_lock.
1305         * pthread_create.c (__find_in_stack_list): Likewise.
1306         (start_thread): Similarly with pd->lock.  Use lll_robust_dead
1307         macro instead of lll_robust_mutex_dead, pass LLL_SHARED to it
1308         as second argument.
1309         * descr.h (struct pthread): Change lock and setxid_futex field
1310         type to int.
1311         * old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0): Use
1312         LLL_LOCK_INITIALIZER instead of LLL_MUTEX_LOCK_INITIALIZER.
1313         * old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
1314         * old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
1315         Likewise.
1316         * old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
1317         * pthread_cond_init.c (__pthread_cond_init): Likewise.
1318         * pthreadP.h (__attr_list_lock): Change type to int.
1319         * pthread_attr_init.c (__attr_list_lock): Likewise.
1320         * pthread_barrier_destroy.c (pthread_barrier_destroy): Pass
1321         ibarrier->private ^ FUTEX_PRIVATE_FLAG as second argument to
1322         lll_{,un}lock.
1323         * pthread_barrier_wait.c (pthread_barrier_wait): Likewise and
1324         also for lll_futex_{wake,wait}.
1325         * pthread_barrier_init.c (pthread_barrier_init): Make iattr
1326         a pointer to const.
1327         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Pass
1328         LLL_SHARED as second argument to lll_{,un}lock.
1329         * pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
1330         * pthread_cond_signal.c (__pthread_cond_singal): Likewise.
1331         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
1332         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait):
1333         Likewise.
1334         * pthread_getattr_np.c (pthread_getattr_np): Add LLL_PRIVATE
1335         as second argument to lll_{,un}lock macros on pd->lock.
1336         * pthread_getschedparam.c (__pthread_getschedparam): Likewise.
1337         * pthread_setschedparam.c (__pthread_setschedparam): Likewise.
1338         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
1339         * tpp.c (__pthread_tpp_change_priority, __pthread_current_priority):
1340         Likewise.
1341         * sysdeps/pthread/createthread.c (do_clone, create_thread):
1342         Likewise.
1343         * pthread_once.c (once_lock): Change type to int.
1344         (__pthread_once): Pass LLL_PRIVATE as second argument to
1345         lll_{,un}lock macros on once_lock.
1346         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Use
1347         lll_{,un}lock macros instead of lll_mutex_{,un}lock, pass
1348         rwlock->__data.__shared as second argument to them and similarly
1349         for lll_futex_w*.
1350         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
1351         Likewise.
1352         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
1353         Likewise.
1354         * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Likewise.
1355         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Likewise.
1356         * pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Likewise.
1357         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1358         * sem_close.c (sem_close): Pass LLL_PRIVATE as second argument
1359         to lll_{,un}lock macros on __sem_mappings_lock.
1360         * sem_open.c (check_add_mapping): Likewise.
1361         (__sem_mappings_lock): Change type to int.
1362         * semaphoreP.h (__sem_mappings_lock): Likewise.
1363         * pthread_mutex_lock.c (LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
1364         LLL_ROBUST_MUTEX_LOCK): Use lll_{,try,robust_}lock macros
1365         instead of lll_*mutex_*, pass LLL_SHARED as last
1366         argument.
1367         (__pthread_mutex_lock): Use lll_unlock instead of lll_mutex_unlock,
1368         pass LLL_SHARED as last argument.
1369         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK,
1370         LLL_MUTEX_TRYLOCK, LLL_ROBUST_MUTEX_LOCK): Use
1371         lll_{cond_,cond_try,robust_cond}lock macros instead of lll_*mutex_*,
1372         pass LLL_SHARED as last argument.
1373         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
1374         lll_{timed,try,robust_timed,un}lock instead of lll_*mutex*, pass
1375         LLL_SHARED as last argument.
1376         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Similarly.
1377         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
1378         Similarly.
1379         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_lock,
1380         __libc_lock_lock_recursive, __libc_lock_unlock,
1381         __libc_lock_unlock_recursive): Pass LLL_PRIVATE as second
1382         argument to lll_{,un}lock.
1383         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_lock,
1384         _IO_lock_unlock): Likewise.
1385         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Don't use
1386         compound literal.
1387         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1388         Pass LLL_PRIVATE as second argument to lll_{,un}lock macros on
1389         __fork_lock.
1390         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork,
1391         free_mem): Likewise.
1392         (__fork_lock): Change type to int.
1393         * sysdeps/unix/sysv/linux/fork.h (__fork_lock): Likewise.
1394         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Pass
1395         isem->private ^ FUTEX_PRIVATE_FLAG as second argument to
1396         lll_futex_wake.
1397         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
1398         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Likewise.
1399         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait_private):
1400         New function.
1401         (__lll_lock_wait, __lll_timedlock_wait): Add private argument and
1402         pass it through to lll_futex_*wait, only compile in when
1403         IS_IN_libpthread.
1404         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
1405         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Add private
1406         argument and pass it through to lll_futex_*wait.
1407         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Renamed all
1408         lll_mutex_* resp. lll_robust_mutex_* macros to lll_* resp.
1409         lll_robust_*.  Renamed all __lll_mutex_* resp. __lll_robust_mutex_*
1410         inline functions to __lll_* resp. __lll_robust_*.
1411         (LLL_MUTEX_LOCK_INITIALIZER): Remove.
1412         (lll_mutex_dead): Add private argument.
1413         (__lll_lock_wait_private): New prototype.
1414         (__lll_lock_wait, __lll_robust_lock_wait, __lll_lock_timedwait,
1415         __lll_robust_lock_timedwait): Add private argument to prototypes.
1416         (__lll_lock): Add private argument, if it is constant LLL_PRIVATE,
1417         call __lll_lock_wait_private, otherwise pass private to
1418         __lll_lock_wait.
1419         (__lll_robust_lock, __lll_cond_lock, __lll_timedlock,
1420         __lll_robust_timedlock): Add private argument, pass it to
1421         __lll_*wait functions.
1422         (__lll_unlock): Add private argument, if it is constant LLL_PRIVATE,
1423         call __lll_unlock_wake_private, otherwise pass private to
1424         __lll_unlock_wake.
1425         (__lll_robust_unlock): Add private argument, pass it to
1426         __lll_robust_unlock_wake.
1427         (lll_lock, lll_robust_lock, lll_cond_lock, lll_timedlock,
1428         lll_robust_timedlock, lll_unlock, lll_robust_unlock): Add private
1429         argument, pass it through to __lll_* inline function.
1430         (__lll_mutex_unlock_force, lll_mutex_unlock_force): Remove.
1431         (lll_lock_t): Remove.
1432         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1433         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1434         lll_cond_wake, lll_cond_broadcast): Remove.
1435         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1436         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1437         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1438         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1439         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Allow including
1440         the header from assembler.  Renamed all lll_mutex_* resp.
1441         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
1442         (LOCK, FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP,
1443         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
1444         (LLL_MUTEX_LOCK_INITIALIZER, LLL_MUTEX_LOCK_INITIALIZER_LOCKED,
1445         LLL_MUTEX_LOCK_INITIALIZER_WAITERS): Remove.
1446         (__lll_mutex_lock_wait, __lll_mutex_timedlock_wait,
1447         __lll_mutex_unlock_wake, __lll_lock_wait, __lll_unlock_wake):
1448         Remove prototype.
1449         (__lll_trylock_asm, __lll_lock_asm_start, __lll_unlock_asm): Define.
1450         (lll_robust_trylock, lll_cond_trylock): Use LLL_LOCK_INITIALIZER*
1451         rather than LLL_MUTEX_LOCK_INITIALIZER* macros.
1452         (lll_trylock): Likewise, use __lll_trylock_asm, pass
1453         MULTIPLE_THREADS_OFFSET as another asm operand.
1454         (lll_lock): Add private argument, use __lll_lock_asm_start, pass
1455         MULTIPLE_THREADS_OFFSET as last asm operand, call
1456         __lll_lock_wait_private if private is constant LLL_PRIVATE,
1457         otherwise pass private as another argument to __lll_lock_wait.
1458         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
1459         lll_timedlock, lll_robust_timedlock): Add private argument, pass
1460         private as another argument to __lll_*lock_wait call.
1461         (lll_unlock): Add private argument, use __lll_unlock_asm, pass
1462         MULTIPLE_THREADS_OFFSET as another asm operand, call
1463         __lll_unlock_wake_private if private is constant LLL_PRIVATE,
1464         otherwise pass private as another argument to __lll_unlock_wake.
1465         (lll_robust_unlock): Add private argument, pass private as another
1466         argument to __lll_unlock_wake.
1467         (lll_robust_dead): Add private argument, use __lll_private_flag
1468         macro.
1469         (lll_islocked): Use LLL_LOCK_INITIALIZER instead of
1470         LLL_MUTEX_LOCK_INITIALIZER.
1471         (lll_lock_t): Remove.
1472         (LLL_LOCK_INITIALIZER_WAITERS): Define.
1473         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
1474         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
1475         lll_cond_wake, lll_cond_broadcast): Remove.
1476         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1477         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Revert
1478         2007-05-2{3,9} changes.
1479         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Include
1480         kernel-features.h and lowlevellock.h.
1481         (LOAD_PRIVATE_FUTEX_WAIT): Define.
1482         (LOAD_FUTEX_WAIT): Rewritten.
1483         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
1484         define.
1485         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
1486         (__lll_mutex_lock_wait): Rename to ...
1487         (__lll_lock_wait): ... this.  Take futex addr from %edx instead of
1488         %ecx, %ecx is now private argument.  Don't compile in for libc.so.
1489         (__lll_mutex_timedlock_wait): Rename to ...
1490         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.  %esi
1491         contains private argument.  Don't compile in for libc.so.
1492         (__lll_mutex_unlock_wake): Rename to ...
1493         (__lll_unlock_wake): ... this.  %ecx contains private argument.
1494         Don't compile in for libc.so.
1495         (__lll_timedwait_tid): Use __NR_gettimeofday.
1496         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Include
1497         kernel-features.h and lowlevellock.h.
1498         (LOAD_FUTEX_WAIT): Define.
1499         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
1500         define.
1501         (__lll_robust_mutex_lock_wait): Rename to ...
1502         (__lll_robust_lock_wait): ... this.  Futex addr is now in %edx
1503         argument, %ecx argument contains private.  Use LOAD_FUTEX_WAIT
1504         macro.
1505         (__lll_robust_mutex_timedlock_wait): Rename to ...
1506         (__lll_robust_timedlock_wait): ... this.  Use __NR_gettimeofday.
1507         %esi argument contains private, use LOAD_FUTEX_WAIT macro.
1508         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Include
1509         lowlevellock.h.
1510         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1511         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
1512         PRIVATE(%ebx) ^ LLL_SHARED as private argument in %ecx to
1513         __lll_lock_wait and __lll_unlock_wake, pass MUTEX(%ebx) address
1514         to __lll_lock_wait in %edx.
1515         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
1516         Include lowlevellock.h and pthread-errnos.h.
1517         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1518         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
1519         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*, pass
1520         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1521         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1522         __lll_unlock_wake.
1523         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
1524         Include lowlevellock.h and pthread-errnos.h.
1525         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
1526         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
1527         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*, pass
1528         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1529         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1530         __lll_unlock_wake.
1531         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
1532         Include lowlevellock.h.
1533         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1534         Don't define.
1535         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*, pass
1536         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
1537         pass LLL_SHARED in %ecx to both __lll_lock_wait and
1538         __lll_unlock_wake.  Use __NR_gettimeofday.
1539         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
1540         Include lowlevellock.h.
1541         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1542         (__pthread_cond_wait, __condvar_w_cleanup): Rename __lll_mutex_*
1543         to __lll_*, pass cond_lock address in %edx rather than %ecx to
1544         __lll_lock_wait, pass LLL_SHARED in %ecx to both __lll_lock_wait
1545         and __lll_unlock_wake.
1546         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S:
1547         Include lowlevellock.h.
1548         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1549         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*, pass
1550         MUTEX(%ebx) address in %edx rather than %ecx to
1551         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
1552         and __lll_unlock_wake.  Move return value from %ecx to %edx
1553         register.
1554         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1555         Include lowlevellock.h.
1556         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1557         Don't define.
1558         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1559         MUTEX(%ebp) address in %edx rather than %ecx to
1560         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
1561         and __lll_unlock_wake.  Move return value from %ecx to %edx
1562         register.  Use __NR_gettimeofday.
1563         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1564         Include lowlevellock.h.
1565         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1566         Don't define.
1567         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1568         MUTEX(%ebp) address in %edx rather than %ecx to
1569         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
1570         and __lll_unlock_wake.  Move return value from %ecx to %edx
1571         register.  Use __NR_gettimeofday.
1572         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
1573         Include lowlevellock.h.
1574         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1575         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*, pass
1576         MUTEX(%edi) address in %edx rather than %ecx to
1577         __lll_lock_wait, pass PSHARED(%edi) in %ecx to both __lll_lock_wait
1578         and __lll_unlock_wake.
1579         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
1580         Include lowlevellock.h.
1581         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1582         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1583         MUTEX(%ebx) address in %edx rather than %ecx to
1584         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
1585         and __lll_unlock_wake.  Move return value from %ecx to %edx
1586         register.
1587         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Include
1588         lowlevellock.h.
1589         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1590         define.
1591         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Include lowlevellock.h.
1592         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1593         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Include
1594         lowlevellock.h.
1595         (LOCK, SYS_futex, SYS_gettimeofday, FUTEX_WAIT): Don't define.
1596         (sem_timedwait): Use __NR_gettimeofday.
1597         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Include
1598         lowlevellock.h.
1599         (LOCK): Don't define.
1600         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include
1601         lowlevellock.h.
1602         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1603         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Wake only when there
1604         are waiters.
1605         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Revert
1606         2007-05-2{3,9} changes.
1607         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Include
1608         kernel-features.h and lowlevellock.h.
1609         (LOAD_PRIVATE_FUTEX_WAIT): Define.
1610         (LOAD_FUTEX_WAIT): Rewritten.
1611         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
1612         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
1613         (__lll_mutex_lock_wait): Rename to ...
1614         (__lll_lock_wait): ... this.  %esi is now private argument.
1615         Don't compile in for libc.so.
1616         (__lll_mutex_timedlock_wait): Rename to ...
1617         (__lll_timedlock_wait): ... this.  %esi contains private argument.
1618         Don't compile in for libc.so.
1619         (__lll_mutex_unlock_wake): Rename to ...
1620         (__lll_unlock_wake): ... this.  %esi contains private argument.
1621         Don't compile in for libc.so.
1622         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Include
1623         kernel-features.h and lowlevellock.h.
1624         (LOAD_FUTEX_WAIT): Define.
1625         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
1626         (__lll_robust_mutex_lock_wait): Rename to ...
1627         (__lll_robust_lock_wait): ... this.  %esi argument contains private.
1628         Use LOAD_FUTEX_WAIT macro.
1629         (__lll_robust_mutex_timedlock_wait): Rename to ...
1630         (__lll_robust_timedlock_wait): ... this. %esi argument contains
1631         private, use LOAD_FUTEX_WAIT macro.
1632         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Include
1633         lowlevellock.h.
1634         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1635         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
1636         PRIVATE(%rdi) ^ LLL_SHARED as private argument in %esi to
1637         __lll_lock_wait and __lll_unlock_wake.
1638         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S:
1639         Include lowlevellock.h and pthread-errnos.h.
1640         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1641         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
1642         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*,
1643         pass LLL_SHARED in %esi to both __lll_lock_wait and
1644         __lll_unlock_wake.
1645         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S:
1646         Include lowlevellock.h and pthread-errnos.h.
1647         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
1648         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
1649         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*,
1650         pass LLL_SHARED in %esi to both __lll_lock_wait and
1651         __lll_unlock_wake.
1652         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:
1653         Include lowlevellock.h.
1654         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1655         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*,
1656         pass LLL_SHARED in %esi to both __lll_lock_wait and
1657         __lll_unlock_wake.
1658         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
1659         Include lowlevellock.h.
1660         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1661         (__pthread_cond_wait, __condvar_cleanup): Rename __lll_mutex_*
1662         to __lll_*, pass LLL_SHARED in %esi to both __lll_lock_wait
1663         and __lll_unlock_wake.
1664         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:
1665         Include lowlevellock.h.
1666         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1667         Don't define.
1668         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*,
1669         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1670         and __lll_unlock_wake.
1671         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1672         Include lowlevellock.h.
1673         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1674         Don't define.
1675         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1676         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1677         and __lll_unlock_wake.
1678         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1679         Include lowlevellock.h.
1680         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1681         Don't define.
1682         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1683         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1684         and __lll_unlock_wake.
1685         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S:
1686         Include lowlevellock.h.
1687         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1688         Don't define.
1689         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*,
1690         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1691         and __lll_unlock_wake.
1692         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:
1693         Include lowlevellock.h.
1694         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1695         Don't define.
1696         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1697         pass PSHARED(%rdi) in %ecx to both __lll_lock_wait
1698         and __lll_unlock_wake.
1699         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Include
1700         lowlevellock.h.
1701         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1702         define.
1703         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Include lowlevellock.h.
1704         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1705         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Include
1706         lowlevellock.h.
1707         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1708         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Include
1709         lowlevellock.h.
1710         (LOCK): Don't define.
1711         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Include
1712         lowlevellock.h.
1713         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1714         * sysdeps/unix/sysv/linux/sparc/internaltypes.h: New file.
1715         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c: New file.
1716         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c: New file.
1717         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c: New file.
1718         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
1719         (__lll_lock_wait_private): New function.
1720         (__lll_lock_wait, __lll_timedlock_wait): Add private argument, pass
1721         it to lll_futex_*wait.  Don't compile in for libc.so.
1722         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c:
1723         Remove.
1724         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
1725         (struct sparc_pthread_barrier): Remove.
1726         (pthread_barrier_wait): Use union sparc_pthread_barrier instead of
1727         struct sparc_pthread_barrier.  Pass
1728         ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE to lll_{,un}lock
1729         and lll_futex_wait macros.
1730         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
1731         Remove.
1732         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1733         Include sparc pthread_barrier_wait.c instead of generic one.
1735 2007-07-30  Jakub Jelinek  <jakub@redhat.com>
1737         * tst-rwlock14.c (do_test): Avoid warnings on 32-bit arches.
1739         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
1740         (pthread_rwlock_timedrdlock): Copy futex retval to %esi rather than
1741         %ecx.
1742         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
1743         (pthread_rwlock_timedwrlock): Likewise.
1744         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
1745         (__pthread_rwlock_unlock): Fix MUTEX != 0 args to __lll_*.
1747 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
1749         * sysdeps/sparc/tls.h (tcbhead_t): Add private_futex field.
1751 2007-07-26  Jakub Jelinek  <jakub@redhat.com>
1753         * tst-locale2.c (useless): Add return statement.
1755 2007-07-24  Jakub Jelinek  <jakub@redhat.com>
1757         * allocatestack.c (__nptl_setxid, __wait_lookup_done): Replace
1758         lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).
1759         * pthread_create.c (start_thread): Likewise.
1760         * init.c (sighandler_setxid): Likewise.
1761         * sysdeps/alpha/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1762         * sysdeps/ia64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1763         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1764         * sysdeps/s390/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1765         * sysdeps/powerpc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1766         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1767         * sysdeps/sparc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1768         * sysdeps/sh/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1769         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY, AIO_MISC_WAIT):
1770         Likewise.
1771         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY, GAI_MISC_WAIT):
1772         Likewise.
1773         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1774         Likewise.
1775         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_waitzero,
1776         __rtld_notify): Likewise.
1777         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Likewise.
1778         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (clear_once_control,
1779         __pthread_once): Likewise.
1780         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (clear_once_control,
1781         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1782         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1783         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1784         (lll_futex_wait): Add private argument, define as wrapper around
1785         lll_futex_timed_wait.
1786         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1787         use __lll_private_flag macro.
1788         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1789         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1790         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (clear_once_control,
1791         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1792         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1793         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1794         (lll_futex_wait): Add private argument, define as wrapper around
1795         lll_futex_timed_wait.
1796         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1797         use __lll_private_flag macro.
1798         (__lll_mutex_unlock, __lll_robust_mutex_unlock, lll_wait_tid,
1799         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1800         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
1801         Define.
1802         (lll_futex_timed_wait, lll_futex_wake): Use it.
1803         (lll_private_futex_wait, lll_private_futex_timed_wait,
1804         lll_private_futex_wake): Removed.
1805         * sysdeps/unix/sysv/linux/s390/pthread_once.c (clear_once_control,
1806         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1807         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1808         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1809         (lll_futex_wait): Add private argument, define as wrapper around
1810         lll_futex_timed_wait.
1811         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1812         use __lll_private_flag macro.
1813         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1814         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1815         to lll_futex_*.
1816         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1817         (lll_private_futex_wait, lll_private_futex_timed_wait,
1818         lll_private_futex_wake): Removed.
1819         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_private_flag):
1820         Fix !__ASSUME_PRIVATE_FUTEX non-constant private case.
1821         (lll_private_futex_wait, lll_private_futex_timed_wait,
1822         lll_private_futex_wake): Removed.
1823         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (clear_once_control,
1824         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1825         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1826         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1827         (lll_futex_wait): Add private argument, define as wrapper around
1828         lll_futex_timed_wait.
1829         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1830         use __lll_private_flag macro.
1831         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1832         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1833         to lll_futex_*.
1834         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (__lll_private_flag):
1835         Define.
1836         (lll_futex_timed_wait, lll_futex_wake): Use it.
1837         (lll_private_futex_wait, lll_private_futex_timed_wait,
1838         lll_private_futex_wake): Removed.
1840 2007-07-27  Jakub Jelinek  <jakub@redhat.com>
1842         * sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
1843         of the structure for sparc32.
1845 2007-07-26  Aurelien Jarno  <aurelien@aurel32.net>
1847         * sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
1849 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1851         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1852         code used when private futexes are assumed.
1853         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1854         Likewise.
1856 2007-07-23  Jakub Jelinek  <jakub@redhat.com>
1858         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1859         (__lll_private_flag): Define.
1860         (lll_futex_wait): Define as a wrapper around lll_futex_timed_wait.
1861         (lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Use
1862         __lll_private_flag.
1863         (lll_private_futex_wait, lll_private_futex_timedwait,
1864         lll_private_futex_wake): Define as wrapper around non-_private
1865         macros.
1866         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1867         (__lll_private_flag): Define.
1868         (lll_futex_timed_wait, lll_futex_wake): Use __lll_private_flag.
1869         (lll_private_futex_wait, lll_private_futex_timedwait,
1870         lll_private_futex_wake): Define as wrapper around non-_private
1871         macros.
1873 2007-07-10  Steven Munroe  <sjmunroe@us.ibm.com>
1875         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Add LLL_SHARED
1876         parameter to lll_futex_wait call.
1877         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1879         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
1880         Replace lll_futex_wait with lll_private_futex_wait.
1881         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1882         Add LLL_SHARED parameter to lll_futex_wake().
1884         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define LLL_PRIVATE
1885         LLL_SHARED, lll_private_futex_wait, lll_private_futex_timed_wait and
1886         lll_private_futex_wake.
1887         (lll_futex_wait): Add private parameter. Adjust FUTEX_PRIVATE_FLAG
1888         bit from private parm before syscall.
1889         (lll_futex_timed_wait): Likewise.
1890         (lll_futex_wake): Likewise.
1891         (lll_futex_wake_unlock): Likewise.
1892         (lll_mutex_unlock): Add LLL_SHARED parm to lll_futex_wake call.
1893         (lll_robust_mutex_unlock): Likewise.
1894         (lll_mutex_unlock_force): Likewise.
1895         (lll_wait_tid): Add LLL_SHARED parm to lll_futex_wait call.
1897 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1899         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1900         compilation when unconditionally using private futexes.
1901         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1902         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1903         Likewise.
1904         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1905         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1907 2007-07-17  Jakub Jelinek  <jakub@redhat.com>
1909         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
1910         Define.
1912 2007-07-06  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1914         * sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and
1915         kernel-features.h.
1917 2007-05-16  Roland McGrath  <roland@redhat.com>
1919         * init.c (__nptl_initial_report_events): New variable.
1920         (__pthread_initialize_minimal_internal): Initialize pd->report_events
1921         to that.
1923 2007-06-22  Jakub Jelinek  <jakub@redhat.com>
1925         * pthread_getattr_np.c (pthread_getattr_np): Clear cpuset and
1926         cpusetsize if pthread_getaffinity_np failed with ENOSYS.
1928 2007-06-19  Ulrich Drepper  <drepper@redhat.com>
1930         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Remove mrlock
1931         implementation.
1933 2007-06-18  Ulrich Drepper  <drepper@redhat.com>
1935         * pthreadP.h: Define PTHREAD_MUTEX_TYPE.
1936         * phtread_mutex_lock.c: Use PTHREAD_MUTEX_TYPE.
1937         * pthread_mutex_timedlock.c: Likewise.
1938         * pthread_mutex_trylock.c: Likewise.
1939         * pthread_mutex_unlock.c: Likewise.
1941 2007-06-17  Andreas Schwab  <schwab@suse.de>
1943         * sysdeps/pthread/pt-initfini.c: Tell gcc about the nonstandard
1944         sections.
1946 2007-06-17  Ulrich Drepper  <drepper@redhat.com>
1948         * allocatestack.c (allocate_stack): Make code compile if
1949         __ASSUME_PRIVATE_FUTEX is set.
1951 2007-06-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1953         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S:
1954         (__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
1955         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
1956         (__pthread_rwlock_wrlock): Likewise.
1957         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
1958         (pthread_rwlock_timedrdlock): Likewise.
1959         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
1960         (pthread_rwlock_timedwrlock): Likewise.
1961         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
1962         (__pthread_rwlock_unlock): Likewise.
1964 2007-06-10  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1966         * sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
1967         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
1968         Split __flags into __flags, __shared, __pad1 and __pad2.
1969         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
1970         futexes if they are available.
1971         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
1972         in libc-lowlevellock.S allow using private futexes.
1973         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
1974         FUTEX_PRIVATE_FLAG.  Add additional parameter to lll_futex_wait,
1975         lll_futex_timed_wait and lll_futex_wake.  Change lll_futex_wait
1976         to call lll_futex_timed_wait.  Add lll_private_futex_wait,
1977         lll_private_futex_timed_wait and lll_private_futex_wake.
1978         (lll_robust_mutex_unlock): Fix typo.
1979         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
1980         field in futex command setup.
1981         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
1982         COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
1983         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
1984         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
1985         if they are available.  Remove clear_once_control.
1986         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
1987         futexes if they are available.
1988         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1989         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1990         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1991         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1992         * sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
1993         Wake only when there are waiters.
1994         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
1995         support.  Indicate that there are waiters.  Remove unnecessary
1996         extra cancellation test.
1997         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.  Removed
1998         left-over duplication of __sem_wait_cleanup.
2000 2007-06-07  Ulrich Drepper  <drepper@redhat.com>
2002         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Add additional
2003         parameter to lll_futex_wait, lll_futex_timed_wait, and
2004         lll_futex_wake.  Change lll_futex_wait to call lll_futex_timed_wait.
2005         Add lll_private_futex_wait, lll_private_futex_timed_wait, and
2006         lll_private_futex_wake.
2007         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2008         * allocatestack.c: Adjust use of lll_futex_* macros.
2009         * init.c: Likewise.
2010         * lowlevellock.h: Likewise.
2011         * pthread_barrier_wait.c: Likewise.
2012         * pthread_cond_broadcast.c: Likewise.
2013         * pthread_cond_destroy.c: Likewise.
2014         * pthread_cond_signal.c: Likewise.
2015         * pthread_cond_timedwait.c: Likewise.
2016         * pthread_cond_wait.c: Likewise.
2017         * pthread_create.c: Likewise.
2018         * pthread_mutex_lock.c: Likewise.
2019         * pthread_mutex_setprioceiling.c: Likewise.
2020         * pthread_mutex_timedlock.c: Likewise.
2021         * pthread_mutex_unlock.c: Likewise.
2022         * pthread_rwlock_timedrdlock.c: Likewise.
2023         * pthread_rwlock_timedwrlock.c: Likewise.
2024         * pthread_rwlock_unlock.c: Likewise.
2025         * sysdeps/alpha/tls.h: Likewise.
2026         * sysdeps/i386/tls.h: Likewise.
2027         * sysdeps/ia64/tls.h: Likewise.
2028         * sysdeps/powerpc/tls.h: Likewise.
2029         * sysdeps/pthread/aio_misc.h: Likewise.
2030         * sysdeps/pthread/gai_misc.h: Likewise.
2031         * sysdeps/s390/tls.h: Likewise.
2032         * sysdeps/sh/tls.h: Likewise.
2033         * sysdeps/sparc/tls.h: Likewise.
2034         * sysdeps/unix/sysv/linux/fork.c: Likewise.
2035         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
2036         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
2037         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Likewise.
2038         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
2039         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
2040         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
2041         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
2042         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
2043         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
2044         Likewise.
2045         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise.
2046         * sysdeps/x86_64/tls.h: Likewise.
2048 2007-05-29  Ulrich Drepper  <drepper@redhat.com>
2050         * pthread_getattr_np.c: No need to install a cancellation handler,
2051         this is no cancellation point.
2052         * pthread_getschedparam.c: Likewise.
2053         * pthread_setschedparam.c: Likewise.
2054         * pthread_setschedprio.c: Likewise.
2055         * sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
2056         lll_unlock_wake_cb.
2057         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2058         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2059         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2060         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2061         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2062         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2063         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
2064         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2065         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2066         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
2067         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
2068         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2070         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
2071         whether there are more than one thread makes no sense here since
2072         we only call the slow path if the locks are taken.
2073         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
2075         * sysdeps/unix/sysv/linux/internaltypes.h: Introduce
2076         COND_NWAITERS_SHIFT.
2077         * pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of
2078         COND_CLOCK_BITS.
2079         * pthread_cond_init.c: Likewise.
2080         * pthread_cond_timedwait.c: Likewise.
2081         * pthread_cond_wait.c: Likewise.
2082         * pthread_condattr_getclock.c: Likewise.
2083         * pthread_condattr_setclock.c: Likewise.
2084         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise.
2085         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2086         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2087         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2088         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2090 2007-05-28  Jakub Jelinek  <jakub@redhat.com>
2092         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
2093         unistd.h.
2095         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
2096         insn suffix.
2097         (THREAD_GSCOPE_GET_FLAG): Remove.
2098         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Remove.
2099         * allocatestack.c (__wait_lookup_done): Revert 2007-05-24
2100         changes.
2101         * sysdeps/powerpc/tls.h (tcbhead_t): Remove gscope_flag.
2102         (THREAD_GSCOPE_GET_FLAG): Remove.
2103         (THREAD_GSCOPE_RESET_FLAG): Use THREAD_SELF->header.gscope_flag
2104         instead of THREAD_GSCOPE_GET_FLAG.
2105         (THREAD_GSCOPE_SET_FLAG): Likewise.  Add atomic_write_barrier after
2106         it.
2107         * sysdeps/s390/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2108         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2109         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2110         THREAD_GSCOPE_WAIT): Define.
2111         * sysdeps/sparc/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2112         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2113         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2114         THREAD_GSCOPE_WAIT): Define.
2115         * sysdeps/sh/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2116         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2117         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2118         THREAD_GSCOPE_WAIT): Define.
2119         * sysdeps/ia64/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2120         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2121         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2122         THREAD_GSCOPE_WAIT): Define.
2124 2007-05-24  Richard Henderson  <rth@redhat.com>
2126         * descr.h (struct pthread): Add header.gscope_flag.
2127         * sysdeps/alpha/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
2128         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
2129         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
2130         THREAD_GSCOPE_WAIT): Define.
2132 2007-05-27  Ulrich Drepper  <drepper@redhat.com>
2134         * init.c: Make it compile with older kernel headers.
2136         * tst-initializers1.c: Show through exit code which test failed.
2138         * pthread_rwlock_init.c: Also initialize __shared field.
2139         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
2140         element in rwlock structure into four byte elements.  One of them is
2141         the new __shared element.
2142         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
2143         Likewise.
2144         [__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
2145         __shared, adjust names of other padding elements.
2146         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2147         * sysdeps/pthread/pthread.h: Adjust rwlock initializers.
2148         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
2149         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
2150         FUTEX_PRIVATE_FLAG.
2151         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
2152         futex to use private operations if possible.
2153         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
2154         Likewise.
2155         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2156         Likewise.
2157         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
2158         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2159         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2160         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2161         Likewise.
2162         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2163         Likewise.
2164         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
2165         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2167 2007-05-26  Ulrich Drepper  <drepper@redhat.com>
2169         * pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
2170         * pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
2171         * pthread_rwlock_timedrdlock.c: Likewise.
2172         * pthread_rwlock_tryrdlock.c: Likewise.
2174         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
2175         optimization.
2177         * sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
2178         * sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
2179         duplication of __sem_wait_cleanup.
2181         * allocatestack.c: Revert last change.
2182         * init.c: Likewise.
2183         * sysdeps/i386/tls.h: Likewise.
2184         * sysdeps/x86_64/tls.h: Likewise.
2185         * descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
2186         header structure.
2187         * sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
2189         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
2190         Add private field.
2191         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
2192         * pthread_barrier_init.c: Set private flag if pshared and private
2193         futexes are supported.
2194         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
2195         private field in futex command setup.
2196         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
2198 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
2200         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
2201         support.
2202         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2203         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2204         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2205         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2206         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2208         * semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
2209         * sem_init.c (__new_sem_init): Rewrite to initialize all three
2210         fields in the structure.
2211         (__old_sem_init): New function.
2212         * sem_open.c: Initialize all fields of the structure.
2213         * sem_getvalue.c: Adjust for renamed element.
2214         * sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
2215         (gen-as-const-headers): Add structsem.sym.
2216         * sysdeps/unix/sysv/linux/structsem.sym: New file.
2217         * sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
2218         struct new_sem.  Add struct old_sem.
2219         * sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
2220         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
2221         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
2222         * sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
2223         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2224         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
2225         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
2226         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2227         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2228         * Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
2229         * tst-sem10.c: New file.
2230         * tst-sem11.c: New file.
2231         * tst-sem12.c: New file.
2232         * tst-typesizes.c: Test struct new_sem and struct old_sem instead
2233         of struct sem.
2235 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
2236             Jakub Jelinek  <jakub@redhat.com>
2238         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
2239         Move __pthread_enable_asynccancel right before futex syscall.
2240         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
2241         Likewise.
2243 2007-05-24  Jakub Jelinek  <jakub@redhat.com>
2245         * sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
2246         THREAD_COPY_PRIVATE_FUTEX): Define.
2247         * sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
2248         THREAD_COPY_PRIVATE_FUTEX): Define.
2249         * allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
2250         * init.c (__pthread_initialize_minimal_internal): Use
2251         THREAD_SET_PRIVATE_FUTEX.
2253         * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
2254         (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
2255         THREAD_GSCOPE_FLAG_WAIT): Define.
2256         (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG,
2257         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define.
2258         * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use
2259         PTR_DEMANGLE.
2260         (THREAD_GSCOPE_GET_FLAG): Define.
2261         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define.
2262         * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
2263         instead of ->header.gscope_flag directly.
2265 2007-05-23  Ulrich Drepper  <drepper@redhat.com>
2267         * init.c (__pthread_initialize_minimal_internal): Check whether
2268         private futexes are available.
2269         * allocatestack.c (allocate_stack): Copy private_futex field from
2270         current thread into the new stack.
2271         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
2272         futexes if they are available.
2273         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
2274         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
2275         in libc-lowlevellock.S allow using private futexes.
2276         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2277         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
2278         FUTEX_PRIVATE_FLAG.
2279         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
2280         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
2281         if they are available.
2282         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
2283         * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
2284         * sysdeps/i386/tcb-offsets.sym: Likewise.
2285         * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
2286         * sysdeps/i386/tls.h (tcbhead_t): Likewise.
2288 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
2290         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2291         Remove ptr_wait_lookup_done again.
2292         * init.c (pthread_functions): Don't add .ptr_wait_lookup_done here.
2293         (__pthread_initialize_minimal_internal): Initialize
2294         _dl_wait_lookup_done pointer in _rtld_global directly.
2295         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
2296         Remove code to code _dl_wait_lookup_done.
2297         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
2298         encrypted for now.
2300 2007-05-21  Jakub Jelinek  <jakub@redhat.com>
2302         * tst-robust9.c (do_test): Don't fail if ENABLE_PI and
2303         pthread_mutex_init failed with ENOTSUP.
2305 2007-05-19  Ulrich Drepper  <drepper@redhat.com>
2307         * allocatestack.c (__wait_lookup_done): New function.
2308         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
2309         Add ptr_wait_lookup_done.
2310         * init.c (pthread_functions): Initialize .ptr_wait_lookup_done.
2311         * pthreadP.h: Declare __wait_lookup_done.
2312         * sysdeps/i386/tls.h (tcbhead_t): Add gscope_flag.
2313         Define macros to implement reference handling of global scope.
2314         * sysdeps/x86_64/tls.h: Likewise.
2315         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
2316         Initialize GL(dl_wait_lookup_done).
2318 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
2320         [BZ #4512]
2321         * pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
2322         is detected.
2323         * pthread_mutex_timedlock.c: Likewise.
2324         * pthread_mutex_trylock.c: Likewise.
2325         Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
2327         * Makefile (tests): Add tst-robust9 and tst-robustpi9.
2328         * tst-robust9.c: New file.
2329         * tst-robustpi9.c: New file.
2331         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
2332         unnecessary extra cancellation test.
2334 2007-05-14  Ulrich Drepper  <drepper@redhat.com>
2336         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
2337         extra cancellation test.
2338         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
2340 2007-05-10  Ulrich Drepper  <drepper@redhat.com>
2342         * descr.h (struct pthread): Rearrange members to fill hole in
2343         64-bit layout.
2345         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2346         (__pthread_setaffinity_new): If syscall was successful and
2347         RESET_VGETCPU_CACHE is defined, use it before returning.
2348         * sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
2350 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
2352         [BZ #4455]
2353         * tst-align2.c: Include stackinfo.h.
2354         * tst-getpid1.c: Likewise.
2356 2007-05-02  Carlos O'Donell  <carlos@systemhalted.org>
2358         [BZ #4455]
2359         * tst-align2.c (do_test): Add _STACK_GROWS_UP case.
2360         * tst-getpid1.c (do_test): Likewise.
2362         [BZ #4456]
2363         * allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
2364         (allocate_stack): Likewise.
2366 2007-05-07  Ulrich Drepper  <drepper@redhat.com>
2368         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
2369         (__lll_robust_lock_wait): Fix race caused by reloading of futex value.
2370         (__lll_robust_timedlock_wait): Likewise.
2371         Reported by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
2373 2007-05-06  Mike Frysinger  <vapier@gentoo.org>
2375         [BZ #4465]
2376         * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
2377         * tst-cancel4.c (tf_fdatasync): New test.
2379 2007-04-27  Ulrich Drepper  <drepper@redhat.com>
2381         [BZ #4392]
2382         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Treat error
2383         check mutexes like normal mutexes.
2385         [BZ #4306]
2386         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
2387         Initialize the whole sigevent structure to appease valgrind.
2389 2007-04-25  Ulrich Drepper  <drepper@redhat.com>
2391         * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
2392         * sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
2394 2007-04-06  Ulrich Drepper  <drepper@redhat.com>
2396         * tst-locale1.c: Avoid warnings.
2397         * tst-locale2.c: Likewise.
2399 2007-03-19  Steven Munroe  <sjmunroe@us.ibm.com>
2401         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2402         (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
2404 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
2406         * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
2407         __extern_always_inline where appropriate.
2408         * sysdeps/pthread/pthread.h: Likewise.
2410 2007-03-13  Richard Henderson  <rth@redhat.com>
2412         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
2413         separate cfi regions for the two subsections.
2415 2007-02-25  Ulrich Drepper  <drepper@redhat.com>
2417         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
2418         new thread, don't just decrement it.
2419         Patch by Suzuki K P <suzuki@in.ibm.com>.
2421 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
2423         * sysdeps/pthread/pthread-functions.h: Correct last patch, correct
2424         PTHFCT_CALL definition.
2426 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
2428         * sysdeps/pthread/pthread-functions.h: If PTR_DEMANGLE is not
2429         available, don't use it.
2431 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
2433         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2434         (__lll_mutex_timedlock_wait): Use correct pointer when we don't
2435         call into the kernel to delay.
2437 2007-01-18  Ulrich Drepper  <drepper@redhat.com>
2439         * tst-initializers1.c: We want to test the initializers as seen
2440         outside of libc, so undefined _LIBC.
2442         * pthread_join.c (cleanup): Avoid warning.
2444 2007-01-17  Ulrich Drepper  <drepper@redhat.com>
2446         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
2447         (__lll_timedwait_tid): Add unwind info.
2449         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Don't just copy the
2450         function table, mangle the pointers.
2451         * sysdeps/pthread/pthread-functions.h: Define PTHFCT_CALL.
2452         * forward.c: Use PTHFCT_CALL and __libc_pthread_functions_init.
2453         * sysdeps/pthread/bits/libc-lock.h: When using __libc_pthread_functions
2454         demangle pointers before use.
2455         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Use PTHFCT_CALL to
2456         demangle pointer.
2457         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
2458         * sysdeps/pthread/setxid.h: Likewise.
2460 2007-01-12  Ulrich Drepper  <drepper@redhat.com>
2462         * tst-rwlock7.c: Show some more information in case of correct
2463         behavior.
2465 2007-01-11  Ulrich Drepper  <drepper@redhat.com>
2467         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2468         (lll_futex_timed_wait): Undo part of last change, don't negate
2469         return value.
2471 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
2473         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups.  Define
2474         FUTEX_CMP_REQUEUE and lll_futex_requeue.
2476 2006-12-28  David S. Miller  <davem@davemloft.net>
2478         * shlib-versions: Fix sparc64 linux target specification.
2480 2007-01-10  Jakub Jelinek  <jakub@redhat.com>
2482         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2483         Adjust include path for pthread_barrier_wait.c move.
2485 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
2487         * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
2488         tid isn't reread from pd->tid in between ESRCH test and the syscall.
2490 2006-12-06  Jakub Jelinek  <jakub@redhat.com>
2492         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
2493         6 argument cancellable syscalls.
2494         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
2495         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
2496         6 argument cancellable syscalls.
2497         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
2499 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
2501         * sysdeps/unix/sysv/linux/rtld-lowlevel.h
2502         (__rtld_mrlock_initialize): Add missing closing parenthesis.
2504 2006-10-30  Jakub Jelinek  <jakub@redhat.com>
2506         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
2507         __sync_lock_release instead of __sync_lock_release_si.
2509 2006-10-29  Jakub Jelinek  <jakub@redhat.com>
2511         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P):
2512         Define.
2513         (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld.
2514         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
2515         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
2516         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
2517         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
2518         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2519         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
2520         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
2521         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2522         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2523         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
2525 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
2527         * sysdeps/pthread/pthread_barrier_wait.c: Move to...
2528         * pthread_barrier_wait.c: ...here.
2529         * sysdeps/pthread/pthread_cond_broadcast.c: Move to...
2530         * pthread_cond_broadcast.c: ...here.
2531         * sysdeps/pthread/pthread_cond_signal.c: Move to...
2532         * pthread_cond_signal.c: ...here.
2533         * sysdeps/pthread/pthread_cond_timedwait.c: Move to...
2534         * pthread_cond_timedwait.c: ...here.
2535         * sysdeps/pthread/pthread_cond_wait.c: Move to...
2536         * pthread_cond_wait.c: ...here.
2537         * sysdeps/pthread/pthread_once.c: Move to...
2538         * pthread_once.c: ...here.
2539         * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to...
2540         * pthread_rwlock_rdlock.c: ...here.
2541         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to...
2542         * pthread_rwlock_timedrdlock.c: ...here.
2543         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to...
2544         * pthread_rwlock_timedwrlock.c: ...here.
2545         * sysdeps/pthread/pthread_rwlock_unlock.c: Move to...
2546         * pthread_rwlock_unlock.c: ...here.
2547         * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to...
2548         * pthread_rwlock_wrlock.c: ...here.
2549         * sysdeps/pthread/pthread_spin_destroy.c: Move to...
2550         * pthread_spin_destroy.c: ...here.
2551         * sysdeps/pthread/pthread_spin_init.c: Move to...
2552         * pthread_spin_init.c: ...here.
2553         * sysdeps/pthread/pthread_spin_unlock.c: Move to...
2554         * pthread_spin_unlock.c: ...here.
2555         * sysdeps/pthread/pthread_getcpuclockid.c: Move to...
2556         * pthread_getcpuclockid.c: ...here.
2558         * init.c: USE_TLS support is now always enabled.
2559         * tst-tls5.h: Likewise.
2560         * sysdeps/alpha/tls.h: Likewise.
2561         * sysdeps/i386/tls.h: Likewise.
2562         * sysdeps/ia64/tls.h: Likewise.
2563         * sysdeps/powerpc/tls.h: Likewise.
2564         * sysdeps/s390/tls.h: Likewise.
2565         * sysdeps/sh/tls.h: Likewise.
2566         * sysdeps/sparc/tls.h: Likewise.
2567         * sysdeps/x86_64/tls.h: Likewise.
2569 2006-10-27  Jakub Jelinek  <jakub@redhat.com>
2571         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
2572         __rtld_mrlock_change): Update oldval if atomic compare and exchange
2573         failed.
2575         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
2576         Define to THREAD_SELF->header.multiple_threads.
2577         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
2578         Likewise.
2579         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
2580         Likewise.
2581         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
2582         (SINGLE_THREAD_P): Likewise.
2583         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
2584         (SINGLE_THREAD_P): Likewise.
2585         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2586         (SINGLE_THREAD_P): Likewise.
2587         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
2588         (SINGLE_THREAD_P): Likewise.
2589         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P):
2590         Likewise.
2591         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
2592         (SINGLE_THREAD_P): Likewise.
2593         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
2594         (SINGLE_THREAD_P): Likewise.
2595         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P):
2596         Likewise.
2598 2006-10-26  Jakub Jelinek  <jakub@redhat.com>
2600         * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3
2601         by default rather than 2_3_3.
2603 2006-10-17  Jakub Jelinek  <jakub@redhat.com>
2605         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
2606         __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
2607         atomic_* instead of catomic_* macros.
2609 2006-10-12  Ulrich Drepper  <drepper@redhat.com>
2611         [BZ #3285]
2612         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX.
2613         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
2614         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
2615         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
2616         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
2617         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX.
2618         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
2619         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
2620         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
2621         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise.
2622         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
2623         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
2624         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
2626 2006-10-11  Ulrich Drepper  <drepper@redhat.com>
2628         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for
2629         cancelable syscalls with six parameters.
2631         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
2632         operations instead of atomic_*.
2634 2006-10-09  Ulrich Drepper  <drepper@redhat.com>
2636         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
2638 2006-10-07  Ulrich Drepper  <drepper@redhat.com>
2640         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file.
2641         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file.
2642         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c:
2643         New file.
2644         * pthread_attr_setstack.c: Allow overwriting the version number of the
2645         new symbol.
2646         * pthread_attr_setstacksize.c: Likewise.
2647         (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use
2648         it.
2649         * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add
2650         pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6.
2652 2006-09-24  Ulrich Drepper  <drepper@redhat.com>
2654         [BZ #3251]
2655         * descr.h (ENQUEUE_MUTEX_BOTH): Add cast to avoid warning.
2656         Patch by Petr Baudis.
2658 2006-09-18  Jakub Jelinek  <jakub@redhat.com>
2660         * tst-kill4.c (do_test): Explicitly set tf thread's stack size.
2662         * tst-cancel2.c (tf): Loop as long as something was written.
2664 2006-09-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2666         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: For PI
2667         mutexes wake all mutexes.
2668         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Don't increment
2669         WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2670         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2672 2006-09-12  Ulrich Drepper  <drepper@redhat.com>
2674         * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use
2675         to guarantee the thread is always canceled.
2677 2006-09-08  Jakub Jelinek  <jakub@redhat.com>
2679         * tst-cond22.c: Include pthread.h instead of pthreadP.h.
2680         Include stdlib.h.
2681         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Only
2682         increase FUTEX if increasing WAKEUP_SEQ.  Fix comment typo.
2683         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2684         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2685         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2687 2006-09-08  Ulrich Drepper  <drepper@redhat.com>
2689         [BZ #3123]
2690         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Don't
2691         increment WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2692         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2693         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2694         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2695         * Makefile (tests): Add tst-cond22.
2696         * tst-cond22.c: New file.
2698 2006-09-05  Ulrich Drepper  <drepper@redhat.com>
2700         [BZ #3124]
2701         * descr.h (struct pthread): Add parent_cancelhandling.
2702         * sysdeps/pthread/createthread.c (create_thread): Pass parent
2703         cancelhandling value to child.
2704         * pthread_create.c (start_thread): If parent thread was canceled
2705         reset the SIGCANCEL mask.
2706         * Makefile (tests): Add tst-cancel25.
2707         * tst-cancel25.c: New file.
2709 2006-09-05  Jakub Jelinek  <jakub@redhat.com>
2710             Ulrich Drepper  <drepper@redhat.com>
2712         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
2713         counterp if it is already zero.
2714         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
2716 2006-03-04  Jakub Jelinek  <jakub@redhat.com>
2717             Roland McGrath  <roland@redhat.com>
2719         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2720         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2721         LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
2722         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2723         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2724         lll_robust_mutex_timedlock, lll_mutex_unlock,
2725         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2726         Add _L_*_ symbols around the subsection.
2727         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
2728         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2730 2006-03-03  Jakub Jelinek  <jakub@redhat.com>
2731             Roland McGrath  <roland@redhat.com>
2733         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2734         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2735         LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
2736         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2737         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2738         lll_robust_mutex_timedlock, lll_mutex_unlock,
2739         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2740         Add _L_*_ symbols around the subsection.
2741         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
2742         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2744 2006-08-31  Ulrich Drepper  <drepper@redhat.com>
2746         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Undo last
2747         change because it can disturb too much existing code.  If real hard
2748         reader preference is needed we'll introduce another type.
2749         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2750         (pthread_rwlock_timedwrlock): Likewise.
2751         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2752         Likewise.
2754 2006-08-30  Ulrich Drepper  <drepper@redhat.com>
2756         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Respect
2757         reader preference.
2758         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2759         (pthread_rwlock_timedwrlock): Likewise.
2760         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2761         Likewise.
2763 2006-08-25  Jakub Jelinek  <jakub@redhat.com>
2765         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
2766         Only define ifdef SHARED.
2768 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
2770         * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
2771         (free_stacks): ...here.
2772         (__free_stack_cache): New function.
2773         * pthreadP.h: Declare __free_stack_cache.
2774         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
2775         ptr_freeres.
2776         * init.c (pthread_functions): Initialize ptr_freeres.
2777         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
2778         New freeres function.
2780 2006-07-30  Joseph S. Myers  <joseph@codesourcery.com>
2782         [BZ #3018]
2783         * Makefile (extra-objs): Add modules to extra-test-objs instead.
2785 2006-08-20  Ulrich Drepper  <drepper@redhat.com>
2787         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2788         _XOPEN_REALTIME_THREADS.
2790 2006-08-15  Jakub Jelinek  <jakub@redhat.com>
2792         * sysdeps/unix/sysv/linux/clock_settime.c (INTERNAL_VSYSCALL): Use
2793         HAVE_CLOCK_GETRES_VSYSCALL as guard macro rather than
2794         HAVE_CLOCK_GETTIME_VSYSCALL.
2795         (maybe_syscall_settime_cpu): Use plain INTERNAL_VSYSCALL here.
2797 2006-08-14  Jakub Jelinek  <jakub@redhat.com>
2799         * sysdeps/unix/sysv/linux/bits/posix_opt.h
2800         (_POSIX_THREAD_PRIO_PROTECT): Define to 200112L.
2801         * descr.h (struct priority_protection_data): New type.
2802         (struct pthread): Add tpp field.
2803         * pthreadP.h (PTHREAD_MUTEX_PP_NORMAL_NP,
2804         PTHREAD_MUTEX_PP_RECURSIVE_NP, PTHREAD_MUTEX_PP_ERRORCHECK_NP,
2805         PTHREAD_MUTEX_PP_ADAPTIVE_NP): New enum values.
2806         * pthread_mutex_init.c (__pthread_mutex_init): Handle non-robust
2807         TPP mutexes.
2808         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle TPP mutexes.
2809         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
2810         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
2811         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
2812         * tpp.c: New file.
2813         * pthread_setschedparam.c (__pthread_setschedparam): Handle priority
2814         boosted by TPP.
2815         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
2816         * pthread_mutexattr_getprioceiling.c
2817         (pthread_mutexattr_getprioceiling): If ceiling is 0, ensure it is
2818         in the SCHED_FIFO priority range.
2819         * pthread_mutexattr_setprioceiling.c
2820         (pthread_mutexattr_setprioceiling): Fix prioceiling validation.
2821         * pthread_mutex_getprioceiling.c (pthread_mutex_getprioceiling): Fail
2822         if mutex is not TPP.  Ceiling is now in __data.__lock.
2823         * pthread_mutex_setprioceiling.c: Include stdbool.h.
2824         (pthread_mutex_setprioceiling): Fix prioceiling validation.  Ceiling
2825         is now in __data.__lock.  Add locking.
2826         * pthread_create.c (__free_tcb): Free pd->tpp structure.
2827         * Makefile (libpthread-routines): Add tpp.
2828         (xtests): Add tst-mutexpp1, tst-mutexpp6 and tst-mutexpp10.
2829         * tst-tpp.h: New file.
2830         * tst-mutexpp1.c: New file.
2831         * tst-mutexpp6.c: New file.
2832         * tst-mutexpp10.c: New file.
2833         * tst-mutex1.c (TEST_FUNCTION): Don't redefine if already defined.
2834         * tst-mutex6.c (TEST_FUNCTION): Likewise.
2836 2006-08-12  Ulrich Drepper  <drepper@redhat.com>
2838         [BZ #2843]
2839         * pthread_join.c (pthread_join): Account for self being canceled
2840         when checking for deadlocks.
2841         * tst-join5.c: Cleanups.  Allow to be used in tst-join6.
2842         (tf1): Don't print anything after pthread_join returns, this would be
2843         another cancellation point.
2844         (tf2): Likewise.
2845         * tst-join6.c: New file.
2846         * Makefile (tests): Add tst-join6.
2848 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
2850         [BZ #2892]
2851         * pthread_setspecific.c (__pthread_setspecific): Check
2852         out-of-range index before checking for unused key.
2854         * sysdeps/pthread/gai_misc.h: New file.
2856 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
2858         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
2859         file.  Don't use sysctl.
2860         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
2861         overwrite the file if this is likely not true.
2863 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
2865         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
2866         * Makefile (tests): Add tst-getpid3.
2867         * tst-getpid3.c: New file.
2869 2006-07-30  Roland McGrath  <roland@redhat.com>
2871         * Makefile (libpthread-routines): Add ptw-sigsuspend.
2873         * sysdeps/unix/sysv/linux/i386/not-cancel.h
2874         (pause_not_cancel): New macro.
2875         (nanosleep_not_cancel): New macro.
2876         (sigsuspend_not_cancel): New macro.
2877         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
2878         nanosleep_not_cancel macro from <not-cancel.h>.
2879         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
2880         macro from <not-cancel.h>.
2882 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
2883             Jakub Jelinek  <jakub@redhat.com>
2885         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
2886         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
2887         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
2888         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
2889         * pthread_mutex_init.c: Add support for priority inheritance mutex.
2890         * pthread_mutex_lock.c: Likewise.
2891         * pthread_mutex_timedlock.c: Likewise.
2892         * pthread_mutex_trylock.c: Likewise.
2893         * pthread_mutex_unlock.c: Likewise.
2894         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
2895         all mutexes.
2896         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
2897         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
2898         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
2899         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
2900         pthread-pi-defines.sym.
2901         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
2902         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
2903         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2904         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2905         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2906         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2907         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2908         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2909         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2910         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2911         _POSIX_THREAD_PRIO_INHERIT to 200112L.
2912         * tst-mutex1.c: Adjust to allow use in PI mutex test.
2913         * tst-mutex2.c: Likewise.
2914         * tst-mutex3.c: Likewise.
2915         * tst-mutex4.c: Likewise.
2916         * tst-mutex5.c: Likewise.
2917         * tst-mutex6.c: Likewise.
2918         * tst-mutex7.c: Likewise.
2919         * tst-mutex7a.c: Likewise.
2920         * tst-mutex8.c: Likewise.
2921         * tst-mutex9.c: Likewise.
2922         * tst-robust1.c: Likewise.
2923         * tst-robust7.c: Likewise.
2924         * tst-robust8.c: Likewise.
2925         * tst-mutexpi1.c: New file.
2926         * tst-mutexpi2.c: New file.
2927         * tst-mutexpi3.c: New file.
2928         * tst-mutexpi4.c: New file.
2929         * tst-mutexpi5.c: New file.
2930         * tst-mutexpi6.c: New file.
2931         * tst-mutexpi7.c: New file.
2932         * tst-mutexpi7a.c: New file.
2933         * tst-mutexpi8.c: New file.
2934         * tst-mutexpi9.c: New file.
2935         * tst-robust1.c: New file.
2936         * tst-robust2.c: New file.
2937         * tst-robust3.c: New file.
2938         * tst-robust4.c: New file.
2939         * tst-robust5.c: New file.
2940         * tst-robust6.c: New file.
2941         * tst-robust7.c: New file.
2942         * tst-robust8.c: New file.
2943         * Makefile (tests): Add the new tests.
2945         * pthread_create.c (start_thread): Add some casts to avoid warnings.
2946         * pthread_mutex_destroy.c: Remove unneeded label.
2948 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
2950         * pthread_mutex_init.c (__pthread_mutex_init): Move some
2951         computations to compile time.
2953 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
2955         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
2957 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
2959         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
2961 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
2963         * pthread_key_create.c (__pthread_key_create): Do away with
2964         __pthread_keys_lock.
2966         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2967         (__kernel_cpumask_size): Mark as hidden.
2968         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
2970         * sem_open.c (__sem_mappings_lock): Mark as hidden.
2971         * semaphoreP.h (__sem_mappings_lock): Likewise.
2973 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
2975         * pthread_atfork.c: Mark __dso_handle as hidden.
2977 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
2979         [BZ #2644]
2980         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
2981         the reload problem.  Change the one path in pthread_cancel_init
2982         which causes the problem.  Force gcc to reload.  Simplify callers.
2983         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
2984         (_Unwind_GetBSP): Undo last patch.
2986 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
2988         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
2989         function pointer is reloaded after pthread_cancel_init calls.
2991         [BZ #2644]
2992         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
2993         pointers are reloaded after pthread_cancel_init calls.
2995 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
2997         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
2998         __always_inline.
3000 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
3002         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3003         Allocate new object which is passed to timer_sigev_thread so that
3004         the timer can be deleted before the new thread is scheduled.
3006 2006-04-26  Roland McGrath  <roland@redhat.com>
3008         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
3010 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
3012         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
3013         suffix for conditional jumps.
3014         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
3015         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
3016         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
3017         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
3018         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
3019         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
3021         * init.c (sigcancel_handler): Compare with correct PID even if the
3022         thread is in the middle of a fork call.
3023         (sighandler_setxid): Likewise.
3024         Reported by Suzuki K P <suzuki@in.ibm.com> .
3026 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
3028         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
3030 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
3032         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
3033         fails [Coverity CID 105].
3035 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
3037         * sysdeps/pthread/pthread.h: Add nonnull attributes.
3039 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
3041         [BZ #2505]
3042         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
3043         Define __lll_rel_instr using lwsync.
3045 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
3047         * allocatestack.c (allocate_stack): Always initialize robust_head.
3048         * descr.h: Define struct robust_list_head.
3049         (struct pthread): Use robust_list_head in robust mutex list definition.
3050         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
3051         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
3052         (__pthread_initialize_minimal_internal): Register robust_list with
3053         the kernel.
3054         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
3055         Declare __set_robust_list_avail.
3056         * pthread_create.c (start_thread): Register robust_list of new thread.
3057         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
3058         waiters.
3059         * pthread_mutex_destroy.c: For robust mutexes don't look at the
3060         number of users, it's unreliable.
3061         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
3062         set_robust_list syscall is available.
3063         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
3064         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
3065         Set robust_head.list_op_pending before trying to lock a robust mutex.
3066         * pthread_mutex_timedlock.c: Likewise.
3067         * pthread_mutex_trylock.c: Likewise.
3068         * pthread_mutex_unlock.c: Likewise for unlocking.
3069         * Makefile (tests): Add tst-robust8.
3070         * tst-robust8.c: New file.
3072 2006-03-08  Andreas Schwab  <schwab@suse.de>
3074         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
3075         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
3077 2006-03-05  Roland McGrath  <roland@redhat.com>
3079         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
3080         and $config_os doesn't match *linux*.
3082 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
3084         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
3085         Use __syscall_error.
3086         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
3087         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
3088         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
3089         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
3090         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
3091         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
3093 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
3095         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
3097 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
3099         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
3100         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
3101         mutex.
3102         (__lll_robust_timedlock_wait): Likewise.
3103         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
3104         (__lll_robust_lock_wait): Likewise.
3105         (__lll_robust_timedlock_wait): Likewise.
3106         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
3107         (__lll_robust_lock_wait): Likewise.
3108         (__lll_robust_timedlock_wait): Likewise.
3110 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
3112         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
3113         lll_robust_mutex_trylock, lll_robust_mutex_lock,
3114         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
3115         lll_robust_mutex_unlock): Define.
3116         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
3118 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
3120         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
3121         instead of <clone.S>.
3123 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
3125         * Makefile (libpthread-routines): Add
3126         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
3127         and pthread_mutex_[sg]etprioceiling.
3128         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
3129         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
3130         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
3131         pthread_mutex_setprioceiling.
3132         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
3133         PTHREAD_PRIO_PROTECT): New enum values.
3134         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
3135         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
3136         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
3137         prototypes.
3138         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
3139         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
3140         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
3141         Define.
3142         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
3143         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
3144         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
3145         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
3146         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
3147         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
3148         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
3149         protocol mutexes.
3150         * pthread_mutex_getprioceiling.c: New file.
3151         * pthread_mutex_setprioceiling.c: New file.
3152         * pthread_mutexattr_getprioceiling.c: New file.
3153         * pthread_mutexattr_setprioceiling.c: New file.
3154         * pthread_mutexattr_getprotocol.c: New file.
3155         * pthread_mutexattr_setprotocol.c: New file.
3157 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
3159         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
3161 2006-02-27  Roland McGrath  <roland@redhat.com>
3163         * sysdeps/pthread/Subdirs: List nptl here too.
3164         * configure (libc_add_on_canonical): New variable.
3166         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
3168         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
3169         self to get main source tree's file.
3170         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
3171         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
3172         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
3173         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
3174         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
3175         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
3176         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
3177         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
3178         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
3179         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
3180         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
3181         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
3182         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
3184         * Makefile: Use $(sysdirs) in vpath directive.
3186         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
3187         (CPPFLAGS-timer_routines.c): Likewise.
3189         * Makeconfig (includes): Variable removed.
3191 2006-02-26  Roland McGrath  <roland@redhat.com>
3193         * sysdeps/generic/pt-raise.c: Moved to ...
3194         * pt-raise.c: ... here.
3195         * sysdeps/generic/lowlevellock.h: Moved to ...
3196         * lowlevellock.h: ... here.
3198 2006-02-23  Roland McGrath  <roland@redhat.com>
3200         * descr.h (struct pthread): Add final member `end_padding'.
3201         (PTHREAD_STRUCT_END_PADDING): Use it.
3203 2006-02-20  Roland McGrath  <roland@redhat.com>
3205         * sysdeps/mips: Directory removed, saved in ports repository.
3206         * sysdeps/unix/sysv/linux/mips: Likewise.
3208 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
3210         * tst-robust1.c: Add second mutex to check that the mutex list is
3211         handled correctly.
3213 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
3215         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
3216         lll_robust_mutex_trylock, lll_robust_mutex_lock,
3217         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
3218         lll_robust_mutex_unlock): New macros.
3219         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
3220         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
3221         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
3222         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3223         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
3225 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3227         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
3228         definitions.
3229         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
3231 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
3233         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
3234         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
3235         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
3236         (lll_robust_mutex_unlock): Likewise.
3238 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
3240         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
3241         Set robust_list.__next rather than robust_list.
3242         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
3243         (__pthread_list_t): New typedef.
3244         (pthread_mutex_t): Replace __next and __prev fields with __list.
3245         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
3246         (__pthread_list_t): New typedef.
3247         (pthread_mutex_t): Replace __next and __prev fields with __list.
3248         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3249         (__pthread_list_t, __pthread_slist_t): New typedefs.
3250         (pthread_mutex_t): Replace __next and __prev fields with __list.
3251         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
3252         (__pthread_list_t, __pthread_slist_t): New typedefs.
3253         (pthread_mutex_t): Replace __next and __prev fields with __list.
3254         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
3255         (__pthread_list_t, __pthread_slist_t): New typedefs.
3256         (pthread_mutex_t): Replace __next and __prev fields with __list.
3257         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
3258         (__pthread_slist_t): New typedef.
3259         (pthread_mutex_t): Replace __next field with __list.
3261 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
3263         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
3264         PTHREAD_MUTEX_OWNERDEAD.
3265         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
3266         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
3267         * Makefile (libpthread-routines): Add lowlevelrobustlock.
3268         * pthread_create.c (start_thread): Very much simplify robust_list loop.
3269         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
3270         to PTHREAD_MUTEX_INCONSISTENT.
3271         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
3272         * pthread_mutex_lock.c: Reimplement robust mutex handling.
3273         * pthread_mutex_trylock.c: Likewise.
3274         * pthread_mutex_timedlock.c: Likewise.
3275         * pthread_mutex_unlock.c: Likewise.
3276         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
3277         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
3278         lowlevelrobustlock.sym.
3279         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
3280         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
3281         definitions.
3282         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3283         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
3284         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
3285         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
3286         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
3288 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
3290         * allocatestack.c (allocate_stack): Initialize robust_list.
3291         * init.c (__pthread_initialize_minimal_internal): Likewise.
3292         * descr.h (struct xid_command): Pretty printing.
3293         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
3294         robust_list.  Adjust macros.
3295         * pthread_create.c (start_thread): Adjust robust_list handling.
3296         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
3297         but the owner for all robust mutex types.
3298         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
3299         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
3300         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3301         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
3303         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
3304         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
3306 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
3308         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
3309         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
3311 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3313         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
3314         Return status.
3315         (lll_futex_timed_wait): Define.
3317 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
3319         * tst-cancel4.c: Test ppoll.
3321 2006-01-18  Andreas Jaeger  <aj@suse.de>
3323         [BZ #2167]
3324         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
3325         (pthread_mutex_t): Follow changes for other archs.  Based on patch
3326         by Jim Gifford <patches@jg555.com>.
3328 2006-01-13  Richard Henderson  <rth@redhat.com>
3330         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
3332 2006-01-10  Roland McGrath  <roland@redhat.com>
3334         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
3335         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
3336         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
3337         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3338         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3339         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3340         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3341         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
3342         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
3343         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3345 2006-01-09  Roland McGrath  <roland@redhat.com>
3347         * tst-initializers1-c89.c: New file.
3348         * tst-initializers1-c99.c: New file.
3349         * tst-initializers1-gnu89.c: New file.
3350         * tst-initializers1-gnu99.c: New file.
3351         * Makefile (tests): Add them.
3352         (CFLAGS-tst-initializers1-c89.c): New variable.
3353         (CFLAGS-tst-initializers1-c99.c): New variable.
3354         (CFLAGS-tst-initializers1-gnu89.c): New variable.
3355         (CFLAGS-tst-initializers1-gnu99.c): New variable.
3357         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3358         Use __extension__ on anonymous union definition.
3359         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3360         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3361         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3362         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3363         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3365 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
3367         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
3368         Don't give the union a name because it changes the mangled name.
3369         Instead name the struct for __data.
3370         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
3371         Likewise.
3372         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
3373         Likewise.
3375 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
3377         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
3378         stack bias to mc_ftp field.
3380 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
3382         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
3383         being too clever and reloading the futex value where it shouldn't.
3385 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
3387         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
3388         correct type.
3390 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
3392         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
3393         Add cfi directives.
3395 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
3397         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
3398         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
3399         rename in tcbhead_t.
3401         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3402         Don't give the union a name because it changes the mangled name.
3403         Instead name the struct for __data.
3404         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3405         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3406         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3407         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3408         * pthread_create.c (start_thread): Adjust robust mutex free loop.
3409         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
3411 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
3413         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
3414         Return status.
3415         (lll_futex_timed_wait): Define.
3416         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3417         * sysdeps/pthread/aio_misc.h: New file.
3419 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
3421         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
3423 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
3425         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3426         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
3427         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
3429 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
3431         * tst-cancel24.cc: Use C headers instead of C++ headers.
3433 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
3435         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
3436         sparc-linux configured glibc.
3437         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
3438         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
3439         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
3440         atomic_compare_and_exchange_val_24_acq instead of
3441         atomic_compare_and_exchange_val_acq.
3442         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
3443         instead of atomic_exchange_rel.
3444         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
3445         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
3446         file.
3447         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
3448         file.
3449         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
3450         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
3451         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
3452         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
3453         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
3454         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
3455         New file.
3456         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
3457         New file.
3458         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
3459         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
3460         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
3461         file.
3462         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
3463         file.
3464         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
3466 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
3468         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
3469         mutex initializers.
3471 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
3473         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
3474         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3475         THREAD_COPY_POINTER_GUARD): Define.
3476         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
3477         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
3479 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
3481         * version.c: Update copyright year.
3483 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3485         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
3486         .eh_frame section, use cfi_* directives.
3487         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
3489 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
3491         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
3492         now.
3494 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
3496         * sysdeps/pthread/sigaction.c: Removed.
3497         * sigaction.c: New file.
3498         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
3500 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
3502         * Makefile (tests): Add tst-signal7.
3503         * tst-signal7.c: New file.
3505 2005-12-27  Roland McGrath  <roland@redhat.com>
3507         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
3508         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
3509         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
3510         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
3511         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
3512         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3513         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3514         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3515         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3516         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
3517         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3519 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
3521         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
3522         and __prev field to pthread_mutex_t.
3523         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3524         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3525         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3526         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3527         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
3528         to pthread_mutex_t.
3530 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
3532         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
3533         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
3534         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
3535         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
3536         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
3537         and PTHREAD_MUTEXATTR_FLAG_BITS.
3538         * descr.h (struct pthread): Add robust_list field and define
3539         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
3540         * pthread_mutexattr_getrobust.c: New file.
3541         * pthread_mutexattr_setrobust.c: New file.
3542         * pthread_mutex_consistent.c: New file.
3543         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
3544         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
3545         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
3546         Adjust pthread_mutex_t initializers.
3547         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
3548         field to pthread_mutex_t.
3549         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
3550         and __prev field to pthread_mutex_t.
3551         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
3552         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
3553         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
3554         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
3555         * pthread_mutexattr_gettype.c: Likewise.
3556         * pthread_mutexattr_setpshared.c: Likewise.
3557         * pthread_mutexattr_settype.c: Likewise.
3558         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
3559         Initialize mutex kind according to robust flag.
3560         * pthread_mutex_lock.c: Implement local robust mutex.
3561         * pthread_mutex_timedlock.c: Likewise.
3562         * pthread_mutex_trylock.c: Likewise.
3563         * pthread_mutex_unlock.c: Likewise.
3564         * pthread_create.c (start_thread): Mark robust mutexes which remained
3565         locked as dead.
3566         * tst-robust1.c: New file.
3567         * tst-robust2.c: New file.
3568         * tst-robust3.c: New file.
3569         * tst-robust4.c: New file.
3570         * tst-robust5.c: New file.
3571         * tst-robust6.c: New file.
3572         * tst-robust7.c: New file.
3573         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
3574         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
3575         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
3576         tst-robust5, tst-robust6, and tst-robust7.
3578         * tst-typesizes.c: New file.
3579         * Makefile (tests): Add tst-typesizes.
3581         * tst-once3.c: More debug output.
3583 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
3585         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
3586         missing after last change.
3588         * version.c: Update copyright year.
3590 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
3592         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
3593         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
3594         * pthread_mutex_trylock.c: Likewise.
3595         * pthread_mutex_timedlock.c: Likewise.
3596         * pthread_mutex_unlock.c: Likewise.
3598 2005-12-22  Roland McGrath  <roland@redhat.com>
3600         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
3601         so that #include_next's search location is not reset to the -I..
3602         directory where <nptl/...> can be found.
3604 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
3606         [BZ #1913]
3607         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3608         Fix unwind info.  Remove useless branch prediction prefix.
3609         * tst-cancel24.cc: New file.
3610         * Makefile: Add rules to build and run tst-cancel24.
3612 2005-12-21  Roland McGrath  <roland@redhat.com>
3614         * libc-cancellation.c: Use <> rather than "" #includes.
3615         * pt-cleanup.c: Likewise.
3616         * pthread_create.c: Likewise.
3617         * pthread_join.c: Likewise.
3618         * pthread_timedjoin.c: Likewise.
3619         * pthread_tryjoin.c: Likewise.
3620         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
3621         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
3622         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
3623         * unwind.c: Likewise.
3625 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3627         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
3628         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
3629         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3630         THREAD_COPY_POINTER_GUARD): Define.
3632 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
3634         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
3635         rather than one.
3636         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3637         THREAD_COPY_POINTER_GUARD): Define.
3638         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
3639         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
3640         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3641         THREAD_COPY_POINTER_GUARD): Define.
3642         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
3643         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
3644         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
3645         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
3646         Use PTR_DEMANGLE for B0 if defined.
3648 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
3650         * pthread_create.c (__pthread_create_2_1): Use
3651         THREAD_COPY_POINTER_GUARD if available.
3652         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
3653         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3654         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
3655         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
3656         * sysdeps/x86_64/tls.h: Likewise.
3658 2005-12-15  Roland McGrath  <roland@redhat.com>
3660         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
3662 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
3664         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
3665         sysdeps/generic.
3666         * errno-loc.c: New file.
3668 2005-12-12  Roland McGrath  <roland@redhat.com>
3670         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
3671         adjustments before choosing stack size.  Update minimum stack size
3672         calculation to match allocate_stack change.
3674 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
3676         * allocatestack.c (allocate_stack): Don't demand that there is an
3677         additional full page available on the stack beside guard, TLS, the
3678         minimum stack.
3680 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
3682         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3683         (__cleanup_fct_attribute): Use __regparm__ not regparm.
3685         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
3686         compiling 32-bit code we must define __cleanup_fct_attribute.
3688 005-11-24  Jakub Jelinek  <jakub@redhat.com>
3690         [BZ #1920]
3691         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
3692         __attribute__ instead of __attribute.
3693         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3694         (__cleanup_fct_attribute): Likewise.
3696 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
3698         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
3699         a write barrier before writing libgcc_s_getcfa.
3701 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
3703         * sysdeps/unix/sysv/linux/configure: Removed.
3705 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
3707         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
3708         optional init_array/fini_array support.
3710 2005-10-24  Roland McGrath  <roland@redhat.com>
3712         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
3713         versioned_symbol use.
3715 2005-10-16  Roland McGrath  <roland@redhat.com>
3717         * init.c (__pthread_initialize_minimal_internal): Even when using a
3718         compile-time default stack size, apply the minimum that allocate_stack
3719         will require, and round up to page size.
3721 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
3723         * Makefile ($(test-modules)): Remove static pattern rule.
3725 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
3726             Ulrich Drepper  <drepper@redhat.com>
3728         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
3729         alignment in callback function.
3730         * Makefile: Add rules to build and run tst-align3.
3731         * tst-align3.c: New file.
3733 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
3735         * allocatestack.c (setxid_signal_thread): Add
3736         INTERNAL_SYSCALL_DECL (err).
3738 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
3740         * allocatestack.c (setxid_signal_thread): Need to use
3741         atomic_compare_and_exchange_bool_acq.
3743 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
3744             Jakub Jelinek  <jakub@redhat.com>
3746         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
3747         CANCEL_RESTMASK.
3748         (struct pthread): Move specific_used field to avoid padding.
3749         Add setxid_futex field.
3750         * init.c (sighandler_setxid): Reset setxid flag and release the
3751         setxid futex.
3752         * allocatestack.c (setxid_signal_thread): New function.  Broken
3753         out of the bodies of the two loops in __nptl_setxid.  For undetached
3754         threads check whether they are exiting and if yes, don't send a signal.
3755         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
3756         * pthread_create.c (start_thread): For undetached threads, check
3757         whether setxid bit is set.  If yes, wait until signal has been
3758         processed.
3760         * allocatestack.c (STACK_VARIABLES): Initialize them.
3761         * pthread_create.c (__pthread_create_2_1): Initialize pd.
3763 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
3765         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
3766         waiters, awake all waiters on the associated mutex.
3768 2005-09-22  Roland McGrath  <roland@redhat.com>
3770         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
3771         ../sysdeps/x86_64/hp-timing.h).
3773 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
3775         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
3776         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3777         (lll_futex_wake_unlock): Define.
3778         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
3779         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3780         (lll_futex_wake_unlock): Define.
3781         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
3782         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3783         (lll_futex_wake_unlock): Define.
3784         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
3785         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3786         (lll_futex_wake_unlock): Define.
3787         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
3788         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3789         (lll_futex_wake_unlock): Define.
3790         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
3791         lll_futex_wake_unlock.
3792         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3793         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3794         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3795         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
3796         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3797         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3799 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3801         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
3802         Fix typo in register name.
3804 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
3806         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3807         Use __sigfillset.  Document that sigfillset does the right thing wrt
3808         to SIGSETXID.
3810 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3812         [BZ #1102]
3813         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
3814         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
3815         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
3816         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
3817         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
3818         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
3819         in the structure.
3820         * Makefile (tests): Add tst-initializers1.
3821         (CFLAGS-tst-initializers1.c): Set.
3822         * tst-initializers1.c: New test.
3824 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3826         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
3827         Make sure __flags are located at offset 48 from the start of the
3828         structure.
3830 2005-07-02  Roland McGrath  <roland@redhat.com>
3832         * Makeconfig: Comment fix.
3834 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
3836         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
3837         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
3838         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
3839         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
3840         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3841         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3842         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
3843         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
3844         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
3845         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3847 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
3849         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
3850         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3851         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
3852         fields.
3853         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3854         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
3855         field.  Put in sysinfo field unconditionally.
3856         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3857         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
3858         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3859         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
3860         fields.
3861         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3862         * pthread_create.c (__pthread_create_2_1): Use
3863         THREAD_COPY_STACK_GUARD macro.
3864         * Makefile: Add rules to build and run tst-stackguard1{,-static}
3865         tests.
3866         * tst-stackguard1.c: New file.
3867         * tst-stackguard1-static.c: New file.
3869 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
3871         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
3872         Invoke CGOTSETUP and CGOTRESTORE.
3873         (CGOTSETUP, CGOTRESTORE): Define.
3875 2005-05-29  Richard Henderson  <rth@redhat.com>
3877         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
3878         (tf_write, tf_writev): Use it.
3879         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
3880         the system minimum.
3882 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
3884         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3885         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
3886         __librt_*_asynccancel@local.
3888 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
3890         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
3891         all occurrences of JUMPTARGET.  Instead append @local to labels.
3893 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
3895         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
3896         size/alignment of struct pthread rather than tcbhead_t.
3897         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3898         Likewise.
3899         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3900         Likewise.
3901         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3902         Likewise.
3904 2005-05-19  Richard Henderson  <rth@redhat.com>
3906         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
3907         __sync_val_compare_and_swap, not explicit _si variant.
3908         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
3910 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
3912         [BZ #915]
3913         * sysdeps/pthread/pthread.h: Avoid empty initializers.
3915 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
3917         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
3918         .eh_frame section, use cfi_* directives.
3920 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
3922         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
3923         of "" includes.
3925 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
3927         [BZ #1075]
3928         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
3929         aio_write blocks.
3931 2005-04-27  Roland McGrath  <roland@redhat.com>
3933         * Makefile (tests): Remove tst-clock2.
3935         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
3936         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
3937         translating to the kernel clockid_t for our own process/thread clock.
3939         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
3941 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
3943         * old_pthread_cond_init.c: Include <errno.h>.
3944         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
3945         process shared or uses clock other than CLOCK_REALTIME.
3946         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
3948 2005-04-13  David S. Miller  <davem@davemloft.net>
3950         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
3951         * sysdeps/sparc/sparc64/clone.S: New file.
3953 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
3955         [BZ #1102]
3956         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
3957         __inline instead of inline.
3958         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
3960 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
3962         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
3963         functionally equivalent, but shorter instructions.
3964         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
3965         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3966         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
3967         Likewise.
3968         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
3969         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3970         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3971         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3972         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3973         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
3974         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3975         Likewise.
3976         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3977         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
3978         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3979         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
3980         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3982 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
3984         * sysdeps/mips/Makefile: New file.
3985         * sysdeps/mips/nptl-sysdep.S: New file.
3986         * sysdeps/mips/tcb-offsets.sym: New file.
3987         * sysdeps/mips/pthread_spin_lock.S: New file.
3988         * sysdeps/mips/pthread_spin_trylock.S: New file.
3989         * sysdeps/mips/pthreaddef.h: New file.
3990         * sysdeps/mips/tls.h: New file.
3991         * sysdeps/mips/jmpbuf-unwind.h: New file.
3992         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
3993         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
3994         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
3995         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
3996         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
3997         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
3998         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
3999         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
4000         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
4001         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
4003 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
4005         [BZ #1112]
4006         * pthread_create.c (__pthread_create_2_1): Rename syscall error
4007         variable to scerr.
4009 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
4011         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
4013 2005-02-25  Roland McGrath  <roland@redhat.com>
4015         * alloca_cutoff.c: Correct license text.
4016         * tst-unload.c: Likewise.
4017         * sysdeps/pthread/allocalim.h: Likewise.
4018         * sysdeps/pthread/pt-initfini.c: Likewise.
4019         * sysdeps/pthread/bits/libc-lock.h: Likewise.
4020         * sysdeps/pthread/bits/sigthread.h: Likewise.
4021         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
4022         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
4024 2005-02-16  Roland McGrath  <roland@redhat.com>
4026         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
4027         Use unsigned int * for ptr_nthreads.
4029 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
4031         [BZ #721]
4032         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
4033         gcc4.
4035 2005-02-07  Richard Henderson  <rth@redhat.com>
4037         [BZ #787]
4038         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
4039         argument.
4041 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
4043         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
4044         order of arguments in invocation of atomic_add_zero.
4046 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
4048         [BZ #737]
4049         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
4050         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
4051         at least gotntpoff relocation and addition.
4052         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
4053         Likewise.
4054         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
4055         Likewise.
4056         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
4057         Likewise.
4059 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
4061         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
4062         entry for static tls deallocation fix.
4063         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
4064         also contains information whether the memory pointed to is static
4065         TLS or not.
4066         * sysdeps/i386/tls.h: Likewise.
4067         * sysdeps/ia64/tls.h: Likewise.
4068         * sysdeps/powerpc/tls.h: Likewise.
4069         * sysdeps/s390/tls.h: Likewise.
4070         * sysdeps/sh/tls.h: Likewise.
4071         * sysdeps/sparc/tls.h: Likewise.
4072         * sysdeps/x86_64/tls.h: Likewise.
4074 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
4076         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
4078 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
4080         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
4081         %esp.
4082         * Makefile (tests): Add tst-align2.
4083         * tst-align2.c: New test.
4084         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
4085         -mpreferred-stack-boundary=4.
4087 2004-12-18  Roland McGrath  <roland@redhat.com>
4089         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
4090         New file removed withdrawn for the moment.
4092 2004-12-17  Richard Henderson  <rth@redhat.com>
4094         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
4095         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
4097 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
4099         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
4100         Increased PTHREAD_STACK_MIN.
4102         * tst-context1.c (stacks): Use bigger stack size.
4104 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
4106         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
4107         * sysdeps/sparc/tcb-offsets.sym: Add TID.
4109 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
4111         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
4112         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
4113         * sysdeps/s390/tcb-offsets.sym (TID): Add.
4115 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
4117         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
4119 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
4121         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
4122         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
4124         * tst-getpid1.c: If child crashes, report this first.  Print which
4125         signal.
4127 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
4129         * init.c (__pthread_initialize_minimal_internal): Also unblock
4130         SIGSETXID.
4132 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
4134         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
4135         _POSIX_THREAD_CPUTIME): Define to 0.
4136         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
4137         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
4138         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
4139         __timer_signal_thread_tclk): Remove.
4140         (init_module): Remove their initialization.
4141         (thread_cleanup): Remove their cleanup assertions.
4142         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
4143         __timer_signal_thread_tclk): Remove.
4144         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
4145         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
4146         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
4148 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
4150         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
4151         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
4153         * Makefile (tests): Add tst-getpid2.
4154         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
4155         (do_test): Use it.  Use __clone2 instead of clone on ia64.
4156         * tst-getpid2.c: New test.
4158 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4160         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
4162 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
4164         * Makefile (tests): Add tst-getpid1.
4165         * tst-getpid1.c: New file.
4166         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
4167         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
4169 2004-12-02  Roland McGrath  <roland@redhat.com>
4171         * Makefile (libpthread-nonshared): Variable removed.
4172         ($(objpfx)libpthread_nonshared.a): Target removed.
4173         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
4174         These are now handled by generic magic from
4175         libpthread-static-only-routines being set.
4177 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
4179         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
4180         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
4181         _POSIX_THREAD_PRIO_PROTECT): Define.
4182         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4183         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4184         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
4186 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
4188         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
4189         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
4190         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
4191         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
4192         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4193         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4194         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
4196 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
4198         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
4200         * Makefile (libpthread-routines): Add pthread_setschedprio.
4201         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
4202         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
4203         * pthread_setschedprio.c: New file.
4205 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
4207         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
4208         * pthread_cancel.c (pthread_create): Likewise.
4210         * Makefile (libpthread-routines): Add vars.
4211         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
4212         * init.c (__default_stacksize, __is_smp): Remove.
4213         * vars.c: New file.
4214         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
4215         and define a wrapper macro.
4216         (PTHREAD_STATIC_FN_REQUIRE): Define.
4217         * allocatestack.c (__find_thread_by_id): Undefine.
4218         * pthread_create (__pthread_keys): Remove.
4219         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
4220         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
4221         PTHREAD_STATIC_FN_REQUIRE.
4223 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4225         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
4226         parameter to REGISTER macro.
4228 2004-11-17  Roland McGrath  <roland@redhat.com>
4230         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
4231         Make sure SIGCANCEL is blocked as well.
4233 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
4235         * sysdeps/pthread/setxid.h: New file.
4236         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
4237         (struct xid_command): Add forward decl.
4238         (struct pthread_functions): Change return type of __nptl_setxid hook
4239         to int.
4240         * pthreadP.h (__nptl_setxid): Change return type to int.
4241         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
4242         calling thread, return its return value and set errno on failure.
4243         * descr.h (struct xid_command): Change id type to long array.
4245         * Makefile: Add rules to build and test tst-setuid1 and
4246         tst-setuid1-static.
4247         * tst-setuid1.c: New test.
4248         * tst-setuid1-static.c: New test.
4250 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
4252         * Makefile (tests): Add tst-exit3.
4253         * tst-exit3.c: New test.
4255 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
4257         * Makefile (tests): Add tst-exit2.
4258         * tst-exit2.c: New file.
4260 2004-11-09  Roland McGrath  <roland@redhat.com>
4262         [BZ #530]
4263         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
4264         here, before calling clone.
4265         * pthread_create.c (start_thread): Don't do it here.
4267 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
4269         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
4271 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
4273         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
4274         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
4275         assembler warning.
4277 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
4279         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
4280         if sched_priority is not between minprio and maxprio.
4282 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4284         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4285         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
4287         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
4288         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
4290 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
4292         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
4293         not-cancelable I/O functions.
4295 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4297         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
4298         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
4299         make sure 2 is stored in the futex and we looked at the old value.
4300         Fix a few other problems to return the correct value.
4302 2004-10-14  Richard Henderson  <rth@redhat.com>
4304         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
4305         make gcc4 happy.
4307 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
4309         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
4310         of pthread-functions.h and pthreaddef.h.
4311         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
4313         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4314         Change __data.__nwaiters from int to unsigned int.
4316         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
4317         sysconf (_SC_THREAD_CPUTIME) returns negative value.
4319         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
4320         before return type.
4322         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
4323         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
4325 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
4327         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
4328         test fails, remove message queue.
4329         (tf_msgsnd): Likewise.
4331 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
4333         * tst-clock1.c: Change #ifdef to #if defined.
4334         * tst-clock2.c: Likewise.
4335         * tst-cond11.c: Likewise.
4337         * sysdeps/pthread/timer_create.c (timer_create): Use
4338         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
4339         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
4340         THREAD_CPUTIME.
4342 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
4344         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
4345         _POSIX_THREAD_CPUTIME): Define to 0.
4347 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
4349         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
4350         and _POSIX_THREAD_CPUTIME to zero.
4351         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
4352         * tst-barrier2.c: Fix testing for POSIX feature.
4353         * tst-clock1.c: Likewise.
4354         * tst-clock2.c: Likewise.
4355         * tst-cond11.c: Likewise.
4356         * tst-cond4.c: Likewise.
4357         * tst-cond6.c: Likewise.
4358         * tst-flock2.c: Likewise.
4359         * tst-mutex4.c: Likewise.
4360         * tst-mutex9.c: Likewise.
4361         * tst-rwlock12.c: Likewise.
4362         * tst-rwlock4.c: Likewise.
4363         * tst-signal1.c: Likewise.
4364         * tst-spin2.c: Likewise.
4365         * sysdeps/pthread/posix-timer.h: Likewise.
4366         * sysdeps/pthread/timer_create.c: Likewise.
4367         * sysdeps/pthread/timer_routines.c: Likewise.
4369 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
4371         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4372         (__lll_mutex_timedlock_wait): Address futex correctly.
4374         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4375         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
4376         make sure 2 is stored in the futex and we looked at the old value.
4377         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4378         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
4379         which might very well made the code not working at all before.
4380         [BZ #417]
4382 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
4384         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
4385         allow SIGSETXID to be sent.
4386         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
4387         for SIGSETXID to be defined.
4388         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
4389         SIGSETXID cannot be blocked.
4391         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4392         Add __extension__ to long long types.
4393         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4394         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4395         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4396         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4397         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
4398         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4399         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4401 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
4403         * descr.h (struct pthread): Add stopped_start field.
4404         * sysdeps/pthread/createthread.c (create_thread): Set
4405         start_stopped flag in descriptor for new thread appropriately.
4406         * pthread_create.c (start_thread): Only take lock to be stopped on
4407         startup if stopped_start flag says so.
4409 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
4411         * pthread_create.c (__pthread_create_2_1): Remember whether thread
4412         is created detached and if yes, do not try to free the stack in case
4413         the thread creation failed.
4414         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
4415         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
4416         case there has been no error.  [BZ #405]
4418         * pthread_create.c (start_thread): Don't wait for scheduler data
4419         etc to be set at the beginning of the function.  The cancellation
4420         infrastructure must have been set up.  And enable async
4421         cancellation before potentially going to sleep.  [BZ #401]
4423 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
4425         * Versions: Remove exports for pthread_set*id_np functions.
4426         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
4427         for now.
4428         * Makefile: Don't build pthread_set*id code for now.
4430 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
4432         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
4433         internal use.
4434         * allocatestack.c (__nptl_setxid): New function.
4435         * descr.h (struct xid_command): Define type.
4436         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
4437         (sighandler_setxid): New function.
4438         (__pthread_initialize_minimal): Register sighandler_setxid for
4439         SIGCANCEL.
4440         * pt-allocrtsig.c: Update comment.
4441         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
4442         Declare __nptl_setxid.
4443         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
4444         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
4445         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
4446         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
4447         and pthread_setresuid_np.
4448         * pthread_setgid_np.c: New file.
4449         * pthread_setuid_np.c: New file.
4450         * pthread_setegid_np.c: New file.
4451         * pthread_seteuid_np.c: New file.
4452         * pthread_setregid_np.c: New file.
4453         * pthread_setreuid_np.c: New file.
4454         * pthread_setresgid_np.c: New file.
4455         * pthread_setresuid_np.c: New file.
4456         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
4457         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
4458         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
4459         and pthread_setresuid_np.
4460         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
4461         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
4462         pthread_setregid, and pthread_setresgid.
4464 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
4466         * allocatestack.c (allocate_stack): Return EAGAIN instead of
4467         ENOMEM when out of memory.
4469 2004-09-10  Roland McGrath  <roland@redhat.com>
4471         [BZ #379]
4472         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
4473         code, since we don't try to use the broken CLONE_STOPPED any more.
4474         * pthread_create.c (start_thread): Likewise.
4476 2004-09-15  Richard Henderson  <rth@redhat.com>
4478         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
4480 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
4482         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
4483         (__libc_unwind_longjmp): Delete macro and declare as function.
4484         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
4485         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
4486         nptl directory.
4487         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
4488         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
4489         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
4491 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
4493         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
4494         for __USE_XOPEN2K.
4495         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
4496         types also for __USE_XOPEN2K.
4497         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4498         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4499         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4500         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4501         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4502         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4503         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4504         [BZ #320]
4506 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
4508         * sysdeps/pthread/pthread.h
4509         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
4510         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
4511         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
4512         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
4513         [BZ #375]
4515 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
4517         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
4518         PSEUDO to be used with . prefix.
4520         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
4521         Use atomic_increment instead of atomic_exchange_and_add.
4522         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
4523         Likewise.
4524         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
4525         Likewise.
4526         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
4527         Likewise.
4529         * allocatestack.c (allocate_stack): Use atomic_increment_val
4530         instead of atomic_exchange_and_add.
4531         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
4532         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
4533         Likewise.
4534         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4535         Likewise.
4537         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
4538         the initialization function might throw.
4540 2005-09-05  Richard Henderson  <rth@redhat.com>
4542         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
4543         Move definition inside libpthread, libc, librt check.  Provide
4544         definition for rtld.
4546 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
4548         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
4549         * sysdeps/i386/jmpbuf-unwind.h: Likewise
4550         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
4551         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
4552         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
4553         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
4554         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
4555         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
4556         * unwind.c: Use it.
4558         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4559         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
4560         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4561         Likewise.
4562         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4563         Decrement __nwaiters.  If pthread_cond_destroy has been called and
4564         this is the last waiter, signal pthread_cond_destroy caller and
4565         avoid using the pthread_cond_t structure after unlock.
4566         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4567         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4568         Read clock type from the least significant bits of __nwaiters instead
4569         of __clock.
4570         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4571         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
4573 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
4575         [BZ #342]
4576         * Makefile (tests): Add tst-cond20 and tst-cond21.
4577         * tst-cond20.c: New test.
4578         * tst-cond21.c: New test.
4579         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
4580         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
4581         it unsigned int.
4582         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4583         Likewise.
4584         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4585         (pthread_cond_t): Likewise.
4586         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4587         Likewise.
4588         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4589         Likewise.
4590         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4591         Likewise.
4592         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
4593         (cond_nwaiters): New.
4594         (clock_bits): New.
4595         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
4596         if there are waiters not signalled yet.
4597         Wait until all already signalled waiters wake up.
4598         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
4599         __nwaiters.  If pthread_cond_destroy has been called and this is the
4600         last waiter, signal pthread_cond_destroy caller and avoid using
4601         the pthread_cond_t structure after unlock.
4602         (__pthread_cond_wait): Increment __nwaiters in the beginning,
4603         decrement it when leaving.  If pthread_cond_destroy has been called
4604         and this is the last waiter, signal pthread_cond_destroy caller.
4605         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4606         Likewise.  Read clock type from the least significant bits of
4607         __nwaiters instead of __clock.
4608         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
4609         whether clock ID can be encoded in COND_CLOCK_BITS bits.
4610         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
4611         clock type just from the last COND_CLOCK_BITS bits of value.
4612         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
4613         instead of __clock, just from second bit of condattr's value.
4615 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
4617         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
4618         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
4619         != 64.
4620         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4622 2004-08-15  Roland McGrath  <roland@frob.com>
4624         * pthread_atfork.c: Update copyright terms including special exception
4625         for these trivial files, which are statically linked into executables
4626         that use dynamic linking for the significant library code.
4628 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
4630         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
4631         pthread_rwlock_rdlock.
4632         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
4633         Decrease __nr_readers_queued after reacquiring lock.
4634         * sysdeps/pthread/pthread_rwlock_timedrdlock
4635         (pthread_rwlock_timedrdlock): Likewise.
4636         Reported by Bob Cook <bobcook47@hotmail.com>.
4638 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
4640         * tst-rwlock14.c (tf): Read main thread handle from *ARG
4641         before pthread_barrier_wait.
4643 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
4645         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
4646         Remove unnecessary exception handling data.
4648 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
4650         [BZ #284]
4651         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
4652         instead of clockid_t.
4654 2004-07-21  Roland McGrath  <roland@redhat.com>
4656         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
4658 2004-07-19  Roland McGrath  <roland@redhat.com>
4660         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
4662 2004-07-02  Roland McGrath  <roland@redhat.com>
4664         * configure: Don't exit.
4666 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4668         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4669         (__pthread_cond_timedwait): Check for invalid nanosecond in
4670         timeout value.
4672 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
4674         * Makefile: Add rules to build and run tst-fini1.
4675         * tst-fini1.c: New file.
4676         * tst-fini1mod.c: New file.
4678 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
4680         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
4681         if no cancellation support is needed.
4682         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
4683         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
4684         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4685         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
4686         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
4687         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
4688         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
4689         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
4690         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
4692         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
4693         only if not already defined.
4695 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
4697         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
4698         constraint "m" instead of "0" for futex.
4700         * shlib-versions: Add powerpc64-.*-linux.*.
4702 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
4704         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
4705         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
4706         for valid tv_nsec.
4707         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
4708         1 billion and 64-bit tv_nsec which is valid when truncated to 32
4709         bits.
4711 2004-06-29  Roland McGrath  <roland@redhat.com>
4713         * Banner: NPTL no longer has its own version number.
4714         * Makefile (nptl-version): Variable removed.
4715         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
4716         using $(version), the glibc version number.
4718 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4720         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4721         Fix branch offset for a PLT entry.
4722         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
4723         Likewise.
4724         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
4725         Likewise.
4726         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
4727         Likewise.
4728         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
4729         Likewise.
4731 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4733         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
4734         unconditionally.
4736 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4738         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
4739         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
4740         instead of tv_sec.
4741         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
4742         (pthread_rwlock_timedrdlock): Likewise.
4744 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
4746         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4747         Set __r7 to val, not mutex.
4749 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
4751         * Makefile: Add rules to build tst-rwlock14.
4752         * tst-rwlock14.c: New file.
4754 2004-06-24  Boris Hu  <boris.hu@intel.com>
4756         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
4757         check.
4758         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
4760 2004-06-19  Andreas Jaeger  <aj@suse.de>
4762         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
4763         assembler in last patch.
4765 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
4767         * sysdeps/pthread/pthread_cond_timedwait.c
4768         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
4769         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4770         (__pthread_cond_timedwait): Check for invalid nanosecond in
4771         timeout value.
4772         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4773         * tst-cond19.c: New file.
4774         * Makefile: Add rules to build and run tst-cond19.
4776 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
4778         * tst-context1.c (GUARD_PATTERN): Defined.
4779         (tst_context_t): Define struct containing ucontext_t & guard words.
4780         (ctx): Declare as an array of tst_context_t.
4781         (fct): Verify uc_link & guard words are still valid.
4782         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
4784 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4786         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4787         Add __data.__futex field, reshuffle __data.__clock.
4788         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
4789         (__pthread_cond_signal): Increment __futex at the same time as
4790         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4791         address of low 32-bits of __wakeup_seq to futex syscall.
4792         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4793         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4794         releasing internal lock to FUTEX_WAIT.
4795         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4796         (__pthread_cond_timedwait): Likewise.
4797         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4798         (FUTEX_CMP_REQUEUE): Define.
4799         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4800         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4801         Pass __futex value from before the unlock and __futex address instead
4802         of address of low 32-bits of __wakeup_seq to futex syscall.
4803         Fallback to FUTEX_WAKE all on any errors.
4805 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
4807         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
4808         comment typo.
4809         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
4810         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
4811         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
4812         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
4813         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
4815 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4817         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
4818         Add memory clobber to inline assembly.
4819         (__lll_mutex_trylock): Likewise.
4820         (__lll_mutex_cond_trylock): Likewise.
4822 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4824         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4825         Pass val argument as 6th system call argument in %r7.
4827 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4829         * Makefile (tests): Add tst-cond16.
4830         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
4831         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
4832         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4833         Add __data.__futex field, reshuffle __data.__clock.
4834         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
4835         (__pthread_cond_signal): Increment __futex at the same time as
4836         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4837         address of low 32-bits of __wakeup_seq to futex syscall.
4838         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
4839         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4840         releasing internal lock to FUTEX_WAIT.
4841         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
4842         (__pthread_cond_timedwait): Likewise.
4843         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
4844         (FUTEX_CMP_REQUEUE): Define.
4845         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4846         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4847         Pass __futex value from before the unlock and __futex address instead
4848         of address of low 32-bits of __wakeup_seq to futex syscall.
4849         Fallback to FUTEX_WAKE all on any errors.
4850         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
4851         Define.
4852         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4853         internally.  Return non-zero if error, zero if success.
4854         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4855         Add __data.__futex field, reshuffle __data.__clock.
4856         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
4857         Define.
4858         (lll_futex_requeue): Add val argument, return 1 unconditionally
4859         for the time being.
4860         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4861         Add __data.__futex field, reshuffle __data.__clock.
4862         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4863         Define.
4864         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4865         internally.  Return non-zero if error, zero if success.
4866         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4867         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
4868         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4869         Define.
4870         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4871         internally.  Return non-zero if error, zero if success.
4872         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4873         Add __data.__futex field, reshuffle __data.__clock.
4874         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
4875         Define.
4876         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4877         internally.  Return non-zero if error, zero if success.
4878         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4879         Add __data.__futex field, reshuffle __data.__clock.
4880         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4881         Add __data.__futex field, reshuffle __data.__clock.
4882         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
4883         Increment __futex at the same time as __wakeup_seq or __total_seq.
4884         Pass address of __futex instead of address of low 32-bits of
4885         __wakeup_seq to futex syscall.
4886         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4887         Pass __futex value from before releasing internal lock
4888         to FUTEX_WAIT.
4889         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4890         Likewise.  Avoid unnecessary shadowing of variables.
4891         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
4892         Set __futex to 2 * __total_seq.  Pass __futex value from before the
4893         unlock and __futex address instead of address of low 32-bits of
4894         __wakeup_seq to futex_requeue macro, adjust for new return value
4895         meaning.
4896         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
4897         (__pthread_cond_signal): Increment __futex at the same time as
4898         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4899         address of low 32-bits of __wakeup_seq to futex syscall.
4900         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
4901         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4902         releasing internal lock to FUTEX_WAIT.
4903         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4904         (__pthread_cond_timedwait): Likewise.
4905         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4906         (FUTEX_CMP_REQUEUE): Define.
4907         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4908         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4909         Pass __futex value from before the unlock and __futex address instead
4910         of address of low 32-bits of __wakeup_seq to futex syscall.
4911         Fallback to FUTEX_WAKE all on any errors.
4913 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4915         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
4916         Add nop to align the end of critical section.
4917         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
4919 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4921         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4922         Add __broadcast_seq field.
4923         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
4924         all waiters as woken with woken_seq and bump broadcast counter.
4925         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
4926         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
4927         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4928         Comment typo fixes.  Avoid returning -ETIMEDOUT.
4930 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
4932         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4933         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
4934         Reported by Kaz Kojima.
4936 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
4938         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
4940 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4942         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
4943         __broadcast_seq with bc_seq after acquiring internal lock instead of
4944         before it.
4946 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
4948         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
4949         compilation.
4950         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4951         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
4952         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4953         (pthread_cond_t): Add __data.__broadcast_seq field.
4954         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4955         (FRAME_SIZE): Define.
4956         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
4957         Comment typo fixes.
4958         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
4959         Define.
4960         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
4961         typo fixes.
4962         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4963         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
4964         fixes.
4966 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
4968         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
4969         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4970         Add __broadcast_seq field.
4971         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4972         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4973         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4974         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4975         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4976         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
4977         all waiters as woken with woken_seq and bump broadcast counter.
4978         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
4979         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
4980         __broadcast_seq field.
4981         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4982         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4983         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
4984         * pthread_cond_init.c: Initialize __broadcast_seq field.
4985         * Makefile (tests): Add tst-cond17 and tst-cond18.
4986         Add .NOTPARALLEL goal.
4987         * tst-cond16.c: New file.  From Jakub.
4988         * tst-cond17.c: New file.  From Jakub.
4989         * tst-cond18.c: New file.  From Jakub.
4991 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
4993         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
4994         unwind info.
4996         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4997         Parametrize frame size.  Correct some unwind info.
4998         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5000 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
5002         * tst-stack3.c: Note testing functionality beyond POSIX.
5004 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
5006         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
5007         Change conditional from ifdef to if.
5009 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
5011         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
5012         SYSDEP_CANCEL_ERROR): Define.
5013         (PSEUDO): Use it.
5015 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
5017         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
5019 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
5021         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
5023 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5025         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
5026         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
5027         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
5028         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
5030 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
5032         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
5033         thread has all signals blocked.
5035 2004-04-18  Andreas Jaeger  <aj@suse.de>
5037         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
5038         (SEM_VALUE_MAX): Add missing brace.
5040 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
5042         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
5043         in rt subdir.
5044         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
5045         * sysdeps/pthread/tst-mqueue8x.c: New test.
5046         * tst-cancel4.c: Update comment about message queues.
5048         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
5049         return it_value { 0, 0 }.
5050         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
5051         like SIGEV_SIGNAL.
5052         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
5053         assertion for SIGEV_NONE.
5054         (thread_attr_compare): Compare all attributes, not just a partial
5055         subset.
5057 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
5059         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
5061 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
5063         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
5064         Just use a plain number.
5065         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
5066         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
5067         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
5068         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
5069         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
5070         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
5071         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
5073 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5075         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
5076         frame info.
5077         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5079 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
5081         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
5082         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
5083         of calling sigwaitinfo.
5085 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
5087         * allocatestack.c (allocate_stack): Set reported_guardsize
5088         unconditionally.
5089         * pthread_getattr_np.c (pthread_getattr_np): Use
5090         reported_guardsize instead of guardsize.
5091         * descr.h (struct pthread): Add reported_guardsize field.
5093 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
5095         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
5097 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
5099         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
5101 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
5103         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
5104         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
5105         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
5106         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
5107         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
5108         Define.
5109         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
5110         (_POSIX_MESSAGE_PASSING): Define.
5111         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
5112         (_POSIX_MESSAGE_PASSING): Define.
5113         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
5114         (_POSIX_MESSAGE_PASSING): Define.
5116 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
5118         * tst-context1.c (fct): Check whether correct stack is used.
5120 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
5122         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
5123         matching constraints for asm mem parameters.
5125         * tst-clock2.c (tf): Don't define unless needed.
5127 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
5129         * Makefile (link-libc-static): Use $(static-gnulib) instead of
5130         $(gnulib).
5132 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
5134         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
5135         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
5136         * pthreadP.h: Declare __nptl_deallocate_tsd.
5137         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
5138         Adjust caller.
5140         * Makefile (tests): Add tst-tsd5.
5141         * tst-tsd5.c: New file.
5143 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
5145         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5146         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
5147         is SHLIB_COMPAT check.
5148         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
5149         (__pthread_attr_getaffinity_old): Likewise.
5150         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5151         (__pthread_getaffinity_old): Likewise.
5152         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5153         (__pthread_setaffinity_old): Likewise.
5155 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
5157         * allocatestack.c (_make_stacks_executable): Call
5158         _dl_make_stack_executable first.
5160 2004-03-24  Roland McGrath  <roland@redhat.com>
5162         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
5163         constraint instead of "0".
5165 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
5167         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
5168         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
5170         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
5171         code to avoid warning.
5173 2004-03-24  Andreas Jaeger  <aj@suse.de>
5175         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5176         (__pthread_attr_setaffinity_old): Remove const.
5178 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
5180         * sysdeps/unix/sysv/linux/smp.h: New file.
5181         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
5182         * init.c: Define __is_smp.
5183         (__pthread_initialize_minimal_internal): Call is_smp_system to
5184         initialize __is_smp.
5185         * pthreadP.h: Declare __is_smp.
5186         Define MAX_ADAPTIVE_COUNT is necessary.
5187         * pthread_mutex_init.c: Add comment regarding __spins field.
5188         * pthread_mutex_lock.c: Implement adaptive mutex type.
5189         * pthread_mutex_timedlock.c: Likewise.
5190         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
5191         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
5192         Add __spins field.
5193         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5194         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5195         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5196         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5197         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5198         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5199         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
5200         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
5201         lll_mutex_cond_trylock.
5202         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5203         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5204         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5205         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5206         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5207         Define BUSY_WAIT_NOP.
5208         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5209         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
5211         * tst-mutex5.c: Add support for testing adaptive mutexes.
5212         * tst-mutex7.c: Likewise.
5213         * tst-mutex5a.c: New file.
5214         * tst-mutex7a.c: New file.
5215         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
5217         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5218         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
5219         vgettimeofday call might destroy the content.
5221         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
5222         @pause in the loop.
5224         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
5225         No need to restrict type of ret.  Make it int.  Add comment.
5227         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
5228         Remove unnecessary setne instruction.
5230 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
5232         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5233         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
5234         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
5235         If realloc fails, break out of the loop.
5237 2004-03-20  Andreas Jaeger  <aj@suse.de>
5239         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5240         (__pthread_setaffinity_old): Fix interface.
5241         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5242         (__pthread_getaffinity_old): Likewise.
5244         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
5245         (__pthread_setaffinity_new): Remove duplicate declaration.
5247 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5249         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
5250         the return value to a safe register.
5251         (CDISABLE): Set the function argument correctly.
5253 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5255         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
5256         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
5257         Rewrite so that only one locked memory operation per round is needed.
5258         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
5259         (pthread_barrier_wait): After wakeup, release lock only when the
5260         last thread stopped using the barrier object.
5261         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
5262         (__pthread_cond_wait): Don't store mutex address if the current
5263         value is ~0l.  Add correct cleanup support and unwind info.
5264         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5265         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
5266         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
5267         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
5268         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
5269         Add correct cleanup support and unwind info.
5270         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
5271         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
5272         information for syscall wrappers.
5274 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
5276         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
5277         cpusetsize field, remove next.
5278         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
5279         parameter for size of the CPU set.
5280         (pthread_setaffinity_np): Likewise.
5281         (pthread_attr_getaffinity_np): Likewise.
5282         (pthread_attr_setaffinity_np): Likewise.
5283         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
5284         interface change, keep compatibility code.
5285         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
5286         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
5287         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
5288         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
5289         __pthread_getaffinity_np.
5290         * Versions: Add version for changed interfaces.
5291         * tst-attr3.c: Adjust test for interface change.
5292         * pthread_getattr_np.c: Query the kernel about the affinity mask with
5293         increasing buffer sizes.
5294         * pthread_attr_destroy.c: Remove unused list handling.
5295         * pthread_attr_init.c: Likewise.
5297 2004-03-17  Roland McGrath  <roland@redhat.com>
5299         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
5300         first argument to clock_getres so we ever enable kernel timers.
5302 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
5304         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
5306 2004-03-12  Richard Henderson  <rth@redhat.com>
5308         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
5309         oldvalue from CENABLE to CDISABLE.
5311 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
5313         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
5314         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
5315         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
5316         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
5318 2004-03-11  Richard Henderson  <rth@redhat.com>
5320         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
5321         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
5322         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
5324 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
5326         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
5327         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
5328         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
5330 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
5332         * forward.c (__pthread_cond_broadcast_2_0,
5333         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
5334         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
5335         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
5337 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5339         * sysdeps/sh/tcb-offsets.sym: Add PID.
5340         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
5341         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
5343 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
5345         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
5346         include <sysdep-cancel.h>, vfork is no cancellation point.
5347         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
5348         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
5349         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
5351 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
5353         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
5354         libc_hidden_def.
5355         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
5356         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
5357         Likewise.
5358         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
5359         Likewise.
5360         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
5361         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
5362         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
5363         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
5364         of DO_CALL_VIA_BREAK.  Work around a gas problem.
5366         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
5367         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
5368         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
5369         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
5370         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
5371         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
5373         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
5374         a local register for saving old PID.  Negate PID in parent upon exit.
5376         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
5377         tcb-offsets.h.
5378         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
5379         before syscall, set to the old value in the parent afterwards.
5380         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
5381         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
5382         tcb-offsets.h.
5383         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
5384         before syscall, set to the old value in the parent afterwards.
5385         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
5386         * sysdeps/s390/tcb-offsets.sym: Add PID.
5388         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
5389         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
5390         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
5391         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
5392         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
5393         * sysdeps/sparc/tcb-offsets.sym: Add PID.
5395 2004-03-10  Andreas Schwab  <schwab@suse.de>
5397         * sysdeps/ia64/tcb-offsets.sym: Add PID.
5398         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
5399         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
5401 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
5403         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
5404         * tst-cancel21.c (do_one_test): Likewise.
5405         Reported by Gordon Jin <gordon.jin@intel.com>.
5407 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
5409         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
5410         if non-zero and set to INT_MIN if zero.
5411         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
5412         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
5413         (SAVE_PID, RESTORE_PID): Define.
5414         (__vfork): Use it.
5415         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
5416         Use relative path to avoid including NPTL i386/vfork.S.
5417         (SAVE_PID, RESTORE_PID): Define.
5418         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
5419         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
5420         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
5421         tst-vfork2x.
5422         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
5423         * tst-vfork1.c: New test.
5424         * tst-vfork2.c: New test.
5425         * tst-vfork1x.c: New test.
5426         * tst-vfork2x.c: New test.
5428 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
5430         * sysdeps/i386/tcb-offsets.sym: Add PID.
5431         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
5432         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
5433         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
5435 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
5437         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
5439 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
5441         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
5442         _rtld_global_ro.
5444 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
5446         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
5447         _rtld_global_ro.
5449         * tst-once4.c: Remove unnecessary macro definition.
5451         * tst-mutex7.c (do_test): Limit thread stack size.
5452         * tst-once2.c (do_test): Likewise.
5453         * tst-tls3.c (do_test): Likewise.
5454         * tst-tls1.c (do_test): Likewise.
5455         * tst-signal3.c (do_test): Likewise.
5456         * tst-kill6.c (do_test): Likewise.
5457         * tst-key4.c (do_test): Likewise.
5458         * tst-join4.c (do_test): Likewise.
5459         * tst-fork1.c (do_test): Likewise.
5460         * tst-context1.c (do_test): Likewise.
5461         * tst-cond2.c (do_test): Likewise.
5462         * tst-cond10.c (do_test): Likewise.
5463         * tst-clock2.c (do_test): Likewise.
5464         * tst-cancel10.c (do_test): Likewise.
5465         * tst-basic2.c (do_test): Likewise.
5466         * tst-barrier4.c (do_test): Likewise.
5468 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
5470         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
5472 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
5474         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5475         (__pthread_cond_timedwait): Optimize wakeup test.
5476         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5477         (__pthread_cond_wait): Likewise.
5478         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
5479         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5480         Likewise.
5482 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
5484         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5485         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
5486         the atomic instruction needed.
5487         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5488         (__lll_mutex_lock_wait): Likewise.
5490 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
5492         * Makefile (tests): Add tst-cond14 and tst-cond15.
5493         * tst-cond14.c: New file.
5494         * tst-cond15.c: New file.
5496 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
5498         * sysdeps/pthread/createthread.c (create_thread): Remove use of
5499         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
5500         needs to be implemented differently to be useful.
5502 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
5504         * pthread_attr_setschedparam.c: Don't test priority against limits
5505         here.  Set ATTR_FLAG_SCHED_SET flag.
5506         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
5507         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
5508         from parent thread to child.  If attribute is used and scheduling
5509         parameters are not inherited, copy parameters from attribute or
5510         compute them.  Check priority value.
5511         * pthread_getschedparam.c: If the parameters aren't known yet get
5512         them from the kernel.
5513         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
5514         ATTR_FLAG_POLICY_SET flag for thread.
5515         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
5516         and ATTR_FLAG_POLICY_SET.
5518         * sysdeps/pthread/createthread.c: Use tgkill if possible.
5520         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
5521         fail if stack address hasn't been set.  Just return 0.
5523 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
5525         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
5526         libpthread for the files in this list.
5527         (CFLAGS-tst-unload): Removed.
5528         * tst-unload.c (do_test): Don't use complete path for
5529         LIBPHREAD_SO.
5531         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
5532         tst-_res1mod2.
5534 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
5536         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5537         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
5538         operation per round is needed.
5539         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
5540         (__lll_mutex_lock_wait): Likewise.
5542 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
5544         * tst-cancel9.c (cleanup): Don't print to stderr.
5546 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5548         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
5550 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
5552         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
5553         (__syscall_error_handler2): Call CDISABLE.
5554         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
5555         (__syscall_error_handler2): Call CDISABLE.
5557         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5558         Release lock before the loop, don't reacquire it.
5560         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
5562 2004-02-19  Andreas Schwab  <schwab@suse.de>
5564         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5565         Fix last change.
5567 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
5569         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
5570         (pthread_barrier_wait): After wakeup, release lock only when the
5571         last thread stopped using the barrier object.
5572         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
5573         (pthread_barrier_wait): Likewise.
5574         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5575         Likewise.
5576         * Makefile (tests): Add tst-barrier4.
5577         * tst-barrier4.c: New file.
5579         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5580         (__pthread_cond_timedwait): Perform timeout test while holding
5581         internal lock to prevent wakeup race.
5582         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
5583         * sysdeps/pthread/pthread_cond_timedwait.c
5584         (__pthread_cond_timedwait): Likewise.
5585         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5586         (__pthread_cond_timedwait): Likewise.
5588 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
5590         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
5591         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
5592         * Makefile (tests): Add tst-rwlock13.
5593         * tst-rwlock13.c: New test.
5595 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
5597         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5598         (__condvar_tw_cleanup): Little optimization.
5599         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
5601 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
5603         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
5604         libpthread as "lib" parameter to SHLIB_COMPAT.
5605         (__novmx_siglongjmp): Fix typo in function name.
5606         (__novmx_longjmp): Fix typo in function name.
5608 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
5610         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
5611         __builtin_expect.
5613         * sysdeps/generic/pt-longjmp.c: Moved to...
5614         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
5616 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
5618         * Makefile (libpthread-routines): Add pt-cleanup.
5619         * pt-longjmp.c: Removed.
5620         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
5621         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
5622         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
5623         Version longjmp, siglongjmp for GLIBC_2.3.4.
5624         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
5626 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
5628         * sysdeps/pthread/pthread_cond_timedwait.c
5629         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
5630         Reuse code.  Add __builtin_expects.
5632         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5633         (__pthread_cond_timedwait): Get internal lock in case timeout has
5634         passed before the futex syscall.
5635         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5637 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
5639         * allocatestack.c: Pretty printing.
5641         * sysdeps/pthread/createthread.c (create_thread): Don't add
5642         CLONE_DETACHED bit if it is not necessary.
5644 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
5646         * pthread_getattr_np.c: Include ldsodefs.h.
5648 2004-01-16  Richard Henderson  <rth@redhat.com>
5650         * allocatestack.c: Don't declare __libc_stack_end.
5651         * init.c (__pthread_initialize_minimal_internal): Likewise.
5652         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
5654 2004-01-15  Richard Henderson  <rth@redhat.com>
5656         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
5657         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
5658         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
5659         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
5660         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
5661         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
5662         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
5663         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
5665 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
5667         * init.c (pthread_functions): Make array const.
5669 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
5671         * allocatestack.c (__make_stacks_executable): Change interface.
5672         Check parameters.  Pass parameter on to libc counterpart.
5673         * pthreadP.h: Change declaration.
5675 2004-01-13  Richard Henderson  <rth@redhat.com>
5677         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
5678         prototype form.
5679         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
5680         Likewise.
5682         * sysdeps/alpha/Makefile: New file.
5683         * sysdeps/alpha/tcb-offsets.sym: New file.
5684         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
5685         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
5687         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
5688         on powerpc version.
5690 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
5692         * Makefile (tests): Add tst-backtrace1.
5693         * tst-backtrace1.c: New test.
5695 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
5697         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
5698         register as second parameter to the REGISTER macro.
5699         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
5700         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
5701         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
5702         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
5703         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
5704         of thread register as second parameter to REGISTER macro in 64 case.
5706 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
5708         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
5709         (CFLAGS-getpid.o): Defined.
5710         (CFLAGS-getpid.os): Defined.
5712 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
5714         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
5715         returned for main thread does not overlap with any other VMA.
5716         Patch by Jakub Jelinek.
5718 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
5720         * tst-raise1.c: Include stdio.h.
5722 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
5724         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
5725         setting with __ASSUME_TGKILL || defined __NR_tgkill.
5726         If pid is 0, set it to selftid.
5727         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
5728         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
5729         != 0, return self->tid without doing a syscall.
5730         * descr.h (struct pthread): Move pid field after tid.
5732         * Makefile (tests): Add tst-raise1.
5733         * tst-raise1.c: New file.
5735 2003-12-23  Roland McGrath  <roland@redhat.com>
5737         * tst-oddstacklimit.c: New file.
5738         * Makefile (tests): Add it.
5739         (tst-oddstacklimit-ENV): New variable.
5741         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
5742         value up to page size for __default_stacksize.
5744 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
5746         * Makefile (tests): Add tst-eintr5.
5747         * tst-eintr5.c: New file.
5749         * eintr.c (eintr_source): Prevent sending signal to self.
5751         * tst-eintr2.c (tf1): Improve error message.
5753 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
5755         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
5756         * sysdeps/unix/sysv/linux/getpid.c: New file.
5757         * pthread_cancel.c: Add comment explaining use of PID field.
5758         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
5759         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
5760         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
5761         temporarily to signal the field must not be relied on and updated
5762         by getpid().
5763         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
5764         temporarily negative.
5765         * sysdeps/unix/sysv/linux/raise.c: Likewise.
5767 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
5769         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
5770         (eintr_source): If ARG != NULL, use pthread_kill.
5771         * tst-eintr1.c: Adjust for this change.
5772         * tst-eintr2.c: Likewise.
5773         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
5774         * tst-eintr3.c: New file.
5775         * tst-eintr4.c: New file.
5777 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
5779         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
5780         if CANCELSTATE_BITMASK is set.
5781         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
5782         Likewise.
5784         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
5785         (tests-reverse): Add tst-cancel23.
5786         * tst-cancel22.c: New test.
5787         * tst-cancel23.c: New test.
5789 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
5791         * tst-eintr1.c: Better error messages.
5793         * Makefile (tests): Add tst-eintr2.
5794         * tst-eintr2.c: New file.
5796 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
5798         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
5799         (CFLAGS-tst-cancelx21.c): Set.
5800         * tst-cancel21.c: New test.
5801         * tst-cancelx21.c: New test.
5803         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
5804         comparison operand.
5805         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
5806         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
5807         * pt-longjmp.c: Include jmpbuf-unwind.h.
5808         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
5809         _JMPBUF_UNWINDS.  Adjust compared pointers.
5810         * init.c (__pthread_initialize_minimal_internal): Initialize
5811         pd->stackblock_size.
5812         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
5813         * sysdeps/alpha/jmpbuf-unwind.h: New file.
5814         * sysdeps/i386/jmpbuf-unwind.h: New file.
5815         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
5816         * sysdeps/s390/jmpbuf-unwind.h: New file.
5817         * sysdeps/sh/jmpbuf-unwind.h: New file.
5818         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
5819         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
5820         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
5821         (_JMPBUF_CFA_UNWINDS): Remove.
5822         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
5824 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
5826         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
5827         (CFLAGS-tst-cancelx20.c): Set.
5828         * tst-cancel20.c: New test.
5829         * tst-cancelx20.c: New test.
5831 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
5833         * init.c (__pthread_initialize_minimal_internal): Don't treat
5834         architectures with separate register stack special here when
5835         computing default stack size.
5837 2003-12-17  Roland McGrath  <roland@redhat.com>
5839         * Makefile (tst-cancelx7-ARGS): New variable.
5840         Reportd by Greg Schafer <gschafer@zip.com.au>.
5842 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
5844         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
5845         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
5846         (tst-stack3-ENV): Set.
5847         ($(objpfx)tst-stack3-mem): New.
5848         * tst-stack3.c: New test.
5850 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
5852         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
5853         Add unwind directives.  Drop unused .regstk directive.
5854         (_fini_EPILOG_BEGINS): Add unwind directives.
5856 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
5858         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
5859         Assume parameter is a pointer.
5860         (lll_futex_wake): Likewise.
5861         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
5862         Likewise.
5863         (lll_futex_wake): Likewise.
5864         Reported by Boris Hu.
5865         * sysdeps/unix/sysv/linux/unregister-atfork.c
5866         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
5868         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
5870 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
5872         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
5873         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
5874         __rtld_lock_initialize for ld.so lock.
5875         Patch in part by Adam Li <adam.li@intel.com>.
5877 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
5879         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
5880         in $(gnulib).  Also, remove stale comment.
5882 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
5884         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
5885         advantage of new syscall stub and optimize accordingly.
5887         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
5888         from SYS_futex, to match expectations of
5889         sysdep.h:DO_INLINE_SYSCALL.
5890         (lll_futex_clobbers): Remove.
5891         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
5892         (lll_futex_wake): Likewise.
5893         (lll_futex_requeue): Likewise.
5894         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
5895         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
5896         Jelinek).
5897         (__lll_mutex_lock): Likewise.
5898         (__lll_mutex_cond_lock): Likewise.
5899         (__lll_mutex_timed_lock): Likewise.
5900         (__lll_mutex_unlock): Likewise.
5901         (__lll_mutex_unlock_force): Likewise.
5903         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
5904         comes before the include of <sysdep.h>.
5905         (THREAD_SELF_SYSINFO): New macro.
5906         (THREAD_SYSINFO): Likewise.
5907         (INIT_SYSINFO): New macro.
5908         (TLS_INIT_TP): Call INIT_SYSINFO.
5910         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
5912         * sysdeps/pthread/createthread.c (create_thread): Use
5913         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
5914         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
5915         THREAD_SELF_SYSINFO instead of open code.
5916         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
5917         (THREAD_SYSINFO): Likewise.
5919         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
5921         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
5923 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
5925         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
5926         instead of .init.  Patch by David Mosberger.
5928 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
5930         * sysdeps/pthread/configure.in: Remove broken declaration in C
5931         cleanup handling check.
5933 2003-11-30  Andreas Jaeger  <aj@suse.de>
5935         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
5936         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
5937         Likewise.
5939 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
5941         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
5942         * pthread_attr_destroy.c: Include shlib-compat.h.
5943         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
5944         is set in iattr->flags.
5945         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
5947 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
5949         * Makefile (distribute): Add tst-cleanup4aux.c.
5951         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
5952         include.
5954 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
5956         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
5957         pthread_cond_signal.
5959         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
5960         store mutex address if the current value is ~0l.
5961         * sysdeps/pthread/pthread_cond_timedwait.c
5962         (__pthread_cond_timedwait): Likewise.
5963         * sysdeps/pthread/pthread_cond_broadcast.c
5964         (__pthread_cond_broadcast): Don't use requeue for pshared
5965         condvars.
5967         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5968         (__pthread_cond_wait): Don't store mutex address if the current
5969         value is ~0l.
5970         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5971         (__pthread_cond_timedwait): Likewise.
5972         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5973         (__pthread_cond_broadcast): Don't use requeue for pshared
5974         condvars.
5976         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
5977         element with ~0l for pshared condvars, with NULL otherwise.
5979         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5980         (__pthread_cond_wait): Don't store mutex address if the current
5981         value is ~0l.
5982         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5983         (__pthread_cond_timedwait): Likewise.
5984         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
5985         (__pthread_cond_broadcast): Don't use requeue for pshared
5986         condvars.
5988         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
5989         * tst-cond12.c: New file.
5990         * tst-cond13.c: New file.
5992 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
5994         * sysdeps/pthread/configure.in: Make missing forced unwind support
5995         fatal.
5997 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
5999         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
6001 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
6003         * Makefile: Add magic to clean up correctly.
6005 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
6007         * unwind.c (FRAME_LEFT): Define.
6008         (unwind_stop): Handle old style cleanups here.
6009         (__pthread_unwind): Handle old style cleanups only if
6010         !HAVE_FORCED_UNWIND.
6011         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
6012         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
6013         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
6014         ($(objpfx)tst-cleanupx4): Likewise.
6015         * tst-cleanup4.c: New test.
6016         * tst-cleanup4aux.c: New.
6017         * tst-cleanupx4.c: New test.
6019 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
6021         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
6022         lll_mutex_*lock macros to skip atomic operations on some archs.
6024 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
6026         * sysdeps/pthread/tst-timer.c (main): Initialize
6027         sigev2.sigev_value as well.
6029 2003-10-15  Roland McGrath  <roland@redhat.com>
6031         * sysdeps/pthread/configure.in: Barf if visibility attribute support
6032         is missing.
6033         * sysdeps/pthread/configure: Regenerated.
6035 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6037         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
6038         locking macros.  No distinction between normal and mutex locking
6039         anymore.
6040         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
6041         Merge bits from lowlevelmutex.S we still need.
6042         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
6043         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
6044         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
6045         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
6046         new mutex implementation.
6047         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
6048         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
6049         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6050         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
6051         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
6052         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
6053         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
6054         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
6055         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6056         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
6057         symbol for entry point to avoid cancellation.
6059 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
6061         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
6062         changes.
6063         (SAVE_OLDTYPE_0): Fix a typo.
6065 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
6067         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
6068         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
6070 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
6072         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
6073         correct offset.
6075 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
6077         * Makefile (tests): Add tst-cancel19.
6078         * tst-cancel19.c: New test.
6080 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
6082         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
6083         restoring of the old cancellation type.
6085 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
6087         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
6089 2003-09-27  Wolfram Gloger  <wg@malloc.de>
6091         * sysdeps/pthread/malloc-machine.h: New file
6093 2003-09-24  Roland McGrath  <roland@redhat.com>
6095         * allocatestack.c (__make_stacks_executable): Don't ignore return
6096         value from _dl_make_stack_executable.
6098 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
6100         * allocatestack.c (__make_stacks_executable): Also change
6101         permission of the currently unused stacks.
6103         * allocatestack.c (change_stack_perm): Split out from
6104         __make_stacks_executable.
6105         (allocate_stack): If the required permission changed between the time
6106         we started preparing the stack and queueing it, change the permission.
6107         (__make_stacks_executable): Call change_stack_perm.
6109         * Makefile: Build tst-execstack-mod locally.
6110         * tst-execstack-mod.c: New file.
6112 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
6114         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
6116 2003-09-23  Roland McGrath  <roland@redhat.com>
6118         * tst-execstack.c: New file.
6119         * Makefile (tests): Add it.
6120         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
6121         (LDFLAGS-tst-execstack): New variable.
6123         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
6124         whether to use PROT_EXEC for stack mmap.
6125         (__make_stacks_executable): New function.
6126         * pthreadP.h: Declare it.
6127         * init.c (__pthread_initialize_minimal_internal): Set
6128         GL(dl_make_stack_executable_hook) to that.
6130 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
6132         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
6133         recommendation from AMD re avoidance of lock prefix.
6135 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
6137         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
6138         lll_futex_timed_wait instead of lll_futex_wait.
6139         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
6140         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
6141         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
6142         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
6143         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
6144         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
6145         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
6146         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
6147         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
6148         Completely revamp the locking macros.  No distinction between
6149         normal and mutex locking anymore.
6150         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
6151         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
6152         __lll_lock_timedwait): Fix prototypes.
6153         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
6154         __lll_lock_timedwait): Likewise.
6155         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
6156         macros, add __builtin_expect.
6157         (lll_mutex_timedlock): Likewise.  Fix return value.
6158         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
6159         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
6160         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
6161         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
6162         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
6163         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
6164         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
6165         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
6167 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
6169         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
6170         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
6171         operation if possible.
6173         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
6174         like jumping over the lock prefix.
6176 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
6178         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
6179         locking macros.  No distinction between normal and mutex locking
6180         anymore.
6181         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6182         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
6183         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
6184         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
6185         locking.  Merge bits from lowlevelmutex.S we still need.
6186         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
6187         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
6188         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
6189         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
6190         * Makefile (routines): Remove libc-lowlevelmutex.
6191         (libpthread-rountines): Remove lowlevelmutex.
6192         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
6193         for new mutex implementation.
6194         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6195         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6196         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6197         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6198         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6199         Likewise.
6200         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6201         Likewise.
6202         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
6203         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6204         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
6205         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
6206         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6207         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6208         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
6209         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
6210         Likewise.
6211         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
6212         Likewise.
6213         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
6214         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
6215         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6216         Don't use requeue.
6217         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
6218         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
6220 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
6222         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
6223         in parameters of asm with output parameters.
6225         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
6226         type of DECR parameter to int.
6227         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
6229 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
6231         * tst-attr3.c (tf, do_test): Print stack start/end/size and
6232         guardsize for each thread.
6234 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
6236         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
6237         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
6238         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
6240         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
6241         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
6242         NULL.
6243         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
6244         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
6245         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
6246         (pthread_getaffinity_np): Add hidden_def.
6248         * Makefile (tests): Add tst-attr3.
6249         * tst-attr3.c: New test.
6251         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
6253 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
6255         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
6256         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
6258 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
6260         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
6261         * tst-align.c: Include tst-stack-align.h.
6262         (tf, do_test): Use TEST_STACK_ALIGN macro.
6264 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
6266         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
6267         variable.
6269 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
6271         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
6272         stack-related values for the initial thread.
6274 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
6276         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
6278 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
6280         * pthread_mutex_lock.c: Minor code rearrangements.
6282 2003-09-05  Roland McGrath  <roland@redhat.com>
6284         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
6285         Instead, include ../nptl_db/db_info.c to do its magic.
6286         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
6287         (__pthread_pthread_key_2ndlevel_size): Likewise.
6288         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
6289         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
6290         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
6291         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
6292         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
6293         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
6294         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
6295         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
6296         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
6297         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
6298         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
6299         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
6300         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
6301         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
6302         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
6303         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
6304         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
6306 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
6308         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
6309         of pthread_t to be compatible with LT.
6310         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
6311         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6312         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6313         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6314         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
6315         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6316         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
6318 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
6320         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
6322 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
6324         * unwind-forcedunwind.c: Move to...
6325         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
6326         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
6327         * sysdeps/pthread/jmpbuf-unwind.h: New file.
6328         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
6329         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
6330         * unwind.c: Include jmpbuf-unwind.h.
6331         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
6333 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
6335         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
6336         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
6337         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
6338         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
6339         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
6340         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
6341         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
6342         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
6343         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
6344         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
6345         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
6346         function.
6347         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
6348         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
6349         * Makefile (tests): Add tst-stack2.
6350         * tst-stack2.c: New test.
6351         * tst-stack1.c: Include limits.h and sys/param.h.
6352         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
6354         * pthread_condattr_setpshared.c: Include errno.h.
6355         (pthread_condattr_setpshared): Return EINVAL if pshared
6356         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
6358         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
6359         defined symbol for entry point to avoid cancellation.
6360         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
6361         Likewise.
6362         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
6363         Likewise.
6364         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
6365         Likewise.
6366         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
6367         Likewise.
6368         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
6369         Likewise.
6370         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
6371         __close_nocancel, __read_nocancel, __write_nocancel,
6372         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
6373         libpthread.so or librt.so, define to corresponding function
6374         without _nocancel suffix.
6375         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
6376         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
6377         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
6379         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
6381 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
6383         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
6384         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
6386         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
6387         in subsections has a symbol associated with it.
6389         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
6390         defined symbol for entry point to avoid cancellation.
6391         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
6393 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
6395         * Makefile (tests): Add tst-tls5.
6396         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
6397         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
6398         ($(objpfx)tst-tls5): New.
6399         ($(objpfx)tst-tls6.out): Likewise.
6400         (tests): Depend on $(objpfx)tst-tls6.out.
6401         * tst-tls3.c: Include stdint.h and pthreaddef.h.
6402         (do_test): Check pthread_self () return value alignment.
6403         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
6404         (tf): Check pthread_self () return value alignment.
6405         * tst-tls5.c: New test.
6406         * tst-tls5.h: New.
6407         * tst-tls5mod.c: New.
6408         * tst-tls5moda.c: New.
6409         * tst-tls5modb.c: New.
6410         * tst-tls5modc.c: New.
6411         * tst-tls5modd.c: New.
6412         * tst-tls5mode.c: New.
6413         * tst-tls5modf.c: New.
6414         * tst-tls6.sh: New test.
6416         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
6417         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
6418         * init.c (pthread_functions): Initialize them.
6419         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
6420         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
6421         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
6422         pthread_cond_timedwait@@GLIBC_2.3.2.
6424 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
6426         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
6427         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
6428         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
6429         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
6430         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
6431         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
6433         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
6435         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
6436         _POSIX_THREAD_PRIORITY_SCHEDULING.
6437         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
6439 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
6441         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
6442         nested function, use static inline function from libio.h.
6443         Code by Richard Henderson.
6445         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
6446         weak.
6448 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
6450         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
6451         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
6452         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
6453         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
6454         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
6455         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
6456         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
6457         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
6458         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
6459         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
6460         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
6461         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
6462         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
6463         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
6464         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
6465         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
6466         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
6467         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
6468         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
6469         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
6470         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
6471         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
6472         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
6473         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
6474         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
6475         * sysdeps/sparc/tls.h: New file.
6476         * sysdeps/sparc/tcb-offsets.sym: New file.
6477         * sysdeps/sparc/Makefile: New file.
6478         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
6479         * init.c [__sparc__] (__NR_set_tid_address): Define.
6481 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
6483         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
6484         _IO_release_lock): Define.
6486 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
6488         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
6489         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
6491 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
6493         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
6494         (__pthread_cleanup_class): Add missing return types of member
6495         functions.
6497 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
6499         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6500         (lll_mutex_unlock_force): Add memory barrier between store and futex
6501         syscall.
6503 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
6505         * tst-cancel4.c (do_test): Also unlink tempfname and remove
6506         tempmsg in first loop.
6508 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
6510         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
6511         _POSIX_THREAD_PRIORITY_SCHEDULING.
6512         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
6514 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
6516         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
6517         (__rtld_lock_default_lock_recursive,
6518         __rtld_lock_default_unlock_recursive): Define.
6519         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
6520         __rtld_lock_unlock_recursive): Define using
6521         GL(_dl_rtld_*lock_recursive).
6522         * init.c (__pthread_initialize_minimal_internal): Initialize
6523         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
6524         Lock GL(_dl_load_lock) the same number of times as
6525         GL(_dl_load_lock) using non-mt implementation was nested.
6527         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
6528         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
6530 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
6532         * tst-cancel17.c (do_test): Make len2 maximum of page size and
6533         PIPE_BUF.
6535 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
6537         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
6539 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
6541         * sysdeps/pthread/createthread.c (do_clone): Move error handling
6542         to first syscall error check.  Move syscall error check for tkill
6543         into __ASSUME_CLONE_STOPPED #ifdef.
6545 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
6547         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
6548         is not defined, do explicit synchronization.
6549         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
6550         is not defined also unlock pd->lock for non-debugging case in case
6551         it is necessary.
6552         * pthread_create.c (start_thread): Always get and release pd->lock
6553         if __ASSUME_CLONE_STOPPED is not defined.
6554         (start_thread_debug): Removed.  Adjust users.
6555         * allocatestack.c (allocate_stack): Always initialize lock if
6556         __ASSUME_CLONE_STOPPED is not defined.
6557         * Makefile (tests): Add tst-sched1.
6558         * tst-sched1.c: New file.
6560         * sysdeps/pthread/createthread.c (do_clone): Only use
6561         sched_setschduler and pass correct parameters.
6563 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6565         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
6566         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
6567         PTHREAD_STACK_MIN in comments.
6569 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6571         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
6572         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
6573         argument.
6574         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
6575         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
6576         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
6577         (__pthread_cleanup_upto): Fix prototype.
6578         (_longjmp_unwind): Adjust caller.
6579         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
6580         Change second argument to const struct pointer.
6581         * tst-sem8.c (main): Remove unused s2 and s3 variables.
6582         * tst-sem9.c (main): Likewise.
6583         * unwind.c: Include string.h for strlen prototype.
6585 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
6587         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6588         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
6589         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
6590         Define HAVE_CMOV.
6591         Patch by Nicholas Miell <nmiell@attbi.com>.
6593 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
6595         * init.c (__pthread_initialize_minimal_internal): Initialize
6596         GL(dl_init_static_tls).
6597         * pthreadP.h (__pthread_init_static_tls): New prototype.
6598         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
6599         New functions.
6600         * Makefile (tests): Add tst-tls4.
6601         (modules-names): Add tst-tls4moda and tst-tls4modb.
6602         ($(objpfx)tst-tls4): Link against libdl and libpthread.
6603         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
6604         tst-tls4modb.so.
6605         * tst-tls4.c: New file.
6606         * tst-tls4moda.c: New file.
6607         * tst-tls4modb.c: New file.
6609 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
6611         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
6612         before __timer_dealloc.
6613         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
6614         Don't call list_unlink.
6616 2003-07-29  Roland McGrath  <roland@redhat.com>
6618         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
6620 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
6622         * tst-cancel17.c (do_test): Check if aio_cancel failed.
6623         Don't reuse struct aiocb A if it failed.
6624         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
6625         not just one byte, as that does not block.
6627 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
6629         * sysdeps/pthread/unwind-resume.c: New file.
6630         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
6631         unwind-resume in csu subdir.
6632         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
6633         exceptions.
6634         (librt-sysdep_routines, librt-shared-only-routines): Add
6635         rt-unwind-resume.
6636         * sysdeps/pthread/rt-unwind-resume.c: New file.
6637         * unwind-forcedunwind.c: New file.
6638         * Makefile (libpthread-routines): Add unwind-forcedunwind.
6639         (libpthread-shared-only-routines): Likewise.
6640         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
6641         * pthreadP.h (pthread_cancel_init): New prototype.
6642         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
6644         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
6645         attr argument const struct pthread_attr *.
6647         * res.c (__res_state): Return __resp.
6648         * descr.h: Include resolv.h.
6649         (struct pthread): Add res field.
6650         * pthread_create.c: Include resolv.h.
6651         (start_thread): Initialize __resp.
6652         * Makefile (tests): Add tst-_res1.
6653         (module-names): Add tst-_res1mod1, tst-_res1mod2.
6654         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
6655         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
6656         libpthread.
6657         * tst-_res1.c: New file.
6658         * tst-_res1mod1.c: New file.
6659         * tst-_res1mod2.c: New file.
6661 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
6663         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
6665         * Makefile: Define various *-no-z-defs variables for test DSOs
6666         which has undefined symbols.
6668 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
6670         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
6671         Retry if the stwcx fails to store once_control.
6673 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
6675         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
6676         pthread_attr_setaffinity.
6677         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
6678         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
6679         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
6680         * pthread_attr_destroy.c: Free cpuset element if allocated.
6681         * pthread_create.c: Pass iattr as additional parameter to
6682         create_thread.
6683         * sysdeps/pthread/createthread.c: If attribute is provided and
6684         a new thread is created with affinity set or scheduling parameters,
6685         start thread with CLONE_STOPPED.
6686         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
6687         pthread_attr_setaffinity.
6688         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
6689         cpuset element.
6691 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
6693         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
6695 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
6697         * sysdeps/pthread/configure.in: Require CFI directives also for
6698         ppc and s390.
6700 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
6702         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
6703         Add cfi directives.
6705 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6707         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
6708         CLEANUP_JMP_BUF.
6709         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
6710         registers as variables.  Call __pthread_mutex_unlock_usercnt.
6711         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6712         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
6713         not self pointer in __writer.  Compare with TID to determine
6714         deadlocks.
6715         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6716         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
6717         Likewise.
6718         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
6719         Likewise.
6720         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
6721         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
6722         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
6723         macros also when compiling librt.
6725 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
6727         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
6728         -fasynchronous-unwind-tables.
6729         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
6730         (PSEUDO): Add cfi directives.
6731         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
6732         Likewise.
6733         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
6734         Likewise.
6736 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
6738         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
6739         __pthread_unregister_cancel): Add prototypes and hidden_proto.
6740         * unwind.c (__pthread_unwind_next): Add hidden_def.
6741         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
6742         Likewise.
6743         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
6744         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
6745         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
6746         Likewise.
6747         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
6748         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
6749         Likewise.
6750         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
6751         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
6752         __pthread_unregister_cancel and __pthread_unwind_next.
6754 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
6756         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
6757         different symbol for the cancellation syscall wrapper and
6758         non-cancellation syscall wrapper.
6759         (PSEUDO_END): Define.
6761 2003-07-05  Richard Henderson  <rth@redhat.com>
6763         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
6764         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
6765         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6766         return actual return value from the syscall, not 0.
6768 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
6770         * descr.h (struct pthread): Add pid field.
6771         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
6772         (__reclaim_stacks): Likewise.
6773         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
6774         also check for PID of the signal source.
6775         (__pthread_initialize_minimal_internal): Also initialize pid field
6776         of initial thread's descriptor.
6777         * pthread_cancel.c: Use tgkill instead of tkill if possible.
6778         * sysdeps/unix/sysv/linux/fork.c: Likewise.
6779         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
6780         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
6781         * sysdeps/unix/sysv/linux/raise.c: Likewise.
6783 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
6785         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
6786         Fix use of parameter.
6787         (__libc_cleanup_pop): Likewise.
6789 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
6791         * init.c (sigcancel_handler): Change parameters to match handler
6792         for SA_SIGACTION.  Check signal number and code to recognize
6793         invalid invocations.
6795 2003-07-03  Roland McGrath  <roland@redhat.com>
6797         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
6798         Apply sizeof (struct pthread) bias to r13 value.
6800 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
6802         * sysdeps/pthread/configure.in: Require CFI directives.
6804         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
6805         definition.
6806         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
6807         libpthread compilation.
6808         * unwind.c (__pthread_unwind): Add hidden_def.
6809         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
6811 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6813         * libc-cancellation.c (__libc_cleanup_routine): Define.
6814         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
6815         (__pthread_cleanup_pop): Define.
6817 2003-07-01  Richard Henderson  <rth@redhat.com>
6819         * sysdeps/alpha/elf/pt-initfini.c: New file.
6820         * sysdeps/alpha/pthread_spin_lock.S: New file.
6821         * sysdeps/alpha/pthread_spin_trylock.S: New file.
6822         * sysdeps/alpha/pthreaddef.h: New file.
6823         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
6824         * sysdeps/alpha/tls.h: New file.
6825         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
6826         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
6827         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
6828         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
6829         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
6830         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
6831         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
6832         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
6833         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
6834         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
6836 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6838         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
6839         cleanup support and unwind info.
6841 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
6843         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
6844         Use correct cleanup handler registration.  Add unwind info.
6845         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
6846         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
6847         * tst-once3.c: Add cleanup handler and check it is called.
6848         * tst-once4.c: Likewise.
6849         * tst-oncex3.c: New file.
6850         * tst-oncex4.c: New file.
6851         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
6853 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
6855         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
6857 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
6859         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
6860         (tf_msgsnd): Likewise.
6862         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
6863         premature returns a bit more.
6865 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
6867         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
6868         definition to the front.
6870         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
6871         the cleanup functions to make the names unique.  Fix dwarf opcode
6872         un unwind table.
6873         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
6874         functions to make the names unique.  Fix CFA offset for two blocks.
6876 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
6878         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
6879         missing closing braces.
6880         Patch by Christophe Saout <christophe@saout.de>.
6882 2003-06-24  Roland McGrath  <roland@redhat.com>
6884         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
6886 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
6888         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
6889         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
6891         * pthreadP.h: Declare __find_thread_by_id.
6892         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
6893         * pthread_clock_gettime.c: Allow using other thread's clock.
6894         * pthread_clock_settime.c: Likewise.
6895         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
6896         * Makefile: Add rules to build and run tst-clock2.
6897         * tst-clock2.c: New file.
6899 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
6901         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
6902         to use exception-based cleanup handler.
6903         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6905         * tst-cond8.c (ch): Announce that we are done.
6907         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
6909         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
6910         Also test aio_suspend with timeout value.
6912 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
6914         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
6915         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
6916         attribute_hidden.
6918         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
6919         (__pthread_mutex_lock_internal): Likewise.
6920         (__pthread_mutex_unlock_internal): Likewise.
6921         (__pthread_mutex_unlock_usercnt): Declare.
6922         * pthread_mutex_destroy.c: Always fail if used in any way.
6923         * pthread_mutex_init.c: Update comment.
6924         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
6925         * pthread_mutex_timedlock.c: Adjust __nusers.
6926         * pthread_mutex_trylock.c: Adjust __nusers.
6927         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
6928         and public interfaces are wrapper with pass additional parameter.
6929         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
6930         parameter zero.
6931         * tst-mutex8.c: New file.
6932         * Makefile (tests): Add tst-mutex8.
6933         * sysdeps/pthread/pthread_cond_timedwait.c: Call
6934         __pthread_mutex_unlock_usercnt.
6935         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6936         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6937         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6938         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6939         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6940         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
6941         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6942         Add __nusers.
6943         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6944         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6945         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6946         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6947         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6949         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
6950         * pthread_mutex_timedlock.c: Likewise.
6951         * pthread_mutex_trylock.c: Adjust __nusers.
6952         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
6953         * tst-mutex9.c: New file.
6954         * Makefile (tests): Add tst-mutex9.
6955         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
6956         * sysdeps/ia64/tls.h: Likewise.
6957         * sysdeps/powerpc/tls.h: Likewise.
6958         * sysdeps/s390/tls.h: Likewise.
6959         * sysdeps/sh/tls.h: Likewise.
6960         * sysdeps/x86_64/tls.h: Likewise.
6961         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6962         Change type of __owner.
6963         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6964         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6965         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6966         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6967         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6969 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
6971         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
6972         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
6974         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
6975         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
6976         instead of nr to lll_futex_wake.  Only set errno and return -1
6977         if err < 0.
6979         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
6980         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6981         return actual return value from the syscall, not 0.
6983 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
6985         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
6986         find a random value.
6987         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
6988         errno==EIDRM.
6990         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
6991         compat_timer_settime.
6992         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
6993         compat_timer_gettime.
6994         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
6995         compat_timer_getoverrun.
6996         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
6997         compat_timer_delete.
6999         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
7000         error-checking mutex detect busy mutexes.
7002 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
7004         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
7005         Add ax to clobber list.
7006         (lll_mutex_cond_lock): Likewise.
7007         (lll_mutex_unlock): Likewise.
7008         (lll_lock): Likewise.
7009         (lll_unlock): Likewise.
7011         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
7012         * tst-cancel18.c: New file.
7013         * tst-cancelx18.c: New file.
7015         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
7016         and tcdrain.
7018         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
7019         * tst-cancel17.c: New file.
7020         * tst-cancelx17.c: New file.
7022         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
7023         * sysdeps/unix/sysv/linux/sigwait.c: New file.
7024         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
7026         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
7028 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
7030         * sysdeps/pthread/createthread.c (create_thread): Set
7031         header.multiple_threads unconditionally.
7032         * allocatestack.c (allocate_stack): Likewise.
7033         * descr.h (struct pthread): Add header.multiple_threads
7034         unconditionally.
7035         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
7036         Define for librt.  #error if neither libpthread, libc nor librt.
7037         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
7038         Likewise.
7039         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
7040         CDISABLE): Likewise.
7041         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
7042         CDISABLE): Likewise.
7043         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
7044         CDISABLE): Likewise.
7045         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
7046         CDISABLE): Likewise.  Access header.multiple_threads outside of
7047         libc and libpthread.
7048         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
7049         Likewise.
7050         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
7051         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
7053 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
7055         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
7056         Also test early cancellation before the thread reaches the cancellation
7057         point.
7059         * Makefile: Compile forward.c with exceptions.
7061         * sysdeps/unix/sysv/linux/sleep.c: New file.
7063 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
7065         * Makefile: Add CFLAGS definition to compile function wrappers
7066         duplicated from libc with exceptions.
7067         * tst-cancel4.c: Also check cancellation handlers.
7069         * Makefile: Add rules to build and run tst-cancel16 and
7070         tst-cancelx16.  Add missing CFLAGS definitions.
7071         * tst-cancel16.c: New file.
7072         * tst-cancelx16.c: New file.
7074 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
7076         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
7077         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
7078         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
7079         (DL_SYSINFO_IMPLEMENTATION): Likewise.
7081         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
7082         (LIBC_CANCEL_RESET): Likewise.
7083         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
7084         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
7085         librt-cancellation.
7086         (CFLAGS-libcrt-cancellation.c): Define.
7087         * sysdeps/pthread/librt-cancellation.c: New file.
7088         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
7089         macros also when compiling librt.
7090         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
7091         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
7092         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
7093         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
7094         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
7095         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
7096         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
7098         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
7099         compat_timer_create.
7101 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
7103         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
7105         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
7106         __register_atfork.
7107         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
7108         Add libc_hidden_def.
7110 2003-06-13  Roland McGrath  <roland@redhat.com>
7112         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
7113         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
7115 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
7117         * allocatestack.c (queue_stack): Always inline.
7118         * ptreadhP.h (__do_cancel): Likewise.
7120 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
7122         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
7123         a typo.
7125 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
7127         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7128         (__pthread_cond_signal): Remove incorrect second addition for
7129         cond_lock!=0.
7131 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
7133         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7134         (__pthread_cond_signal): Use correct futex pointer in
7135         __lll_mutex_lock_wait call.
7137         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7138         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
7140 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
7142         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
7143         cancelable.
7144         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
7145         Likewise.
7147         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
7148         hand-written CFI generation code.  Since ENTRY/END also initiated
7149         CFI frames this caused two CFI sets to be generated.
7151 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
7153         * cleanup_routine.c: New file.
7154         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
7155         * sysdeps/pthread/pthread.h: Add support for fully exception-based
7156         cleanup handling.
7157         * Makefile (libpthread-routines): Add cleanup_routine.
7158         Add more CFLAGS variables to compile with exceptions.  Add comments
7159         why which file needs unwind tables.
7160         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
7161         tests.
7162         * tst-cancelx1.c: New file.
7163         * tst-cancelx2.c: New file.
7164         * tst-cancelx3.c: New file.
7165         * tst-cancelx4.c: New file.
7166         * tst-cancelx5.c: New file.
7167         * tst-cancelx6.c: New file.
7168         * tst-cancelx7.c: New file.
7169         * tst-cancelx8.c: New file.
7170         * tst-cancelx9.c: New file.
7171         * tst-cancelx10.c: New file.
7172         * tst-cancelx11.c: New file.
7173         * tst-cancelx12.c: New file.
7174         * tst-cancelx13.c: New file.
7175         * tst-cancelx14.c: New file.
7176         * tst-cancelx15.c: New file.
7177         * tst-cleanupx0.c: New file.
7178         * tst-cleanupx0.expect: New file.
7179         * tst-cleanupx1.c: New file.
7180         * tst-cleanupx2.c: New file.
7181         * tst-cleanupx3.c: New file.
7183         * tst-cleanup0.c: Make standard compliant.
7184         * tst-cleanup1.c: Likewise.
7186         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
7187         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
7188         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
7189         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
7190         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7191         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7192         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
7193         CLEANUP_JMP_BUF.
7194         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7195         * tst-cancel12.c: New file.
7196         * tst-cancel13.c: New file.
7197         * tst-cancel14.c: New file.
7198         * tst-cancel15.c: New file.
7199         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
7200         and tst-cancel15.
7202         * tst-cancel1.c: Add some comments.
7204         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
7205         timeout correctly.
7207 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
7209         * Makefile (CFLAGS-pthread_cancel.c): Define.
7211 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
7213         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
7214         Change type of __writer element to int.
7215         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7216         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7217         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7218         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7219         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7220         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
7221         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7222         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
7223         Compare with TID to determine deadlocks.
7224         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
7225         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
7226         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
7227         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
7228         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
7229         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7230         Likewise.
7231         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7232         Likewise.
7233         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7234         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
7235         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
7236         Likewise.
7237         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
7238         Likewise.
7239         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
7240         * Makefile (tests): Add tst-rwlock12.
7241         * tst-rwlock12.c: New file.
7243 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
7245         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
7246         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
7247         Remove bogus hidden_proto.
7248         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
7249         Likewise.
7250         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
7251         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
7252         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
7253         ___lll_mutex_timedlock): Likewise.
7255 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
7257         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
7258         (__pthread_cond_signal): Add some code to eventually handle
7259         cond_lock!=0.
7261 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
7263         * Makefile (tests): Add tst-exec4.
7264         (tst-exec4-ARGS): Define.
7265         * tst-exec4.c: New file.
7267 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
7269         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
7270         Also fail if tv_nsec < 0.
7271         (__lll_timedwait_tid): Likewise.
7272         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
7273         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
7274         Likewise.
7275         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
7276         Likewise.
7277         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
7278         Likewise.
7279         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
7280         Likewise.
7281         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
7282         Likewise.
7283         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
7284         Likewise.
7286         * Makefile (tests): Add tst-sem8 and tst-sem9.
7287         * tst-sem8.c: New file.
7288         * tst-sem9.c: New file.
7289         * sem_open.c: Fix creation of in_use record if the file exists but
7290         no internal record.
7292         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
7293         definitions.
7295         * sysdeps/pthread/timer_create.c (timer_create): In case
7296         evp==NULL, assign timer ID to sival_ptr.
7298         * descr.h (struct pthread_unwind_buf): Change type of prev element to
7299         struct pthread_unwind_buf *.
7300         (struct pthread): Likewise for cleanup_jmp_buf element.
7302         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
7303         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
7304         * unwind.c (__pthread_unwind_next): Likewise.
7306 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
7308         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7309         (lll_futex_timed_wait): Use int for futex value parameter.
7310         (lll_futex_wake): Likewise.
7311         (lll_futex_requeue): Likewise.
7313         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
7314         Replace one memory operation with one register operation.
7316         * tst-join4.c (do_test): Fix error message.
7318         * tst-rwlock6.c (do_test): Use correct format specifier.
7320         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
7321         (__lll_mutex_lock_wait): Replace one memory operation with one
7322         register operation.
7323         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
7324         (__lll_mutex_lock_wait): Likewise.
7326         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7327         (__lll_mutex_cond_lock): Add one to value parameter of
7328         __lll_lock_wait to reflect reality in the futex syscall.
7329         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
7330         (lll_mutex_cond_lock): Likewise.
7332 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
7334         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
7335         New function.
7336         (lll_mutex_cond_lock): Define.
7338 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
7340         * Makefile (tests): Add tst-signal6.
7341         * tst-signal6.c: New file.
7343         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
7344         (__lll_mutex_unlock_force): New function
7345         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
7347         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7348         (__lll_mutex_unlock_force): New function.
7349         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
7351         * tst-rwlock7.c (do_test): Use correct format specifier.
7353         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
7354         Find break parameter in correct asm argument.
7356 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
7358         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
7359         Remove out4.
7360         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
7361         error occured.
7362         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
7363         Add __mutex.
7364         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
7365         lll_futex_requeue, lll_mutex_unlock_force): Define.
7367 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
7369         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7370         (pthread_cond_t): Add __mutex.
7371         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
7372         lll_futex_requeue, lll_mutex_unlock_force): Define.
7374 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7376         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
7377         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
7378         Add __mutex field.
7379         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
7380         Define.
7381         (lll_futex_wait, lll_futex_wake): Define.
7382         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
7383         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
7384         FUTEX_REQUEUE instead of FUTEX_WAIT.
7385         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
7386         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
7387         mutex which was used in condvar structure.  Call
7388         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
7389         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
7391         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
7392         include tcb-offsets.h.  Read wakeup value in locked region.
7393         Use the value of gbr register as THREAD_ID.
7394         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7395         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7396         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7398         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
7399         macros.
7401 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
7403         * sysdeps/pthread/pthread_cond_broadcast.c
7404         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
7406 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
7408         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
7409         typo in register name.
7410         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
7411         correctly.  Actually use requeue.  Little optimization.
7412         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
7413         mutex address early.  Handle cancellation state as 32-bit value.
7414         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7415         Remove unnecessary label.
7417 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
7419         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
7420         instead of FUTEX_WAIT.
7421         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
7422         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
7423         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
7424         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
7425         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
7426         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
7427         used in condvar structure.  Call __pthread_mutex_cond_lock instead
7428         of __pthread_mutex_lock_internal.
7429         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7430         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7431         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7432         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
7433         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7434         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7435         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
7436         Add pthread_mutex_cond_lock.
7437         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
7438         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
7439         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
7440         lll_mutex_cond_lock.
7441         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
7442         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7443         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
7444         Add __mutex field.
7445         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7446         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7448         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
7449         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
7451         * pthreadP.h: Declare __pthread_mutex_cond_lock.
7452         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
7453         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
7454         macro don't define aliases.
7456         * cancellation.c: Remove __pthread_enable_asynccancel_2.
7457         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
7458         * sysdeps/pthread/pthread_cond_timedwait.c: Use
7459         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
7460         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7461         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7462         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
7463         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7464         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7466 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
7468         * sem_open.c: Fix one endless loop.  Implement correct semantics
7469         wrt opening the same semaphore more then once.
7470         * sem_close.c: Adjust for sem_open change.
7471         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
7472         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
7473         * Makefile (tests): Add tst-sem7.
7474         * tst-sem7.c: New file.
7476 2003-05-16  Roland McGrath  <roland@redhat.com>
7478         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
7479         uninitialized variable braino.
7481 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
7483         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
7484         test for syscall availability.
7486         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
7487         __no_posix_timers to -1 if the syscalls don't exist.
7489         * pthread_join.c (pthread_join): Set tid field of the joined
7490         thread to -1.  This isn't necessary but helps to recognize some
7491         error conditions with almost no cost.
7493         * allocatestack.c (FREE_P): Also negative values indicate an
7494         unused stack.
7496         * unwind.c: Include <unistd.h>.
7498 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
7500         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
7502 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
7504         * Makefile (crti-objs, crtn-objs): New variables.
7505         (omit-deps, extra-objs): Add crtn.
7506         ($(objpfx)libpthread.so): Depend on both crti and crtn
7507         and links to them in multidir.
7508         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
7510 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
7512         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
7513         (lll_mutex_unlock): Use atomic_exchange_rel.
7515 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
7517         * cond-perf.c (cons): Add missing locking around setting of alldone.
7519 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
7521         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
7522         related macros.
7523         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7525 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
7527         * tst-sem6.c: New file.
7528         * Makefile (tests): Add tst-sem6.
7530         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
7531         Use atomic_exchange_rel instead of atomic_exchange.
7532         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
7533         Likewise.
7535         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
7536         code for lll_futex_wait and lll_futex_wake in static apps.  Use
7537         vsyscall is possible.
7539         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
7540         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
7541         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
7542         pthread_setaffinity_np.
7543         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
7544         and pthread_setaffinity_np.
7545         * Makefile (libpthread-routines): Add pthread_getaffinity and
7546         pthread_setaffinity.
7548         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
7549         use it in case mmap to allocate the stack fails.
7550         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
7551         ARCH_MAP_FLAGS here.
7552         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
7553         ARCH_RETRY_MMAP.
7555 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
7557         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
7558         handler implementation.  It is now lockless in fork().
7559         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
7560         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
7561         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
7562         declare the __fork_*_lists.
7563         (struct fork_handler): Include pointers to all three functions.
7564         Add next, refcntr and need_signal elements.
7565         (__fork_handlers): New declaration.
7566         (__register_atfork_malloc): Remove declaration.
7567         (HAVE_register_atfork_malloc): Remove definition.
7568         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
7569         __pthread_child_handler variable.
7570         (__libc_pthread_init): Use __register_atfork instead of explicitly
7571         adding to the list.
7572         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
7573         and lll_futex_wake.
7574         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7576         * unwind.c (unwind_cleanup): Print error message and then abort.  This
7577         function must never be reached.
7579         * cond-perf.c: New file.
7581 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
7583         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
7585 2003-05-04  Roland McGrath  <roland@redhat.com>
7587         * Makefile ($(objpfx)../libc.so): New target.
7589 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
7591         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7592         (pthread_condattr_t): Size is only an int, don't use long for
7593         alignment.
7594         (pthread_mutexattr_t): Likewise.
7595         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7596         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7597         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7599 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
7601         * sysdeps/i386/tls.h: Define THREAD_ID.
7602         * sysdeps/ia64/tls.h: Likewise.
7603         * sysdeps/powerpc/tls.h: Likewise.
7604         * sysdeps/s390/tls.h: Likewise.
7605         * sysdeps/sh/tls.h: Likewise.
7606         * sysdeps/x86_64/tls.h: Likewise.
7607         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
7608         record ownership.
7609         * pthread_mutex_timedlock.c: Likewise.
7610         * pthread_mutex_trylock.c: Likewise.
7611         * pthread_mutex_unlock.c: Likewise.
7612         * pthread_rwlock_trywrlock.c: Likewise.
7613         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
7614         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
7615         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
7616         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
7618         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
7619         flag.
7621 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
7623         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7624         (__SIZEOF_PTHREAD_COND_T): Define to 48.
7625         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
7626         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
7627         Make __align long long instead of long.
7628         (pthread_rwlock_t): Formatting.
7629         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
7630         (pthread_rwlock_t): Formatting.
7631         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7632         (pthread_cond_t): Make __align long long instead of long.
7633         (pthread_rwlock_t): Move __flags field to the same position as in
7634         linuxthreads.
7636 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
7638         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
7639         * tst-rwlock7.c (do_test): Likewise.
7641 2003-04-26  Roland McGrath  <roland@redhat.com>
7643         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
7645 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
7647         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
7648         sizeof (struct pthread).
7649         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
7650         1 struct pthread.
7651         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
7652         to 0.
7653         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
7654         struct pthread.
7655         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
7656         to 32-bit bytes.
7657         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
7658         tcbp.
7659         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
7660         unneccessarily.
7661         (NO_TLS_OFFSET): Define.
7662         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
7663         add TLS_TCB_SIZE unnecessarily.
7665 2003-04-22  Roland McGrath  <roland@redhat.com>
7667         * Makeconfig (shared-thread-library): Reverse link order to work
7668         around linker bug.
7670 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
7672         * semaphore.h: Fix typo in comment.
7674 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
7676         * sysdeps/pthread/sigfillset.c: New file.
7678         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
7679         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
7680         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
7681         * sysdeps/pthread/sigaction.c: Likewise.
7682         * sysdeps/pthread/sigprocmask.c: New file.
7683         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
7684         __SIGRTMIN+1.
7685         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7686         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
7687         in this case.
7689 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
7691         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
7692         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
7694         * sysdeps/unix/sysv/linux/unregister-atfork.c
7695         (__unregister_atfork): Don't free memory not allocated dynamically.
7697         * semaphore.h: Remove __THROW marker from cancellation points.
7698         * nptl/sysdeps/pthread/pthread.h: Likewise.
7700 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
7702         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
7703         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
7704         __THROW.
7706 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
7708         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
7710 2003-04-15  Roland McGrath  <roland@redhat.com>
7712         * forward.c (__pthread_unwind): Tweak to avoid warning.
7714 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
7716         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
7718 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
7720         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
7721         overflow CFA advance instructions.
7722         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7724 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
7726         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
7727         * sysdeps/i386/pthread_spin_lock.c: Likewise.
7728         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
7729         defined.
7731         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
7732         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
7733         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
7734         DW_CFA_advance_loc for .Laddl-.Lsubl.
7736 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
7738         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
7739         position-independent unwind data for static libraries.
7740         Add missing unwind info.  Add comments.
7742         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
7743         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7744         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7745         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7747 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
7749         * Makefile: Make sure all cancellation points are compiled with
7750         exception and asynchronous unwind tables.
7752         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
7753         which mishandles loading of global object addresses in PIC.
7754         (THREAD_SETMEM_NC): Likewise.
7756 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7758         * pthread.h: Define new data structure for cleanup buffer.  Declare
7759         new cleanup handler interfaces.
7760         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
7761         (struct pthread): Add cleanup_jmp_buf pointer.  Define
7762         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
7763         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
7764         it.  Declare old cleanup handler installation functions.
7765         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
7766         handling.
7767         * cleanup_defer.c: Likewise.
7768         * cleanup_compat.c: New file.  Old cleanup code.
7769         * cleanup_def_compat.c: New file.  Old cleanup code.
7770         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
7771         if own thread descriptor.
7772         * unwind.c: New file.
7773         * forward.c: Add __pthread_unwind.
7774         * init.c (pthread_functions): Add __pthread_unwind.
7775         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
7776         Add ptr___pthread_unwind.
7777         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
7778         and unwind function.
7779         * Makefile (libpthread-routines): Add cleanup_compat,
7780         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
7781         table generation if necessary.
7782         * version.c: Record whether unwind support is compiled in.
7783         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
7784         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
7785         handler interfaces.
7786         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
7787         complication to generate unwind information for syscall wrappers.
7788         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
7789         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
7790         __cleanup_fct_attribute.
7792         * Makefile: Add rules to build and run tst-cleanup0.
7793         * tst-cleanup0.c: New file.
7794         * tst-cleanup0.expect: New file.
7796         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
7797         caller.  Optimize to avoid often unecessary local variable.
7799 2003-04-11  Roland McGrath  <roland@redhat.com>
7801         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
7802         sets variable `multidir'; include that.
7803         (generated): Add it.
7804         ($(objpfx)$(multidir)/crti.o): New target.
7805         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
7807 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7809         * tst-attr2.c (do_test): Add cast to avoid warning.
7810         * tst-mutex4.c (do_test): Likewise.
7812 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
7814         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
7815         in child.
7817 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
7819         * Makefile (tests): Add tst-detach1.
7820         * tst-detach1.c: New file.
7822 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
7824         * sysdeps/pthread/pthread.h: Remove duplicate
7825         pthread_cleanup_{push,pop} definitions.
7827         * tst-barrier2.c: Eliminate warnings.
7828         * tst-cancel4.c: Likewise.
7829         * tst-cond4.c: Likewise.
7830         * tst-cond6.c: Likewise.
7831         * tst-detach1.c: Likewise.
7832         * tst-rwlock4.c: Likewise.
7833         * tst-rwlock6.c: Likewise.
7834         * tst-rwlock7.c: Likewise.
7835         * tst-sem3.c: Likewise.
7836         * tst-spin2.c: Likewise.
7837         * tst-umask1.c: Likewise.
7839 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
7841         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
7843 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
7845         * descr.h (struct pthread): Move cancelhandling member to the front.
7847 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
7849         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
7850         malloc_parent, and malloc_child statically.
7851         (__register_atfork_malloc): New function.
7852         (free_mem): Don't free any of the malloc_* variables on the list.
7853         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
7854         Define HAVE_register_atfork_malloc.
7856 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
7858         * sysdeps/pthread/createthread.c (create_thread): Add some more
7859         comments explaining when to set multiple_threads and when not.
7861         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7862         THREAD_ATOMIC_BIT_SET if not already defined.
7863         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7864         THREAD_ATOMIC_BIT_SET:
7865         * sysdeps/x86_64/tls.h: Likewise.
7866         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
7867         THREAD_ATOMIC_CMPXCHG_VAL.
7868         (_pthread_cleanup_pop_restore): Likewise.
7869         * cancellation.c (__pthread_enable_asynccancel): Likewise.
7870         (__pthread_enable_asynccancel_2): Likewise.
7871         (__pthread_disable_asynccancel): Likewise.
7872         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7873         (__libc_disable_asynccancel): Likewise.
7874         * init.c (sigcancel_handler): Likewise.
7875         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
7876         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
7878 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
7880         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
7881         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7882         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
7883         * Makefile (tests): Add tst-cancel11.
7884         * tst-cancel11.c: New file.
7886 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
7888         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
7889         round, not the first.  Use specific_used flag instead of local
7890         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
7891         (__free_tcb): Don't call deallocate_tsd here.
7892         (start_thread): Call deallocate_tsd here.
7893         * pthread_setspecific.c: Set specific_used flag really only when
7894         needed.
7895         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
7896         * tst-tsd3.c: New file.
7897         * tst-tsd4.c: New file.
7899 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7901         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
7902         Use atomic_exchange_and_add instead of __lll_add.
7903         (__lll_mutex_timedlock): Likewise.
7904         Patch by Ian Wienand.
7906 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
7908         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7909         (SINGLE_THREAD_P): Fix typo.
7910         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
7912 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7914         * Makefile (tests): Add tst-align.
7915         * tst-align.c: New file.
7916         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
7918         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
7919         function correctly.
7921         * tst-tsd2.c: Add casts to avoid warnings.
7923 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
7925         * descr.h (struct pthread): Move most often used elements to the front.
7927 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
7929         * Makefile (libpthread-routines): Add pthread_atfork.
7930         (libpthread-static-only-routines): Add pthread_atfork.
7932 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7934         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
7935         of TLS_DTV_AT_TP.
7936         (INSTALL_DTV): Add parens.
7937         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
7938         Use passed descr instead of THREAD_SELF.
7939         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
7940         (__lll_mutex_timedlock_wait): Correct expected value after
7941         spurious wakeup.
7942         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
7943         Release lock before waking up the waiters.
7944         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
7945         criteria.  Reorderstruct passed to cleanup handler.  Fix
7946         handling of cancellation and failung pthread_mutex_unlock call.
7947         Use __pthread_enable_asynccancel_2 instead of
7948         __pthread_enable_asynccancel.
7949         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7950         Return result of lock re-get if it fails.
7951         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
7952         for __pthread_cleanup_push.
7953         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
7954         completely broken rwlock implementation.
7955         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7956         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7957         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7958         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
7959         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7960         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
7961         versioned_symbol macro.
7962         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
7963         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
7965 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
7967         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
7968         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
7969         and __helper_tid.
7970         (struct timer): Remove th and bar field.
7971         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
7972         debugging code.  Create only one helper thread.
7973         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
7974         helper thread.
7975         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7976         Renamed.  Define statically.  Use thread info from siginfo.
7977         (__helper_once): New variable.
7978         (__helper_tid): New variable.
7979         (__reset_helper_control): New function.
7980         (__start_helper_thread): New function.
7982         * pthread_create.c (start_thread): Don't use setjmp inside
7983         __builtin_expect to work around gcc bug.
7985         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
7986         timer_delete syscall fails, but not with ENOSYS, set
7987         __no_posix_timers.
7989         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
7990         (timer_settime): Fix typo.
7991         * sysdeps/unix/sysv/linux/timer_getoverr.c
7992         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
7994 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
7996         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
7997         offset of cleanupbuf.__prev.
7999 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
8001         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
8002         of included file.
8004 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
8006         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
8007         NULL provide default definition to syscall.
8009 2003-03-25  Roland McGrath  <roland@redhat.com>
8011         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
8012         (timer_id2ptr): Fix typo.
8014 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
8016         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
8017         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
8018         * sysdeps/ia64/pthreaddef.h: Likewise.
8019         * sysdeps/powerpc/pthreaddef.h: Likewise.
8020         * sysdeps/s390/pthreaddef.h: Likewise.
8021         * sysdeps/sh/pthreaddef.h: Likewise.
8022         * sysdeps/x86_64/pthreaddef.h: Likewise.
8023         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
8024         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
8025         being changed.
8026         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
8027         SIGTIMER is not unblocked.
8028         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
8029         RT signal taken.
8030         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
8031         be send.
8032         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
8033         pass pointer through as ID.
8034         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
8035         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
8036         * sysdeps/unix/sysv/linux/timer_create.c: New file.
8037         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
8038         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
8039         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
8040         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
8041         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
8042         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
8043         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
8044         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
8045         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
8046         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
8047         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
8048         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
8049         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
8050         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
8051         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
8052         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
8053         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
8054         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
8055         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
8056         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
8057         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
8058         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
8059         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
8060         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
8061         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
8062         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
8063         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
8064         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
8065         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
8066         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
8068         * pthreadP.h: Remove FRAME_LEFT definition.
8069         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
8070         already left frame.  Programs which have this problem are not POSIX
8071         compliant.
8072         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
8074 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
8076         * sysdeps/pthread/tst-timer.c: Check return values of the
8077         functions we test.
8079 2003-03-23  Roland McGrath  <roland@redhat.com>
8081         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
8082         * tst-tls3mod.c: Likewise.
8083         * tst-tls1.c: Likewise.
8084         * tst-tls2.c: Likewise.
8086         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
8087         undefined behavior.
8089         * tst-join5.c (tf1, tf2): Add a cast.
8091         * Makeconfig (includes): Append -I$(..)nptl to this variable.
8093         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
8094         Don't test anything.
8095         * tst-cond4.c: Likewise.
8096         * tst-cond6.c: Likewise.
8097         * tst-flock2.c: Likewise.
8098         * tst-mutex4.c: Likewise.
8099         * tst-rwlock4.c: Likewise.
8100         * tst-signal1.c: Likewise.
8101         * tst-spin2.c: Likewise.
8102         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
8104         * tst-mutex4.c: Use test-skeleton.c.
8105         * tst-spin2.c: Likewise.
8106         * tst-sysconf.c: Likewise.
8107         * tst-barrier2.c: Likewise.
8108         * tst-cond4.c: Likewise.
8109         * tst-cond6.c: Likewise.
8110         * tst-rwlock4.c: Likewise.
8111         * tst-unload.c: Likewise.
8112         * tst-flock2.c (do_test): Use return instead of exit.
8114 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
8116         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
8118 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
8120         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
8121         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
8122         instead of __lll_compare_and_swap.
8123         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
8124         Likewise.
8125         Removed definition if __lll_compare_and_swap.
8127         * cancellation.c: Adjust for new form of compare&exchange macros.
8128         * cleanup_defer.c: Likewise.
8129         * init.c: Likewise.
8130         * libc-cancellation.c: Likewise.
8131         * old_pthread_cond_broadcast.c: Likewise.
8132         * old_pthread_cond_signal.c: Likewise.
8133         * old_pthread_cond_timedwait.c: Likewise.
8134         * old_pthread_cond_wait.c: Likewise.
8135         * pthread_cancel.c: Likewise.
8136         * pthread_create.c: Likewise.
8137         * pthread_detach.c: Likewise.
8138         * pthread_join.c: Likewise.
8139         * pthread_key_delete.c: Likewise.
8140         * pthread_setcancelstate.c: Likewise.
8141         * pthread_setcanceltype.c: Likewise.
8142         * pthread_timedjoin.c: Likewise.
8143         * pthread_tryjoin.c: Likewise.
8144         * sysdeps/pthread/createthread.c: Likewise.
8146 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
8148         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
8149         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
8150         definitions.  Replace uses with calls to atomic_* functions.
8151         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
8152         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
8153         __lll_test_and_set calls with atomic_exchange_and_add and
8154         atomic_exchange calls respectively.
8155         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
8156         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
8157         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
8158         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
8159         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
8160         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
8161         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
8163         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
8164         returns the old value.
8166 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
8168         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
8169         int for variable OLDVAL and correct inline assembler contraint.
8170         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
8171         type int for variable OLD.
8173         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
8174         only for s390-32.
8175         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
8176         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
8177         instead of multiple_threads field in the TCB.
8179 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
8181         * sysdeps/i386/i686/bits/atomic.h: Removed.
8182         * sysdeps/i386/i586/bits/atomic.h: Removed.
8183         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
8184         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
8185         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
8186         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
8187         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
8188         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
8189         * atomic.h: Removed.  Moved to glibc.
8191         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
8192         support for clock selection.
8194         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
8195         signalling waiters.
8197 2003-03-18  Roland McGrath  <roland@redhat.com>
8199         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
8200         Add __lll_rel_instr first.  Add memory clobber.
8201         (lll_mutex_unlock): Use __lll_test_and_set.
8202         From Paul Mackerras <paulus@samba.org>.
8204         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
8205         unconditionally.
8206         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
8207         (SINGLE_THREAD_P):  Add `header.' prefix.
8208         From Paul Mackerras <paulus@samba.org>.
8210         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
8211         pthread_timedjoin_np to ...
8212         (libpthread: GLIBC_2.3.3): ... here.
8213         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
8215         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
8216         Avoid shadowing VAL variable.
8218         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
8219         New macro.
8221 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
8223         * Makefile (tests): Add tst-cond11.
8224         * tst-cond11.c: New file.
8226         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
8227         struct passed to cleanup handler to eliminate one more
8228         instruction.
8229         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8231         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
8232         (pthrad_cond_t): Replace __unused field with __clock.
8234         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
8235         waken all waiters in cleanup handler.
8236         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
8237         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8239         * pthread_condattr_getclock.c: New file.
8240         * pthread_condattr_setclock.c: New file.
8241         * sysdeps/pthread/pthread.h: Declare these new functions.
8242         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
8243         * Makefile (libpthread-routines): Add the new functions.
8244         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
8245         Renamed field to value.  Document use of the bits.
8246         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
8247         change.
8248         * pthread_condattr_setpshared.c: Likewise.
8249         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
8250         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
8251         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
8252         Add __clock field.
8253         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
8254         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
8255         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
8256         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
8257         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
8258         Implement clock selection.
8259         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
8260         * pthread-errnos.sym: Add ENOSYS.
8261         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
8262         _POSIX_CLOCK_SELECTION.
8263         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
8265         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
8266         invalid .size directive.
8268 2003-03-17  Roland McGrath  <roland@redhat.com>
8270         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
8271         Formatting tweaks.
8273 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
8275         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
8276         Use __lll_add instead of spelling it out.  Use protected symbol names.
8277         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
8278         Use __lll_add.
8279         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
8280         Renamed from lll_compare_and_swap.  Use new name where necessary.
8281         (__lll_add): Defined.
8282         (__lll_dec_if_positive): Defined.
8283         (__lll_test_and_set): Defined.
8284         * sysdeps/ia64/pthread_spin_init.c: Removed.
8285         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
8286         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
8287         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
8288         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
8289         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
8290         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
8291         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
8292         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
8293         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
8294         __sync_lock_release_si.
8295         Patch by Jakub Jelinek.
8297         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
8298         Fix timeout handling.
8299         (__lll_timedwait_tid): Likewise.
8300         (lll_unlock_wake_cb): Wake up other waiters if necessary.
8301         Patch by Jakub Jelinek.
8303         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
8305 2003-03-17  Roland McGrath  <roland@redhat.com>
8307         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
8308         * sysdeps/pthread/pthread_spin_init.c: New file.
8309         * sysdeps/pthread/pthread_spin_unlock.c: New file.
8310         * sysdeps/powerpc/Makefile: New file.
8311         * sysdeps/powerpc/pthread_spin_lock.c: New file.
8312         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
8313         * sysdeps/powerpc/pthreaddef.h: New file.
8314         * sysdeps/powerpc/tcb-offsets.sym: New file.
8315         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
8316         * sysdeps/powerpc/tls.h: New file.
8317         * sysdeps/powerpc/bits/atomic.h: New file.
8318         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
8319         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
8320         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
8322         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
8323         * sysdeps/unix/sysv/linux/sem_post.c: New file.
8324         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
8325         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
8326         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
8327         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
8328         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
8329         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
8330         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
8331         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
8332         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
8333         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
8334         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
8335         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
8336         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
8338         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
8339         not gettimeofday.
8340         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
8341         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
8342         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
8343         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
8344         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8346 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
8348         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
8349         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
8350         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8351         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8352         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
8354 2003-03-16  Roland McGrath  <roland@redhat.com>
8356         * tst-fork4.c: Include <string.h>.
8357         * tst-signal2.c: Likewise.
8358         * tst-mutex5.c (do_test): exit -> return.
8359         * tst-mutex2.c: Include <stdlib.h>.
8361 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
8363         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
8364         (__lll_mutex_timedlock_wait): Correct expected value after
8365         spurious wakeup.  Otherwise we would never wait again.
8367         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
8368         zone versus inline asm stupidity.  Use correct instructions.
8370         * tst-rwlock6.c: Add some more status output.
8372 2003-03-15  Roland McGrath  <roland@redhat.com>
8374         * sysdeps/pthread/configure.in: New file.
8375         * sysdeps/pthread/configure: New file (generated).
8377 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
8379         * allocatestack.c (allocate_stack): Store the exact stack size of
8380         user allocated stacks.
8382 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
8384         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
8385         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
8386         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
8387         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
8388         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
8389         Use `header.' prefix.
8390         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
8392 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
8394         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
8395         __builtin_frame_address, use stack pointer.
8397         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
8398         instead of __builtin_frame_pointer.
8400 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
8402         * tst-basic1.c (do_test): Add cast to avoid warning.
8403         * tst-basic2.c (do_test): Likewise.
8405         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
8406         amount of stack correction.
8408         * tst-fork4.c: Use test-skeleton.c.
8410 2003-03-14  Roland McGrath  <roland@redhat.com>
8412         * init.c: Fix typo "#eli" for "#else".
8414 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
8416         * allocatestack.c (__stack_user): Use hidden_data_def.
8417         * pthread_create.c (__pthread_keys): Likewise.
8419         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
8421 2003-03-14  Roland McGrath  <roland@redhat.com>
8423         * tst-fork4.c: New file.
8424         * Makefile (tests): Add it.
8426         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
8427         we always define the padding space.
8428         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
8429         stopped supporting its own extensions fully.
8430         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
8431         struct also called `header', so `header.multiple_threads' is the field
8432         name to use on all machines.
8433         * allocatestack.c (allocate_stack): Use `header.' prefix.
8434         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8435         * pthread_create.c (__pthread_create_2_1): Likewise.
8436         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
8437         (THREAD_SELF): Likewise.
8438         * sysdeps/x86_64/tls.h: Likewise.
8439         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
8440         (SINGLE_THREAD_P): Likewise.
8441         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
8442         (SINGLE_THREAD_P): Likewise.
8443         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
8444         (SINGLE_THREAD_P): Likewise.
8446         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
8447         value directly.
8449 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
8451         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
8452         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
8454         * pthread_create.c (start_thread): setjmp is expected to return 0.
8456         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
8457         (THREAD_GETMEM_NC): Likewise.
8459 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
8461         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
8462         and the size of the stack which must be allocated is a multiple,
8463         allocate one more page.
8464         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
8465         MULTI_PAGE_ALIASING.
8467 2003-03-13  Roland McGrath  <roland@redhat.com>
8469         * pthread_create.c (start_thread): Set EXITING_BIT after the
8470         event-reporting (and destructors), not before.
8472 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
8474         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
8475         lll_futex_wake): Declare register variables as long int instead of
8476         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
8477         Make syscall arguments clobbered by the syscall.
8478         (lll_futex_wait): Define using lll_futex_timed_wait.
8480         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
8481         to void *.
8483         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
8484         PPID if [! NDEBUG].
8486         * allocatestack.c (nptl_ncreated): Only declare if
8487         COLORING_INCREMENT != 0.
8489         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
8490         (__libc_enable_asynccancel_2): Remove prototype.
8492         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
8493         ctid to match kernel.
8495 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
8497         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
8498         libc_multiple_threads.
8499         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
8500         __libc_multiple_threads to...
8501         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
8503         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
8504         versioning.
8505         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8506         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8508         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
8509         (__pthread_once_internal): Define.
8511         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
8512         macros instead of .symver directly.
8513         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
8514         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
8516         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
8517         * sysdeps/x86_64/tcb-offsets.sym: New file.
8518         * sysdeps/x86_64/Makefile: New file.
8520         * sysdeps/i386/tcb-offsets.sym: Add SELF.
8521         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
8522         to access own pthread_t in TCB.
8523         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8524         Likewise.
8525         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8526         Likewise.
8527         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8529 2003-03-12  Roland McGrath  <roland@redhat.com>
8531         * pthread-errnos.sym: New file.
8532         * Makefile (gen-as-const-headers): New variable, list that file.
8533         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
8534         header <pthread-errnos.h> instead of defining errno values here.
8535         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
8536         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8537         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8538         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8539         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8540         Likewise.
8541         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8542         Likewise.
8543         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8544         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8545         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8546         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8547         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8548         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8549         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
8550         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
8551         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
8552         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
8553         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
8554         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
8555         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
8556         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
8557         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
8558         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
8559         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
8560         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
8561         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
8562         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
8563         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8564         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
8565         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
8566         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
8567         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
8568         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
8569         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
8571         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
8572         CLONE_CHILD_SETTID worked.
8574 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
8576         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
8577         file.
8578         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
8579         file.
8581         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
8582         (pthread_cond_t): Add padding.
8584         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
8585         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
8586         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
8588         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
8589         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
8590         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
8591         (__pthread_rwlock_timedrdlock): Likewise.
8592         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
8593         (__pthread_rwlock_wrlock): Likewise.
8594         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
8595         (__pthread_rwlock_rdlock): Likewise.
8597         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
8599         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
8600         result of lock re-get if it fails.
8602 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8604         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
8605         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
8606         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
8607         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
8608         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
8609         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
8610         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
8611         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
8612         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8613         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8615         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
8616         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
8618         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
8619         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
8620         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
8621         (create_thread): Likewise.
8622         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
8623         * init.c (__pthread_initialize_minimal_internal): Initialize
8624         __libc_multiple_threads_ptr if necessary.
8625         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
8626         __pthread_multiple_threads and __libc_multiple_threads_ptr.
8627         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
8628         __libc_multiple_threads.
8629         (__libc_pthread_init): Return pointer to __libc_pthread_init if
8630         necessary.
8632         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
8633         (THREAD_SETMEM_NC): Likewise.
8635         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
8636         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
8637         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
8638         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
8640         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
8641         Eliminate one entire instruction.
8643         * cancellation.c (__pthread_enable_asynccancel_2): New function.
8644         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
8645         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
8646         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
8647         instead of __pthread_enable_asynccancel.
8648         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8649         (__pthread_cond_wait): Likewise.
8650         * sysdeps/pthread/pthread_cond_timedwait.c
8651         (__pthread_cond_timedwait): Likewise.
8652         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
8654         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8655         (__condvar_cleanup): Wake up all waiters in case we got signaled
8656         after being woken up but before disabling asynchronous
8657         cancellation.
8658         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8659         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
8660         (__condvar_cleanup): Likewise.
8662         * init.c (__NR_set_tid_address): If already defined, don't redefine.
8663         Make it an error if architecture has no #if case.  Add x86-64.
8665         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
8666         pt-initfini.s generation.
8668         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
8669         (TLS_INIT_TP): Fix typo.
8671 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8673         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
8674         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
8676         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
8677         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
8678         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
8679         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
8680         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
8681         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8682         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8683         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8685 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8687         * sysdeps/pthread/pthread_cond_timedwait.c
8688         (__pthread_cond_timedwait): Return the result of the final
8689         locking.  If it succeeds, the regular function return value.
8691         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
8692         Return result of the final locking.
8693         * version.c (__nptl_main): Work around problems with the strange
8694         INTERNAL_SYSCALL macro on ppc32.
8695         * init.c (__pthread_initialize_minimal_internal): Unblock
8696         SIGCANCEL in case the parent blocked it.
8697         Reported by Paul Mackerras <paulus@samba.org>.
8699         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
8700         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
8701         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
8703 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8705         * sysdeps/pthread/pthread_cond_timedwait.c
8706         (__pthread_cond_timedwait): Unlock and fail if
8707         __pthread_mutex_unlock_internal failed.
8709         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
8710         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
8711         Use ARCH_CLONE.
8712         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
8713         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
8714         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
8715         ALLOCATE_STACK): New macros.
8716         (TLS_TPADJ): New macro.
8717         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
8718         (allocate_stack): Handle TLS_DTV_AT_TP and
8719         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
8720         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
8721         Don't set PD->self.
8722         * init.c [__ia64__] (__NR_set_tid_address): Define.
8724         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
8725         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
8726         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
8727         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
8728         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
8729         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
8730         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
8731         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
8732         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
8733         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
8734         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
8735         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
8736         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
8737         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
8738         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
8739         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
8740         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
8741         * sysdeps/ia64/bits/atomic.h: New file.
8742         * sysdeps/ia64/Makefile: New file.
8743         * sysdeps/ia64/pthread_spin_init.c: New file.
8744         * sysdeps/ia64/pthread_spin_lock.c: New file.
8745         * sysdeps/ia64/pthread_spin_trylock.c: New file.
8746         * sysdeps/ia64/pthread_spin_unlock.c: New file.
8747         * sysdeps/ia64/pthreaddef.h: New file.
8748         * sysdeps/ia64/tcb-offsets.sym: New file.
8749         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
8750         * sysdeps/ia64/tls.h: New file.
8752         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
8753         to syscall instead of no arguments.
8755 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
8757         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
8758         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
8759         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
8760         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
8762         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
8763         unused code.
8765         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
8767         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8768         lowlevelbarrier.sym.
8769         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
8770         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
8771         Include lowlevelbarrier.h and don't define offsets locally.
8772         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
8774         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
8775         (__lll_mutex_lock_wait): Reverse order of first two parameters.
8776         (__lll_mutex_timedlock_wait): Likewise.
8777         (lll_mutex_lock): Adjust asm for that.
8778         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
8779         (lll_lock): Adjust asm for operand order change.
8780         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
8781         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
8783         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
8784         Reverse order of parameters.
8785         (__lll_timedwait_tid): Remove regparms attribute.
8786         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
8787         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
8789         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8790         (__lll_timedwait_tid): Remove one unnecessary instruction.
8792         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
8793         __lll_mutex_timedlock_wait only for NOT_IN_libc.
8794         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
8795         lowlevelmutex.S.
8797         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
8798         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
8799         for NOT_IN_libc.
8800         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
8801         lowlevellock.S.
8803         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
8804         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
8805         for libc.so.
8806         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
8807         define LOCK here (if UP is not defined).  The actual code is in
8808         lowlevelmutex.S.
8810         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
8811         LOCK is already defined.  Don't define lll_unlock_wake_cb and
8812         __lll_timedwait_tid for libc.so.
8813         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
8814         define LOCK here (if UP is not defined).  The actual code is in
8815         lowlevellock.S.
8817         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
8818         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
8819         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
8820         instead of lowlevelsem.h.
8821         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8822         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8823         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8825         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8826         lowlevelrwlock.sym.
8827         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
8828         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
8829         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
8831         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
8832         register loading.
8833         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
8834         last changed.  D'oh.
8836         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
8838         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
8839         of __libc_locking_needed.
8840         (lll_trylock): Initialize %eax to zero.
8842         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
8843         pthread_cond_t definition.
8845 2003-03-10  Roland McGrath  <roland@redhat.com>
8847         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
8848         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
8849         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
8850         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
8851         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
8853         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
8854         Instead of setting PD->multiple_threads, set globals
8855         __pthread_multiple_threads and __libc_multiple_threads.
8856         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8857         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
8858         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
8860         * descr.h (struct pthread): Conditionalize first member on
8861         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
8862         containing an anonymous tcbhead_t.  Move `list' member out.
8863         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
8864         * allocatestack.c: Remove use of `header.data.' prefix.
8865         * pthread_create.c: Likewise.
8866         * init.c (__pthread_initialize_minimal_internal): Likewise.
8867         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8868         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
8869         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
8870         * sysdeps/x86_64/tls.h: Likewise.
8871         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
8872         (SINGLE_THREAD_P): Likewise.
8873         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
8874         (SINGLE_THREAD_P): Likewise.
8875         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
8876         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
8878 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
8880         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
8882         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
8883         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8885         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
8886         leftovers from the ia32 code.
8888         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
8889         memory load.
8890         (clear_once_control): Don't load %esi.
8892         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
8893         handling.
8895         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8897         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
8898         * sysdeps/unix/sysv/linux/createthread.c: ...here.
8900         * Makefile (tests): Add tst-cond10.
8901         * tst-cond10.c: New file.
8903 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
8905         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
8906         * tst-signal3.c (do_test): Likewise.
8907         * tst-sem5.c (do_test): Likewise.
8908         * tst-kill6.c (do_test): Likewise.
8909         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
8911         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
8912         of inc/dec.
8913         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
8914         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
8915         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8916         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8917         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8918         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8919         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8920         Likewise.
8921         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8922         Likewise.
8923         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8924         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8925         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8926         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
8927         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
8928         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
8929         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8930         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8932         * allocatestack.c (allocate_stack): If mprotect() fails free the
8933         TLS memory.
8935 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
8937         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
8939         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
8940         lll_wake_tid.  This was used only to work around kernel limits in
8941         the early days.
8942         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
8943         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
8944         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8945         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
8947         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
8948         (__pthread_initialize_minimal_internal): Change initialization of
8949         __static_tls_align_m1 appropriately.
8950         * pthreadP.h (__static_tls_align_m1): Renamed from
8951         __static_tls_align.
8952         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
8953         instead of __static_tls_align-1.
8955 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
8957         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
8959         * pthread_create.c: Define __pthread_keys using nocommon
8960         attribute, not by placing it explicitly in bss.
8961         Remove DEFINE_DEALLOC definition.  Not needed anymore.
8963         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
8964         Use it in mmap call to allocate stacks.
8966         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
8968         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
8969         result of the thread function.
8971 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
8973         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
8974         version is just fine.
8976         * sysdeps/unix/sysv/linux/libc_pthread_init.c
8977         (__pthread_child_handler): Renamed from pthread_child_handler,
8978         exported, and marked hidden.  Change all users.
8979         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
8980         free __pthread_child_handler from child list.
8982 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8984         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
8986         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
8987         Fix handling of cancellation and failing pthread_mutex_unlock call.
8988         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8989         (__pthread_cond_wait): Likewise.
8991         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
8992         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
8993         lll_futex_timed_wait call.
8994         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
8995         (pthread_rwlock_timedwrlock): Likewise.
8997         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
8998         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
8999         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
9001         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
9002         check of lll_futex_wake return value.
9004 2003-03-03  Roland McGrath  <roland@redhat.com>
9006         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
9008         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9009         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
9010         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
9012 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
9014         * sysdeps/pthread/timer_create.c (timer_create): Return correct
9015         error for CPU clocks.
9017         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
9018         _POSIX_MONOTONIC_CLOCK.
9019         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
9021         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
9022         recent kernels.
9024 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
9026         * descr.h (struct pthread): Move cleanup field to the front.
9028 2003-03-01  Roland McGrath  <roland@redhat.com>
9030         * sem_open.c (sem_open): Braino fix.
9032 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
9034         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
9035         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
9036         __pthread_cleanup_pop functionality.
9037         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9039         * descr.h (struct pthread): Move tid field to the front now that
9040         it is often used.
9042         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
9043         (__lll_mutex_timedlock_wait): Remove.
9044         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
9045         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
9046         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
9047         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9048         (lll_unlock_wake_cb): Don't save and restore %esi.
9049         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
9050         %esi.
9051         (__lll_timedwait_tid): Add alignment.
9052         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
9053         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
9054         %esi.
9055         (__lll_timedwait_tid): Removed.
9056         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
9057         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
9058         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
9059         (pthread_barrier_wait): Don't save, load, and restore %esi for
9060         last thread.
9061         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
9062         (__pthread_cond_signal): Don't save, load, and restore %esi.
9063         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
9064         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
9065         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
9066         Don't save, load, and restore %esi.
9068 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
9070         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
9071         Release lock before waking up the waiters.
9073         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
9075         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
9076         (reader_thread): Likewise.
9078         * sysdeps/pthread/pthread_rwlock_unlock.c
9079         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
9080         to wake up readers if there are none.
9082         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
9083         Release internal lock before wake threads.
9085 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
9087         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
9088         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
9089         predefined.
9090         * tst-rwlock9.c: Likewise.
9091         * tst-rwlock10.c: New file.
9092         * tst-rwlock11.c: New file.
9094         * Makefile (tests): Add tst-dlsym1.
9095         * tst-dlsym1.c: New file.
9097         * init.c (__pthread_initialize_minimal_internal): Set
9098         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
9099         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
9101 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
9103         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
9105         * tst-cond2.c: Fix sychronization with child.
9107         * tst-rwlock8.c (reader_thread): Remove unused variable.
9109         * Makefile: Add rules to build and run tst-tls3.
9110         * tst-tls3.c: New file.
9111         * tst-tls3mod.c: New file.
9113         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
9114         * tst-rwlock8.c: New file.
9115         * tst-rwlock9.c: New file.
9116         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
9117         complete broken rwlock implementation.
9118         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9119         Likewise.
9120         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9121         Likewise.
9122         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
9123         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
9124         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
9125         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
9126         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
9127         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
9128         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
9130 2003-02-23  Roland McGrath  <roland@redhat.com>
9132         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
9134 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
9136         * Makefile (tests): Add tst-context1.
9137         * tst-context1.c: New file.
9139         * Makefile (tests): Add tst-tls1 and tst-tls2.
9140         * tst-tls1.c: New file.
9141         * tst-tls2.c: New file.
9143         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
9144         for failed cmpxchg.
9146         * pthread_create.c (start_thread): Set EXITING_BIT early.
9148         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
9149         (THREAD_GETMEM_NC): Likewise.
9151 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
9153         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
9154         off 3 more bytes by using offset-less instructions when possible.
9156         * Makefile: Add dependency for $(objpfx)version.d.
9158         * eintr.c (eintr_source): Add unnecessary return but the compiler
9159         insists.
9161         * tst-kill3.c: Include <unistd.h>.
9163 2003-02-21  Roland McGrath  <roland@redhat.com>
9165         * pthread_create.c (start_thread): Call __libc_thread_freeres.
9167 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
9169         * Makefile (tests): Add tst-eintr1.
9170         (distribute): Add eintr.c.
9171         * tst-eintr1.c: New file.
9172         * eintr.c: New file.
9174         * pthread_cancel.c (pthread_cancel): Use tkill directly.
9176         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
9177         Disallow sending SIGCANCEL.
9179         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
9180         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
9181         * tst-kill1.c: New file.
9182         * tst-kill2.c: New file.
9183         * tst-kill3.c: New file.
9184         * tst-kill5.c: New file.
9185         * tst-kill6.c: New file.
9186         * tst-basic7.c: Renamed to...
9187         * tst-kill4.c: ...this.
9189 2003-02-21  Roland McGrath  <roland@redhat.com>
9191         * Makefile (install-lib-ldscripts): New variable.
9193 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
9195         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
9196         * pthread_cancel.c: Use INVALID_TD_P.
9197         * pthread_detach.c: Likewise.
9198         * pthread_getschedparam.c: Likewise.
9199         * pthread_setschedparam.c: Likewise.
9200         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
9201         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
9202         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
9203         * pthread_timedjoin.c: Likewise.
9205         * tst-basic7.c: Include <signal.h>.
9207         * pthread_join.c (pthread_join): Limited checking for invalid
9208         descriptors.
9209         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
9211 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
9213         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
9214         beginning of the loop.  Clear the entire first block of TSD.
9215         * Makefile (tests): Add tst-key4.
9216         * tst-key4.c: New file.
9218 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
9220         * Makefile (tests): Add tst-basic7.
9221         * tst-basic7.c: New file.
9223         * pthread_create.c (deallocate_tsd): Mark as internal_function.
9224         Add some more __builtin_expect.
9226         * pthreadP.h: Define dummy version of DEBUGGING_P.
9228 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
9230         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
9231         _POSIX_THREAD_PRIORITY_SCHEDULING.
9232         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
9233         _XOPEN_REALTIME_THREADS.
9234         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
9236         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
9237         kernel returns EINVAL for PID <= 0, work around it.
9239         * Makefile (tests): Add tst-signal5.
9240         * tst-signal5.c: New file.
9242         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
9243         and LOGIN_NAME_MAX.
9245         * tst-cancel1.c (tf): Block all signals.
9247         * Makefile (tests): Add tst-basic6.
9248         * tst-basic6.c: New file.
9250         * tst-basic1.c: Add test for process ID.
9252         * Makefile (tests): Add tst-cancel10.
9253         * tst-cancel10.c: New file.
9255         * Makefile (tests): Add tst-signal4.
9256         * tst-signal4.c: New file.
9258         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
9259         __sigismember instead of sigismember.  Add __builtin_expect.
9261 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
9263         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
9264         pthread_setcancelstate, and pthread_rwlock_setpshared.
9266         * tst-cancel7.c (do_test): Make sure the pid file exists before
9267         canceling the thread.
9269         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
9270         pthread_rwlock_timedrdlock tests.
9271         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
9272         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9273         Check for invalid tv_nsec field.
9274         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9275         Likewise.
9277         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
9278         recursive mutex of overflow.
9280         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
9282         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
9283         going into an endless loop.
9284         * Makefile (tests): Add tst-cancel9.
9285         * tst-cancel9.c: New file.
9287         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
9289 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
9291         * tst-mutex5.c (do_test): Add more timedlock tests.
9293         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
9294         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
9296         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
9297         use INLINE_SYSCALL.  Error number is returned, not -1.
9299         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
9300         and __deallocate_stack with internal_function.
9301         * pthread_create.c: Adjust definitions appropriately.
9302         * allocatestack.c: Likewise.
9304         * pthread_join.c: Add one more __builtin_expect.
9305         * pthread_timedjoin.c: Likewise.
9307         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
9308         not data of sequence number does not match.
9309         Add one __builtin_expect.
9311         * Makefile (tests): Add tst-clock1.
9312         * tst-clock1.c: New file.
9314         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
9315         negative arguments.
9316         * Makefile (tests): Add tst-basic5.
9317         * tst-basic5.c: New file.
9319 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
9321         * Makefile (tests): Add tst-basic4.
9322         * tst-basic4.c: New file.
9324         * pthreadP.h: Add declaraction for __nptl_nthreads.
9325         * pthread_create.c: Define __nptl_nthreads
9326         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
9327         after thread is done.  If then zero, call exit(0).
9328         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9329         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
9330         * init.c (pthread_functions): Initialize ptr_nthreads.
9331         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
9332         (__reclaim_stacks): Decrement __nptl_nthreads.
9333         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
9334         Define.
9335         * Makefile (tests): Add tst-basic3.
9336         * tst-basic3.c: New file.
9338         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
9339         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
9340         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
9341         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
9342         if asynchronous canceling is enabled.
9343         * pthread_join.c (pthread_join): When recognizing circular joins,
9344         take into account the other thread might be already canceled.
9345         * Makefile (tests): Add tst-join5.
9346         * tst-join5.c: New file.
9348         * Makefile (tests): Add tst-join4.
9349         * tst-join4.c: New file.
9351 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
9353         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
9355 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9357         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
9358         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
9359         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
9360         warning.
9361         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
9362         to avoid warning.
9363         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
9364         error if lll_futex_wake failed.
9366 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
9368         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
9369         handling of cancellation and failung pthread_mutex_unlock call.
9370         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9371         * Makefile (tests): Add tst-cond8 and tst-cond9.
9372         * tst-cond8.c: New file.
9373         * tst-cond9.c: New file.
9375         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
9377         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
9378         non-standard initializers with __USE_GNU.
9380         * Makefile (tests): Add tst-cleanup3.
9381         * tst-cleanup3.c: New file.
9383 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
9385         * Makefile (tests): Add tst-attr1 and tst-attr2.
9386         * tst-attr1.c: New file.
9387         * tst-attr2.c: New file.
9389         * Makefile: Add rules to build and run tst-atfork2 test.
9390         * tst-atfork2.c: New file.
9391         * tst-atfork2mod.c: New file.
9393         * sysdeps/unix/sysv/linux/unregister-atfork.c
9394         (__unregister_atfork): Free the memory allocated for the handlers
9395         after removing them from the lists.
9397         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
9398         cleanup function.
9400         * tst-atfork1.c (do_test): Wait for the child we forked.
9401         Report error in child.
9403         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
9405         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
9407 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
9409         * Makefile (tests): Add tst-cancel8.
9410         * tst-cancel8.c: New file.
9412         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
9413         clearing of control variable.
9414         * Makefile (tests): Add tst-once3 and tst-once4.
9415         * tst-once3.c: New file.
9416         * tst-once4.c: New file.
9418 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
9420         * sysdeps/sh/Makefile: New file.
9421         * sysdeps/sh/bits/atomic.h: New file.
9422         * sysdeps/sh/pthread_spin_init.c: New file.
9423         * sysdeps/sh/pthread_spin_lock.c: New file.
9424         * sysdeps/sh/pthread_spin_trylock.S: New file.
9425         * sysdeps/sh/pthread_spin_unlock.S: New file.
9426         * sysdeps/sh/pthreaddef.h: New file.
9427         * sysdeps/sh/tcb-offsets.sym: New file.
9428         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
9429         * sysdeps/sh/tls.h: New file.
9430         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
9431         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
9432         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
9433         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
9434         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
9435         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
9436         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
9437         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
9438         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
9439         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
9440         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
9441         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
9442         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
9443         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
9444         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
9445         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
9446         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
9447         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
9448         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
9449         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
9450         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
9451         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
9452         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
9453         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
9454         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
9455         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
9456         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
9457         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
9458         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
9459         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
9461 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
9463         * tst-cond2.c: Rearrange code to not rely on behavior undefined
9464         according to POSIX.
9466         * tst-basic2.c (do_test): Lock mutex before creating the thread.
9468 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
9470         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
9471         (TLS_GET_FS): New #define.
9472         (TLS_SET_FS): New #define.
9473         Correct value of __NR_set_thread_area.
9475         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
9477 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
9479         * Makefile (tests): Add tst-popen1.
9480         * tst-popen1.c: New file.
9482         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
9483         but inactive generalization.
9484         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
9485         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
9486         Minor optimization, remove one instruction.
9487         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
9489 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9491         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
9493 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
9495         * init.c (__NR_set_tid_address): Add #ifdef for s390.
9496         * sysdeps/pthread/pthread_barrier_wait.c: New file.
9497         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
9498         * sysdeps/pthread/pthread_cond_signal.c: New file.
9499         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
9500         * sysdeps/pthread/pthread_cond_wait.c: New file.
9501         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
9502         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
9503         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
9504         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
9505         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
9506         * sysdeps/s390/Makefile: New file.
9507         * sysdeps/s390/bits/atomic.h: New file.
9508         * sysdeps/s390/pthread_spin_init.c: New file.
9509         * sysdeps/s390/pthread_spin_lock.c: New file.
9510         * sysdeps/s390/pthread_spin_trylock.c: New file.
9511         * sysdeps/s390/pthread_spin_unlock.c: New file.
9512         * sysdeps/s390/pthreaddef.h: New file.
9513         * sysdeps/s390/tcb-offsets.sym: New file.
9514         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
9515         * sysdeps/s390/tls.h: New file.
9516         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
9517         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
9518         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
9519         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
9520         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
9521         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
9522         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
9523         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
9524         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
9525         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
9526         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
9527         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
9528         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
9529         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
9530         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
9531         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
9532         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
9533         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
9534         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
9535         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
9536         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
9537         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
9538         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
9540 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
9542         * atomic.h: Add a couple more default implementations.
9543         (atomic_compare_and_exchange_acq): Use
9544         __arch_compare_and_exchange_32_acq in return value definition.  It
9545         always exists.
9546         (atomic_bit_set): Renamed from atomic_set_bit.
9547         Add missing atomic_ prefixes.
9549         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
9550         thread library is available, use correct value to mark initialized
9551         once variable.
9553 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
9555         * allocatestack.c (allocate_stack): Use __getpagesize instead of
9556         __sysconf to determine pagesize.
9558         * pthread_create.c: Include <atomic.h>.
9559         * allocatestack.c (allocate_stack): Implement coloring of the
9560         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
9561         size minus one.  Adjust users.
9562         * sysdeps/i386/i686/Makefile: New file.
9564 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
9566         * allocatestack.c: Improve comment throughout the file.
9568         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9569         (__lll_lock_wait): Add branch prediction.
9570         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
9571         (__lll_lock_wait): Likewise.
9572         (lll_unlock_wake_cb): Removed.
9574 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
9576         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
9577         _POSIX_THREAD_PRIORITY_SCHEDULING.
9579 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
9581         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9582         Fix return type of ptr___pthread_getspecific.
9584 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
9586         * Makefile (tests): Add tst-umask1.
9587         (tst-umask1-ARGS): Define.
9588         * tst-umask1.c: New file.
9590 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
9592         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
9593         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
9594         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
9595         pthread_rwlock_unlock.
9596         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
9597         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
9598         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
9599         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
9600         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9601         New file.
9602         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
9603         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9604         New file.
9605         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
9606         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
9607         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
9608         New file.
9609         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
9610         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
9611         New file.
9612         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
9613         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
9614         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
9615         New file.
9616         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
9617         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
9618         New file.
9619         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
9621         * Makefile (libpthread-routines): Remove lowlevelcond and
9622         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
9623         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
9624         and pthread_cond_broadcast.
9625         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
9626         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
9627         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
9628         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
9629         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
9630         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
9631         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
9632         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
9633         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
9634         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
9635         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
9636         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
9637         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
9638         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
9639         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
9640         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
9641         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
9642         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
9643         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
9644         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
9645         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
9646         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
9647         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
9648         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
9649         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
9650         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
9651         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
9652         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
9653         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
9654         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
9655         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
9657         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
9658         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
9659         of the code is moved to ...
9660         * sysdeps/pthread/createthread.c: ...here.  New file.
9662 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
9664         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
9665         (__new_sem_post): Clear %eax before returning.
9666         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
9668         * Makefile (tests): Add tst-cleanup2.
9669         * tst-cleanup2.c: New file.
9671         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
9672         Interpret first parameter correctly.
9674 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
9676         * Makefile (headers): Add bits/semaphore.h.
9678 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
9680         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
9681         if not SHARED.
9683 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
9685         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
9686         must be used and mapping failed.
9687         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
9689         * Makefile (CFLAGS-pthread_self.os): Define this, not
9690         CFLAGS-pthread_self.c.
9692 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9694         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
9695         lll_unlock_wake_cb.
9697         * Makefile (libpthread-routines): Add version.  Add rules to build
9698         version.os and banner.h.
9699         * version.c: New file.
9701 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
9703         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
9704         the alias unconditional.
9705         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
9707 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9709         * Makefile (CFLAGS-pthread_self.c): New definition.
9711 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9713         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
9714         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
9715         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
9716         * init.c (__pthread_initialize_minimal_internal): Likewise.
9718 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
9720         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
9722         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
9723         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9724         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9725         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
9726         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9727         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9729 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9731         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
9732         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
9733         * tst-cancel-wrappers.sh: Remove all exceptions.
9735 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
9737         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
9738         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
9740         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
9741         Use __libc_pthread_functions array if SHARED.
9743         * pthreadP.h: Move pthread_cond_2_0_t definition to...
9744         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
9746         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
9747         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
9748         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
9749         __libc_ptf_call instead of __libc_maybe_call.
9750         (PTF): New #define.
9751         (__libc_cleanup_region_start): Wrap function name with PTF call.
9752         (__libc_cleanup_region_end): Likewise.
9753         (__libc_cleanup_end): Likewise.
9755         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
9756         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
9757         * pthread_key_create.c: Add __pthread_key_create_internal alias.
9758         * pthreadP.h: Add prototypes.
9760         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
9761         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
9762         __pthread_rwlock_unlock aliases.
9763         * pthreadP.h: Add prototypes for new aliases.
9765         * pthreadP.h (struct pthead_functions): Moved to...
9766         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
9767         * init.c (pthread_functions): Add initializers for new elements.
9769         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
9770         __pthread_cleanup_pop_restore aliases.
9771         * pthreadP.h: Add prototypes.
9773         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
9774         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
9775         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
9776         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
9777         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
9778         * pthreadP.h: Adjust prototypes and callers.
9780 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
9782         * Makefile (tests): Add tst-cancel7.
9783         (tst-cancel7-ARGS): New variable.
9784         * tst-cancel7.c: New file.
9786         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
9787         around gcc defficiencies.
9788         * old_pthread_cond_signal.c: Likewise.
9789         * old_pthread_cond_timedwait.c: Likewise.
9790         * old_pthread_cond_wait.c: Likewise.
9792         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
9794 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9796         * Makefile (tests): Add tst-cond7.
9797         * tst-cond7.c: New file.
9799         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9800         (condvar_cleanup): Get condvar address from the right place.
9802         * atomic.h: Correct definitions of atomic_full_barrier,
9803         atomic_read_barrier, atomic_write_barrier.
9805         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
9806         race-free.
9807         * old_pthread_cond_signal.c: Likewise.
9808         * old_pthread_cond_timedwait.c: Likewise.
9809         * old_pthread_cond_wait.c: Likewise.
9811 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
9813         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
9815 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9817         * pthreadP.h (pthread_cond_2_0_t): New type.
9818         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
9819         Use new type for the 2.0 condvar function prototypes.
9820         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
9821         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
9822         parameter.
9823         * old_pthread_cond_destroy.c: Likewise.
9824         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
9825         * old_pthread_cond_signal.c: Likewise.
9826         * old_pthread_cond_timedwait.c: Likewise.
9827         * old_pthread_cond_wait.c: Likewise.
9829         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9830         (__pthread_cond_wait): Don't save cancellation mode and seq value
9831         in same location.
9833         * herrno.c (__h_errno_location): Don't define as weak.
9835 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9837         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
9838         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
9839         and pthread_cond_wait.
9840         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
9841         Renamed to...
9842         (__pthread_cond_broadcast_2_0): ... this.
9843         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
9844         Renamed to...
9845         (__pthread_cond_destroy_2_0): ... this.
9846         * old_pthread_cond_init.c (__old_pthread_cond_init):
9847         Renamed to...
9848         (__pthread_cond_init_2_0): ... this.
9849         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
9850         Renamed to...
9851         (__pthread_cond_signal_2_0): ... this.
9852         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
9853         Renamed to...
9854         (__pthread_cond_wait_2_0): ... this.
9855         * pthread_cond_destroy.c: Include shlib-compat.h.
9856         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
9857         * pthread_cond_init.c: Include shlib-compat.h.
9858         (pthread_cond_init): Change strong_alias into versioned_symbol.
9859         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
9860         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
9861         fields.
9862         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
9863         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
9864         __pthread_cond_wait_2_0): New prototypes.
9865         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
9866         __old_pthread_cond_init, __old_pthread_cond_signal,
9867         __old_pthread_cond_wait): Removed.
9868         * init.c: Include shlib-compat.h.
9869         (pthread_functions): Guard ptr___pthread_attr_init_2_0
9870         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
9871         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
9872         ptr___pthread_cond_*_2_0 fields.
9873         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
9874         pthread_cond_*@GLIBC_2.0 compatibility symbols.
9876         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
9877         LIBC_SIGACTION was not yet defined.
9878         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
9879         [!defined LIBC_SIGACTION] (__sigaction): New function and
9880         libc_hidden_weak.
9881         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
9882         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
9884 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9886         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
9888 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
9890         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
9891         New, larger type definition.
9892         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
9893         implementation.
9894         * Versions [libpthread]: Add definitions for new pthread_cond_*
9895         interfaces for version GLIBC_2.3.2.
9896         * pthread_cond_init.c: Update initialization for new type definition.
9897         * Makefile (libpthread-routines): Remove pthread_cond_wait,
9898         pthread_cond_timedwait, pthread_cond_signal, and
9899         pthread_cond_broadcast.  Add old_pthread_cond_init,
9900         old_pthread_cond_destroy, old_pthread_cond_wait,
9901         old_pthread_cond_timedwait, old_pthread_cond_signal, and
9902         old_pthread_cond_broadcast.
9903         * old_pthread_cond_broadcast.c: New file.
9904         * old_pthread_cond_destroy.c: New file.
9905         * old_pthread_cond_init.c: New file.
9906         * old_pthread_cond_signal.c: New file.
9907         * old_pthread_cond_timedwait.c: New file.
9908         * old_pthread_cond_wait.c: New file.
9909         * pthreadP.h: Add prototypes for the compatibility interfaces.
9911         * pthread_cond_destroy.c: Don't include <errno.h>.
9913 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
9915         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
9916         unnecessary zero offset when addressing MUTEX.
9918 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9920         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
9921         __register_atfork.
9922         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
9923         for __register_atfork.
9925 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9927         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
9928         instead of ASSEMBLER test macro.
9930         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
9931         __libc_current_sigrtmax): Add libc_hidden_def.
9933         * sysdeps/pthread/list.h: Remove assert.h include.
9935 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9937         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
9938         __pthread_initialize_minimal_internal not
9939         __pthread_initialize_minimal.
9941 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
9943         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
9944         __pthread_initialize_minimal as hidden.
9946         * init.c (__pthread_initialize_minimal_internal): Don't mark as
9947         constructor.
9949 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9951         * Makefile ($(inst_libdir)/libpthread.so): Depend on
9952         $(common-objpfx)format.lds, include that into the output script.
9953         Fix comment.
9954         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
9956 2002-12-28  Andreas Jaeger  <aj@suse.de>
9958         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
9959         nsec resolution changes.
9960         (xstat64_conv): Likewise.
9961         (xstat32_conv): Likewise.
9962         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
9963         struct kernel_stat.
9964         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
9965         structs stat and stat64.
9966         * time/time.h (__timespec_defined): Define for __USE_MISC.
9967         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
9969 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
9971         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
9972         argument.
9973         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
9974         (pthread_exit): Use strong_alias to avoid warnings.
9975         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
9976         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
9977         ptr___pthread_attr_init_2_*.
9978         * init.c (pthread_functions): Adjust.
9980 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
9982         * forward.c: Make all functions available by default again.  It
9983         caused too much trouble.
9985         * pt-siglongjmp.c: Removed.
9987 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
9989         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
9990         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
9991         * sysdeps/i386/Makefile: New file.
9992         * sysdeps/i386/tcb-offsets.sym: New file.
9993         * sysdeps/pthread/tcb-offsets.h: New file.
9994         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9995         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
9997         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
9998         __register_atfork...
9999         (GLIBC_2.3.2): ...here.
10001 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
10003         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
10004         pthread_attr_setstackaddr with __attribute_deprecated__.
10006 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
10008         * pt-system.c (system): Remove cancellation handling.
10009         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
10010         cancellation routines.
10012 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
10014         * descr.h: Include <dl-sysdep.h>.
10015         (struct pthread): Move header.data.list to the back of the struct.
10016         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
10017         (MULTIPLE_THREADS_OFFSET): Adjust offset.
10018         (SYSINFO_OFFSEET): Likewise.
10020 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
10022         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
10023         Define.
10024         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
10025         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
10026         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
10027         (USE_DL_SYSINFO): Undef.
10029 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
10031         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
10032         $(common-objpfx)libc.so.
10033         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
10034         it is bigger than pipe buffer size even on arches with bigger
10035         page size.
10036         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
10038 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
10040         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
10041         correct errno access for case that USE___THREAD is not defined.
10043 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
10045         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
10046         Patch by Marijn Ros <marijn@mad.scientist.com>.
10048 2002-12-22  Roland McGrath  <roland@redhat.com>
10050         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
10052 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
10054         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
10056 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
10058         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
10059         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
10060         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
10062         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
10063         of int $0x80.
10064         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10065         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
10066         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
10067         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
10068         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
10069         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
10070         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
10071         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
10073         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
10074         sysenter.
10075         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
10077         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
10079         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
10080         in new TCB.
10081         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
10082         that sysinfo is properly initialized.
10083         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
10084         to 1 only for ld.so.
10086         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
10087         RTLD_CORRECT_DYNAMIC_WEAK.
10089 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
10091         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
10092         Use return 0 as 6th argument to FORWARD4.
10093         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
10095 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
10097         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
10098         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
10099         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
10100         (INIT_SYSINFO): New #define.
10101         (TLS_TP_INIT): Use INIT_SYSINFO.
10102         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10103         At test to make sure SYSINFO_OFFSET value is correct.
10104         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
10106 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
10108         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
10109         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
10110         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
10111         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
10112         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
10113         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
10114         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
10116 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
10118         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
10119         macro instead of using int $0x80 directly.
10121         * sysdeps/pthread/bits/stdio-lock.h: New file.
10122         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
10123         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
10124         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
10125         * Makefile (routines): Add libc-lowlevelmutex.
10127         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
10128         __i686.get_pc_thunk.dx.
10130 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
10132         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
10133         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
10134         ($(objpfx)tst-cancel-wrappers.out): New rule.
10135         * tst-cancel-wrappers.sh: New test.
10136         * tst-locale1.c: Include signal.h.
10137         (uselocale): Test static linking of __libc_current_sigrt*.
10139 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
10141         * Makefile (tests): Add tst-cancel6.
10142         * tst-cancel6.c: New file
10144 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
10146         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
10147         Define meaningfully for assembler as well.
10148         * pthreadP.h (struct pthread_functions): Remove
10149         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
10150         and ptr_pthread_attr_init_2_1 fields.
10151         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
10152         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
10153         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
10154         (FORWARD3): Define using FORWARD4.
10155         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
10156         versions.
10157         * pt-system.c: Remove duplicate stdlib.h include.
10159 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
10161         * sem_init.c: Define sem_init@GLIBC_2.0.
10162         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
10163         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
10165         * flockfile.c: Moved to...
10166         * sysdeps/pthread/flockfile.c: ...here.  New file.
10167         * funlockfile.c: Moved to...
10168         * sysdeps/pthread/funlockfile.c: ...here.  New file.
10169         * ftrylockfile.c: Moved to...
10170         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
10172 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
10174         * libc-cancellation.c: Guard both function with
10175         #if !defined NOT_IN_libc.
10176         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
10177         automatically provided pthread wrappers.
10178         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
10179         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
10180         nor in libpthread.
10181         * pt-open.c: Removed.
10182         * pt-fcntl.c: Removed.
10183         * pt-fsync.c: Removed.
10184         * pt-lseek.c: Removed.
10185         * pt-msgrcv.c: Removed.
10186         * pt-msgsnd.c: Removed.
10187         * pt-msync.c: Removed.
10188         * pt-nanosleep.c: Removed.
10189         * pt-open64.c: Removed.
10190         * pt-pause.c: Removed.
10191         * pt-pread.c: Removed.
10192         * pt-pread64.c: Removed.
10193         * pt-pwrite.c: Removed.
10194         * pt-pwrite64.c: Removed.
10195         * pt-read.c: Removed.
10196         * pt-recv.c: Removed.
10197         * pt-recvfrom.c: Removed.
10198         * pt-recvmsg.c: Removed.
10199         * pt-send.c: Removed.
10200         * pt-sendto.c: Removed.
10201         * pt-sigtimedwait.c: Removed.
10202         * pt-sigwait.c: Removed.
10203         * pt-wait.c: Removed.
10204         * pt-waitpid.c: Removed.
10205         * pt-write.c: Removed.
10206         * pt-accept.c: Removed.
10207         * pt-close.c: Removed.
10208         * pt-connect.c: Removed.
10209         * pt-lseek64.c: Removed.
10210         * pt-sendmsg.c: Removed.
10211         * pt-tcdrain.c: Removed.
10213 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
10215         * init.c (__pthread_initialize_minimal_internal): Renamed from
10216         __pthread_initialize_minimal.  Make old name an alias.  This
10217         converts a normal relocation into a relative relocation.
10219         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
10221         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
10222         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
10223         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
10224         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
10225         pt-sigwaitinfo, pt-waitid, and pt-writev.
10226         * pt-creat.c: Removed.
10227         * pt-poll.c: Removed.
10228         * pt-pselect.c: Removed.
10229         * pt-readv.c: Removed.
10230         * pt-select.c: Removed.
10231         * pt-sigpause.c: Removed.
10232         * pt-sigsuspend.c: Removed.
10233         * pt-sigwaitinfo.c: Removed.
10234         * pt-waitid.c: Removed.
10235         * pt-writev.c: Removed.
10237         * init.c (pthread_functions): New variable.
10238         (__pthread_initialize_minimal): Pass pointer to pthread_functions
10239         (or NULL) to __libc_pthread_init.
10240         * forward.c: Rewrite to use __libc:pthread_functions array to get
10241         function addresses.
10242         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
10243         prototype.
10244         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
10245         Take new parameter.  Copy content of variable pointed to by it
10246         to __libc_pthread_init.
10248         * pthreadP.h (struct pthread_functions): New type.
10249         (__libc_pthread_init): Declare.
10251         * pthread_attr_destroy.c: Add namespace protected alias.
10252         * pthread_attr_getdetachstate.c: Likewise.
10253         * pthread_attr_getinheritsched.c: Likewise.
10254         * pthread_attr_getschedparam.c: Likewise.
10255         * pthread_attr_getschedpolicy.c: Likewise.
10256         * pthread_attr_getscope.c: Likewise.
10257         * pthread_attr_setdetachstate.c: Likewise.
10258         * pthread_attr_setinheritsched.c: Likewise.
10259         * pthread_attr_setschedparam.c: Likewise.
10260         * pthread_attr_setschedpolicy.c: Likewise.
10261         * pthread_attr_setscope.c: Likewise.
10262         * pthread_cond_broadcast.c: Likewise.
10263         * pthread_cond_destroy.c: Likewise.
10264         * pthread_cond_init.c: Likewise.
10265         * pthread_cond_signal.c: Likewise.
10266         * pthread_cond_wait.c: Likewise.
10267         * pthread_condattr_destroy.c: Likewise.
10268         * pthread_condattr_init.c: Likewise.
10269         * pthread_equal.c: Likewise.
10270         * pthread_exit.c: Likewise.
10271         * pthread_getschedparam.c: Likewise.
10272         * pthread_self.c: Likewise.
10273         * pthread_setcancelstate.c: Likewise.
10274         * pthread_setschedparam.c: Likewise.
10275         * pthread_mutex_destroy.c: Likewise.
10276         * pthread_mutex_init.c: Likewise.
10277         * pthreadP.h: Add prototypes for the aliases.
10279         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
10280         multiple_threads member in correct TCB to 1.
10282         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
10283         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
10284         member of thread decriptor, otherwise return unconditionally 1.
10286 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
10288         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
10289         regular Linux version.  Remove file.
10290         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
10291         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
10292         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
10293         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
10294         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
10295         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
10296         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
10297         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
10298         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
10299         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
10300         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
10301         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
10302         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
10303         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
10304         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
10305         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
10306         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
10307         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
10308         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
10309         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
10310         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
10311         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
10312         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
10313         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
10314         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
10315         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
10316         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
10317         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
10318         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
10319         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
10321 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
10323         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
10324         * sysdeps/unix/sysv/linux/open.c: Removed.
10325         * sysdeps/unix/sysv/linux/fsync.c: Removed.
10326         * sysdeps/unix/sysv/linux/lseek.c: Removed.
10327         * sysdeps/unix/sysv/linux/msync.c: Removed.
10328         * sysdeps/unix/sysv/linux/read.c: Removed.
10329         * sysdeps/unix/sysv/linux/close.c: Removed.
10330         * sysdeps/unix/sysv/linux/creat.c: Removed.
10331         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
10332         * sysdeps/unix/sysv/linux/pause.c: Removed.
10333         * sysdeps/unix/sysv/linux/select.c: Removed.
10334         * sysdeps/unix/sysv/linux/write.c: Removed.
10336 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
10338         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
10339         element in TCB to see whether locking is needed.
10341         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
10342         MULTIPLE_THREADS_OFFSET value is correct.
10344         * sysdeps/unix/sysv/linux/close.c: New file.
10345         * sysdeps/unix/sysv/linux/connect.S: New file.
10346         * sysdeps/unix/sysv/linux/creat.c: New file.
10347         * sysdeps/unix/sysv/linux/fsync.c: New file.
10348         * sysdeps/unix/sysv/linux/llseek.c: New file.
10349         * sysdeps/unix/sysv/linux/lseek.c: New file.
10350         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
10351         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
10352         * sysdeps/unix/sysv/linux/msync.c: New file.
10353         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
10354         * sysdeps/unix/sysv/linux/open.c: New file.
10355         * sysdeps/unix/sysv/linux/open64.c: New file.
10356         * sysdeps/unix/sysv/linux/pause.c: New file.
10357         * sysdeps/unix/sysv/linux/poll.c: New file.
10358         * sysdeps/unix/sysv/linux/pread.c: New file.
10359         * sysdeps/unix/sysv/linux/pread64.c: New file.
10360         * sysdeps/unix/sysv/linux/pselect.c: New file.
10361         * sysdeps/unix/sysv/linux/pwrite.c: New file.
10362         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
10363         * sysdeps/unix/sysv/linux/readv.c: New file.
10364         * sysdeps/unix/sysv/linux/recv.S: New file.
10365         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
10366         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
10367         * sysdeps/unix/sysv/linux/select.c: New file.
10368         * sysdeps/unix/sysv/linux/send.S: New file.
10369         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
10370         * sysdeps/unix/sysv/linux/sendto.S: New file.
10371         * sysdeps/unix/sysv/linux/sigpause.c: New file.
10372         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
10373         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
10374         * sysdeps/unix/sysv/linux/sigwait.c: New file.
10375         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
10376         * sysdeps/unix/sysv/linux/system.c: New file.
10377         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
10378         * sysdeps/unix/sysv/linux/wait.c: New file.
10379         * sysdeps/unix/sysv/linux/waitid.c: New file.
10380         * sysdeps/unix/sysv/linux/waitpid.c: New file.
10381         * sysdeps/unix/sysv/linux/writev.c: New file.
10382         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
10384         * pt-readv.c: Fix comment.
10386 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
10388         * tst-cleanup1.c: Include stdlib.h.
10390         * tst-cancel5.c: New test.
10391         * Makefile (tests): Add tst-cancel5.
10392         (tst-cancel5): Link against libc.so libpthread.so in that order.
10394 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
10396         * forward.c (test_loaded): Prevent recursive calls.
10398         * Makefile (routines): Add libc-cancellation.
10399         * libc-cancellation.c: New file.
10400         * descr.h (struct pthread): Add multiple_threads field.
10401         * allocatestack.c (allocate_stack): Initialize multiple_header field of
10402         new thread descriptor to 1.
10403         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
10404         Initialize multiple_thread field after successful thread creation.
10405         * cancellation.c (__do_cancel): Move to pthreadP.h.
10406         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
10407         (__pthread_disable_asynccancel): Add internal_function attribute.
10408         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
10409         * pthread_setcancelstate.c: Likewise.
10410         * pthread_setcanceltype.c: Likewise.
10411         * pthread_exit.c: Likewise.
10412         * pthreadP.h (CANCELLATION_P): Likewise.
10413         (__do_cancel): Define as static inline.
10414         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
10415         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
10416         declarations.
10417         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
10418         fields.  Define MULTIPLE_THREADS_OFFSET.
10419         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
10420         declaration.
10421         * sysdeps/unix/sysv/linux/accept.S: New file.
10422         * sysdeps/unix/sysv/linux/read.c: New file.
10423         * sysdeps/unix/sysv/linux/write.c: New file.
10424         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
10425         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
10426         initialization of __libc_locking_needed.
10427         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
10428         __libc_locking_needed, use multiple_threads field in TCB.
10429         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10431 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
10433         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
10434         version.
10435         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
10437         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
10438         access to __libc_locking_needed for PIC.
10440 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
10442         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
10443         declare for libc.so.
10444         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
10445         expression.
10446         (__libc_lock_lock): Put into statement expression.
10447         (__libc_lock_unlock): Remove trailing semicolon.
10448         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
10450 2002-12-12  Roland McGrath  <roland@redhat.com>
10452         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
10453         "m" constraint to refer to __libc_locking_needed.  Declare it here.
10455 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
10457         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
10458         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
10459         Initialize __libc_locking_needed.
10460         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
10461         instead of __register_pthread_fork_handler.
10462         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
10463         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
10464         fork-gen with libc_pthread_init.
10465         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
10466         of __register_pthread_fork_handler.
10467         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
10468         of __register_pthread_fork_handler.
10469         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
10470         __libc_locking_needed to determine whether lock prefix can be avoided.
10471         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
10473 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
10475         * Makefile (tests): Add tst-cleanup1.
10476         * tst-cleanup1.c: New file.
10477         * cancellation.c (__cleanup_thread): Removed.
10478         (__do_cancel): Remove call to __cleanup_thread.
10479         * pthreadP.h: Remove __cleanup_thread prorotype.
10481         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
10482         Remember function and argument even if cancellation handler
10483         function is not available.
10484         (__libc_cleanup_region_end): Execute registered function directly if
10485         pthread functions are not available.
10486         (__libc_cleanup_end): Likewise.
10488         * init.c (__pthread_initialize_minimal): Fix initialization in
10489         static lib by preventing gcc from being too clever.
10491 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
10493         * init.c (__pthread_initialize_minimal): Remove unneccesary
10494         sigaddset call.
10496         * Makefile (tests): We can run tst-locale2 now.
10498 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
10500         * Versions: Remove duplicated sigwait entry.
10502 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
10504         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
10505         inside libpthread.
10507         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
10509         * pthreadP.h: Declare __pthread_enable_asynccancel and
10510         __pthread_disable_asynccancel.
10511         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
10512         (CANCEL_RESET): Use __pthread_disable_asynccancel.
10513         * cancellation.c (__pthread_enable_asynccancel): New function.
10514         (__pthread_disable_asynccancel): New function.
10515         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
10516         * pt-close.c: Likewise.
10517         * pt-connect.c: Likewise.
10518         * pt-creat.c: Likewise.
10519         * pt-fcntl.c: Likewise.
10520         * pt-fsync.c: Likewise.
10521         * pt-lseek.c: Likewise.
10522         * pt-lseek64.c: Likewise.
10523         * pt-msgrcv.c: Likewise.
10524         * pt-msgsnd.c: Likewise.
10525         * pt-msync.c: Likewise.
10526         * pt-nanosleep.c: Likewise.
10527         * pt-open.c: Likewise.
10528         * pt-open64.c: Likewise.
10529         * pt-pause.c: Likewise.
10530         * pt-poll.c: Likewise.
10531         * pt-pread.c: Likewise.
10532         * pt-pread64.c: Likewise.
10533         * pt-pselect.c: Likewise.
10534         * pt-pwrite.c: Likewise.
10535         * pt-pwrite64.c: Likewise.
10536         * pt-read.c: Likewise.
10537         * pt-readv.c: Likewise.
10538         * pt-recv.c: Likewise.
10539         * pt-recvfrom.c: Likewise.
10540         * pt-recvmsg.c: Likewise.
10541         * pt-select.c: Likewise.
10542         * pt-send.c: Likewise.
10543         * pt-sendmsg.c: Likewise.
10544         * pt-sendto.c: Likewise.
10545         * pt-sigpause.c: Likewise.
10546         * pt-sigsuspend.c: Likewise.
10547         * pt-sigtimedwait.c: Likewise.
10548         * pt-sigwait.c: Likewise.
10549         * pt-sigwaitinfo.c: Likewise.
10550         * pt-system.c: Likewise.
10551         * pt-tcdrain.c: Likewise.
10552         * pt-wait.c: Likewise.
10553         * pt-waitid.c: Likewise.
10554         * pt-waitpid.c: Likewise.
10555         * pt-write.c: Likewise.
10556         * pt-writev.c: Likewise.
10557         * pthread_join.c: Likewise.
10558         * pthread_timedjoin.c: Likewise.
10560         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
10561         (__xpg_sigpause): New function.
10562         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
10564 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
10566         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
10568         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
10569         _GI_pthread_cleanup_pop to pthreadP.h.
10571         * ftrylockfile.c: Use _IO_lock_trylock instead of
10572         pthread_mutex_trylock.
10574         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
10575         (CANCEL_RESET): Likewise.
10576         (__pthread_setcanceltype_): Declare.
10577         (__pthread_mutex_lock_internal): Declare.
10578         (__pthread_mutex_unlock_internal): Declare.
10579         (__pthread_once_internal): Declare.
10580         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
10581         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
10583         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
10584         and pthread_mutex_unlock.
10585         * pthread_cond_wait.c: Likewise.
10586         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
10587         * pthread_mutex_unlock.c: Likewise.
10589         * pthread_setcanceltype.c: Add additional alias
10590         __pthread_setcanceltype.
10592         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
10593         * sem_open.c (sem_open): Likewise.
10594         Use __libc_open, __libc_write, and __libc_close instead of
10595         open, write, and close respectively.
10597         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
10598         Rewrite as statement expression since it must return a value.
10600         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
10601         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
10602         __pthread_kill.
10604         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
10605         alias __pthread_once_internal.
10607         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
10609 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
10611         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
10612         * tst-stdio1.c: New file.
10613         * tst-stdio2.c: New file.
10615         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
10617         * Makefile (tests): Comment out tst-locale2 for now.
10618         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
10620         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
10621         -D_IO_MTSAFE_IO.
10622         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
10623         Use _IO_lock_init instead of explicit assignment.
10625         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
10626         Define __libc_lock_* and __libc_lock_recursive macros with
10627         lowlevellock macros, not pthread mutexes.
10629         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
10630         of pthread_mutex_lock.
10631         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
10632         instead of pthread_mutex_unlock.
10634 2002-12-06  Roland McGrath  <roland@redhat.com>
10636         * allocatestack.c (__stack_user): Use uninitialized defn.
10637         * init.c (__pthread_initialize_minimal): Initialize it here.
10639 2002-12-05  Roland McGrath  <roland@redhat.com>
10641         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
10642         string.
10643         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
10645         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
10646         missing & here too.
10648 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
10650         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10651         lowlevellock.
10652         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
10653         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
10654         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
10655         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
10656         for __libc_lock_* macros.
10657         * Makefile (routines): Add libc-lowlevellock.
10659 2002-10-09  Roland McGrath  <roland@redhat.com>
10661         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
10662         Under [__PIC__], call the function via the pointer fetched for
10663         comparison rather than a call by name that uses the PLT.
10664         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
10665         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
10666         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
10667         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
10668         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
10670 2002-12-04  Roland McGrath  <roland@redhat.com>
10672         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
10674         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
10675         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
10677         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
10679 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10681         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
10682         a completely opaque, non-integer type.
10683         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
10685 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
10687         * sysdeps/i386/tls.h: Include stdlib.h.
10688         * sysdeps/x86_64/tls.h: Likewise.
10690 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10692         * Makefile (tests): Add tst-locale2.
10693         (tests-static): Likewise.
10694         * tst-locale2.c: New file.
10696         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
10697         volatile and add memory clobbers to lock operations.
10699 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
10701         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
10702         * sysdeps/i386/i486/bits/atomic.h: New file.
10703         * sysdeps/i386/i586/bits/atomic.h: New file.
10704         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
10705         include i486 version.
10706         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
10707         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
10708         Patch by Marijn Ros <marijn@mad.scientist.com>.
10710         * allocatestack.c (get_cached_stack): Don't crash if we first
10711         found a stack with a larger size then needed.
10712         Reported by Hui Huang <hui.huang@sun.com>.
10714         * Makefile (tests): Add tst-sysconf.
10715         * tst-sysconf.c: New file.
10717         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
10718         PTHREAD_THREADS_MAX.
10720 2002-12-02  Roland McGrath  <roland@redhat.com>
10722         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
10723         Declare using hidden_proto instead of attribute_hidden, so there are
10724         non-.hidden static symbols for gdb to find.
10725         (__pthread_keys): Likewise.
10726         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
10727         * allocatestack.c (__stack_user): Likewise.
10728         * pthread_create.c (__pthread_keys): Likewise.
10729         (__nptl_threads_events, __nptl_last_event): Make these static instead
10730         of hidden.
10731         * pthread_key_create.c (__pthread_pthread_keys_max,
10732         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
10734 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
10736         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
10737         statically.
10738         * tst-locale1.c: New file.
10740         * pthread_cond_timedwait.c: Include <stdlib.h>.
10742         * Makefile (tests): Add tst-fork2 and tst-fork3.
10743         * tst-fork2.c: New file.
10744         * tst-fork3.c: New file.
10746 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
10748         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
10750         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
10751         require it to 200112L.
10753         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
10754         instruction only if HAVE_CMOV is defined.
10755         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
10757         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
10759         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
10761         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
10763         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
10765 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
10767         * sysdeps/x86_64/bits/atomic.h: New file.
10769         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
10770         16-bit operations.
10772         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
10773         possible since gettid cannot fail.
10775         * sysdeps/x86_64/pthreaddef.h: New file.
10777         * sysdeps/i386/pthreaddef.h (gettid): Removed.
10779         * sysdeps/x86_64/pthread_spin_init.c: New file.
10780         * sysdeps/x86_64/pthread_spin_lock.c: New file.
10781         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
10782         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
10784         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
10785         Add missing lock prefix.  Minute optimization.
10787         * tst-spin2.c (main): Also check successful trylock call.
10789         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
10790         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
10792         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
10793         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
10795         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
10796         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
10797         value in case of an error.  Add support for INTERNAL_SYSCALL.
10799         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
10800         value in case of an error.
10802         * sysdeps/x86_64/tls.h: New file.
10804 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10806         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
10807         takes the array member name and the index as parameters.
10808         (THREAD_SETMEM_NC): Likewise.
10809         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
10810         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
10811         interfaces.
10813         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
10814         to decide which code to use.
10815         (THREAD_SETMEM_NC): Likewise.
10817         * allocatestack.c (queue_stack): Don't remove stack from list here.
10818         Do it in the caller.  Correct condition to prematurely terminate
10819         loop to free stacks.
10820         (__deallocate_stack): Remove stack from list here.
10822 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10824         * Makefile (tests): Add tst-stack1.
10825         * tst-stack1.c: New file.
10827         * allocatestack.c (allocate_stack): Initialize the TCB on a user
10828         provided stack.
10830         * pthread_attr_getstack.c: Return bottom of the thread area.
10832 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
10834         * Makefile (libpthread-routines): Add pt-allocrtsig and
10835         pthread_kill_other_threads.
10836         * pt-allocrtsig.c: New file.
10837         * pthread_kill_other_threads.c: New file.
10838         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
10839         all three functions.
10840         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10841         allocrtsig.
10842         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
10843         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
10844         and __libc_allocate_rtsig_private.
10845         * Versions (libpthread): Export pthread_kill_other_threads_np,
10846         __libc_current_sigrtmin, and __libc_current_sigrtmax.
10848 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
10850         * allocatestack.c (allocate_stack): stackaddr in attribute points to
10851         the end of the stack.  Adjust computations.
10852         When mprotect call fails dequeue stack and free it.
10853         * pthread_attr_setstack.c: Store top of the stack in stackaddr
10854         attribute.
10855         * pthread_getattr_np.c: Likewise.
10857         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
10858         surprises.
10860 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
10862         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
10863         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10865 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
10867         * pthread_getspecific.c: Optimize access to first 2nd-level array.
10868         * pthread_setspecific.c: Likewise.
10870 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
10872         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
10873         definitions.  Get them from the official place.
10874         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
10876         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
10877         Use new CLONE_ flags in clone() calls.
10879         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
10880         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
10882         * Versions: Add pthread_* functions for libc.
10883         * forward.c: New file.
10885         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
10886         errno-loc.
10887         * herrno.c: New file.
10888         * res.c: New file.
10890         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
10891         sem_trywait, and sem_timedwait.  Add herrno and res.
10892         * sem_init.c: Don't initialize lock and waiters members.
10893         * sem_open.c: Likewise.
10894         * sem_post.c: Removed.
10895         * sem_wait.c: Removed.
10896         * sem_trywait.c: Removed.
10897         * sem_timedwait.c: Removed.
10898         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
10899         Includes full implementations of sem_post, sem_wait, sem_trywait,
10900         and sem_timedwait.
10901         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
10902         for new implementation.
10903         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
10904         and waiters fields.
10906         * tst-sem3.c: Improve error message.
10907         * tst-signal3.c: Likewise.
10909         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
10910         to tell the kernel about the termination futex and to initialize tid
10911         member.  Don't initialize main_thread.
10912         * descr.h (struct pthread): Remove main_thread member.
10913         * cancelllation.c (__do_cancel): Remove code handling main thread.
10914         The main thread is not special anymore.
10916         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
10917         size of the stacks to stack_cache_actsize.
10919         * pt-readv.c: Add missing "defined".
10920         * pt-sigwait.c: Likewise.
10921         * pt-writev.c: Likewise.
10923 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
10925         * Versions: Export __connect from libpthread.
10926         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10928         * Makefile (libpthread-routines): Add pt-raise.
10929         * sysdeps/unix/sysv/linux/raise.c: New file.
10930         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
10931         * sysdeps/generic/pt-raise.c: New file.
10933         * pthread_cond_init.c: Initialize all data elements of the condvar
10934         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10936         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
10937         * pthread_create.c: Likewise.
10939         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
10940         * tst-key1.c: New file.
10941         * tst-key2.c: New file.
10942         * tst-key3.c: New file.
10944         * Versions: Export pthread_detach for version GLIBC_2.0.
10945         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
10947 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
10949         * pthread_key_create.c: Terminate search after an unused key was found.
10950         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10952         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
10953         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10955 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
10957         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
10958         dynamic lookup for errno in PIC.
10960         * allocatestack.c (get_cached_stack): Rearrange code slightly to
10961         release the stack lock as soon as possible.
10962         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
10963         the static TLS block.
10964         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
10966         * cancellation.c: Renamed from cancelation.c.
10967         * Makefile: Adjust accordingly.
10968         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
10969         * cleanup_defer.c: Use CANCELLATION_P.
10970         * pthread_testcancel.c: Likewise.
10971         * descr.h: Fix spelling in comments.
10972         * init.c: Likewise.
10973         * pthread_getattr_np.c: Likewise.
10974         * pthread_getschedparam.c: Likewise.
10975         * pthread_setschedparam.c: Likewise.
10976         * Versions: Likewise.
10978         * pt-pselect.c: New file.
10979         * Makefile (libpthread-routines): Add pt-pselect.
10980         * Versions: Add pselect.
10982         * tst-cancel4.c: New file.
10983         * Makefile (tests): Add tst-cancel4.
10985 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
10987         * pthread_mutex_lock.c: Always record lock ownership.
10988         * pthread_mutex_timedlock.c: Likewise.
10989         * pthread_mutex_trylock.c: Likewise.
10991         * pt-readv.c: New file.
10992         * pt-writev.c: New file.
10993         * pt-creat.c: New file.
10994         * pt-msgrcv.c: New file.
10995         * pt-msgsnd.c: New file.
10996         * pt-poll.c: New file.
10997         * pt-select.c: New file.
10998         * pt-sigpause.c: New file.
10999         * pt-sigsuspend.c: New file.
11000         * pt-sigwait.c: New file.
11001         * pt-sigwaitinfo.c: New file.
11002         * pt-waitid.c: New file.
11003         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
11004         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
11005         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
11006         * Versions: Add all the new functions.
11008         * tst-exit1.c: New file.
11009         * Makefile (tests): Add tst-exit1.
11011         * sem_timedwait.c: Minor optimization for more optimal fastpath.
11013 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
11015         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
11017         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
11018         call.  pthread_join is an official cancellation point.
11019         * pthread_timedjoin.c: Likewise.
11021         * pthread_cond_wait.c: Revert order in which internal lock are dropped
11022         and the condvar's mutex are retrieved.
11023         * pthread_cond_timedwait.c: Likewise.
11024         Reported by dice@saros.East.Sun.COM.
11026 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
11028         * pthreadP.h: Cut out all type definitions and move them...
11029         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
11030         * pthreadP.h: Include <internaltypes.h>.
11032         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
11033         performance tweaks.
11035         * sem_trywait.c: Shuffle #includes around to get right order.
11036         * sem_timedwait.c: Likewise.
11037         * sem_post.c: Likewise.
11038         * sem_wait.c: Likewise.
11040         * nptl 0.3 released.
11042         * Makefile (tests): Add tst-signal3.
11043         * tst-signal3.c: New file.
11045 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
11047         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
11048         the asms modify the sem object.
11049         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
11051         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
11052         the actual members.
11053         * pthreadP.h (struct sem): New type.  Actual semaphore type.
11054         * semaphoreP.h: Include pthreadP.h.
11055         * sem_getvalue.c: Adjust to sem_t change.
11056         * sem_init.c: Likewise.
11057         * sem_open.c: Likewise.
11058         * sem_post.c: Likewise.
11059         * sem_timedwait.c: Likewise.
11060         * sem_trywait.c: Likewise.
11061         * sem_wait.c: Likewise.
11063 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
11065         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
11066         * tst-basic2.c: New file.
11067         * tst-exec1.c: New file.
11068         * tst-exec2.c: New file.
11069         * tst-exec3.c: New file.
11071         * tst-fork1.c: Remove extra */.
11073         * nptl 0.2 released.  The API for IA-32 is complete.