[BZ #1920]
[glibc.git] / nptl / ChangeLog
blobc61769a2d3803797db1eeaa2aeea64e2f5115023
1 005-11-24  Jakub Jelinek  <jakub@redhat.com>
3         [BZ #1920]
4         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
5         __attribute__ instead of __attribute.
6         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
7         (__cleanup_fct_attribute): Likewise.
9 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
11         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
12         a write barrier before writing libgcc_s_getcfa.
14 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
16         * sysdeps/unix/sysv/linux/configure: Removed.
18 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
20         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
21         optional init_array/fini_array support.
23 2005-10-24  Roland McGrath  <roland@redhat.com>
25         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
26         versioned_symbol use.
28 2005-10-16  Roland McGrath  <roland@redhat.com>
30         * init.c (__pthread_initialize_minimal_internal): Even when using a
31         compile-time default stack size, apply the minimum that allocate_stack
32         will require, and round up to page size.
34 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
36         * Makefile ($(test-modules)): Remove static pattern rule.
38 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
39             Ulrich Drepper  <drepper@redhat.com>
41         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
42         alignment in callback function.
43         * Makefile: Add rules to build and run tst-align3.
44         * tst-align3.c: New file.
46 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
48         * allocatestack.c (setxid_signal_thread): Add
49         INTERNAL_SYSCALL_DECL (err).
51 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
53         * allocatestack.c (setxid_signal_thread): Need to use
54         atomic_compare_and_exchange_bool_acq.
56 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
57             Jakub Jelinek  <jakub@redhat.com>
59         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
60         CANCEL_RESTMASK.
61         (struct pthread): Move specific_used field to avoid padding.
62         Add setxid_futex field.
63         * init.c (sighandler_setxid): Reset setxid flag and release the
64         setxid futex.
65         * allocatestack.c (setxid_signal_thread): New function.  Broken
66         out of the bodies of the two loops in __nptl_setxid.  For undetached
67         threads check whether they are exiting and if yes, don't send a signal.
68         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
69         * pthread_create.c (start_thread): For undetached threads, check
70         whether setxid bit is set.  If yes, wait until signal has been
71         processed.
73         * allocatestack.c (STACK_VARIABLES): Initialize them.
74         * pthread_create.c (__pthread_create_2_1): Initialize pd.
76 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
78         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
79         waiters, awake all waiters on the associated mutex.
81 2005-09-22  Roland McGrath  <roland@redhat.com>
83         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
84         ../sysdeps/x86_64/hp-timing.h).
86 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
88         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
89         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
90         (lll_futex_wake_unlock): Define.
91         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
92         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
93         (lll_futex_wake_unlock): Define.
94         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
95         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
96         (lll_futex_wake_unlock): Define.
97         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
98         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
99         (lll_futex_wake_unlock): Define.
100         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
101         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
102         (lll_futex_wake_unlock): Define.
103         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
104         lll_futex_wake_unlock.
105         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
106         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
107         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
108         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
109         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
110         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
112 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
114         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
115         Fix typo in register name.
117 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
119         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
120         Use __sigfillset.  Document that sigfillset does the right thing wrt
121         to SIGSETXID.
123 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
125         [BZ #1102]
126         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
127         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
128         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
129         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
130         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
131         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
132         in the structure.
133         * Makefile (tests): Add tst-initializers1.
134         (CFLAGS-tst-initializers1.c): Set.
135         * tst-initializers1.c: New test.
137 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
139         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
140         Make sure __flags are located at offset 48 from the start of the
141         structure.
143 2005-07-02  Roland McGrath  <roland@redhat.com>
145         * Makeconfig: Comment fix.
147 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
149         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
150         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
151         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
152         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
153         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
154         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
155         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
156         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
157         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
158         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
160 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
162         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
163         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
164         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
165         fields.
166         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
167         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
168         field.  Put in sysinfo field unconditionally.
169         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
170         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
171         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
172         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
173         fields.
174         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
175         * pthread_create.c (__pthread_create_2_1): Use
176         THREAD_COPY_STACK_GUARD macro.
177         * Makefile: Add rules to build and run tst-stackguard1{,-static}
178         tests.
179         * tst-stackguard1.c: New file.
180         * tst-stackguard1-static.c: New file.
182 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
184         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
185         Invoke CGOTSETUP and CGOTRESTORE.
186         (CGOTSETUP, CGOTRESTORE): Define.
188 2005-05-29  Richard Henderson  <rth@redhat.com>
190         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
191         (tf_write, tf_writev): Use it.
192         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
193         the system minimum.
195 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
197         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
198         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
199         __librt_*_asynccancel@local.
201 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
203         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
204         all occurrences of JUMPTARGET.  Instead append @local to labels.
206 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
208         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
209         size/alignment of struct pthread rather than tcbhead_t.
210         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
211         Likewise.
212         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
213         Likewise.
214         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
215         Likewise.
217 2005-05-19  Richard Henderson  <rth@redhat.com>
219         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
220         __sync_val_compare_and_swap, not explicit _si variant.
221         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
223 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
225         [BZ #915]
226         * sysdeps/pthread/pthread.h: Avoid empty initializers.
228 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
230         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
231         .eh_frame section, use cfi_* directives.
233 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
235         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
236         of "" includes.
238 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
240         [BZ #1075]
241         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
242         aio_write blocks.
244 2005-04-27  Roland McGrath  <roland@redhat.com>
246         * Makefile (tests): Remove tst-clock2.
248         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
249         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
250         translating to the kernel clockid_t for our own process/thread clock.
252         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
254 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
256         * old_pthread_cond_init.c: Include <errno.h>.
257         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
258         process shared or uses clock other than CLOCK_REALTIME.
259         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
261 2005-04-13  David S. Miller  <davem@davemloft.net>
263         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
264         * sysdeps/sparc/sparc64/clone.S: New file.
266 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
268         [BZ #1102]
269         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
270         __inline instead of inline.
271         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
273 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
275         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
276         functionally equivalent, but shorter instructions.
277         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
278         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
279         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
280         Likewise.
281         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
282         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
283         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
284         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
285         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
286         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
287         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
288         Likewise.
289         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
290         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
291         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
292         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
293         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
295 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
297         * sysdeps/mips/Makefile: New file.
298         * sysdeps/mips/nptl-sysdep.S: New file.
299         * sysdeps/mips/tcb-offsets.sym: New file.
300         * sysdeps/mips/pthread_spin_lock.S: New file.
301         * sysdeps/mips/pthread_spin_trylock.S: New file.
302         * sysdeps/mips/pthreaddef.h: New file.
303         * sysdeps/mips/tls.h: New file.
304         * sysdeps/mips/jmpbuf-unwind.h: New file.
305         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
306         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
307         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
308         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
309         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
310         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
311         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
312         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
313         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
314         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
316 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
318         [BZ #1112]
319         * pthread_create.c (__pthread_create_2_1): Rename syscall error
320         variable to scerr.
322 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
324         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
326 2005-02-25  Roland McGrath  <roland@redhat.com>
328         * alloca_cutoff.c: Correct license text.
329         * tst-unload.c: Likewise.
330         * sysdeps/pthread/allocalim.h: Likewise.
331         * sysdeps/pthread/pt-initfini.c: Likewise.
332         * sysdeps/pthread/bits/libc-lock.h: Likewise.
333         * sysdeps/pthread/bits/sigthread.h: Likewise.
334         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
335         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
337 2005-02-16  Roland McGrath  <roland@redhat.com>
339         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
340         Use unsigned int * for ptr_nthreads.
342 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
344         [BZ #721]
345         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
346         gcc4.
348 2005-02-07  Richard Henderson  <rth@redhat.com>
350         [BZ #787]
351         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
352         argument.
354 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
356         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
357         order of arguments in invocation of atomic_add_zero.
359 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
361         [BZ #737]
362         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
363         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
364         at least gotntpoff relocation and addition.
365         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
366         Likewise.
367         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
368         Likewise.
369         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
370         Likewise.
372 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
374         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
375         entry for static tls deallocation fix.
376         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
377         also contains information whether the memory pointed to is static
378         TLS or not.
379         * sysdeps/i386/tls.h: Likewise.
380         * sysdeps/ia64/tls.h: Likewise.
381         * sysdeps/powerpc/tls.h: Likewise.
382         * sysdeps/s390/tls.h: Likewise.
383         * sysdeps/sh/tls.h: Likewise.
384         * sysdeps/sparc/tls.h: Likewise.
385         * sysdeps/x86_64/tls.h: Likewise.
387 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
389         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
391 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
393         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
394         %esp.
395         * Makefile (tests): Add tst-align2.
396         * tst-align2.c: New test.
397         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
398         -mpreferred-stack-boundary=4.
400 2004-12-18  Roland McGrath  <roland@redhat.com>
402         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
403         New file removed withdrawn for the moment.
405 2004-12-17  Richard Henderson  <rth@redhat.com>
407         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
408         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
410 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
412         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
413         Increased PTHREAD_STACK_MIN.
415         * tst-context1.c (stacks): Use bigger stack size.
417 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
419         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
420         * sysdeps/sparc/tcb-offsets.sym: Add TID.
422 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
424         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
425         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
426         * sysdeps/s390/tcb-offsets.sym (TID): Add.
428 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
430         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
432 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
434         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
435         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
437         * tst-getpid1.c: If child crashes, report this first.  Print which
438         signal.
440 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
442         * init.c (__pthread_initialize_minimal_internal): Also unblock
443         SIGSETXID.
445 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
447         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
448         _POSIX_THREAD_CPUTIME): Define to 0.
449         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
450         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
451         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
452         __timer_signal_thread_tclk): Remove.
453         (init_module): Remove their initialization.
454         (thread_cleanup): Remove their cleanup assertions.
455         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
456         __timer_signal_thread_tclk): Remove.
457         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
458         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
459         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
461 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
463         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
464         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
466         * Makefile (tests): Add tst-getpid2.
467         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
468         (do_test): Use it.  Use __clone2 instead of clone on ia64.
469         * tst-getpid2.c: New test.
471 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
473         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
475 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
477         * Makefile (tests): Add tst-getpid1.
478         * tst-getpid1.c: New file.
479         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
480         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
482 2004-12-02  Roland McGrath  <roland@redhat.com>
484         * Makefile (libpthread-nonshared): Variable removed.
485         ($(objpfx)libpthread_nonshared.a): Target removed.
486         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
487         These are now handled by generic magic from
488         libpthread-static-only-routines being set.
490 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
492         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
493         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
494         _POSIX_THREAD_PRIO_PROTECT): Define.
495         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
496         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
497         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
499 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
501         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
502         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
503         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
504         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
505         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
506         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
507         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
509 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
511         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
513         * Makefile (libpthread-routines): Add pthread_setschedprio.
514         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
515         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
516         * pthread_setschedprio.c: New file.
518 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
520         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
521         * pthread_cancel.c (pthread_create): Likewise.
523         * Makefile (libpthread-routines): Add vars.
524         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
525         * init.c (__default_stacksize, __is_smp): Remove.
526         * vars.c: New file.
527         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
528         and define a wrapper macro.
529         (PTHREAD_STATIC_FN_REQUIRE): Define.
530         * allocatestack.c (__find_thread_by_id): Undefine.
531         * pthread_create (__pthread_keys): Remove.
532         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
533         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
534         PTHREAD_STATIC_FN_REQUIRE.
536 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
538         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
539         parameter to REGISTER macro.
541 2004-11-17  Roland McGrath  <roland@redhat.com>
543         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
544         Make sure SIGCANCEL is blocked as well.
546 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
548         * sysdeps/pthread/setxid.h: New file.
549         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
550         (struct xid_command): Add forward decl.
551         (struct pthread_functions): Change return type of __nptl_setxid hook
552         to int.
553         * pthreadP.h (__nptl_setxid): Change return type to int.
554         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
555         calling thread, return its return value and set errno on failure.
556         * descr.h (struct xid_command): Change id type to long array.
558         * Makefile: Add rules to build and test tst-setuid1 and
559         tst-setuid1-static.
560         * tst-setuid1.c: New test.
561         * tst-setuid1-static.c: New test.
563 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
565         * Makefile (tests): Add tst-exit3.
566         * tst-exit3.c: New test.
568 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
570         * Makefile (tests): Add tst-exit2.
571         * tst-exit2.c: New file.
573 2004-11-09  Roland McGrath  <roland@redhat.com>
575         [BZ #530]
576         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
577         here, before calling clone.
578         * pthread_create.c (start_thread): Don't do it here.
580 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
582         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
584 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
586         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
587         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
588         assembler warning.
590 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
592         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
593         if sched_priority is not between minprio and maxprio.
595 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
597         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
598         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
600         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
601         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
603 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
605         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
606         not-cancelable I/O functions.
608 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
610         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
611         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
612         make sure 2 is stored in the futex and we looked at the old value.
613         Fix a few other problems to return the correct value.
615 2004-10-14  Richard Henderson  <rth@redhat.com>
617         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
618         make gcc4 happy.
620 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
622         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
623         of pthread-functions.h and pthreaddef.h.
624         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
626         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
627         Change __data.__nwaiters from int to unsigned int.
629         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
630         sysconf (_SC_THREAD_CPUTIME) returns negative value.
632         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
633         before return type.
635         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
636         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
638 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
640         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
641         test fails, remove message queue.
642         (tf_msgsnd): Likewise.
644 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
646         * tst-clock1.c: Change #ifdef to #if defined.
647         * tst-clock2.c: Likewise.
648         * tst-cond11.c: Likewise.
650         * sysdeps/pthread/timer_create.c (timer_create): Use
651         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
652         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
653         THREAD_CPUTIME.
655 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
657         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
658         _POSIX_THREAD_CPUTIME): Define to 0.
660 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
662         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
663         and _POSIX_THREAD_CPUTIME to zero.
664         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
665         * tst-barrier2.c: Fix testing for POSIX feature.
666         * tst-clock1.c: Likewise.
667         * tst-clock2.c: Likewise.
668         * tst-cond11.c: Likewise.
669         * tst-cond4.c: Likewise.
670         * tst-cond6.c: Likewise.
671         * tst-flock2.c: Likewise.
672         * tst-mutex4.c: Likewise.
673         * tst-mutex9.c: Likewise.
674         * tst-rwlock12.c: Likewise.
675         * tst-rwlock4.c: Likewise.
676         * tst-signal1.c: Likewise.
677         * tst-spin2.c: Likewise.
678         * sysdeps/pthread/posix-timer.h: Likewise.
679         * sysdeps/pthread/timer_create.c: Likewise.
680         * sysdeps/pthread/timer_routines.c: Likewise.
682 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
684         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
685         (__lll_mutex_timedlock_wait): Address futex correctly.
687         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
688         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
689         make sure 2 is stored in the futex and we looked at the old value.
690         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
691         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
692         which might very well made the code not working at all before.
693         [BZ #417]
695 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
697         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
698         allow SIGSETXID to be sent.
699         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
700         for SIGSETXID to be defined.
701         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
702         SIGSETXID cannot be blocked.
704         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
705         Add __extension__ to long long types.
706         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
707         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
708         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
709         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
710         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
711         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
712         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
714 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
716         * descr.h (struct pthread): Add stopped_start field.
717         * sysdeps/pthread/createthread.c (create_thread): Set
718         start_stopped flag in descriptor for new thread appropriately.
719         * pthread_create.c (start_thread): Only take lock to be stopped on
720         startup if stopped_start flag says so.
722 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
724         * pthread_create.c (__pthread_create_2_1): Remember whether thread
725         is created detached and if yes, do not try to free the stack in case
726         the thread creation failed.
727         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
728         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
729         case there has been no error.  [BZ #405]
731         * pthread_create.c (start_thread): Don't wait for scheduler data
732         etc to be set at the beginning of the function.  The cancellation
733         infrastructure must have been set up.  And enable async
734         cancellation before potentially going to sleep.  [BZ #401]
736 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
738         * Versions: Remove exports for pthread_set*id_np functions.
739         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
740         for now.
741         * Makefile: Don't build pthread_set*id code for now.
743 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
745         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
746         internal use.
747         * allocatestack.c (__nptl_setxid): New function.
748         * descr.h (struct xid_command): Define type.
749         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
750         (sighandler_setxid): New function.
751         (__pthread_initialize_minimal): Register sighandler_setxid for
752         SIGCANCEL.
753         * pt-allocrtsig.c: Update comment.
754         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
755         Declare __nptl_setxid.
756         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
757         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
758         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
759         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
760         and pthread_setresuid_np.
761         * pthread_setgid_np.c: New file.
762         * pthread_setuid_np.c: New file.
763         * pthread_setegid_np.c: New file.
764         * pthread_seteuid_np.c: New file.
765         * pthread_setregid_np.c: New file.
766         * pthread_setreuid_np.c: New file.
767         * pthread_setresgid_np.c: New file.
768         * pthread_setresuid_np.c: New file.
769         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
770         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
771         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
772         and pthread_setresuid_np.
773         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
774         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
775         pthread_setregid, and pthread_setresgid.
777 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
779         * allocatestack.c (allocate_stack): Return EAGAIN instead of
780         ENOMEM when out of memory.
782 2004-09-10  Roland McGrath  <roland@redhat.com>
784         [BZ #379]
785         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
786         code, since we don't try to use the broken CLONE_STOPPED any more.
787         * pthread_create.c (start_thread): Likewise.
789 2004-09-15  Richard Henderson  <rth@redhat.com>
791         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
793 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
795         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
796         (__libc_unwind_longjmp): Delete macro and declare as function.
797         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
798         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
799         nptl directory.
800         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
801         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
802         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
804 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
806         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
807         for __USE_XOPEN2K.
808         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
809         types also for __USE_XOPEN2K.
810         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
811         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
812         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
813         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
814         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
815         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
816         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
817         [BZ #320]
819 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
821         * sysdeps/pthread/pthread.h
822         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
823         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
824         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
825         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
826         [BZ #375]
828 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
830         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
831         PSEUDO to be used with . prefix.
833         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
834         Use atomic_increment instead of atomic_exchange_and_add.
835         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
836         Likewise.
837         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
838         Likewise.
839         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
840         Likewise.
842         * allocatestack.c (allocate_stack): Use atomic_increment_val
843         instead of atomic_exchange_and_add.
844         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
845         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
846         Likewise.
847         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
848         Likewise.
850         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
851         the initialization function might throw.
853 2005-09-05  Richard Henderson  <rth@redhat.com>
855         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
856         Move definition inside libpthread, libc, librt check.  Provide
857         definition for rtld.
859 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
861         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
862         * sysdeps/i386/jmpbuf-unwind.h: Likewise
863         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
864         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
865         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
866         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
867         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
868         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
869         * unwind.c: Use it.
871         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
872         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
873         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
874         Likewise.
875         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
876         Decrement __nwaiters.  If pthread_cond_destroy has been called and
877         this is the last waiter, signal pthread_cond_destroy caller and
878         avoid using the pthread_cond_t structure after unlock.
879         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
880         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
881         Read clock type from the least significant bits of __nwaiters instead
882         of __clock.
883         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
884         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
886 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
888         [BZ #342]
889         * Makefile (tests): Add tst-cond20 and tst-cond21.
890         * tst-cond20.c: New test.
891         * tst-cond21.c: New test.
892         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
893         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
894         it unsigned int.
895         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
896         Likewise.
897         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
898         (pthread_cond_t): Likewise.
899         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
900         Likewise.
901         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
902         Likewise.
903         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
904         Likewise.
905         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
906         (cond_nwaiters): New.
907         (clock_bits): New.
908         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
909         if there are waiters not signalled yet.
910         Wait until all already signalled waiters wake up.
911         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
912         __nwaiters.  If pthread_cond_destroy has been called and this is the
913         last waiter, signal pthread_cond_destroy caller and avoid using
914         the pthread_cond_t structure after unlock.
915         (__pthread_cond_wait): Increment __nwaiters in the beginning,
916         decrement it when leaving.  If pthread_cond_destroy has been called
917         and this is the last waiter, signal pthread_cond_destroy caller.
918         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
919         Likewise.  Read clock type from the least significant bits of
920         __nwaiters instead of __clock.
921         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
922         whether clock ID can be encoded in COND_CLOCK_BITS bits.
923         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
924         clock type just from the last COND_CLOCK_BITS bits of value.
925         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
926         instead of __clock, just from second bit of condattr's value.
928 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
930         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
931         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
932         != 64.
933         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
935 2004-08-15  Roland McGrath  <roland@frob.com>
937         * pthread_atfork.c: Update copyright terms including special exception
938         for these trivial files, which are statically linked into executables
939         that use dynamic linking for the significant library code.
941 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
943         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
944         pthread_rwlock_rdlock.
945         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
946         Decrease __nr_readers_queued after reacquiring lock.
947         * sysdeps/pthread/pthread_rwlock_timedrdlock
948         (pthread_rwlock_timedrdlock): Likewise.
949         Reported by Bob Cook <bobcook47@hotmail.com>.
951 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
953         * tst-rwlock14.c (tf): Read main thread handle from *ARG
954         before pthread_barrier_wait.
956 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
958         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
959         Remove unnecessary exception handling data.
961 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
963         [BZ #284]
964         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
965         instead of clockid_t.
967 2004-07-21  Roland McGrath  <roland@redhat.com>
969         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
971 2004-07-19  Roland McGrath  <roland@redhat.com>
973         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
975 2004-07-02  Roland McGrath  <roland@redhat.com>
977         * configure: Don't exit.
979 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
981         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
982         (__pthread_cond_timedwait): Check for invalid nanosecond in
983         timeout value.
985 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
987         * Makefile: Add rules to build and run tst-fini1.
988         * tst-fini1.c: New file.
989         * tst-fini1mod.c: New file.
991 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
993         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
994         if no cancellation support is needed.
995         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
996         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
997         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
998         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
999         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
1000         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
1001         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
1002         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
1003         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
1005         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
1006         only if not already defined.
1008 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
1010         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
1011         constraint "m" instead of "0" for futex.
1013         * shlib-versions: Add powerpc64-.*-linux.*.
1015 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
1017         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
1018         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
1019         for valid tv_nsec.
1020         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
1021         1 billion and 64-bit tv_nsec which is valid when truncated to 32
1022         bits.
1024 2004-06-29  Roland McGrath  <roland@redhat.com>
1026         * Banner: NPTL no longer has its own version number.
1027         * Makefile (nptl-version): Variable removed.
1028         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
1029         using $(version), the glibc version number.
1031 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1033         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
1034         Fix branch offset for a PLT entry.
1035         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
1036         Likewise.
1037         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
1038         Likewise.
1039         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
1040         Likewise.
1041         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
1042         Likewise.
1044 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
1046         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
1047         unconditionally.
1049 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
1051         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
1052         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
1053         instead of tv_sec.
1054         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
1055         (pthread_rwlock_timedrdlock): Likewise.
1057 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
1059         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
1060         Set __r7 to val, not mutex.
1062 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
1064         * Makefile: Add rules to build tst-rwlock14.
1065         * tst-rwlock14.c: New file.
1067 2004-06-24  Boris Hu  <boris.hu@intel.com>
1069         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
1070         check.
1071         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
1073 2004-06-19  Andreas Jaeger  <aj@suse.de>
1075         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
1076         assembler in last patch.
1078 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
1080         * sysdeps/pthread/pthread_cond_timedwait.c
1081         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
1082         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1083         (__pthread_cond_timedwait): Check for invalid nanosecond in
1084         timeout value.
1085         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1086         * tst-cond19.c: New file.
1087         * Makefile: Add rules to build and run tst-cond19.
1089 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
1091         * tst-context1.c (GUARD_PATTERN): Defined.
1092         (tst_context_t): Define struct containing ucontext_t & guard words.
1093         (ctx): Declare as an array of tst_context_t.
1094         (fct): Verify uc_link & guard words are still valid.
1095         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
1097 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1099         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
1100         Add __data.__futex field, reshuffle __data.__clock.
1101         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
1102         (__pthread_cond_signal): Increment __futex at the same time as
1103         __wakeup_seq or __total_seq.  Pass address of __futex instead of
1104         address of low 32-bits of __wakeup_seq to futex syscall.
1105         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
1106         (__pthread_cond_wait): Likewise.  Pass __futex value from before
1107         releasing internal lock to FUTEX_WAIT.
1108         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
1109         (__pthread_cond_timedwait): Likewise.
1110         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
1111         (FUTEX_CMP_REQUEUE): Define.
1112         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
1113         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
1114         Pass __futex value from before the unlock and __futex address instead
1115         of address of low 32-bits of __wakeup_seq to futex syscall.
1116         Fallback to FUTEX_WAKE all on any errors.
1118 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
1120         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
1121         comment typo.
1122         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
1123         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
1124         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
1125         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
1126         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
1128 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1130         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
1131         Add memory clobber to inline assembly.
1132         (__lll_mutex_trylock): Likewise.
1133         (__lll_mutex_cond_trylock): Likewise.
1135 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1137         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
1138         Pass val argument as 6th system call argument in %r7.
1140 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
1142         * Makefile (tests): Add tst-cond16.
1143         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
1144         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
1145         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
1146         Add __data.__futex field, reshuffle __data.__clock.
1147         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
1148         (__pthread_cond_signal): Increment __futex at the same time as
1149         __wakeup_seq or __total_seq.  Pass address of __futex instead of
1150         address of low 32-bits of __wakeup_seq to futex syscall.
1151         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
1152         (__pthread_cond_wait): Likewise.  Pass __futex value from before
1153         releasing internal lock to FUTEX_WAIT.
1154         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
1155         (__pthread_cond_timedwait): Likewise.
1156         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
1157         (FUTEX_CMP_REQUEUE): Define.
1158         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
1159         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
1160         Pass __futex value from before the unlock and __futex address instead
1161         of address of low 32-bits of __wakeup_seq to futex syscall.
1162         Fallback to FUTEX_WAKE all on any errors.
1163         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
1164         Define.
1165         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
1166         internally.  Return non-zero if error, zero if success.
1167         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
1168         Add __data.__futex field, reshuffle __data.__clock.
1169         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
1170         Define.
1171         (lll_futex_requeue): Add val argument, return 1 unconditionally
1172         for the time being.
1173         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
1174         Add __data.__futex field, reshuffle __data.__clock.
1175         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
1176         Define.
1177         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
1178         internally.  Return non-zero if error, zero if success.
1179         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
1180         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
1181         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
1182         Define.
1183         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
1184         internally.  Return non-zero if error, zero if success.
1185         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
1186         Add __data.__futex field, reshuffle __data.__clock.
1187         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
1188         Define.
1189         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
1190         internally.  Return non-zero if error, zero if success.
1191         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
1192         Add __data.__futex field, reshuffle __data.__clock.
1193         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
1194         Add __data.__futex field, reshuffle __data.__clock.
1195         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
1196         Increment __futex at the same time as __wakeup_seq or __total_seq.
1197         Pass address of __futex instead of address of low 32-bits of
1198         __wakeup_seq to futex syscall.
1199         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
1200         Pass __futex value from before releasing internal lock
1201         to FUTEX_WAIT.
1202         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1203         Likewise.  Avoid unnecessary shadowing of variables.
1204         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
1205         Set __futex to 2 * __total_seq.  Pass __futex value from before the
1206         unlock and __futex address instead of address of low 32-bits of
1207         __wakeup_seq to futex_requeue macro, adjust for new return value
1208         meaning.
1209         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
1210         (__pthread_cond_signal): Increment __futex at the same time as
1211         __wakeup_seq or __total_seq.  Pass address of __futex instead of
1212         address of low 32-bits of __wakeup_seq to futex syscall.
1213         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
1214         (__pthread_cond_wait): Likewise.  Pass __futex value from before
1215         releasing internal lock to FUTEX_WAIT.
1216         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1217         (__pthread_cond_timedwait): Likewise.
1218         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1219         (FUTEX_CMP_REQUEUE): Define.
1220         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
1221         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
1222         Pass __futex value from before the unlock and __futex address instead
1223         of address of low 32-bits of __wakeup_seq to futex syscall.
1224         Fallback to FUTEX_WAKE all on any errors.
1226 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1228         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
1229         Add nop to align the end of critical section.
1230         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
1232 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1234         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
1235         Add __broadcast_seq field.
1236         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
1237         all waiters as woken with woken_seq and bump broadcast counter.
1238         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
1239         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
1240         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1241         Comment typo fixes.  Avoid returning -ETIMEDOUT.
1243 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
1245         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1246         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
1247         Reported by Kaz Kojima.
1249 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
1251         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
1253 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
1255         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
1256         __broadcast_seq with bc_seq after acquiring internal lock instead of
1257         before it.
1259 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
1261         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
1262         compilation.
1263         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1264         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
1265         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
1266         (pthread_cond_t): Add __data.__broadcast_seq field.
1267         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1268         (FRAME_SIZE): Define.
1269         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
1270         Comment typo fixes.
1271         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
1272         Define.
1273         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
1274         typo fixes.
1275         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
1276         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
1277         fixes.
1279 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
1281         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
1282         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
1283         Add __broadcast_seq field.
1284         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1285         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1286         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1287         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1288         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1289         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
1290         all waiters as woken with woken_seq and bump broadcast counter.
1291         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
1292         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
1293         __broadcast_seq field.
1294         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1295         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
1296         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
1297         * pthread_cond_init.c: Initialize __broadcast_seq field.
1298         * Makefile (tests): Add tst-cond17 and tst-cond18.
1299         Add .NOTPARALLEL goal.
1300         * tst-cond16.c: New file.  From Jakub.
1301         * tst-cond17.c: New file.  From Jakub.
1302         * tst-cond18.c: New file.  From Jakub.
1304 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
1306         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
1307         unwind info.
1309         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
1310         Parametrize frame size.  Correct some unwind info.
1311         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1313 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
1315         * tst-stack3.c: Note testing functionality beyond POSIX.
1317 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
1319         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
1320         Change conditional from ifdef to if.
1322 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
1324         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
1325         SYSDEP_CANCEL_ERROR): Define.
1326         (PSEUDO): Use it.
1328 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
1330         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
1332 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
1334         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
1336 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1338         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
1339         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
1340         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
1341         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
1343 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
1345         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
1346         thread has all signals blocked.
1348 2004-04-18  Andreas Jaeger  <aj@suse.de>
1350         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
1351         (SEM_VALUE_MAX): Add missing brace.
1353 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
1355         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
1356         in rt subdir.
1357         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
1358         * sysdeps/pthread/tst-mqueue8x.c: New test.
1359         * tst-cancel4.c: Update comment about message queues.
1361         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
1362         return it_value { 0, 0 }.
1363         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
1364         like SIGEV_SIGNAL.
1365         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
1366         assertion for SIGEV_NONE.
1367         (thread_attr_compare): Compare all attributes, not just a partial
1368         subset.
1370 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
1372         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
1374 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
1376         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
1377         Just use a plain number.
1378         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
1379         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
1380         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
1381         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
1382         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
1383         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
1384         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
1386 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1388         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
1389         frame info.
1390         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1392 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
1394         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
1395         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
1396         of calling sigwaitinfo.
1398 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
1400         * allocatestack.c (allocate_stack): Set reported_guardsize
1401         unconditionally.
1402         * pthread_getattr_np.c (pthread_getattr_np): Use
1403         reported_guardsize instead of guardsize.
1404         * descr.h (struct pthread): Add reported_guardsize field.
1406 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
1408         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
1410 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
1412         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
1414 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
1416         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
1417         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
1418         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
1419         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
1420         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
1421         Define.
1422         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
1423         (_POSIX_MESSAGE_PASSING): Define.
1424         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
1425         (_POSIX_MESSAGE_PASSING): Define.
1426         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
1427         (_POSIX_MESSAGE_PASSING): Define.
1429 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
1431         * tst-context1.c (fct): Check whether correct stack is used.
1433 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
1435         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
1436         matching constraints for asm mem parameters.
1438         * tst-clock2.c (tf): Don't define unless needed.
1440 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
1442         * Makefile (link-libc-static): Use $(static-gnulib) instead of
1443         $(gnulib).
1445 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
1447         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
1448         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
1449         * pthreadP.h: Declare __nptl_deallocate_tsd.
1450         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
1451         Adjust caller.
1453         * Makefile (tests): Add tst-tsd5.
1454         * tst-tsd5.c: New file.
1456 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
1458         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
1459         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
1460         is SHLIB_COMPAT check.
1461         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
1462         (__pthread_attr_getaffinity_old): Likewise.
1463         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
1464         (__pthread_getaffinity_old): Likewise.
1465         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1466         (__pthread_setaffinity_old): Likewise.
1468 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
1470         * allocatestack.c (_make_stacks_executable): Call
1471         _dl_make_stack_executable first.
1473 2004-03-24  Roland McGrath  <roland@redhat.com>
1475         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
1476         constraint instead of "0".
1478 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
1480         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1481         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
1483         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
1484         code to avoid warning.
1486 2004-03-24  Andreas Jaeger  <aj@suse.de>
1488         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
1489         (__pthread_attr_setaffinity_old): Remove const.
1491 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
1493         * sysdeps/unix/sysv/linux/smp.h: New file.
1494         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
1495         * init.c: Define __is_smp.
1496         (__pthread_initialize_minimal_internal): Call is_smp_system to
1497         initialize __is_smp.
1498         * pthreadP.h: Declare __is_smp.
1499         Define MAX_ADAPTIVE_COUNT is necessary.
1500         * pthread_mutex_init.c: Add comment regarding __spins field.
1501         * pthread_mutex_lock.c: Implement adaptive mutex type.
1502         * pthread_mutex_timedlock.c: Likewise.
1503         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
1504         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
1505         Add __spins field.
1506         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1507         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1508         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1509         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1510         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1511         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1512         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1513         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
1514         lll_mutex_cond_trylock.
1515         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1516         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
1517         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
1518         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
1519         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
1520         Define BUSY_WAIT_NOP.
1521         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
1522         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
1524         * tst-mutex5.c: Add support for testing adaptive mutexes.
1525         * tst-mutex7.c: Likewise.
1526         * tst-mutex5a.c: New file.
1527         * tst-mutex7a.c: New file.
1528         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
1530         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1531         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
1532         vgettimeofday call might destroy the content.
1534         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
1535         @pause in the loop.
1537         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
1538         No need to restrict type of ret.  Make it int.  Add comment.
1540         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
1541         Remove unnecessary setne instruction.
1543 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
1545         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
1546         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
1547         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
1548         If realloc fails, break out of the loop.
1550 2004-03-20  Andreas Jaeger  <aj@suse.de>
1552         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1553         (__pthread_setaffinity_old): Fix interface.
1554         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
1555         (__pthread_getaffinity_old): Likewise.
1557         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1558         (__pthread_setaffinity_new): Remove duplicate declaration.
1560 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1562         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
1563         the return value to a safe register.
1564         (CDISABLE): Set the function argument correctly.
1566 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1568         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
1569         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
1570         Rewrite so that only one locked memory operation per round is needed.
1571         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
1572         (pthread_barrier_wait): After wakeup, release lock only when the
1573         last thread stopped using the barrier object.
1574         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
1575         (__pthread_cond_wait): Don't store mutex address if the current
1576         value is ~0l.  Add correct cleanup support and unwind info.
1577         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
1578         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
1579         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
1580         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
1581         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
1582         Add correct cleanup support and unwind info.
1583         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
1584         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
1585         information for syscall wrappers.
1587 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
1589         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
1590         cpusetsize field, remove next.
1591         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
1592         parameter for size of the CPU set.
1593         (pthread_setaffinity_np): Likewise.
1594         (pthread_attr_getaffinity_np): Likewise.
1595         (pthread_attr_setaffinity_np): Likewise.
1596         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
1597         interface change, keep compatibility code.
1598         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
1599         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
1600         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
1601         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
1602         __pthread_getaffinity_np.
1603         * Versions: Add version for changed interfaces.
1604         * tst-attr3.c: Adjust test for interface change.
1605         * pthread_getattr_np.c: Query the kernel about the affinity mask with
1606         increasing buffer sizes.
1607         * pthread_attr_destroy.c: Remove unused list handling.
1608         * pthread_attr_init.c: Likewise.
1610 2004-03-17  Roland McGrath  <roland@redhat.com>
1612         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
1613         first argument to clock_getres so we ever enable kernel timers.
1615 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
1617         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
1619 2004-03-12  Richard Henderson  <rth@redhat.com>
1621         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
1622         oldvalue from CENABLE to CDISABLE.
1624 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
1626         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
1627         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
1628         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
1629         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
1631 2004-03-11  Richard Henderson  <rth@redhat.com>
1633         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
1634         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
1635         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
1637 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
1639         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
1640         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
1641         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
1643 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
1645         * forward.c (__pthread_cond_broadcast_2_0,
1646         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
1647         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
1648         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
1650 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1652         * sysdeps/sh/tcb-offsets.sym: Add PID.
1653         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
1654         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
1656 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
1658         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
1659         include <sysdep-cancel.h>, vfork is no cancellation point.
1660         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
1661         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
1662         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
1664 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
1666         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
1667         libc_hidden_def.
1668         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
1669         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
1670         Likewise.
1671         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
1672         Likewise.
1673         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
1674         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
1675         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
1676         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
1677         of DO_CALL_VIA_BREAK.  Work around a gas problem.
1679         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
1680         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
1681         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
1682         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
1683         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
1684         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
1686         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
1687         a local register for saving old PID.  Negate PID in parent upon exit.
1689         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
1690         tcb-offsets.h.
1691         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
1692         before syscall, set to the old value in the parent afterwards.
1693         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
1694         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
1695         tcb-offsets.h.
1696         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
1697         before syscall, set to the old value in the parent afterwards.
1698         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
1699         * sysdeps/s390/tcb-offsets.sym: Add PID.
1701         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
1702         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
1703         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
1704         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
1705         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
1706         * sysdeps/sparc/tcb-offsets.sym: Add PID.
1708 2004-03-10  Andreas Schwab  <schwab@suse.de>
1710         * sysdeps/ia64/tcb-offsets.sym: Add PID.
1711         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
1712         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
1714 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
1716         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
1717         * tst-cancel21.c (do_one_test): Likewise.
1718         Reported by Gordon Jin <gordon.jin@intel.com>.
1720 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
1722         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
1723         if non-zero and set to INT_MIN if zero.
1724         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
1725         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
1726         (SAVE_PID, RESTORE_PID): Define.
1727         (__vfork): Use it.
1728         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
1729         Use relative path to avoid including NPTL i386/vfork.S.
1730         (SAVE_PID, RESTORE_PID): Define.
1731         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
1732         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
1733         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
1734         tst-vfork2x.
1735         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
1736         * tst-vfork1.c: New test.
1737         * tst-vfork2.c: New test.
1738         * tst-vfork1x.c: New test.
1739         * tst-vfork2x.c: New test.
1741 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
1743         * sysdeps/i386/tcb-offsets.sym: Add PID.
1744         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
1745         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
1746         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
1748 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
1750         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
1752 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
1754         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
1755         _rtld_global_ro.
1757 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
1759         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
1760         _rtld_global_ro.
1762         * tst-once4.c: Remove unnecessary macro definition.
1764         * tst-mutex7.c (do_test): Limit thread stack size.
1765         * tst-once2.c (do_test): Likewise.
1766         * tst-tls3.c (do_test): Likewise.
1767         * tst-tls1.c (do_test): Likewise.
1768         * tst-signal3.c (do_test): Likewise.
1769         * tst-kill6.c (do_test): Likewise.
1770         * tst-key4.c (do_test): Likewise.
1771         * tst-join4.c (do_test): Likewise.
1772         * tst-fork1.c (do_test): Likewise.
1773         * tst-context1.c (do_test): Likewise.
1774         * tst-cond2.c (do_test): Likewise.
1775         * tst-cond10.c (do_test): Likewise.
1776         * tst-clock2.c (do_test): Likewise.
1777         * tst-cancel10.c (do_test): Likewise.
1778         * tst-basic2.c (do_test): Likewise.
1779         * tst-barrier4.c (do_test): Likewise.
1781 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
1783         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
1785 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
1787         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1788         (__pthread_cond_timedwait): Optimize wakeup test.
1789         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
1790         (__pthread_cond_wait): Likewise.
1791         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
1792         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
1793         Likewise.
1795 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
1797         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1798         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
1799         the atomic instruction needed.
1800         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1801         (__lll_mutex_lock_wait): Likewise.
1803 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
1805         * Makefile (tests): Add tst-cond14 and tst-cond15.
1806         * tst-cond14.c: New file.
1807         * tst-cond15.c: New file.
1809 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
1811         * sysdeps/pthread/createthread.c (create_thread): Remove use of
1812         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
1813         needs to be implemented differently to be useful.
1815 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
1817         * pthread_attr_setschedparam.c: Don't test priority against limits
1818         here.  Set ATTR_FLAG_SCHED_SET flag.
1819         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
1820         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
1821         from parent thread to child.  If attribute is used and scheduling
1822         parameters are not inherited, copy parameters from attribute or
1823         compute them.  Check priority value.
1824         * pthread_getschedparam.c: If the parameters aren't known yet get
1825         them from the kernel.
1826         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
1827         ATTR_FLAG_POLICY_SET flag for thread.
1828         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
1829         and ATTR_FLAG_POLICY_SET.
1831         * sysdeps/pthread/createthread.c: Use tgkill if possible.
1833         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
1834         fail if stack address hasn't been set.  Just return 0.
1836 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
1838         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
1839         libpthread for the files in this list.
1840         (CFLAGS-tst-unload): Removed.
1841         * tst-unload.c (do_test): Don't use complete path for
1842         LIBPHREAD_SO.
1844         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
1845         tst-_res1mod2.
1847 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
1849         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
1850         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
1851         operation per round is needed.
1852         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1853         (__lll_mutex_lock_wait): Likewise.
1855 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
1857         * tst-cancel9.c (cleanup): Don't print to stderr.
1859 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1861         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
1863 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
1865         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
1866         (__syscall_error_handler2): Call CDISABLE.
1867         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
1868         (__syscall_error_handler2): Call CDISABLE.
1870         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1871         Release lock before the loop, don't reacquire it.
1873         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
1875 2004-02-19  Andreas Schwab  <schwab@suse.de>
1877         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1878         Fix last change.
1880 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
1882         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
1883         (pthread_barrier_wait): After wakeup, release lock only when the
1884         last thread stopped using the barrier object.
1885         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
1886         (pthread_barrier_wait): Likewise.
1887         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
1888         Likewise.
1889         * Makefile (tests): Add tst-barrier4.
1890         * tst-barrier4.c: New file.
1892         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1893         (__pthread_cond_timedwait): Perform timeout test while holding
1894         internal lock to prevent wakeup race.
1895         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
1896         * sysdeps/pthread/pthread_cond_timedwait.c
1897         (__pthread_cond_timedwait): Likewise.
1898         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
1899         (__pthread_cond_timedwait): Likewise.
1901 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
1903         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
1904         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
1905         * Makefile (tests): Add tst-rwlock13.
1906         * tst-rwlock13.c: New test.
1908 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
1910         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1911         (__condvar_tw_cleanup): Little optimization.
1912         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
1914 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
1916         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
1917         libpthread as "lib" parameter to SHLIB_COMPAT.
1918         (__novmx_siglongjmp): Fix typo in function name.
1919         (__novmx_longjmp): Fix typo in function name.
1921 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
1923         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
1924         __builtin_expect.
1926         * sysdeps/generic/pt-longjmp.c: Moved to...
1927         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
1929 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
1931         * Makefile (libpthread-routines): Add pt-cleanup.
1932         * pt-longjmp.c: Removed.
1933         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
1934         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
1935         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
1936         Version longjmp, siglongjmp for GLIBC_2.3.4.
1937         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
1939 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
1941         * sysdeps/pthread/pthread_cond_timedwait.c
1942         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
1943         Reuse code.  Add __builtin_expects.
1945         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
1946         (__pthread_cond_timedwait): Get internal lock in case timeout has
1947         passed before the futex syscall.
1948         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1950 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
1952         * allocatestack.c: Pretty printing.
1954         * sysdeps/pthread/createthread.c (create_thread): Don't add
1955         CLONE_DETACHED bit if it is not necessary.
1957 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
1959         * pthread_getattr_np.c: Include ldsodefs.h.
1961 2004-01-16  Richard Henderson  <rth@redhat.com>
1963         * allocatestack.c: Don't declare __libc_stack_end.
1964         * init.c (__pthread_initialize_minimal_internal): Likewise.
1965         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
1967 2004-01-15  Richard Henderson  <rth@redhat.com>
1969         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
1970         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
1971         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
1972         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
1973         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
1974         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
1975         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
1976         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
1978 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
1980         * init.c (pthread_functions): Make array const.
1982 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
1984         * allocatestack.c (__make_stacks_executable): Change interface.
1985         Check parameters.  Pass parameter on to libc counterpart.
1986         * pthreadP.h: Change declaration.
1988 2004-01-13  Richard Henderson  <rth@redhat.com>
1990         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
1991         prototype form.
1992         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
1993         Likewise.
1995         * sysdeps/alpha/Makefile: New file.
1996         * sysdeps/alpha/tcb-offsets.sym: New file.
1997         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
1998         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
2000         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
2001         on powerpc version.
2003 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
2005         * Makefile (tests): Add tst-backtrace1.
2006         * tst-backtrace1.c: New test.
2008 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
2010         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
2011         register as second parameter to the REGISTER macro.
2012         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
2013         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
2014         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
2015         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
2016         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
2017         of thread register as second parameter to REGISTER macro in 64 case.
2019 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
2021         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
2022         (CFLAGS-getpid.o): Defined.
2023         (CFLAGS-getpid.os): Defined.
2025 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
2027         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
2028         returned for main thread does not overlap with any other VMA.
2029         Patch by Jakub Jelinek.
2031 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
2033         * tst-raise1.c: Include stdio.h.
2035 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
2037         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
2038         setting with __ASSUME_TGKILL || defined __NR_tgkill.
2039         If pid is 0, set it to selftid.
2040         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
2041         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
2042         != 0, return self->tid without doing a syscall.
2043         * descr.h (struct pthread): Move pid field after tid.
2045         * Makefile (tests): Add tst-raise1.
2046         * tst-raise1.c: New file.
2048 2003-12-23  Roland McGrath  <roland@redhat.com>
2050         * tst-oddstacklimit.c: New file.
2051         * Makefile (tests): Add it.
2052         (tst-oddstacklimit-ENV): New variable.
2054         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
2055         value up to page size for __default_stacksize.
2057 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
2059         * Makefile (tests): Add tst-eintr5.
2060         * tst-eintr5.c: New file.
2062         * eintr.c (eintr_source): Prevent sending signal to self.
2064         * tst-eintr2.c (tf1): Improve error message.
2066 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
2068         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
2069         * sysdeps/unix/sysv/linux/getpid.c: New file.
2070         * pthread_cancel.c: Add comment explaining use of PID field.
2071         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
2072         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
2073         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
2074         temporarily to signal the field must not be relied on and updated
2075         by getpid().
2076         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
2077         temporarily negative.
2078         * sysdeps/unix/sysv/linux/raise.c: Likewise.
2080 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
2082         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
2083         (eintr_source): If ARG != NULL, use pthread_kill.
2084         * tst-eintr1.c: Adjust for this change.
2085         * tst-eintr2.c: Likewise.
2086         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
2087         * tst-eintr3.c: New file.
2088         * tst-eintr4.c: New file.
2090 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
2092         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
2093         if CANCELSTATE_BITMASK is set.
2094         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
2095         Likewise.
2097         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
2098         (tests-reverse): Add tst-cancel23.
2099         * tst-cancel22.c: New test.
2100         * tst-cancel23.c: New test.
2102 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
2104         * tst-eintr1.c: Better error messages.
2106         * Makefile (tests): Add tst-eintr2.
2107         * tst-eintr2.c: New file.
2109 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
2111         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
2112         (CFLAGS-tst-cancelx21.c): Set.
2113         * tst-cancel21.c: New test.
2114         * tst-cancelx21.c: New test.
2116         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
2117         comparison operand.
2118         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
2119         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
2120         * pt-longjmp.c: Include jmpbuf-unwind.h.
2121         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
2122         _JMPBUF_UNWINDS.  Adjust compared pointers.
2123         * init.c (__pthread_initialize_minimal_internal): Initialize
2124         pd->stackblock_size.
2125         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
2126         * sysdeps/alpha/jmpbuf-unwind.h: New file.
2127         * sysdeps/i386/jmpbuf-unwind.h: New file.
2128         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
2129         * sysdeps/s390/jmpbuf-unwind.h: New file.
2130         * sysdeps/sh/jmpbuf-unwind.h: New file.
2131         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
2132         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
2133         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
2134         (_JMPBUF_CFA_UNWINDS): Remove.
2135         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
2137 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
2139         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
2140         (CFLAGS-tst-cancelx20.c): Set.
2141         * tst-cancel20.c: New test.
2142         * tst-cancelx20.c: New test.
2144 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
2146         * init.c (__pthread_initialize_minimal_internal): Don't treat
2147         architectures with separate register stack special here when
2148         computing default stack size.
2150 2003-12-17  Roland McGrath  <roland@redhat.com>
2152         * Makefile (tst-cancelx7-ARGS): New variable.
2153         Reportd by Greg Schafer <gschafer@zip.com.au>.
2155 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
2157         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
2158         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
2159         (tst-stack3-ENV): Set.
2160         ($(objpfx)tst-stack3-mem): New.
2161         * tst-stack3.c: New test.
2163 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
2165         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
2166         Add unwind directives.  Drop unused .regstk directive.
2167         (_fini_EPILOG_BEGINS): Add unwind directives.
2169 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
2171         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
2172         Assume parameter is a pointer.
2173         (lll_futex_wake): Likewise.
2174         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
2175         Likewise.
2176         (lll_futex_wake): Likewise.
2177         Reported by Boris Hu.
2178         * sysdeps/unix/sysv/linux/unregister-atfork.c
2179         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
2181         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
2183 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
2185         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
2186         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
2187         __rtld_lock_initialize for ld.so lock.
2188         Patch in part by Adam Li <adam.li@intel.com>.
2190 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
2192         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
2193         in $(gnulib).  Also, remove stale comment.
2195 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
2197         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
2198         advantage of new syscall stub and optimize accordingly.
2200         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
2201         from SYS_futex, to match expectations of
2202         sysdep.h:DO_INLINE_SYSCALL.
2203         (lll_futex_clobbers): Remove.
2204         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
2205         (lll_futex_wake): Likewise.
2206         (lll_futex_requeue): Likewise.
2207         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
2208         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
2209         Jelinek).
2210         (__lll_mutex_lock): Likewise.
2211         (__lll_mutex_cond_lock): Likewise.
2212         (__lll_mutex_timed_lock): Likewise.
2213         (__lll_mutex_unlock): Likewise.
2214         (__lll_mutex_unlock_force): Likewise.
2216         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
2217         comes before the include of <sysdep.h>.
2218         (THREAD_SELF_SYSINFO): New macro.
2219         (THREAD_SYSINFO): Likewise.
2220         (INIT_SYSINFO): New macro.
2221         (TLS_INIT_TP): Call INIT_SYSINFO.
2223         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
2225         * sysdeps/pthread/createthread.c (create_thread): Use
2226         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
2227         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
2228         THREAD_SELF_SYSINFO instead of open code.
2229         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
2230         (THREAD_SYSINFO): Likewise.
2232         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
2234         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
2236 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
2238         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
2239         instead of .init.  Patch by David Mosberger.
2241 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
2243         * sysdeps/pthread/configure.in: Remove broken declaration in C
2244         cleanup handling check.
2246 2003-11-30  Andreas Jaeger  <aj@suse.de>
2248         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
2249         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
2250         Likewise.
2252 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
2254         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
2255         * pthread_attr_destroy.c: Include shlib-compat.h.
2256         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
2257         is set in iattr->flags.
2258         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
2260 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
2262         * Makefile (distribute): Add tst-cleanup4aux.c.
2264         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
2265         include.
2267 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
2269         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
2270         pthread_cond_signal.
2272         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
2273         store mutex address if the current value is ~0l.
2274         * sysdeps/pthread/pthread_cond_timedwait.c
2275         (__pthread_cond_timedwait): Likewise.
2276         * sysdeps/pthread/pthread_cond_broadcast.c
2277         (__pthread_cond_broadcast): Don't use requeue for pshared
2278         condvars.
2280         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
2281         (__pthread_cond_wait): Don't store mutex address if the current
2282         value is ~0l.
2283         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
2284         (__pthread_cond_timedwait): Likewise.
2285         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
2286         (__pthread_cond_broadcast): Don't use requeue for pshared
2287         condvars.
2289         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
2290         element with ~0l for pshared condvars, with NULL otherwise.
2292         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
2293         (__pthread_cond_wait): Don't store mutex address if the current
2294         value is ~0l.
2295         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2296         (__pthread_cond_timedwait): Likewise.
2297         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
2298         (__pthread_cond_broadcast): Don't use requeue for pshared
2299         condvars.
2301         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
2302         * tst-cond12.c: New file.
2303         * tst-cond13.c: New file.
2305 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
2307         * sysdeps/pthread/configure.in: Make missing forced unwind support
2308         fatal.
2310 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
2312         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
2314 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
2316         * Makefile: Add magic to clean up correctly.
2318 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
2320         * unwind.c (FRAME_LEFT): Define.
2321         (unwind_stop): Handle old style cleanups here.
2322         (__pthread_unwind): Handle old style cleanups only if
2323         !HAVE_FORCED_UNWIND.
2324         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
2325         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
2326         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
2327         ($(objpfx)tst-cleanupx4): Likewise.
2328         * tst-cleanup4.c: New test.
2329         * tst-cleanup4aux.c: New.
2330         * tst-cleanupx4.c: New test.
2332 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
2334         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
2335         lll_mutex_*lock macros to skip atomic operations on some archs.
2337 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
2339         * sysdeps/pthread/tst-timer.c (main): Initialize
2340         sigev2.sigev_value as well.
2342 2003-10-15  Roland McGrath  <roland@redhat.com>
2344         * sysdeps/pthread/configure.in: Barf if visibility attribute support
2345         is missing.
2346         * sysdeps/pthread/configure: Regenerated.
2348 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2350         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
2351         locking macros.  No distinction between normal and mutex locking
2352         anymore.
2353         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
2354         Merge bits from lowlevelmutex.S we still need.
2355         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
2356         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
2357         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
2358         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
2359         new mutex implementation.
2360         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
2361         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
2362         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2363         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
2364         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
2365         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
2366         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
2367         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
2368         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
2369         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
2370         symbol for entry point to avoid cancellation.
2372 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
2374         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
2375         changes.
2376         (SAVE_OLDTYPE_0): Fix a typo.
2378 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
2380         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
2381         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
2383 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
2385         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
2386         correct offset.
2388 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
2390         * Makefile (tests): Add tst-cancel19.
2391         * tst-cancel19.c: New test.
2393 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
2395         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
2396         restoring of the old cancellation type.
2398 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
2400         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
2402 2003-09-27  Wolfram Gloger  <wg@malloc.de>
2404         * sysdeps/pthread/malloc-machine.h: New file
2406 2003-09-24  Roland McGrath  <roland@redhat.com>
2408         * allocatestack.c (__make_stacks_executable): Don't ignore return
2409         value from _dl_make_stack_executable.
2411 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
2413         * allocatestack.c (__make_stacks_executable): Also change
2414         permission of the currently unused stacks.
2416         * allocatestack.c (change_stack_perm): Split out from
2417         __make_stacks_executable.
2418         (allocate_stack): If the required permission changed between the time
2419         we started preparing the stack and queueing it, change the permission.
2420         (__make_stacks_executable): Call change_stack_perm.
2422         * Makefile: Build tst-execstack-mod locally.
2423         * tst-execstack-mod.c: New file.
2425 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
2427         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
2429 2003-09-23  Roland McGrath  <roland@redhat.com>
2431         * tst-execstack.c: New file.
2432         * Makefile (tests): Add it.
2433         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
2434         (LDFLAGS-tst-execstack): New variable.
2436         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
2437         whether to use PROT_EXEC for stack mmap.
2438         (__make_stacks_executable): New function.
2439         * pthreadP.h: Declare it.
2440         * init.c (__pthread_initialize_minimal_internal): Set
2441         GL(dl_make_stack_executable_hook) to that.
2443 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
2445         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
2446         recommendation from AMD re avoidance of lock prefix.
2448 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
2450         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
2451         lll_futex_timed_wait instead of lll_futex_wait.
2452         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
2453         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
2454         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
2455         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
2456         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
2457         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
2458         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
2459         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
2460         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
2461         Completely revamp the locking macros.  No distinction between
2462         normal and mutex locking anymore.
2463         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2464         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
2465         __lll_lock_timedwait): Fix prototypes.
2466         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
2467         __lll_lock_timedwait): Likewise.
2468         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
2469         macros, add __builtin_expect.
2470         (lll_mutex_timedlock): Likewise.  Fix return value.
2471         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
2472         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
2473         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
2474         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
2475         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
2476         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
2477         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
2478         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
2480 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
2482         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
2483         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
2484         operation if possible.
2486         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
2487         like jumping over the lock prefix.
2489 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
2491         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
2492         locking macros.  No distinction between normal and mutex locking
2493         anymore.
2494         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2495         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2496         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2497         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
2498         locking.  Merge bits from lowlevelmutex.S we still need.
2499         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
2500         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
2501         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
2502         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
2503         * Makefile (routines): Remove libc-lowlevelmutex.
2504         (libpthread-rountines): Remove lowlevelmutex.
2505         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
2506         for new mutex implementation.
2507         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
2508         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2509         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2510         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
2511         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
2512         Likewise.
2513         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
2514         Likewise.
2515         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
2516         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2517         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
2518         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
2519         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2520         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2521         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
2522         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
2523         Likewise.
2524         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
2525         Likewise.
2526         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
2527         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
2528         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
2529         Don't use requeue.
2530         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
2531         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
2533 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
2535         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
2536         in parameters of asm with output parameters.
2538         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
2539         type of DECR parameter to int.
2540         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
2542 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
2544         * tst-attr3.c (tf, do_test): Print stack start/end/size and
2545         guardsize for each thread.
2547 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
2549         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
2550         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
2551         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
2553         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
2554         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
2555         NULL.
2556         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
2557         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
2558         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
2559         (pthread_getaffinity_np): Add hidden_def.
2561         * Makefile (tests): Add tst-attr3.
2562         * tst-attr3.c: New test.
2564         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
2566 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
2568         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
2569         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
2571 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
2573         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
2574         * tst-align.c: Include tst-stack-align.h.
2575         (tf, do_test): Use TEST_STACK_ALIGN macro.
2577 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
2579         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
2580         variable.
2582 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
2584         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
2585         stack-related values for the initial thread.
2587 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
2589         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
2591 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
2593         * pthread_mutex_lock.c: Minor code rearrangements.
2595 2003-09-05  Roland McGrath  <roland@redhat.com>
2597         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
2598         Instead, include ../nptl_db/db_info.c to do its magic.
2599         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
2600         (__pthread_pthread_key_2ndlevel_size): Likewise.
2601         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
2602         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
2603         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
2604         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
2605         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
2606         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
2607         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
2608         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
2609         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
2610         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
2611         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
2612         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
2613         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
2614         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
2615         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
2616         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
2617         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
2619 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
2621         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
2622         of pthread_t to be compatible with LT.
2623         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2624         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2625         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2626         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2627         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
2628         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2629         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
2631 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
2633         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
2635 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
2637         * unwind-forcedunwind.c: Move to...
2638         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
2639         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
2640         * sysdeps/pthread/jmpbuf-unwind.h: New file.
2641         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
2642         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
2643         * unwind.c: Include jmpbuf-unwind.h.
2644         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
2646 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
2648         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
2649         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
2650         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
2651         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
2652         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
2653         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
2654         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
2655         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
2656         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
2657         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
2658         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
2659         function.
2660         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
2661         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
2662         * Makefile (tests): Add tst-stack2.
2663         * tst-stack2.c: New test.
2664         * tst-stack1.c: Include limits.h and sys/param.h.
2665         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
2667         * pthread_condattr_setpshared.c: Include errno.h.
2668         (pthread_condattr_setpshared): Return EINVAL if pshared
2669         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
2671         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
2672         defined symbol for entry point to avoid cancellation.
2673         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
2674         Likewise.
2675         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
2676         Likewise.
2677         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
2678         Likewise.
2679         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
2680         Likewise.
2681         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
2682         Likewise.
2683         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
2684         __close_nocancel, __read_nocancel, __write_nocancel,
2685         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
2686         libpthread.so or librt.so, define to corresponding function
2687         without _nocancel suffix.
2688         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
2689         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
2690         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
2692         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
2694 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
2696         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
2697         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
2699         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
2700         in subsections has a symbol associated with it.
2702         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
2703         defined symbol for entry point to avoid cancellation.
2704         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
2706 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
2708         * Makefile (tests): Add tst-tls5.
2709         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
2710         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
2711         ($(objpfx)tst-tls5): New.
2712         ($(objpfx)tst-tls6.out): Likewise.
2713         (tests): Depend on $(objpfx)tst-tls6.out.
2714         * tst-tls3.c: Include stdint.h and pthreaddef.h.
2715         (do_test): Check pthread_self () return value alignment.
2716         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
2717         (tf): Check pthread_self () return value alignment.
2718         * tst-tls5.c: New test.
2719         * tst-tls5.h: New.
2720         * tst-tls5mod.c: New.
2721         * tst-tls5moda.c: New.
2722         * tst-tls5modb.c: New.
2723         * tst-tls5modc.c: New.
2724         * tst-tls5modd.c: New.
2725         * tst-tls5mode.c: New.
2726         * tst-tls5modf.c: New.
2727         * tst-tls6.sh: New test.
2729         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
2730         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
2731         * init.c (pthread_functions): Initialize them.
2732         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
2733         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
2734         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
2735         pthread_cond_timedwait@@GLIBC_2.3.2.
2737 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
2739         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
2740         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
2741         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
2742         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
2743         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
2744         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
2746         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
2748         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
2749         _POSIX_THREAD_PRIORITY_SCHEDULING.
2750         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
2752 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
2754         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
2755         nested function, use static inline function from libio.h.
2756         Code by Richard Henderson.
2758         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
2759         weak.
2761 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
2763         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
2764         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
2765         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
2766         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
2767         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
2768         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
2769         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
2770         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
2771         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
2772         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
2773         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
2774         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
2775         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
2776         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
2777         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
2778         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
2779         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
2780         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
2781         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
2782         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
2783         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
2784         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
2785         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
2786         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
2787         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
2788         * sysdeps/sparc/tls.h: New file.
2789         * sysdeps/sparc/tcb-offsets.sym: New file.
2790         * sysdeps/sparc/Makefile: New file.
2791         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
2792         * init.c [__sparc__] (__NR_set_tid_address): Define.
2794 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
2796         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
2797         _IO_release_lock): Define.
2799 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
2801         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
2802         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
2804 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
2806         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
2807         (__pthread_cleanup_class): Add missing return types of member
2808         functions.
2810 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
2812         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
2813         (lll_mutex_unlock_force): Add memory barrier between store and futex
2814         syscall.
2816 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
2818         * tst-cancel4.c (do_test): Also unlink tempfname and remove
2819         tempmsg in first loop.
2821 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
2823         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2824         _POSIX_THREAD_PRIORITY_SCHEDULING.
2825         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2827 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
2829         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
2830         (__rtld_lock_default_lock_recursive,
2831         __rtld_lock_default_unlock_recursive): Define.
2832         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
2833         __rtld_lock_unlock_recursive): Define using
2834         GL(_dl_rtld_*lock_recursive).
2835         * init.c (__pthread_initialize_minimal_internal): Initialize
2836         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
2837         Lock GL(_dl_load_lock) the same number of times as
2838         GL(_dl_load_lock) using non-mt implementation was nested.
2840         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
2841         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
2843 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
2845         * tst-cancel17.c (do_test): Make len2 maximum of page size and
2846         PIPE_BUF.
2848 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
2850         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
2852 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
2854         * sysdeps/pthread/createthread.c (do_clone): Move error handling
2855         to first syscall error check.  Move syscall error check for tkill
2856         into __ASSUME_CLONE_STOPPED #ifdef.
2858 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
2860         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
2861         is not defined, do explicit synchronization.
2862         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
2863         is not defined also unlock pd->lock for non-debugging case in case
2864         it is necessary.
2865         * pthread_create.c (start_thread): Always get and release pd->lock
2866         if __ASSUME_CLONE_STOPPED is not defined.
2867         (start_thread_debug): Removed.  Adjust users.
2868         * allocatestack.c (allocate_stack): Always initialize lock if
2869         __ASSUME_CLONE_STOPPED is not defined.
2870         * Makefile (tests): Add tst-sched1.
2871         * tst-sched1.c: New file.
2873         * sysdeps/pthread/createthread.c (do_clone): Only use
2874         sched_setschduler and pass correct parameters.
2876 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
2878         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
2879         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
2880         PTHREAD_STACK_MIN in comments.
2882 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
2884         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
2885         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
2886         argument.
2887         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
2888         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
2889         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
2890         (__pthread_cleanup_upto): Fix prototype.
2891         (_longjmp_unwind): Adjust caller.
2892         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
2893         Change second argument to const struct pointer.
2894         * tst-sem8.c (main): Remove unused s2 and s3 variables.
2895         * tst-sem9.c (main): Likewise.
2896         * unwind.c: Include string.h for strlen prototype.
2898 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
2900         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
2901         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
2902         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
2903         Define HAVE_CMOV.
2904         Patch by Nicholas Miell <nmiell@attbi.com>.
2906 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
2908         * init.c (__pthread_initialize_minimal_internal): Initialize
2909         GL(dl_init_static_tls).
2910         * pthreadP.h (__pthread_init_static_tls): New prototype.
2911         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
2912         New functions.
2913         * Makefile (tests): Add tst-tls4.
2914         (modules-names): Add tst-tls4moda and tst-tls4modb.
2915         ($(objpfx)tst-tls4): Link against libdl and libpthread.
2916         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
2917         tst-tls4modb.so.
2918         * tst-tls4.c: New file.
2919         * tst-tls4moda.c: New file.
2920         * tst-tls4modb.c: New file.
2922 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
2924         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
2925         before __timer_dealloc.
2926         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
2927         Don't call list_unlink.
2929 2003-07-29  Roland McGrath  <roland@redhat.com>
2931         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
2933 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
2935         * tst-cancel17.c (do_test): Check if aio_cancel failed.
2936         Don't reuse struct aiocb A if it failed.
2937         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
2938         not just one byte, as that does not block.
2940 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
2942         * sysdeps/pthread/unwind-resume.c: New file.
2943         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
2944         unwind-resume in csu subdir.
2945         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
2946         exceptions.
2947         (librt-sysdep_routines, librt-shared-only-routines): Add
2948         rt-unwind-resume.
2949         * sysdeps/pthread/rt-unwind-resume.c: New file.
2950         * unwind-forcedunwind.c: New file.
2951         * Makefile (libpthread-routines): Add unwind-forcedunwind.
2952         (libpthread-shared-only-routines): Likewise.
2953         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
2954         * pthreadP.h (pthread_cancel_init): New prototype.
2955         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
2957         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
2958         attr argument const struct pthread_attr *.
2960         * res.c (__res_state): Return __resp.
2961         * descr.h: Include resolv.h.
2962         (struct pthread): Add res field.
2963         * pthread_create.c: Include resolv.h.
2964         (start_thread): Initialize __resp.
2965         * Makefile (tests): Add tst-_res1.
2966         (module-names): Add tst-_res1mod1, tst-_res1mod2.
2967         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
2968         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
2969         libpthread.
2970         * tst-_res1.c: New file.
2971         * tst-_res1mod1.c: New file.
2972         * tst-_res1mod2.c: New file.
2974 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
2976         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
2978         * Makefile: Define various *-no-z-defs variables for test DSOs
2979         which has undefined symbols.
2981 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
2983         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
2984         Retry if the stwcx fails to store once_control.
2986 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
2988         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
2989         pthread_attr_setaffinity.
2990         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
2991         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
2992         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
2993         * pthread_attr_destroy.c: Free cpuset element if allocated.
2994         * pthread_create.c: Pass iattr as additional parameter to
2995         create_thread.
2996         * sysdeps/pthread/createthread.c: If attribute is provided and
2997         a new thread is created with affinity set or scheduling parameters,
2998         start thread with CLONE_STOPPED.
2999         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
3000         pthread_attr_setaffinity.
3001         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
3002         cpuset element.
3004 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
3006         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
3008 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
3010         * sysdeps/pthread/configure.in: Require CFI directives also for
3011         ppc and s390.
3013 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
3015         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
3016         Add cfi directives.
3018 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3020         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
3021         CLEANUP_JMP_BUF.
3022         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
3023         registers as variables.  Call __pthread_mutex_unlock_usercnt.
3024         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
3025         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
3026         not self pointer in __writer.  Compare with TID to determine
3027         deadlocks.
3028         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3029         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
3030         Likewise.
3031         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
3032         Likewise.
3033         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
3034         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
3035         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
3036         macros also when compiling librt.
3038 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
3040         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
3041         -fasynchronous-unwind-tables.
3042         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3043         (PSEUDO): Add cfi directives.
3044         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
3045         Likewise.
3046         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
3047         Likewise.
3049 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
3051         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
3052         __pthread_unregister_cancel): Add prototypes and hidden_proto.
3053         * unwind.c (__pthread_unwind_next): Add hidden_def.
3054         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
3055         Likewise.
3056         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3057         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
3058         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
3059         Likewise.
3060         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
3061         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
3062         Likewise.
3063         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
3064         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
3065         __pthread_unregister_cancel and __pthread_unwind_next.
3067 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
3069         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
3070         different symbol for the cancellation syscall wrapper and
3071         non-cancellation syscall wrapper.
3072         (PSEUDO_END): Define.
3074 2003-07-05  Richard Henderson  <rth@redhat.com>
3076         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
3077         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
3078         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
3079         return actual return value from the syscall, not 0.
3081 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
3083         * descr.h (struct pthread): Add pid field.
3084         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
3085         (__reclaim_stacks): Likewise.
3086         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
3087         also check for PID of the signal source.
3088         (__pthread_initialize_minimal_internal): Also initialize pid field
3089         of initial thread's descriptor.
3090         * pthread_cancel.c: Use tgkill instead of tkill if possible.
3091         * sysdeps/unix/sysv/linux/fork.c: Likewise.
3092         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
3093         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
3094         * sysdeps/unix/sysv/linux/raise.c: Likewise.
3096 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
3098         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
3099         Fix use of parameter.
3100         (__libc_cleanup_pop): Likewise.
3102 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
3104         * init.c (sigcancel_handler): Change parameters to match handler
3105         for SA_SIGACTION.  Check signal number and code to recognize
3106         invalid invocations.
3108 2003-07-03  Roland McGrath  <roland@redhat.com>
3110         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
3111         Apply sizeof (struct pthread) bias to r13 value.
3113 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
3115         * sysdeps/pthread/configure.in: Require CFI directives.
3117         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
3118         definition.
3119         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
3120         libpthread compilation.
3121         * unwind.c (__pthread_unwind): Add hidden_def.
3122         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
3124 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
3126         * libc-cancellation.c (__libc_cleanup_routine): Define.
3127         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
3128         (__pthread_cleanup_pop): Define.
3130 2003-07-01  Richard Henderson  <rth@redhat.com>
3132         * sysdeps/alpha/elf/pt-initfini.c: New file.
3133         * sysdeps/alpha/pthread_spin_lock.S: New file.
3134         * sysdeps/alpha/pthread_spin_trylock.S: New file.
3135         * sysdeps/alpha/pthreaddef.h: New file.
3136         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
3137         * sysdeps/alpha/tls.h: New file.
3138         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
3139         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
3140         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
3141         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
3142         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
3143         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
3144         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
3145         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
3146         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
3147         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
3149 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
3151         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
3152         cleanup support and unwind info.
3154 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
3156         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
3157         Use correct cleanup handler registration.  Add unwind info.
3158         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
3159         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
3160         * tst-once3.c: Add cleanup handler and check it is called.
3161         * tst-once4.c: Likewise.
3162         * tst-oncex3.c: New file.
3163         * tst-oncex4.c: New file.
3164         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
3166 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
3168         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
3170 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
3172         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
3173         (tf_msgsnd): Likewise.
3175         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
3176         premature returns a bit more.
3178 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
3180         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
3181         definition to the front.
3183         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
3184         the cleanup functions to make the names unique.  Fix dwarf opcode
3185         un unwind table.
3186         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
3187         functions to make the names unique.  Fix CFA offset for two blocks.
3189 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
3191         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
3192         missing closing braces.
3193         Patch by Christophe Saout <christophe@saout.de>.
3195 2003-06-24  Roland McGrath  <roland@redhat.com>
3197         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
3199 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
3201         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
3202         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
3204         * pthreadP.h: Declare __find_thread_by_id.
3205         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
3206         * pthread_clock_gettime.c: Allow using other thread's clock.
3207         * pthread_clock_settime.c: Likewise.
3208         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
3209         * Makefile: Add rules to build and run tst-clock2.
3210         * tst-clock2.c: New file.
3212 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
3214         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
3215         to use exception-based cleanup handler.
3216         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3218         * tst-cond8.c (ch): Announce that we are done.
3220         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
3222         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
3223         Also test aio_suspend with timeout value.
3225 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
3227         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
3228         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
3229         attribute_hidden.
3231         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
3232         (__pthread_mutex_lock_internal): Likewise.
3233         (__pthread_mutex_unlock_internal): Likewise.
3234         (__pthread_mutex_unlock_usercnt): Declare.
3235         * pthread_mutex_destroy.c: Always fail if used in any way.
3236         * pthread_mutex_init.c: Update comment.
3237         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
3238         * pthread_mutex_timedlock.c: Adjust __nusers.
3239         * pthread_mutex_trylock.c: Adjust __nusers.
3240         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
3241         and public interfaces are wrapper with pass additional parameter.
3242         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
3243         parameter zero.
3244         * tst-mutex8.c: New file.
3245         * Makefile (tests): Add tst-mutex8.
3246         * sysdeps/pthread/pthread_cond_timedwait.c: Call
3247         __pthread_mutex_unlock_usercnt.
3248         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
3249         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3250         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3251         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3252         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3253         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
3254         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3255         Add __nusers.
3256         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3257         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3258         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3259         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3260         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3262         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
3263         * pthread_mutex_timedlock.c: Likewise.
3264         * pthread_mutex_trylock.c: Adjust __nusers.
3265         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
3266         * tst-mutex9.c: New file.
3267         * Makefile (tests): Add tst-mutex9.
3268         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
3269         * sysdeps/ia64/tls.h: Likewise.
3270         * sysdeps/powerpc/tls.h: Likewise.
3271         * sysdeps/s390/tls.h: Likewise.
3272         * sysdeps/sh/tls.h: Likewise.
3273         * sysdeps/x86_64/tls.h: Likewise.
3274         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
3275         Change type of __owner.
3276         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3277         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3278         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3279         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3280         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3282 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
3284         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
3285         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
3287         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
3288         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
3289         instead of nr to lll_futex_wake.  Only set errno and return -1
3290         if err < 0.
3292         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
3293         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
3294         return actual return value from the syscall, not 0.
3296 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
3298         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
3299         find a random value.
3300         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
3301         errno==EIDRM.
3303         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
3304         compat_timer_settime.
3305         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
3306         compat_timer_gettime.
3307         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
3308         compat_timer_getoverrun.
3309         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
3310         compat_timer_delete.
3312         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
3313         error-checking mutex detect busy mutexes.
3315 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
3317         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
3318         Add ax to clobber list.
3319         (lll_mutex_cond_lock): Likewise.
3320         (lll_mutex_unlock): Likewise.
3321         (lll_lock): Likewise.
3322         (lll_unlock): Likewise.
3324         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
3325         * tst-cancel18.c: New file.
3326         * tst-cancelx18.c: New file.
3328         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
3329         and tcdrain.
3331         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
3332         * tst-cancel17.c: New file.
3333         * tst-cancelx17.c: New file.
3335         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
3336         * sysdeps/unix/sysv/linux/sigwait.c: New file.
3337         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
3339         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
3341 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
3343         * sysdeps/pthread/createthread.c (create_thread): Set
3344         header.multiple_threads unconditionally.
3345         * allocatestack.c (allocate_stack): Likewise.
3346         * descr.h (struct pthread): Add header.multiple_threads
3347         unconditionally.
3348         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
3349         Define for librt.  #error if neither libpthread, libc nor librt.
3350         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
3351         Likewise.
3352         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
3353         CDISABLE): Likewise.
3354         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
3355         CDISABLE): Likewise.
3356         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
3357         CDISABLE): Likewise.
3358         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
3359         CDISABLE): Likewise.  Access header.multiple_threads outside of
3360         libc and libpthread.
3361         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
3362         Likewise.
3363         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
3364         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
3366 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
3368         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
3369         Also test early cancellation before the thread reaches the cancellation
3370         point.
3372         * Makefile: Compile forward.c with exceptions.
3374         * sysdeps/unix/sysv/linux/sleep.c: New file.
3376 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
3378         * Makefile: Add CFLAGS definition to compile function wrappers
3379         duplicated from libc with exceptions.
3380         * tst-cancel4.c: Also check cancellation handlers.
3382         * Makefile: Add rules to build and run tst-cancel16 and
3383         tst-cancelx16.  Add missing CFLAGS definitions.
3384         * tst-cancel16.c: New file.
3385         * tst-cancelx16.c: New file.
3387 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
3389         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
3390         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
3391         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
3392         (DL_SYSINFO_IMPLEMENTATION): Likewise.
3394         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
3395         (LIBC_CANCEL_RESET): Likewise.
3396         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
3397         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
3398         librt-cancellation.
3399         (CFLAGS-libcrt-cancellation.c): Define.
3400         * sysdeps/pthread/librt-cancellation.c: New file.
3401         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
3402         macros also when compiling librt.
3403         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
3404         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
3405         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
3406         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
3407         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
3408         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
3409         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3411         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
3412         compat_timer_create.
3414 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
3416         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
3418         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
3419         __register_atfork.
3420         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
3421         Add libc_hidden_def.
3423 2003-06-13  Roland McGrath  <roland@redhat.com>
3425         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
3426         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
3428 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
3430         * allocatestack.c (queue_stack): Always inline.
3431         * ptreadhP.h (__do_cancel): Likewise.
3433 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
3435         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
3436         a typo.
3438 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
3440         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3441         (__pthread_cond_signal): Remove incorrect second addition for
3442         cond_lock!=0.
3444 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
3446         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3447         (__pthread_cond_signal): Use correct futex pointer in
3448         __lll_mutex_lock_wait call.
3450         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3451         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
3453 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
3455         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
3456         cancelable.
3457         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
3458         Likewise.
3460         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
3461         hand-written CFI generation code.  Since ENTRY/END also initiated
3462         CFI frames this caused two CFI sets to be generated.
3464 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
3466         * cleanup_routine.c: New file.
3467         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
3468         * sysdeps/pthread/pthread.h: Add support for fully exception-based
3469         cleanup handling.
3470         * Makefile (libpthread-routines): Add cleanup_routine.
3471         Add more CFLAGS variables to compile with exceptions.  Add comments
3472         why which file needs unwind tables.
3473         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
3474         tests.
3475         * tst-cancelx1.c: New file.
3476         * tst-cancelx2.c: New file.
3477         * tst-cancelx3.c: New file.
3478         * tst-cancelx4.c: New file.
3479         * tst-cancelx5.c: New file.
3480         * tst-cancelx6.c: New file.
3481         * tst-cancelx7.c: New file.
3482         * tst-cancelx8.c: New file.
3483         * tst-cancelx9.c: New file.
3484         * tst-cancelx10.c: New file.
3485         * tst-cancelx11.c: New file.
3486         * tst-cancelx12.c: New file.
3487         * tst-cancelx13.c: New file.
3488         * tst-cancelx14.c: New file.
3489         * tst-cancelx15.c: New file.
3490         * tst-cleanupx0.c: New file.
3491         * tst-cleanupx0.expect: New file.
3492         * tst-cleanupx1.c: New file.
3493         * tst-cleanupx2.c: New file.
3494         * tst-cleanupx3.c: New file.
3496         * tst-cleanup0.c: Make standard compliant.
3497         * tst-cleanup1.c: Likewise.
3499         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
3500         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
3501         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
3502         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
3503         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3504         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3505         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
3506         CLEANUP_JMP_BUF.
3507         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3508         * tst-cancel12.c: New file.
3509         * tst-cancel13.c: New file.
3510         * tst-cancel14.c: New file.
3511         * tst-cancel15.c: New file.
3512         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
3513         and tst-cancel15.
3515         * tst-cancel1.c: Add some comments.
3517         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
3518         timeout correctly.
3520 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
3522         * Makefile (CFLAGS-pthread_cancel.c): Define.
3524 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
3526         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
3527         Change type of __writer element to int.
3528         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3529         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3530         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3531         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3532         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3533         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
3534         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3535         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
3536         Compare with TID to determine deadlocks.
3537         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
3538         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
3539         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
3540         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
3541         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
3542         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
3543         Likewise.
3544         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
3545         Likewise.
3546         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
3547         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3548         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
3549         Likewise.
3550         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3551         Likewise.
3552         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3553         * Makefile (tests): Add tst-rwlock12.
3554         * tst-rwlock12.c: New file.
3556 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
3558         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
3559         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
3560         Remove bogus hidden_proto.
3561         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
3562         Likewise.
3563         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
3564         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
3565         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
3566         ___lll_mutex_timedlock): Likewise.
3568 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
3570         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3571         (__pthread_cond_signal): Add some code to eventually handle
3572         cond_lock!=0.
3574 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
3576         * Makefile (tests): Add tst-exec4.
3577         (tst-exec4-ARGS): Define.
3578         * tst-exec4.c: New file.
3580 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
3582         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
3583         Also fail if tv_nsec < 0.
3584         (__lll_timedwait_tid): Likewise.
3585         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
3586         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
3587         Likewise.
3588         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
3589         Likewise.
3590         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
3591         Likewise.
3592         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
3593         Likewise.
3594         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
3595         Likewise.
3596         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
3597         Likewise.
3599         * Makefile (tests): Add tst-sem8 and tst-sem9.
3600         * tst-sem8.c: New file.
3601         * tst-sem9.c: New file.
3602         * sem_open.c: Fix creation of in_use record if the file exists but
3603         no internal record.
3605         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
3606         definitions.
3608         * sysdeps/pthread/timer_create.c (timer_create): In case
3609         evp==NULL, assign timer ID to sival_ptr.
3611         * descr.h (struct pthread_unwind_buf): Change type of prev element to
3612         struct pthread_unwind_buf *.
3613         (struct pthread): Likewise for cleanup_jmp_buf element.
3615         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
3616         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
3617         * unwind.c (__pthread_unwind_next): Likewise.
3619 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
3621         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
3622         (lll_futex_timed_wait): Use int for futex value parameter.
3623         (lll_futex_wake): Likewise.
3624         (lll_futex_requeue): Likewise.
3626         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
3627         Replace one memory operation with one register operation.
3629         * tst-join4.c (do_test): Fix error message.
3631         * tst-rwlock6.c (do_test): Use correct format specifier.
3633         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
3634         (__lll_mutex_lock_wait): Replace one memory operation with one
3635         register operation.
3636         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
3637         (__lll_mutex_lock_wait): Likewise.
3639         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
3640         (__lll_mutex_cond_lock): Add one to value parameter of
3641         __lll_lock_wait to reflect reality in the futex syscall.
3642         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
3643         (lll_mutex_cond_lock): Likewise.
3645 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
3647         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
3648         New function.
3649         (lll_mutex_cond_lock): Define.
3651 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
3653         * Makefile (tests): Add tst-signal6.
3654         * tst-signal6.c: New file.
3656         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
3657         (__lll_mutex_unlock_force): New function
3658         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
3660         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
3661         (__lll_mutex_unlock_force): New function.
3662         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
3664         * tst-rwlock7.c (do_test): Use correct format specifier.
3666         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
3667         Find break parameter in correct asm argument.
3669 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
3671         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
3672         Remove out4.
3673         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
3674         error occured.
3675         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
3676         Add __mutex.
3677         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
3678         lll_futex_requeue, lll_mutex_unlock_force): Define.
3680 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
3682         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3683         (pthread_cond_t): Add __mutex.
3684         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
3685         lll_futex_requeue, lll_mutex_unlock_force): Define.
3687 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3689         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
3690         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3691         Add __mutex field.
3692         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
3693         Define.
3694         (lll_futex_wait, lll_futex_wake): Define.
3695         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
3696         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
3697         FUTEX_REQUEUE instead of FUTEX_WAIT.
3698         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
3699         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
3700         mutex which was used in condvar structure.  Call
3701         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
3702         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
3704         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
3705         include tcb-offsets.h.  Read wakeup value in locked region.
3706         Use the value of gbr register as THREAD_ID.
3707         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
3708         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
3709         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
3711         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
3712         macros.
3714 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
3716         * sysdeps/pthread/pthread_cond_broadcast.c
3717         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
3719 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
3721         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
3722         typo in register name.
3723         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
3724         correctly.  Actually use requeue.  Little optimization.
3725         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
3726         mutex address early.  Handle cancellation state as 32-bit value.
3727         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3728         Remove unnecessary label.
3730 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
3732         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
3733         instead of FUTEX_WAIT.
3734         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
3735         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
3736         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
3737         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
3738         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3739         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
3740         used in condvar structure.  Call __pthread_mutex_cond_lock instead
3741         of __pthread_mutex_lock_internal.
3742         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3743         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3744         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
3745         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
3746         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3747         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3748         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
3749         Add pthread_mutex_cond_lock.
3750         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
3751         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
3752         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
3753         lll_mutex_cond_lock.
3754         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
3755         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3756         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3757         Add __mutex field.
3758         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3759         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3761         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
3762         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3764         * pthreadP.h: Declare __pthread_mutex_cond_lock.
3765         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
3766         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
3767         macro don't define aliases.
3769         * cancellation.c: Remove __pthread_enable_asynccancel_2.
3770         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
3771         * sysdeps/pthread/pthread_cond_timedwait.c: Use
3772         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
3773         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3774         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3775         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
3776         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
3777         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3779 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
3781         * sem_open.c: Fix one endless loop.  Implement correct semantics
3782         wrt opening the same semaphore more then once.
3783         * sem_close.c: Adjust for sem_open change.
3784         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
3785         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
3786         * Makefile (tests): Add tst-sem7.
3787         * tst-sem7.c: New file.
3789 2003-05-16  Roland McGrath  <roland@redhat.com>
3791         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
3792         uninitialized variable braino.
3794 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
3796         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
3797         test for syscall availability.
3799         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
3800         __no_posix_timers to -1 if the syscalls don't exist.
3802         * pthread_join.c (pthread_join): Set tid field of the joined
3803         thread to -1.  This isn't necessary but helps to recognize some
3804         error conditions with almost no cost.
3806         * allocatestack.c (FREE_P): Also negative values indicate an
3807         unused stack.
3809         * unwind.c: Include <unistd.h>.
3811 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
3813         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
3815 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
3817         * Makefile (crti-objs, crtn-objs): New variables.
3818         (omit-deps, extra-objs): Add crtn.
3819         ($(objpfx)libpthread.so): Depend on both crti and crtn
3820         and links to them in multidir.
3821         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
3823 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
3825         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
3826         (lll_mutex_unlock): Use atomic_exchange_rel.
3828 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
3830         * cond-perf.c (cons): Add missing locking around setting of alldone.
3832 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
3834         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
3835         related macros.
3836         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
3838 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
3840         * tst-sem6.c: New file.
3841         * Makefile (tests): Add tst-sem6.
3843         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
3844         Use atomic_exchange_rel instead of atomic_exchange.
3845         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
3846         Likewise.
3848         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
3849         code for lll_futex_wait and lll_futex_wake in static apps.  Use
3850         vsyscall is possible.
3852         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
3853         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
3854         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
3855         pthread_setaffinity_np.
3856         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
3857         and pthread_setaffinity_np.
3858         * Makefile (libpthread-routines): Add pthread_getaffinity and
3859         pthread_setaffinity.
3861         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
3862         use it in case mmap to allocate the stack fails.
3863         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
3864         ARCH_MAP_FLAGS here.
3865         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
3866         ARCH_RETRY_MMAP.
3868 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
3870         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
3871         handler implementation.  It is now lockless in fork().
3872         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
3873         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
3874         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
3875         declare the __fork_*_lists.
3876         (struct fork_handler): Include pointers to all three functions.
3877         Add next, refcntr and need_signal elements.
3878         (__fork_handlers): New declaration.
3879         (__register_atfork_malloc): Remove declaration.
3880         (HAVE_register_atfork_malloc): Remove definition.
3881         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
3882         __pthread_child_handler variable.
3883         (__libc_pthread_init): Use __register_atfork instead of explicitly
3884         adding to the list.
3885         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
3886         and lll_futex_wake.
3887         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
3889         * unwind.c (unwind_cleanup): Print error message and then abort.  This
3890         function must never be reached.
3892         * cond-perf.c: New file.
3894 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
3896         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
3898 2003-05-04  Roland McGrath  <roland@redhat.com>
3900         * Makefile ($(objpfx)../libc.so): New target.
3902 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
3904         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3905         (pthread_condattr_t): Size is only an int, don't use long for
3906         alignment.
3907         (pthread_mutexattr_t): Likewise.
3908         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3909         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3910         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3912 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
3914         * sysdeps/i386/tls.h: Define THREAD_ID.
3915         * sysdeps/ia64/tls.h: Likewise.
3916         * sysdeps/powerpc/tls.h: Likewise.
3917         * sysdeps/s390/tls.h: Likewise.
3918         * sysdeps/sh/tls.h: Likewise.
3919         * sysdeps/x86_64/tls.h: Likewise.
3920         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
3921         record ownership.
3922         * pthread_mutex_timedlock.c: Likewise.
3923         * pthread_mutex_trylock.c: Likewise.
3924         * pthread_mutex_unlock.c: Likewise.
3925         * pthread_rwlock_trywrlock.c: Likewise.
3926         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
3927         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
3928         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
3929         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
3931         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
3932         flag.
3934 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
3936         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
3937         (__SIZEOF_PTHREAD_COND_T): Define to 48.
3938         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
3939         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
3940         Make __align long long instead of long.
3941         (pthread_rwlock_t): Formatting.
3942         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
3943         (pthread_rwlock_t): Formatting.
3944         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3945         (pthread_cond_t): Make __align long long instead of long.
3946         (pthread_rwlock_t): Move __flags field to the same position as in
3947         linuxthreads.
3949 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
3951         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
3952         * tst-rwlock7.c (do_test): Likewise.
3954 2003-04-26  Roland McGrath  <roland@redhat.com>
3956         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
3958 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
3960         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
3961         sizeof (struct pthread).
3962         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
3963         1 struct pthread.
3964         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
3965         to 0.
3966         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
3967         struct pthread.
3968         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
3969         to 32-bit bytes.
3970         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
3971         tcbp.
3972         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
3973         unneccessarily.
3974         (NO_TLS_OFFSET): Define.
3975         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
3976         add TLS_TCB_SIZE unnecessarily.
3978 2003-04-22  Roland McGrath  <roland@redhat.com>
3980         * Makeconfig (shared-thread-library): Reverse link order to work
3981         around linker bug.
3983 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
3985         * semaphore.h: Fix typo in comment.
3987 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
3989         * sysdeps/pthread/sigfillset.c: New file.
3991         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
3992         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
3993         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
3994         * sysdeps/pthread/sigaction.c: Likewise.
3995         * sysdeps/pthread/sigprocmask.c: New file.
3996         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
3997         __SIGRTMIN+1.
3998         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3999         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
4000         in this case.
4002 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
4004         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
4005         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
4007         * sysdeps/unix/sysv/linux/unregister-atfork.c
4008         (__unregister_atfork): Don't free memory not allocated dynamically.
4010         * semaphore.h: Remove __THROW marker from cancellation points.
4011         * nptl/sysdeps/pthread/pthread.h: Likewise.
4013 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
4015         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
4016         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
4017         __THROW.
4019 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
4021         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
4023 2003-04-15  Roland McGrath  <roland@redhat.com>
4025         * forward.c (__pthread_unwind): Tweak to avoid warning.
4027 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
4029         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
4031 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
4033         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
4034         overflow CFA advance instructions.
4035         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4037 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
4039         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
4040         * sysdeps/i386/pthread_spin_lock.c: Likewise.
4041         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
4042         defined.
4044         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
4045         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
4046         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
4047         DW_CFA_advance_loc for .Laddl-.Lsubl.
4049 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
4051         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
4052         position-independent unwind data for static libraries.
4053         Add missing unwind info.  Add comments.
4055         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
4056         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4057         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4058         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4060 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
4062         * Makefile: Make sure all cancellation points are compiled with
4063         exception and asynchronous unwind tables.
4065         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
4066         which mishandles loading of global object addresses in PIC.
4067         (THREAD_SETMEM_NC): Likewise.
4069 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
4071         * pthread.h: Define new data structure for cleanup buffer.  Declare
4072         new cleanup handler interfaces.
4073         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
4074         (struct pthread): Add cleanup_jmp_buf pointer.  Define
4075         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
4076         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
4077         it.  Declare old cleanup handler installation functions.
4078         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
4079         handling.
4080         * cleanup_defer.c: Likewise.
4081         * cleanup_compat.c: New file.  Old cleanup code.
4082         * cleanup_def_compat.c: New file.  Old cleanup code.
4083         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
4084         if own thread descriptor.
4085         * unwind.c: New file.
4086         * forward.c: Add __pthread_unwind.
4087         * init.c (pthread_functions): Add __pthread_unwind.
4088         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
4089         Add ptr___pthread_unwind.
4090         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
4091         and unwind function.
4092         * Makefile (libpthread-routines): Add cleanup_compat,
4093         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
4094         table generation if necessary.
4095         * version.c: Record whether unwind support is compiled in.
4096         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
4097         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
4098         handler interfaces.
4099         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
4100         complication to generate unwind information for syscall wrappers.
4101         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4102         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
4103         __cleanup_fct_attribute.
4105         * Makefile: Add rules to build and run tst-cleanup0.
4106         * tst-cleanup0.c: New file.
4107         * tst-cleanup0.expect: New file.
4109         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
4110         caller.  Optimize to avoid often unecessary local variable.
4112 2003-04-11  Roland McGrath  <roland@redhat.com>
4114         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
4115         sets variable `multidir'; include that.
4116         (generated): Add it.
4117         ($(objpfx)$(multidir)/crti.o): New target.
4118         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
4120 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
4122         * tst-attr2.c (do_test): Add cast to avoid warning.
4123         * tst-mutex4.c (do_test): Likewise.
4125 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
4127         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
4128         in child.
4130 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
4132         * Makefile (tests): Add tst-detach1.
4133         * tst-detach1.c: New file.
4135 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
4137         * sysdeps/pthread/pthread.h: Remove duplicate
4138         pthread_cleanup_{push,pop} definitions.
4140         * tst-barrier2.c: Eliminate warnings.
4141         * tst-cancel4.c: Likewise.
4142         * tst-cond4.c: Likewise.
4143         * tst-cond6.c: Likewise.
4144         * tst-detach1.c: Likewise.
4145         * tst-rwlock4.c: Likewise.
4146         * tst-rwlock6.c: Likewise.
4147         * tst-rwlock7.c: Likewise.
4148         * tst-sem3.c: Likewise.
4149         * tst-spin2.c: Likewise.
4150         * tst-umask1.c: Likewise.
4152 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
4154         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
4156 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
4158         * descr.h (struct pthread): Move cancelhandling member to the front.
4160 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
4162         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
4163         malloc_parent, and malloc_child statically.
4164         (__register_atfork_malloc): New function.
4165         (free_mem): Don't free any of the malloc_* variables on the list.
4166         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
4167         Define HAVE_register_atfork_malloc.
4169 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
4171         * sysdeps/pthread/createthread.c (create_thread): Add some more
4172         comments explaining when to set multiple_threads and when not.
4174         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
4175         THREAD_ATOMIC_BIT_SET if not already defined.
4176         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
4177         THREAD_ATOMIC_BIT_SET:
4178         * sysdeps/x86_64/tls.h: Likewise.
4179         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
4180         THREAD_ATOMIC_CMPXCHG_VAL.
4181         (_pthread_cleanup_pop_restore): Likewise.
4182         * cancellation.c (__pthread_enable_asynccancel): Likewise.
4183         (__pthread_enable_asynccancel_2): Likewise.
4184         (__pthread_disable_asynccancel): Likewise.
4185         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
4186         (__libc_disable_asynccancel): Likewise.
4187         * init.c (sigcancel_handler): Likewise.
4188         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
4189         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
4191 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
4193         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
4194         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
4195         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
4196         * Makefile (tests): Add tst-cancel11.
4197         * tst-cancel11.c: New file.
4199 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
4201         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
4202         round, not the first.  Use specific_used flag instead of local
4203         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
4204         (__free_tcb): Don't call deallocate_tsd here.
4205         (start_thread): Call deallocate_tsd here.
4206         * pthread_setspecific.c: Set specific_used flag really only when
4207         needed.
4208         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
4209         * tst-tsd3.c: New file.
4210         * tst-tsd4.c: New file.
4212 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
4214         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
4215         Use atomic_exchange_and_add instead of __lll_add.
4216         (__lll_mutex_timedlock): Likewise.
4217         Patch by Ian Wienand.
4219 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
4221         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
4222         (SINGLE_THREAD_P): Fix typo.
4223         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
4225 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
4227         * Makefile (tests): Add tst-align.
4228         * tst-align.c: New file.
4229         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
4231         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
4232         function correctly.
4234         * tst-tsd2.c: Add casts to avoid warnings.
4236 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
4238         * descr.h (struct pthread): Move most often used elements to the front.
4240 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
4242         * Makefile (libpthread-routines): Add pthread_atfork.
4243         (libpthread-static-only-routines): Add pthread_atfork.
4245 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4247         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
4248         of TLS_DTV_AT_TP.
4249         (INSTALL_DTV): Add parens.
4250         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
4251         Use passed descr instead of THREAD_SELF.
4252         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
4253         (__lll_mutex_timedlock_wait): Correct expected value after
4254         spurious wakeup.
4255         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
4256         Release lock before waking up the waiters.
4257         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
4258         criteria.  Reorderstruct passed to cleanup handler.  Fix
4259         handling of cancellation and failung pthread_mutex_unlock call.
4260         Use __pthread_enable_asynccancel_2 instead of
4261         __pthread_enable_asynccancel.
4262         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4263         Return result of lock re-get if it fails.
4264         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
4265         for __pthread_cleanup_push.
4266         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
4267         completely broken rwlock implementation.
4268         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4269         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
4270         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
4271         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
4272         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4273         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
4274         versioned_symbol macro.
4275         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
4276         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
4278 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
4280         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
4281         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
4282         and __helper_tid.
4283         (struct timer): Remove th and bar field.
4284         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
4285         debugging code.  Create only one helper thread.
4286         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
4287         helper thread.
4288         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
4289         Renamed.  Define statically.  Use thread info from siginfo.
4290         (__helper_once): New variable.
4291         (__helper_tid): New variable.
4292         (__reset_helper_control): New function.
4293         (__start_helper_thread): New function.
4295         * pthread_create.c (start_thread): Don't use setjmp inside
4296         __builtin_expect to work around gcc bug.
4298         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
4299         timer_delete syscall fails, but not with ENOSYS, set
4300         __no_posix_timers.
4302         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
4303         (timer_settime): Fix typo.
4304         * sysdeps/unix/sysv/linux/timer_getoverr.c
4305         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
4307 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
4309         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
4310         offset of cleanupbuf.__prev.
4312 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
4314         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
4315         of included file.
4317 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
4319         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
4320         NULL provide default definition to syscall.
4322 2003-03-25  Roland McGrath  <roland@redhat.com>
4324         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
4325         (timer_id2ptr): Fix typo.
4327 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
4329         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
4330         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
4331         * sysdeps/ia64/pthreaddef.h: Likewise.
4332         * sysdeps/powerpc/pthreaddef.h: Likewise.
4333         * sysdeps/s390/pthreaddef.h: Likewise.
4334         * sysdeps/sh/pthreaddef.h: Likewise.
4335         * sysdeps/x86_64/pthreaddef.h: Likewise.
4336         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
4337         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
4338         being changed.
4339         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
4340         SIGTIMER is not unblocked.
4341         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
4342         RT signal taken.
4343         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
4344         be send.
4345         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
4346         pass pointer through as ID.
4347         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
4348         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
4349         * sysdeps/unix/sysv/linux/timer_create.c: New file.
4350         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
4351         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
4352         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
4353         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
4354         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
4355         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
4356         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
4357         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
4358         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
4359         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
4360         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
4361         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
4362         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
4363         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
4364         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
4365         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
4366         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
4367         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
4368         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
4369         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
4370         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
4371         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
4372         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
4373         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
4374         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
4375         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
4376         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
4377         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
4378         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
4379         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
4381         * pthreadP.h: Remove FRAME_LEFT definition.
4382         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
4383         already left frame.  Programs which have this problem are not POSIX
4384         compliant.
4385         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
4387 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
4389         * sysdeps/pthread/tst-timer.c: Check return values of the
4390         functions we test.
4392 2003-03-23  Roland McGrath  <roland@redhat.com>
4394         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
4395         * tst-tls3mod.c: Likewise.
4396         * tst-tls1.c: Likewise.
4397         * tst-tls2.c: Likewise.
4399         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
4400         undefined behavior.
4402         * tst-join5.c (tf1, tf2): Add a cast.
4404         * Makeconfig (includes): Append -I$(..)nptl to this variable.
4406         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
4407         Don't test anything.
4408         * tst-cond4.c: Likewise.
4409         * tst-cond6.c: Likewise.
4410         * tst-flock2.c: Likewise.
4411         * tst-mutex4.c: Likewise.
4412         * tst-rwlock4.c: Likewise.
4413         * tst-signal1.c: Likewise.
4414         * tst-spin2.c: Likewise.
4415         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
4417         * tst-mutex4.c: Use test-skeleton.c.
4418         * tst-spin2.c: Likewise.
4419         * tst-sysconf.c: Likewise.
4420         * tst-barrier2.c: Likewise.
4421         * tst-cond4.c: Likewise.
4422         * tst-cond6.c: Likewise.
4423         * tst-rwlock4.c: Likewise.
4424         * tst-unload.c: Likewise.
4425         * tst-flock2.c (do_test): Use return instead of exit.
4427 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
4429         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
4431 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
4433         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
4434         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
4435         instead of __lll_compare_and_swap.
4436         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
4437         Likewise.
4438         Removed definition if __lll_compare_and_swap.
4440         * cancellation.c: Adjust for new form of compare&exchange macros.
4441         * cleanup_defer.c: Likewise.
4442         * init.c: Likewise.
4443         * libc-cancellation.c: Likewise.
4444         * old_pthread_cond_broadcast.c: Likewise.
4445         * old_pthread_cond_signal.c: Likewise.
4446         * old_pthread_cond_timedwait.c: Likewise.
4447         * old_pthread_cond_wait.c: Likewise.
4448         * pthread_cancel.c: Likewise.
4449         * pthread_create.c: Likewise.
4450         * pthread_detach.c: Likewise.
4451         * pthread_join.c: Likewise.
4452         * pthread_key_delete.c: Likewise.
4453         * pthread_setcancelstate.c: Likewise.
4454         * pthread_setcanceltype.c: Likewise.
4455         * pthread_timedjoin.c: Likewise.
4456         * pthread_tryjoin.c: Likewise.
4457         * sysdeps/pthread/createthread.c: Likewise.
4459 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
4461         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
4462         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
4463         definitions.  Replace uses with calls to atomic_* functions.
4464         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
4465         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
4466         __lll_test_and_set calls with atomic_exchange_and_add and
4467         atomic_exchange calls respectively.
4468         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
4469         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
4470         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
4471         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
4472         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
4473         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
4474         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
4476         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
4477         returns the old value.
4479 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
4481         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
4482         int for variable OLDVAL and correct inline assembler contraint.
4483         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
4484         type int for variable OLD.
4486         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
4487         only for s390-32.
4488         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
4489         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
4490         instead of multiple_threads field in the TCB.
4492 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
4494         * sysdeps/i386/i686/bits/atomic.h: Removed.
4495         * sysdeps/i386/i586/bits/atomic.h: Removed.
4496         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
4497         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
4498         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
4499         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
4500         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
4501         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
4502         * atomic.h: Removed.  Moved to glibc.
4504         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
4505         support for clock selection.
4507         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
4508         signalling waiters.
4510 2003-03-18  Roland McGrath  <roland@redhat.com>
4512         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
4513         Add __lll_rel_instr first.  Add memory clobber.
4514         (lll_mutex_unlock): Use __lll_test_and_set.
4515         From Paul Mackerras <paulus@samba.org>.
4517         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
4518         unconditionally.
4519         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
4520         (SINGLE_THREAD_P):  Add `header.' prefix.
4521         From Paul Mackerras <paulus@samba.org>.
4523         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
4524         pthread_timedjoin_np to ...
4525         (libpthread: GLIBC_2.3.3): ... here.
4526         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
4528         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4529         Avoid shadowing VAL variable.
4531         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
4532         New macro.
4534 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
4536         * Makefile (tests): Add tst-cond11.
4537         * tst-cond11.c: New file.
4539         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
4540         struct passed to cleanup handler to eliminate one more
4541         instruction.
4542         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4544         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4545         (pthrad_cond_t): Replace __unused field with __clock.
4547         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
4548         waken all waiters in cleanup handler.
4549         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4550         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4552         * pthread_condattr_getclock.c: New file.
4553         * pthread_condattr_setclock.c: New file.
4554         * sysdeps/pthread/pthread.h: Declare these new functions.
4555         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
4556         * Makefile (libpthread-routines): Add the new functions.
4557         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
4558         Renamed field to value.  Document use of the bits.
4559         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
4560         change.
4561         * pthread_condattr_setpshared.c: Likewise.
4562         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
4563         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
4564         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4565         Add __clock field.
4566         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4567         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4568         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4569         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4570         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
4571         Implement clock selection.
4572         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
4573         * pthread-errnos.sym: Add ENOSYS.
4574         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
4575         _POSIX_CLOCK_SELECTION.
4576         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
4578         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
4579         invalid .size directive.
4581 2003-03-17  Roland McGrath  <roland@redhat.com>
4583         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
4584         Formatting tweaks.
4586 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
4588         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
4589         Use __lll_add instead of spelling it out.  Use protected symbol names.
4590         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
4591         Use __lll_add.
4592         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
4593         Renamed from lll_compare_and_swap.  Use new name where necessary.
4594         (__lll_add): Defined.
4595         (__lll_dec_if_positive): Defined.
4596         (__lll_test_and_set): Defined.
4597         * sysdeps/ia64/pthread_spin_init.c: Removed.
4598         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
4599         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
4600         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
4601         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
4602         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
4603         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
4604         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
4605         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
4606         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
4607         __sync_lock_release_si.
4608         Patch by Jakub Jelinek.
4610         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
4611         Fix timeout handling.
4612         (__lll_timedwait_tid): Likewise.
4613         (lll_unlock_wake_cb): Wake up other waiters if necessary.
4614         Patch by Jakub Jelinek.
4616         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
4618 2003-03-17  Roland McGrath  <roland@redhat.com>
4620         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
4621         * sysdeps/pthread/pthread_spin_init.c: New file.
4622         * sysdeps/pthread/pthread_spin_unlock.c: New file.
4623         * sysdeps/powerpc/Makefile: New file.
4624         * sysdeps/powerpc/pthread_spin_lock.c: New file.
4625         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
4626         * sysdeps/powerpc/pthreaddef.h: New file.
4627         * sysdeps/powerpc/tcb-offsets.sym: New file.
4628         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
4629         * sysdeps/powerpc/tls.h: New file.
4630         * sysdeps/powerpc/bits/atomic.h: New file.
4631         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
4632         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
4633         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
4635         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
4636         * sysdeps/unix/sysv/linux/sem_post.c: New file.
4637         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
4638         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
4639         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
4640         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
4641         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
4642         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
4643         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
4644         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
4645         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
4646         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
4647         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
4648         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
4649         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
4651         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
4652         not gettimeofday.
4653         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
4654         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
4655         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
4656         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
4657         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
4659 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
4661         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
4662         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
4663         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4664         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
4665         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
4667 2003-03-16  Roland McGrath  <roland@redhat.com>
4669         * tst-fork4.c: Include <string.h>.
4670         * tst-signal2.c: Likewise.
4671         * tst-mutex5.c (do_test): exit -> return.
4672         * tst-mutex2.c: Include <stdlib.h>.
4674 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
4676         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
4677         (__lll_mutex_timedlock_wait): Correct expected value after
4678         spurious wakeup.  Otherwise we would never wait again.
4680         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
4681         zone versus inline asm stupidity.  Use correct instructions.
4683         * tst-rwlock6.c: Add some more status output.
4685 2003-03-15  Roland McGrath  <roland@redhat.com>
4687         * sysdeps/pthread/configure.in: New file.
4688         * sysdeps/pthread/configure: New file (generated).
4690 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
4692         * allocatestack.c (allocate_stack): Store the exact stack size of
4693         user allocated stacks.
4695 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
4697         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
4698         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
4699         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
4700         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
4701         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
4702         Use `header.' prefix.
4703         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
4705 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
4707         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
4708         __builtin_frame_address, use stack pointer.
4710         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
4711         instead of __builtin_frame_pointer.
4713 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
4715         * tst-basic1.c (do_test): Add cast to avoid warning.
4716         * tst-basic2.c (do_test): Likewise.
4718         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
4719         amount of stack correction.
4721         * tst-fork4.c: Use test-skeleton.c.
4723 2003-03-14  Roland McGrath  <roland@redhat.com>
4725         * init.c: Fix typo "#eli" for "#else".
4727 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
4729         * allocatestack.c (__stack_user): Use hidden_data_def.
4730         * pthread_create.c (__pthread_keys): Likewise.
4732         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
4734 2003-03-14  Roland McGrath  <roland@redhat.com>
4736         * tst-fork4.c: New file.
4737         * Makefile (tests): Add it.
4739         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
4740         we always define the padding space.
4741         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
4742         stopped supporting its own extensions fully.
4743         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
4744         struct also called `header', so `header.multiple_threads' is the field
4745         name to use on all machines.
4746         * allocatestack.c (allocate_stack): Use `header.' prefix.
4747         * sysdeps/pthread/createthread.c (create_thread): Likewise.
4748         * pthread_create.c (__pthread_create_2_1): Likewise.
4749         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
4750         (THREAD_SELF): Likewise.
4751         * sysdeps/x86_64/tls.h: Likewise.
4752         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
4753         (SINGLE_THREAD_P): Likewise.
4754         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
4755         (SINGLE_THREAD_P): Likewise.
4756         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
4757         (SINGLE_THREAD_P): Likewise.
4759         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
4760         value directly.
4762 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
4764         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
4765         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
4767         * pthread_create.c (start_thread): setjmp is expected to return 0.
4769         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
4770         (THREAD_GETMEM_NC): Likewise.
4772 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
4774         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
4775         and the size of the stack which must be allocated is a multiple,
4776         allocate one more page.
4777         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
4778         MULTI_PAGE_ALIASING.
4780 2003-03-13  Roland McGrath  <roland@redhat.com>
4782         * pthread_create.c (start_thread): Set EXITING_BIT after the
4783         event-reporting (and destructors), not before.
4785 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
4787         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
4788         lll_futex_wake): Declare register variables as long int instead of
4789         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
4790         Make syscall arguments clobbered by the syscall.
4791         (lll_futex_wait): Define using lll_futex_timed_wait.
4793         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
4794         to void *.
4796         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
4797         PPID if [! NDEBUG].
4799         * allocatestack.c (nptl_ncreated): Only declare if
4800         COLORING_INCREMENT != 0.
4802         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
4803         (__libc_enable_asynccancel_2): Remove prototype.
4805         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
4806         ctid to match kernel.
4808 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
4810         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
4811         libc_multiple_threads.
4812         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
4813         __libc_multiple_threads to...
4814         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
4816         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
4817         versioning.
4818         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
4819         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4821         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
4822         (__pthread_once_internal): Define.
4824         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
4825         macros instead of .symver directly.
4826         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
4827         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
4829         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
4830         * sysdeps/x86_64/tcb-offsets.sym: New file.
4831         * sysdeps/x86_64/Makefile: New file.
4833         * sysdeps/i386/tcb-offsets.sym: Add SELF.
4834         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
4835         to access own pthread_t in TCB.
4836         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4837         Likewise.
4838         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4839         Likewise.
4840         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4842 2003-03-12  Roland McGrath  <roland@redhat.com>
4844         * pthread-errnos.sym: New file.
4845         * Makefile (gen-as-const-headers): New variable, list that file.
4846         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
4847         header <pthread-errnos.h> instead of defining errno values here.
4848         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
4849         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
4850         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
4851         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
4852         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
4853         Likewise.
4854         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
4855         Likewise.
4856         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
4857         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4858         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
4859         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
4860         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4861         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
4862         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
4863         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
4864         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4865         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
4866         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
4867         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
4868         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
4869         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
4870         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
4871         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
4872         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
4873         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
4874         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4875         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
4876         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
4877         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
4878         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
4879         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
4880         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
4881         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
4882         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
4884         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
4885         CLONE_CHILD_SETTID worked.
4887 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
4889         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
4890         file.
4891         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
4892         file.
4894         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4895         (pthread_cond_t): Add padding.
4897         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
4898         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
4899         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
4901         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
4902         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
4903         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
4904         (__pthread_rwlock_timedrdlock): Likewise.
4905         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
4906         (__pthread_rwlock_wrlock): Likewise.
4907         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
4908         (__pthread_rwlock_rdlock): Likewise.
4910         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
4912         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
4913         result of lock re-get if it fails.
4915 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
4917         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
4918         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
4919         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
4920         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
4921         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4922         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
4923         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
4924         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
4925         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
4926         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
4928         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
4929         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
4931         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
4932         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
4933         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
4934         (create_thread): Likewise.
4935         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
4936         * init.c (__pthread_initialize_minimal_internal): Initialize
4937         __libc_multiple_threads_ptr if necessary.
4938         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
4939         __pthread_multiple_threads and __libc_multiple_threads_ptr.
4940         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
4941         __libc_multiple_threads.
4942         (__libc_pthread_init): Return pointer to __libc_pthread_init if
4943         necessary.
4945         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
4946         (THREAD_SETMEM_NC): Likewise.
4948         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
4949         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
4950         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
4951         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
4953         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
4954         Eliminate one entire instruction.
4956         * cancellation.c (__pthread_enable_asynccancel_2): New function.
4957         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
4958         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4959         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
4960         instead of __pthread_enable_asynccancel.
4961         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
4962         (__pthread_cond_wait): Likewise.
4963         * sysdeps/pthread/pthread_cond_timedwait.c
4964         (__pthread_cond_timedwait): Likewise.
4965         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4967         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
4968         (__condvar_cleanup): Wake up all waiters in case we got signaled
4969         after being woken up but before disabling asynchronous
4970         cancellation.
4971         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
4972         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
4973         (__condvar_cleanup): Likewise.
4975         * init.c (__NR_set_tid_address): If already defined, don't redefine.
4976         Make it an error if architecture has no #if case.  Add x86-64.
4978         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
4979         pt-initfini.s generation.
4981         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
4982         (TLS_INIT_TP): Fix typo.
4984 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
4986         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
4987         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
4989         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
4990         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
4991         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
4992         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
4993         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
4994         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
4995         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
4996         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
4998 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
5000         * sysdeps/pthread/pthread_cond_timedwait.c
5001         (__pthread_cond_timedwait): Return the result of the final
5002         locking.  If it succeeds, the regular function return value.
5004         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
5005         Return result of the final locking.
5006         * version.c (__nptl_main): Work around problems with the strange
5007         INTERNAL_SYSCALL macro on ppc32.
5008         * init.c (__pthread_initialize_minimal_internal): Unblock
5009         SIGCANCEL in case the parent blocked it.
5010         Reported by Paul Mackerras <paulus@samba.org>.
5012         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
5013         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
5014         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
5016 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
5018         * sysdeps/pthread/pthread_cond_timedwait.c
5019         (__pthread_cond_timedwait): Unlock and fail if
5020         __pthread_mutex_unlock_internal failed.
5022         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
5023         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
5024         Use ARCH_CLONE.
5025         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
5026         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
5027         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
5028         ALLOCATE_STACK): New macros.
5029         (TLS_TPADJ): New macro.
5030         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
5031         (allocate_stack): Handle TLS_DTV_AT_TP and
5032         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
5033         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
5034         Don't set PD->self.
5035         * init.c [__ia64__] (__NR_set_tid_address): Define.
5037         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
5038         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
5039         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
5040         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
5041         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
5042         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
5043         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
5044         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
5045         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
5046         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
5047         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
5048         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
5049         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
5050         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
5051         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
5052         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
5053         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
5054         * sysdeps/ia64/bits/atomic.h: New file.
5055         * sysdeps/ia64/Makefile: New file.
5056         * sysdeps/ia64/pthread_spin_init.c: New file.
5057         * sysdeps/ia64/pthread_spin_lock.c: New file.
5058         * sysdeps/ia64/pthread_spin_trylock.c: New file.
5059         * sysdeps/ia64/pthread_spin_unlock.c: New file.
5060         * sysdeps/ia64/pthreaddef.h: New file.
5061         * sysdeps/ia64/tcb-offsets.sym: New file.
5062         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
5063         * sysdeps/ia64/tls.h: New file.
5065         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
5066         to syscall instead of no arguments.
5068 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
5070         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
5071         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
5072         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
5073         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
5075         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
5076         unused code.
5078         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
5080         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
5081         lowlevelbarrier.sym.
5082         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
5083         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
5084         Include lowlevelbarrier.h and don't define offsets locally.
5085         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
5087         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
5088         (__lll_mutex_lock_wait): Reverse order of first two parameters.
5089         (__lll_mutex_timedlock_wait): Likewise.
5090         (lll_mutex_lock): Adjust asm for that.
5091         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
5092         (lll_lock): Adjust asm for operand order change.
5093         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
5094         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
5096         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
5097         Reverse order of parameters.
5098         (__lll_timedwait_tid): Remove regparms attribute.
5099         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
5100         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
5102         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5103         (__lll_timedwait_tid): Remove one unnecessary instruction.
5105         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
5106         __lll_mutex_timedlock_wait only for NOT_IN_libc.
5107         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
5108         lowlevelmutex.S.
5110         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
5111         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
5112         for NOT_IN_libc.
5113         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
5114         lowlevellock.S.
5116         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
5117         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
5118         for libc.so.
5119         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
5120         define LOCK here (if UP is not defined).  The actual code is in
5121         lowlevelmutex.S.
5123         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
5124         LOCK is already defined.  Don't define lll_unlock_wake_cb and
5125         __lll_timedwait_tid for libc.so.
5126         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
5127         define LOCK here (if UP is not defined).  The actual code is in
5128         lowlevellock.S.
5130         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
5131         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
5132         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
5133         instead of lowlevelsem.h.
5134         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
5135         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
5136         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
5138         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
5139         lowlevelrwlock.sym.
5140         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
5141         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
5142         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
5144         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
5145         register loading.
5146         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
5147         last changed.  D'oh.
5149         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
5151         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
5152         of __libc_locking_needed.
5153         (lll_trylock): Initialize %eax to zero.
5155         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
5156         pthread_cond_t definition.
5158 2003-03-10  Roland McGrath  <roland@redhat.com>
5160         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
5161         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
5162         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
5163         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
5164         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
5166         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
5167         Instead of setting PD->multiple_threads, set globals
5168         __pthread_multiple_threads and __libc_multiple_threads.
5169         * sysdeps/pthread/createthread.c (create_thread): Likewise.
5170         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
5171         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
5173         * descr.h (struct pthread): Conditionalize first member on
5174         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
5175         containing an anonymous tcbhead_t.  Move `list' member out.
5176         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
5177         * allocatestack.c: Remove use of `header.data.' prefix.
5178         * pthread_create.c: Likewise.
5179         * init.c (__pthread_initialize_minimal_internal): Likewise.
5180         * sysdeps/pthread/createthread.c (create_thread): Likewise.
5181         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
5182         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
5183         * sysdeps/x86_64/tls.h: Likewise.
5184         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
5185         (SINGLE_THREAD_P): Likewise.
5186         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
5187         (SINGLE_THREAD_P): Likewise.
5188         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
5189         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
5191 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
5193         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
5195         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
5196         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
5198         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
5199         leftovers from the ia32 code.
5201         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
5202         memory load.
5203         (clear_once_control): Don't load %esi.
5205         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
5206         handling.
5208         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
5210         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
5211         * sysdeps/unix/sysv/linux/createthread.c: ...here.
5213         * Makefile (tests): Add tst-cond10.
5214         * tst-cond10.c: New file.
5216 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
5218         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
5219         * tst-signal3.c (do_test): Likewise.
5220         * tst-sem5.c (do_test): Likewise.
5221         * tst-kill6.c (do_test): Likewise.
5222         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
5224         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
5225         of inc/dec.
5226         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
5227         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
5228         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
5229         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
5230         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5231         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
5232         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5233         Likewise.
5234         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5235         Likewise.
5236         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5237         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5238         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5239         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5240         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5241         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
5242         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
5243         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
5245         * allocatestack.c (allocate_stack): If mprotect() fails free the
5246         TLS memory.
5248 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
5250         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
5252         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
5253         lll_wake_tid.  This was used only to work around kernel limits in
5254         the early days.
5255         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
5256         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
5257         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
5258         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
5260         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
5261         (__pthread_initialize_minimal_internal): Change initialization of
5262         __static_tls_align_m1 appropriately.
5263         * pthreadP.h (__static_tls_align_m1): Renamed from
5264         __static_tls_align.
5265         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
5266         instead of __static_tls_align-1.
5268 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
5270         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
5272         * pthread_create.c: Define __pthread_keys using nocommon
5273         attribute, not by placing it explicitly in bss.
5274         Remove DEFINE_DEALLOC definition.  Not needed anymore.
5276         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
5277         Use it in mmap call to allocate stacks.
5279         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
5281         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
5282         result of the thread function.
5284 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
5286         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
5287         version is just fine.
5289         * sysdeps/unix/sysv/linux/libc_pthread_init.c
5290         (__pthread_child_handler): Renamed from pthread_child_handler,
5291         exported, and marked hidden.  Change all users.
5292         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
5293         free __pthread_child_handler from child list.
5295 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5297         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
5299         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5300         Fix handling of cancellation and failing pthread_mutex_unlock call.
5301         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
5302         (__pthread_cond_wait): Likewise.
5304         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
5305         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
5306         lll_futex_timed_wait call.
5307         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
5308         (pthread_rwlock_timedwrlock): Likewise.
5310         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
5311         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
5312         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
5314         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
5315         check of lll_futex_wake return value.
5317 2003-03-03  Roland McGrath  <roland@redhat.com>
5319         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
5321         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
5322         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
5323         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
5325 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
5327         * sysdeps/pthread/timer_create.c (timer_create): Return correct
5328         error for CPU clocks.
5330         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
5331         _POSIX_MONOTONIC_CLOCK.
5332         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
5334         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
5335         recent kernels.
5337 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
5339         * descr.h (struct pthread): Move cleanup field to the front.
5341 2003-03-01  Roland McGrath  <roland@redhat.com>
5343         * sem_open.c (sem_open): Braino fix.
5345 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
5347         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
5348         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
5349         __pthread_cleanup_pop functionality.
5350         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5352         * descr.h (struct pthread): Move tid field to the front now that
5353         it is often used.
5355         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
5356         (__lll_mutex_timedlock_wait): Remove.
5357         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
5358         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
5359         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
5360         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5361         (lll_unlock_wake_cb): Don't save and restore %esi.
5362         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
5363         %esi.
5364         (__lll_timedwait_tid): Add alignment.
5365         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
5366         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
5367         %esi.
5368         (__lll_timedwait_tid): Removed.
5369         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
5370         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
5371         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
5372         (pthread_barrier_wait): Don't save, load, and restore %esi for
5373         last thread.
5374         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
5375         (__pthread_cond_signal): Don't save, load, and restore %esi.
5376         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
5377         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
5378         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
5379         Don't save, load, and restore %esi.
5381 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
5383         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
5384         Release lock before waking up the waiters.
5386         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
5388         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
5389         (reader_thread): Likewise.
5391         * sysdeps/pthread/pthread_rwlock_unlock.c
5392         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
5393         to wake up readers if there are none.
5395         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
5396         Release internal lock before wake threads.
5398 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
5400         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
5401         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
5402         predefined.
5403         * tst-rwlock9.c: Likewise.
5404         * tst-rwlock10.c: New file.
5405         * tst-rwlock11.c: New file.
5407         * Makefile (tests): Add tst-dlsym1.
5408         * tst-dlsym1.c: New file.
5410         * init.c (__pthread_initialize_minimal_internal): Set
5411         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
5412         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
5414 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
5416         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
5418         * tst-cond2.c: Fix sychronization with child.
5420         * tst-rwlock8.c (reader_thread): Remove unused variable.
5422         * Makefile: Add rules to build and run tst-tls3.
5423         * tst-tls3.c: New file.
5424         * tst-tls3mod.c: New file.
5426         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
5427         * tst-rwlock8.c: New file.
5428         * tst-rwlock9.c: New file.
5429         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
5430         complete broken rwlock implementation.
5431         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5432         Likewise.
5433         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5434         Likewise.
5435         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
5436         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5437         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
5438         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
5439         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
5440         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
5441         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
5443 2003-02-23  Roland McGrath  <roland@redhat.com>
5445         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
5447 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
5449         * Makefile (tests): Add tst-context1.
5450         * tst-context1.c: New file.
5452         * Makefile (tests): Add tst-tls1 and tst-tls2.
5453         * tst-tls1.c: New file.
5454         * tst-tls2.c: New file.
5456         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
5457         for failed cmpxchg.
5459         * pthread_create.c (start_thread): Set EXITING_BIT early.
5461         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
5462         (THREAD_GETMEM_NC): Likewise.
5464 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
5466         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
5467         off 3 more bytes by using offset-less instructions when possible.
5469         * Makefile: Add dependency for $(objpfx)version.d.
5471         * eintr.c (eintr_source): Add unnecessary return but the compiler
5472         insists.
5474         * tst-kill3.c: Include <unistd.h>.
5476 2003-02-21  Roland McGrath  <roland@redhat.com>
5478         * pthread_create.c (start_thread): Call __libc_thread_freeres.
5480 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
5482         * Makefile (tests): Add tst-eintr1.
5483         (distribute): Add eintr.c.
5484         * tst-eintr1.c: New file.
5485         * eintr.c: New file.
5487         * pthread_cancel.c (pthread_cancel): Use tkill directly.
5489         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
5490         Disallow sending SIGCANCEL.
5492         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
5493         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
5494         * tst-kill1.c: New file.
5495         * tst-kill2.c: New file.
5496         * tst-kill3.c: New file.
5497         * tst-kill5.c: New file.
5498         * tst-kill6.c: New file.
5499         * tst-basic7.c: Renamed to...
5500         * tst-kill4.c: ...this.
5502 2003-02-21  Roland McGrath  <roland@redhat.com>
5504         * Makefile (install-lib-ldscripts): New variable.
5506 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
5508         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
5509         * pthread_cancel.c: Use INVALID_TD_P.
5510         * pthread_detach.c: Likewise.
5511         * pthread_getschedparam.c: Likewise.
5512         * pthread_setschedparam.c: Likewise.
5513         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
5514         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
5515         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
5516         * pthread_timedjoin.c: Likewise.
5518         * tst-basic7.c: Include <signal.h>.
5520         * pthread_join.c (pthread_join): Limited checking for invalid
5521         descriptors.
5522         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
5524 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
5526         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
5527         beginning of the loop.  Clear the entire first block of TSD.
5528         * Makefile (tests): Add tst-key4.
5529         * tst-key4.c: New file.
5531 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
5533         * Makefile (tests): Add tst-basic7.
5534         * tst-basic7.c: New file.
5536         * pthread_create.c (deallocate_tsd): Mark as internal_function.
5537         Add some more __builtin_expect.
5539         * pthreadP.h: Define dummy version of DEBUGGING_P.
5541 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
5543         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
5544         _POSIX_THREAD_PRIORITY_SCHEDULING.
5545         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
5546         _XOPEN_REALTIME_THREADS.
5547         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
5549         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
5550         kernel returns EINVAL for PID <= 0, work around it.
5552         * Makefile (tests): Add tst-signal5.
5553         * tst-signal5.c: New file.
5555         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
5556         and LOGIN_NAME_MAX.
5558         * tst-cancel1.c (tf): Block all signals.
5560         * Makefile (tests): Add tst-basic6.
5561         * tst-basic6.c: New file.
5563         * tst-basic1.c: Add test for process ID.
5565         * Makefile (tests): Add tst-cancel10.
5566         * tst-cancel10.c: New file.
5568         * Makefile (tests): Add tst-signal4.
5569         * tst-signal4.c: New file.
5571         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
5572         __sigismember instead of sigismember.  Add __builtin_expect.
5574 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
5576         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
5577         pthread_setcancelstate, and pthread_rwlock_setpshared.
5579         * tst-cancel7.c (do_test): Make sure the pid file exists before
5580         canceling the thread.
5582         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
5583         pthread_rwlock_timedrdlock tests.
5584         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
5585         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5586         Check for invalid tv_nsec field.
5587         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5588         Likewise.
5590         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
5591         recursive mutex of overflow.
5593         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
5595         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
5596         going into an endless loop.
5597         * Makefile (tests): Add tst-cancel9.
5598         * tst-cancel9.c: New file.
5600         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
5602 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
5604         * tst-mutex5.c (do_test): Add more timedlock tests.
5606         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
5607         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
5609         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
5610         use INLINE_SYSCALL.  Error number is returned, not -1.
5612         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
5613         and __deallocate_stack with internal_function.
5614         * pthread_create.c: Adjust definitions appropriately.
5615         * allocatestack.c: Likewise.
5617         * pthread_join.c: Add one more __builtin_expect.
5618         * pthread_timedjoin.c: Likewise.
5620         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
5621         not data of sequence number does not match.
5622         Add one __builtin_expect.
5624         * Makefile (tests): Add tst-clock1.
5625         * tst-clock1.c: New file.
5627         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
5628         negative arguments.
5629         * Makefile (tests): Add tst-basic5.
5630         * tst-basic5.c: New file.
5632 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
5634         * Makefile (tests): Add tst-basic4.
5635         * tst-basic4.c: New file.
5637         * pthreadP.h: Add declaraction for __nptl_nthreads.
5638         * pthread_create.c: Define __nptl_nthreads
5639         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
5640         after thread is done.  If then zero, call exit(0).
5641         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
5642         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
5643         * init.c (pthread_functions): Initialize ptr_nthreads.
5644         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
5645         (__reclaim_stacks): Decrement __nptl_nthreads.
5646         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
5647         Define.
5648         * Makefile (tests): Add tst-basic3.
5649         * tst-basic3.c: New file.
5651         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
5652         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
5653         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
5654         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
5655         if asynchronous canceling is enabled.
5656         * pthread_join.c (pthread_join): When recognizing circular joins,
5657         take into account the other thread might be already canceled.
5658         * Makefile (tests): Add tst-join5.
5659         * tst-join5.c: New file.
5661         * Makefile (tests): Add tst-join4.
5662         * tst-join4.c: New file.
5664 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
5666         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
5668 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5670         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
5671         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
5672         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
5673         warning.
5674         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
5675         to avoid warning.
5676         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
5677         error if lll_futex_wake failed.
5679 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
5681         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
5682         handling of cancellation and failung pthread_mutex_unlock call.
5683         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5684         * Makefile (tests): Add tst-cond8 and tst-cond9.
5685         * tst-cond8.c: New file.
5686         * tst-cond9.c: New file.
5688         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
5690         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
5691         non-standard initializers with __USE_GNU.
5693         * Makefile (tests): Add tst-cleanup3.
5694         * tst-cleanup3.c: New file.
5696 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
5698         * Makefile (tests): Add tst-attr1 and tst-attr2.
5699         * tst-attr1.c: New file.
5700         * tst-attr2.c: New file.
5702         * Makefile: Add rules to build and run tst-atfork2 test.
5703         * tst-atfork2.c: New file.
5704         * tst-atfork2mod.c: New file.
5706         * sysdeps/unix/sysv/linux/unregister-atfork.c
5707         (__unregister_atfork): Free the memory allocated for the handlers
5708         after removing them from the lists.
5710         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
5711         cleanup function.
5713         * tst-atfork1.c (do_test): Wait for the child we forked.
5714         Report error in child.
5716         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
5718         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
5720 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
5722         * Makefile (tests): Add tst-cancel8.
5723         * tst-cancel8.c: New file.
5725         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
5726         clearing of control variable.
5727         * Makefile (tests): Add tst-once3 and tst-once4.
5728         * tst-once3.c: New file.
5729         * tst-once4.c: New file.
5731 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
5733         * sysdeps/sh/Makefile: New file.
5734         * sysdeps/sh/bits/atomic.h: New file.
5735         * sysdeps/sh/pthread_spin_init.c: New file.
5736         * sysdeps/sh/pthread_spin_lock.c: New file.
5737         * sysdeps/sh/pthread_spin_trylock.S: New file.
5738         * sysdeps/sh/pthread_spin_unlock.S: New file.
5739         * sysdeps/sh/pthreaddef.h: New file.
5740         * sysdeps/sh/tcb-offsets.sym: New file.
5741         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
5742         * sysdeps/sh/tls.h: New file.
5743         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
5744         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
5745         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
5746         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
5747         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
5748         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
5749         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
5750         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
5751         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
5752         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
5753         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
5754         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
5755         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
5756         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
5757         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
5758         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
5759         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
5760         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
5761         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
5762         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
5763         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
5764         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
5765         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
5766         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
5767         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
5768         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
5769         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
5770         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
5771         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
5772         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
5774 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
5776         * tst-cond2.c: Rearrange code to not rely on behavior undefined
5777         according to POSIX.
5779         * tst-basic2.c (do_test): Lock mutex before creating the thread.
5781 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
5783         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
5784         (TLS_GET_FS): New #define.
5785         (TLS_SET_FS): New #define.
5786         Correct value of __NR_set_thread_area.
5788         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
5790 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
5792         * Makefile (tests): Add tst-popen1.
5793         * tst-popen1.c: New file.
5795         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
5796         but inactive generalization.
5797         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5798         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5799         Minor optimization, remove one instruction.
5800         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5802 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5804         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
5806 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
5808         * init.c (__NR_set_tid_address): Add #ifdef for s390.
5809         * sysdeps/pthread/pthread_barrier_wait.c: New file.
5810         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
5811         * sysdeps/pthread/pthread_cond_signal.c: New file.
5812         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
5813         * sysdeps/pthread/pthread_cond_wait.c: New file.
5814         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
5815         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
5816         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
5817         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
5818         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
5819         * sysdeps/s390/Makefile: New file.
5820         * sysdeps/s390/bits/atomic.h: New file.
5821         * sysdeps/s390/pthread_spin_init.c: New file.
5822         * sysdeps/s390/pthread_spin_lock.c: New file.
5823         * sysdeps/s390/pthread_spin_trylock.c: New file.
5824         * sysdeps/s390/pthread_spin_unlock.c: New file.
5825         * sysdeps/s390/pthreaddef.h: New file.
5826         * sysdeps/s390/tcb-offsets.sym: New file.
5827         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
5828         * sysdeps/s390/tls.h: New file.
5829         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
5830         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
5831         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
5832         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
5833         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
5834         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
5835         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
5836         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
5837         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
5838         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
5839         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
5840         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
5841         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
5842         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
5843         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
5844         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
5845         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
5846         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
5847         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
5848         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
5849         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
5850         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
5851         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
5853 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
5855         * atomic.h: Add a couple more default implementations.
5856         (atomic_compare_and_exchange_acq): Use
5857         __arch_compare_and_exchange_32_acq in return value definition.  It
5858         always exists.
5859         (atomic_bit_set): Renamed from atomic_set_bit.
5860         Add missing atomic_ prefixes.
5862         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
5863         thread library is available, use correct value to mark initialized
5864         once variable.
5866 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
5868         * allocatestack.c (allocate_stack): Use __getpagesize instead of
5869         __sysconf to determine pagesize.
5871         * pthread_create.c: Include <atomic.h>.
5872         * allocatestack.c (allocate_stack): Implement coloring of the
5873         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
5874         size minus one.  Adjust users.
5875         * sysdeps/i386/i686/Makefile: New file.
5877 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
5879         * allocatestack.c: Improve comment throughout the file.
5881         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5882         (__lll_lock_wait): Add branch prediction.
5883         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
5884         (__lll_lock_wait): Likewise.
5885         (lll_unlock_wake_cb): Removed.
5887 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
5889         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
5890         _POSIX_THREAD_PRIORITY_SCHEDULING.
5892 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
5894         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
5895         Fix return type of ptr___pthread_getspecific.
5897 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
5899         * Makefile (tests): Add tst-umask1.
5900         (tst-umask1-ARGS): Define.
5901         * tst-umask1.c: New file.
5903 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
5905         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
5906         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
5907         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
5908         pthread_rwlock_unlock.
5909         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
5910         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
5911         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
5912         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
5913         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5914         New file.
5915         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
5916         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5917         New file.
5918         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
5919         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
5920         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
5921         New file.
5922         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
5923         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
5924         New file.
5925         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
5926         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
5927         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
5928         New file.
5929         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
5930         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
5931         New file.
5932         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
5934         * Makefile (libpthread-routines): Remove lowlevelcond and
5935         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
5936         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
5937         and pthread_cond_broadcast.
5938         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
5939         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
5940         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
5941         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
5942         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
5943         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
5944         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
5945         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
5946         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
5947         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
5948         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
5949         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
5950         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
5951         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
5952         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
5953         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
5954         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
5955         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
5956         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
5957         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
5958         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
5959         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
5960         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
5961         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
5962         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
5963         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
5964         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
5965         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
5966         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
5967         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
5968         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
5970         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
5971         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
5972         of the code is moved to ...
5973         * sysdeps/pthread/createthread.c: ...here.  New file.
5975 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
5977         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
5978         (__new_sem_post): Clear %eax before returning.
5979         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
5981         * Makefile (tests): Add tst-cleanup2.
5982         * tst-cleanup2.c: New file.
5984         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
5985         Interpret first parameter correctly.
5987 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
5989         * Makefile (headers): Add bits/semaphore.h.
5991 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
5993         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
5994         if not SHARED.
5996 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
5998         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
5999         must be used and mapping failed.
6000         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
6002         * Makefile (CFLAGS-pthread_self.os): Define this, not
6003         CFLAGS-pthread_self.c.
6005 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
6007         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
6008         lll_unlock_wake_cb.
6010         * Makefile (libpthread-routines): Add version.  Add rules to build
6011         version.os and banner.h.
6012         * version.c: New file.
6014 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
6016         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
6017         the alias unconditional.
6018         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
6020 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
6022         * Makefile (CFLAGS-pthread_self.c): New definition.
6024 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
6026         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
6027         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
6028         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
6029         * init.c (__pthread_initialize_minimal_internal): Likewise.
6031 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
6033         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
6035         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6036         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
6037         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
6038         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
6039         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
6040         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
6042 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
6044         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
6045         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
6046         * tst-cancel-wrappers.sh: Remove all exceptions.
6048 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
6050         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
6051         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
6053         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
6054         Use __libc_pthread_functions array if SHARED.
6056         * pthreadP.h: Move pthread_cond_2_0_t definition to...
6057         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
6059         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
6060         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
6061         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
6062         __libc_ptf_call instead of __libc_maybe_call.
6063         (PTF): New #define.
6064         (__libc_cleanup_region_start): Wrap function name with PTF call.
6065         (__libc_cleanup_region_end): Likewise.
6066         (__libc_cleanup_end): Likewise.
6068         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
6069         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
6070         * pthread_key_create.c: Add __pthread_key_create_internal alias.
6071         * pthreadP.h: Add prototypes.
6073         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
6074         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
6075         __pthread_rwlock_unlock aliases.
6076         * pthreadP.h: Add prototypes for new aliases.
6078         * pthreadP.h (struct pthead_functions): Moved to...
6079         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
6080         * init.c (pthread_functions): Add initializers for new elements.
6082         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
6083         __pthread_cleanup_pop_restore aliases.
6084         * pthreadP.h: Add prototypes.
6086         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
6087         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
6088         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
6089         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
6090         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
6091         * pthreadP.h: Adjust prototypes and callers.
6093 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
6095         * Makefile (tests): Add tst-cancel7.
6096         (tst-cancel7-ARGS): New variable.
6097         * tst-cancel7.c: New file.
6099         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
6100         around gcc defficiencies.
6101         * old_pthread_cond_signal.c: Likewise.
6102         * old_pthread_cond_timedwait.c: Likewise.
6103         * old_pthread_cond_wait.c: Likewise.
6105         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
6107 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
6109         * Makefile (tests): Add tst-cond7.
6110         * tst-cond7.c: New file.
6112         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
6113         (condvar_cleanup): Get condvar address from the right place.
6115         * atomic.h: Correct definitions of atomic_full_barrier,
6116         atomic_read_barrier, atomic_write_barrier.
6118         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
6119         race-free.
6120         * old_pthread_cond_signal.c: Likewise.
6121         * old_pthread_cond_timedwait.c: Likewise.
6122         * old_pthread_cond_wait.c: Likewise.
6124 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
6126         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
6128 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
6130         * pthreadP.h (pthread_cond_2_0_t): New type.
6131         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
6132         Use new type for the 2.0 condvar function prototypes.
6133         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
6134         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
6135         parameter.
6136         * old_pthread_cond_destroy.c: Likewise.
6137         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
6138         * old_pthread_cond_signal.c: Likewise.
6139         * old_pthread_cond_timedwait.c: Likewise.
6140         * old_pthread_cond_wait.c: Likewise.
6142         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
6143         (__pthread_cond_wait): Don't save cancellation mode and seq value
6144         in same location.
6146         * herrno.c (__h_errno_location): Don't define as weak.
6148 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
6150         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
6151         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
6152         and pthread_cond_wait.
6153         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
6154         Renamed to...
6155         (__pthread_cond_broadcast_2_0): ... this.
6156         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
6157         Renamed to...
6158         (__pthread_cond_destroy_2_0): ... this.
6159         * old_pthread_cond_init.c (__old_pthread_cond_init):
6160         Renamed to...
6161         (__pthread_cond_init_2_0): ... this.
6162         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
6163         Renamed to...
6164         (__pthread_cond_signal_2_0): ... this.
6165         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
6166         Renamed to...
6167         (__pthread_cond_wait_2_0): ... this.
6168         * pthread_cond_destroy.c: Include shlib-compat.h.
6169         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
6170         * pthread_cond_init.c: Include shlib-compat.h.
6171         (pthread_cond_init): Change strong_alias into versioned_symbol.
6172         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
6173         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
6174         fields.
6175         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
6176         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
6177         __pthread_cond_wait_2_0): New prototypes.
6178         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
6179         __old_pthread_cond_init, __old_pthread_cond_signal,
6180         __old_pthread_cond_wait): Removed.
6181         * init.c: Include shlib-compat.h.
6182         (pthread_functions): Guard ptr___pthread_attr_init_2_0
6183         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
6184         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
6185         ptr___pthread_cond_*_2_0 fields.
6186         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
6187         pthread_cond_*@GLIBC_2.0 compatibility symbols.
6189         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
6190         LIBC_SIGACTION was not yet defined.
6191         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
6192         [!defined LIBC_SIGACTION] (__sigaction): New function and
6193         libc_hidden_weak.
6194         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
6195         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
6197 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
6199         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
6201 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
6203         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
6204         New, larger type definition.
6205         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
6206         implementation.
6207         * Versions [libpthread]: Add definitions for new pthread_cond_*
6208         interfaces for version GLIBC_2.3.2.
6209         * pthread_cond_init.c: Update initialization for new type definition.
6210         * Makefile (libpthread-routines): Remove pthread_cond_wait,
6211         pthread_cond_timedwait, pthread_cond_signal, and
6212         pthread_cond_broadcast.  Add old_pthread_cond_init,
6213         old_pthread_cond_destroy, old_pthread_cond_wait,
6214         old_pthread_cond_timedwait, old_pthread_cond_signal, and
6215         old_pthread_cond_broadcast.
6216         * old_pthread_cond_broadcast.c: New file.
6217         * old_pthread_cond_destroy.c: New file.
6218         * old_pthread_cond_init.c: New file.
6219         * old_pthread_cond_signal.c: New file.
6220         * old_pthread_cond_timedwait.c: New file.
6221         * old_pthread_cond_wait.c: New file.
6222         * pthreadP.h: Add prototypes for the compatibility interfaces.
6224         * pthread_cond_destroy.c: Don't include <errno.h>.
6226 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
6228         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
6229         unnecessary zero offset when addressing MUTEX.
6231 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
6233         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
6234         __register_atfork.
6235         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
6236         for __register_atfork.
6238 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
6240         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
6241         instead of ASSEMBLER test macro.
6243         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
6244         __libc_current_sigrtmax): Add libc_hidden_def.
6246         * sysdeps/pthread/list.h: Remove assert.h include.
6248 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
6250         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
6251         __pthread_initialize_minimal_internal not
6252         __pthread_initialize_minimal.
6254 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
6256         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
6257         __pthread_initialize_minimal as hidden.
6259         * init.c (__pthread_initialize_minimal_internal): Don't mark as
6260         constructor.
6262 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
6264         * Makefile ($(inst_libdir)/libpthread.so): Depend on
6265         $(common-objpfx)format.lds, include that into the output script.
6266         Fix comment.
6267         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
6269 2002-12-28  Andreas Jaeger  <aj@suse.de>
6271         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
6272         nsec resolution changes.
6273         (xstat64_conv): Likewise.
6274         (xstat32_conv): Likewise.
6275         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
6276         struct kernel_stat.
6277         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
6278         structs stat and stat64.
6279         * time/time.h (__timespec_defined): Define for __USE_MISC.
6280         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
6282 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
6284         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
6285         argument.
6286         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
6287         (pthread_exit): Use strong_alias to avoid warnings.
6288         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
6289         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
6290         ptr___pthread_attr_init_2_*.
6291         * init.c (pthread_functions): Adjust.
6293 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
6295         * forward.c: Make all functions available by default again.  It
6296         caused too much trouble.
6298         * pt-siglongjmp.c: Removed.
6300 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
6302         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
6303         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
6304         * sysdeps/i386/Makefile: New file.
6305         * sysdeps/i386/tcb-offsets.sym: New file.
6306         * sysdeps/pthread/tcb-offsets.h: New file.
6307         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
6308         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
6310         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
6311         __register_atfork...
6312         (GLIBC_2.3.2): ...here.
6314 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
6316         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
6317         pthread_attr_setstackaddr with __attribute_deprecated__.
6319 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
6321         * pt-system.c (system): Remove cancellation handling.
6322         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
6323         cancellation routines.
6325 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
6327         * descr.h: Include <dl-sysdep.h>.
6328         (struct pthread): Move header.data.list to the back of the struct.
6329         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
6330         (MULTIPLE_THREADS_OFFSET): Adjust offset.
6331         (SYSINFO_OFFSEET): Likewise.
6333 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
6335         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
6336         Define.
6337         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
6338         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
6339         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
6340         (USE_DL_SYSINFO): Undef.
6342 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
6344         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
6345         $(common-objpfx)libc.so.
6346         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
6347         it is bigger than pipe buffer size even on arches with bigger
6348         page size.
6349         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
6351 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
6353         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
6354         correct errno access for case that USE___THREAD is not defined.
6356 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
6358         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
6359         Patch by Marijn Ros <marijn@mad.scientist.com>.
6361 2002-12-22  Roland McGrath  <roland@redhat.com>
6363         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
6365 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
6367         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
6369 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
6371         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
6372         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
6373         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
6375         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
6376         of int $0x80.
6377         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
6378         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
6379         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
6380         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
6381         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
6382         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
6383         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
6384         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
6386         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
6387         sysenter.
6388         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
6390         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
6392         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
6393         in new TCB.
6394         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
6395         that sysinfo is properly initialized.
6396         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
6397         to 1 only for ld.so.
6399         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
6400         RTLD_CORRECT_DYNAMIC_WEAK.
6402 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
6404         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
6405         Use return 0 as 6th argument to FORWARD4.
6406         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
6408 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
6410         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
6411         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
6412         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
6413         (INIT_SYSINFO): New #define.
6414         (TLS_TP_INIT): Use INIT_SYSINFO.
6415         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
6416         At test to make sure SYSINFO_OFFSET value is correct.
6417         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
6419 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
6421         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
6422         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
6423         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
6424         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
6425         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
6426         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
6427         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
6429 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
6431         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
6432         macro instead of using int $0x80 directly.
6434         * sysdeps/pthread/bits/stdio-lock.h: New file.
6435         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
6436         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
6437         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
6438         * Makefile (routines): Add libc-lowlevelmutex.
6440         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
6441         __i686.get_pc_thunk.dx.
6443 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
6445         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
6446         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
6447         ($(objpfx)tst-cancel-wrappers.out): New rule.
6448         * tst-cancel-wrappers.sh: New test.
6449         * tst-locale1.c: Include signal.h.
6450         (uselocale): Test static linking of __libc_current_sigrt*.
6452 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
6454         * Makefile (tests): Add tst-cancel6.
6455         * tst-cancel6.c: New file
6457 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
6459         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
6460         Define meaningfully for assembler as well.
6461         * pthreadP.h (struct pthread_functions): Remove
6462         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
6463         and ptr_pthread_attr_init_2_1 fields.
6464         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
6465         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
6466         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
6467         (FORWARD3): Define using FORWARD4.
6468         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
6469         versions.
6470         * pt-system.c: Remove duplicate stdlib.h include.
6472 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
6474         * sem_init.c: Define sem_init@GLIBC_2.0.
6475         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
6476         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
6478         * flockfile.c: Moved to...
6479         * sysdeps/pthread/flockfile.c: ...here.  New file.
6480         * funlockfile.c: Moved to...
6481         * sysdeps/pthread/funlockfile.c: ...here.  New file.
6482         * ftrylockfile.c: Moved to...
6483         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
6485 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
6487         * libc-cancellation.c: Guard both function with
6488         #if !defined NOT_IN_libc.
6489         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
6490         automatically provided pthread wrappers.
6491         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
6492         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
6493         nor in libpthread.
6494         * pt-open.c: Removed.
6495         * pt-fcntl.c: Removed.
6496         * pt-fsync.c: Removed.
6497         * pt-lseek.c: Removed.
6498         * pt-msgrcv.c: Removed.
6499         * pt-msgsnd.c: Removed.
6500         * pt-msync.c: Removed.
6501         * pt-nanosleep.c: Removed.
6502         * pt-open64.c: Removed.
6503         * pt-pause.c: Removed.
6504         * pt-pread.c: Removed.
6505         * pt-pread64.c: Removed.
6506         * pt-pwrite.c: Removed.
6507         * pt-pwrite64.c: Removed.
6508         * pt-read.c: Removed.
6509         * pt-recv.c: Removed.
6510         * pt-recvfrom.c: Removed.
6511         * pt-recvmsg.c: Removed.
6512         * pt-send.c: Removed.
6513         * pt-sendto.c: Removed.
6514         * pt-sigtimedwait.c: Removed.
6515         * pt-sigwait.c: Removed.
6516         * pt-wait.c: Removed.
6517         * pt-waitpid.c: Removed.
6518         * pt-write.c: Removed.
6519         * pt-accept.c: Removed.
6520         * pt-close.c: Removed.
6521         * pt-connect.c: Removed.
6522         * pt-lseek64.c: Removed.
6523         * pt-sendmsg.c: Removed.
6524         * pt-tcdrain.c: Removed.
6526 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
6528         * init.c (__pthread_initialize_minimal_internal): Renamed from
6529         __pthread_initialize_minimal.  Make old name an alias.  This
6530         converts a normal relocation into a relative relocation.
6532         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
6534         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
6535         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
6536         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
6537         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
6538         pt-sigwaitinfo, pt-waitid, and pt-writev.
6539         * pt-creat.c: Removed.
6540         * pt-poll.c: Removed.
6541         * pt-pselect.c: Removed.
6542         * pt-readv.c: Removed.
6543         * pt-select.c: Removed.
6544         * pt-sigpause.c: Removed.
6545         * pt-sigsuspend.c: Removed.
6546         * pt-sigwaitinfo.c: Removed.
6547         * pt-waitid.c: Removed.
6548         * pt-writev.c: Removed.
6550         * init.c (pthread_functions): New variable.
6551         (__pthread_initialize_minimal): Pass pointer to pthread_functions
6552         (or NULL) to __libc_pthread_init.
6553         * forward.c: Rewrite to use __libc:pthread_functions array to get
6554         function addresses.
6555         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
6556         prototype.
6557         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
6558         Take new parameter.  Copy content of variable pointed to by it
6559         to __libc_pthread_init.
6561         * pthreadP.h (struct pthread_functions): New type.
6562         (__libc_pthread_init): Declare.
6564         * pthread_attr_destroy.c: Add namespace protected alias.
6565         * pthread_attr_getdetachstate.c: Likewise.
6566         * pthread_attr_getinheritsched.c: Likewise.
6567         * pthread_attr_getschedparam.c: Likewise.
6568         * pthread_attr_getschedpolicy.c: Likewise.
6569         * pthread_attr_getscope.c: Likewise.
6570         * pthread_attr_setdetachstate.c: Likewise.
6571         * pthread_attr_setinheritsched.c: Likewise.
6572         * pthread_attr_setschedparam.c: Likewise.
6573         * pthread_attr_setschedpolicy.c: Likewise.
6574         * pthread_attr_setscope.c: Likewise.
6575         * pthread_cond_broadcast.c: Likewise.
6576         * pthread_cond_destroy.c: Likewise.
6577         * pthread_cond_init.c: Likewise.
6578         * pthread_cond_signal.c: Likewise.
6579         * pthread_cond_wait.c: Likewise.
6580         * pthread_condattr_destroy.c: Likewise.
6581         * pthread_condattr_init.c: Likewise.
6582         * pthread_equal.c: Likewise.
6583         * pthread_exit.c: Likewise.
6584         * pthread_getschedparam.c: Likewise.
6585         * pthread_self.c: Likewise.
6586         * pthread_setcancelstate.c: Likewise.
6587         * pthread_setschedparam.c: Likewise.
6588         * pthread_mutex_destroy.c: Likewise.
6589         * pthread_mutex_init.c: Likewise.
6590         * pthreadP.h: Add prototypes for the aliases.
6592         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
6593         multiple_threads member in correct TCB to 1.
6595         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
6596         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
6597         member of thread decriptor, otherwise return unconditionally 1.
6599 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
6601         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
6602         regular Linux version.  Remove file.
6603         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
6604         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
6605         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
6606         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
6607         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
6608         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
6609         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
6610         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
6611         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
6612         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
6613         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
6614         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
6615         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
6616         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
6617         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
6618         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
6619         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
6620         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
6621         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
6622         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
6623         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
6624         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
6625         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
6626         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
6627         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
6628         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
6629         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
6630         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
6631         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
6632         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
6634 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
6636         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
6637         * sysdeps/unix/sysv/linux/open.c: Removed.
6638         * sysdeps/unix/sysv/linux/fsync.c: Removed.
6639         * sysdeps/unix/sysv/linux/lseek.c: Removed.
6640         * sysdeps/unix/sysv/linux/msync.c: Removed.
6641         * sysdeps/unix/sysv/linux/read.c: Removed.
6642         * sysdeps/unix/sysv/linux/close.c: Removed.
6643         * sysdeps/unix/sysv/linux/creat.c: Removed.
6644         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
6645         * sysdeps/unix/sysv/linux/pause.c: Removed.
6646         * sysdeps/unix/sysv/linux/select.c: Removed.
6647         * sysdeps/unix/sysv/linux/write.c: Removed.
6649 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
6651         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
6652         element in TCB to see whether locking is needed.
6654         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
6655         MULTIPLE_THREADS_OFFSET value is correct.
6657         * sysdeps/unix/sysv/linux/close.c: New file.
6658         * sysdeps/unix/sysv/linux/connect.S: New file.
6659         * sysdeps/unix/sysv/linux/creat.c: New file.
6660         * sysdeps/unix/sysv/linux/fsync.c: New file.
6661         * sysdeps/unix/sysv/linux/llseek.c: New file.
6662         * sysdeps/unix/sysv/linux/lseek.c: New file.
6663         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
6664         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
6665         * sysdeps/unix/sysv/linux/msync.c: New file.
6666         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
6667         * sysdeps/unix/sysv/linux/open.c: New file.
6668         * sysdeps/unix/sysv/linux/open64.c: New file.
6669         * sysdeps/unix/sysv/linux/pause.c: New file.
6670         * sysdeps/unix/sysv/linux/poll.c: New file.
6671         * sysdeps/unix/sysv/linux/pread.c: New file.
6672         * sysdeps/unix/sysv/linux/pread64.c: New file.
6673         * sysdeps/unix/sysv/linux/pselect.c: New file.
6674         * sysdeps/unix/sysv/linux/pwrite.c: New file.
6675         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
6676         * sysdeps/unix/sysv/linux/readv.c: New file.
6677         * sysdeps/unix/sysv/linux/recv.S: New file.
6678         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
6679         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
6680         * sysdeps/unix/sysv/linux/select.c: New file.
6681         * sysdeps/unix/sysv/linux/send.S: New file.
6682         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
6683         * sysdeps/unix/sysv/linux/sendto.S: New file.
6684         * sysdeps/unix/sysv/linux/sigpause.c: New file.
6685         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
6686         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
6687         * sysdeps/unix/sysv/linux/sigwait.c: New file.
6688         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
6689         * sysdeps/unix/sysv/linux/system.c: New file.
6690         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
6691         * sysdeps/unix/sysv/linux/wait.c: New file.
6692         * sysdeps/unix/sysv/linux/waitid.c: New file.
6693         * sysdeps/unix/sysv/linux/waitpid.c: New file.
6694         * sysdeps/unix/sysv/linux/writev.c: New file.
6695         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
6697         * pt-readv.c: Fix comment.
6699 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
6701         * tst-cleanup1.c: Include stdlib.h.
6703         * tst-cancel5.c: New test.
6704         * Makefile (tests): Add tst-cancel5.
6705         (tst-cancel5): Link against libc.so libpthread.so in that order.
6707 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
6709         * forward.c (test_loaded): Prevent recursive calls.
6711         * Makefile (routines): Add libc-cancellation.
6712         * libc-cancellation.c: New file.
6713         * descr.h (struct pthread): Add multiple_threads field.
6714         * allocatestack.c (allocate_stack): Initialize multiple_header field of
6715         new thread descriptor to 1.
6716         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
6717         Initialize multiple_thread field after successful thread creation.
6718         * cancellation.c (__do_cancel): Move to pthreadP.h.
6719         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
6720         (__pthread_disable_asynccancel): Add internal_function attribute.
6721         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
6722         * pthread_setcancelstate.c: Likewise.
6723         * pthread_setcanceltype.c: Likewise.
6724         * pthread_exit.c: Likewise.
6725         * pthreadP.h (CANCELLATION_P): Likewise.
6726         (__do_cancel): Define as static inline.
6727         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
6728         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
6729         declarations.
6730         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
6731         fields.  Define MULTIPLE_THREADS_OFFSET.
6732         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
6733         declaration.
6734         * sysdeps/unix/sysv/linux/accept.S: New file.
6735         * sysdeps/unix/sysv/linux/read.c: New file.
6736         * sysdeps/unix/sysv/linux/write.c: New file.
6737         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
6738         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
6739         initialization of __libc_locking_needed.
6740         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
6741         __libc_locking_needed, use multiple_threads field in TCB.
6742         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
6744 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
6746         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
6747         version.
6748         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
6750         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
6751         access to __libc_locking_needed for PIC.
6753 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
6755         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
6756         declare for libc.so.
6757         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
6758         expression.
6759         (__libc_lock_lock): Put into statement expression.
6760         (__libc_lock_unlock): Remove trailing semicolon.
6761         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
6763 2002-12-12  Roland McGrath  <roland@redhat.com>
6765         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
6766         "m" constraint to refer to __libc_locking_needed.  Declare it here.
6768 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
6770         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
6771         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
6772         Initialize __libc_locking_needed.
6773         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
6774         instead of __register_pthread_fork_handler.
6775         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
6776         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
6777         fork-gen with libc_pthread_init.
6778         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
6779         of __register_pthread_fork_handler.
6780         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
6781         of __register_pthread_fork_handler.
6782         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
6783         __libc_locking_needed to determine whether lock prefix can be avoided.
6784         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
6786 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
6788         * Makefile (tests): Add tst-cleanup1.
6789         * tst-cleanup1.c: New file.
6790         * cancellation.c (__cleanup_thread): Removed.
6791         (__do_cancel): Remove call to __cleanup_thread.
6792         * pthreadP.h: Remove __cleanup_thread prorotype.
6794         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
6795         Remember function and argument even if cancellation handler
6796         function is not available.
6797         (__libc_cleanup_region_end): Execute registered function directly if
6798         pthread functions are not available.
6799         (__libc_cleanup_end): Likewise.
6801         * init.c (__pthread_initialize_minimal): Fix initialization in
6802         static lib by preventing gcc from being too clever.
6804 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
6806         * init.c (__pthread_initialize_minimal): Remove unneccesary
6807         sigaddset call.
6809         * Makefile (tests): We can run tst-locale2 now.
6811 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
6813         * Versions: Remove duplicated sigwait entry.
6815 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
6817         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
6818         inside libpthread.
6820         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
6822         * pthreadP.h: Declare __pthread_enable_asynccancel and
6823         __pthread_disable_asynccancel.
6824         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
6825         (CANCEL_RESET): Use __pthread_disable_asynccancel.
6826         * cancellation.c (__pthread_enable_asynccancel): New function.
6827         (__pthread_disable_asynccancel): New function.
6828         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
6829         * pt-close.c: Likewise.
6830         * pt-connect.c: Likewise.
6831         * pt-creat.c: Likewise.
6832         * pt-fcntl.c: Likewise.
6833         * pt-fsync.c: Likewise.
6834         * pt-lseek.c: Likewise.
6835         * pt-lseek64.c: Likewise.
6836         * pt-msgrcv.c: Likewise.
6837         * pt-msgsnd.c: Likewise.
6838         * pt-msync.c: Likewise.
6839         * pt-nanosleep.c: Likewise.
6840         * pt-open.c: Likewise.
6841         * pt-open64.c: Likewise.
6842         * pt-pause.c: Likewise.
6843         * pt-poll.c: Likewise.
6844         * pt-pread.c: Likewise.
6845         * pt-pread64.c: Likewise.
6846         * pt-pselect.c: Likewise.
6847         * pt-pwrite.c: Likewise.
6848         * pt-pwrite64.c: Likewise.
6849         * pt-read.c: Likewise.
6850         * pt-readv.c: Likewise.
6851         * pt-recv.c: Likewise.
6852         * pt-recvfrom.c: Likewise.
6853         * pt-recvmsg.c: Likewise.
6854         * pt-select.c: Likewise.
6855         * pt-send.c: Likewise.
6856         * pt-sendmsg.c: Likewise.
6857         * pt-sendto.c: Likewise.
6858         * pt-sigpause.c: Likewise.
6859         * pt-sigsuspend.c: Likewise.
6860         * pt-sigtimedwait.c: Likewise.
6861         * pt-sigwait.c: Likewise.
6862         * pt-sigwaitinfo.c: Likewise.
6863         * pt-system.c: Likewise.
6864         * pt-tcdrain.c: Likewise.
6865         * pt-wait.c: Likewise.
6866         * pt-waitid.c: Likewise.
6867         * pt-waitpid.c: Likewise.
6868         * pt-write.c: Likewise.
6869         * pt-writev.c: Likewise.
6870         * pthread_join.c: Likewise.
6871         * pthread_timedjoin.c: Likewise.
6873         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
6874         (__xpg_sigpause): New function.
6875         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
6877 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
6879         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
6881         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
6882         _GI_pthread_cleanup_pop to pthreadP.h.
6884         * ftrylockfile.c: Use _IO_lock_trylock instead of
6885         pthread_mutex_trylock.
6887         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
6888         (CANCEL_RESET): Likewise.
6889         (__pthread_setcanceltype_): Declare.
6890         (__pthread_mutex_lock_internal): Declare.
6891         (__pthread_mutex_unlock_internal): Declare.
6892         (__pthread_once_internal): Declare.
6893         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
6894         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
6896         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
6897         and pthread_mutex_unlock.
6898         * pthread_cond_wait.c: Likewise.
6899         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
6900         * pthread_mutex_unlock.c: Likewise.
6902         * pthread_setcanceltype.c: Add additional alias
6903         __pthread_setcanceltype.
6905         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
6906         * sem_open.c (sem_open): Likewise.
6907         Use __libc_open, __libc_write, and __libc_close instead of
6908         open, write, and close respectively.
6910         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
6911         Rewrite as statement expression since it must return a value.
6913         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
6914         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
6915         __pthread_kill.
6917         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
6918         alias __pthread_once_internal.
6920         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
6922 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
6924         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
6925         * tst-stdio1.c: New file.
6926         * tst-stdio2.c: New file.
6928         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
6930         * Makefile (tests): Comment out tst-locale2 for now.
6931         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
6933         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
6934         -D_IO_MTSAFE_IO.
6935         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
6936         Use _IO_lock_init instead of explicit assignment.
6938         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
6939         Define __libc_lock_* and __libc_lock_recursive macros with
6940         lowlevellock macros, not pthread mutexes.
6942         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
6943         of pthread_mutex_lock.
6944         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
6945         instead of pthread_mutex_unlock.
6947 2002-12-06  Roland McGrath  <roland@redhat.com>
6949         * allocatestack.c (__stack_user): Use uninitialized defn.
6950         * init.c (__pthread_initialize_minimal): Initialize it here.
6952 2002-12-05  Roland McGrath  <roland@redhat.com>
6954         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
6955         string.
6956         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
6958         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
6959         missing & here too.
6961 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
6963         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
6964         lowlevellock.
6965         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
6966         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
6967         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
6968         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
6969         for __libc_lock_* macros.
6970         * Makefile (routines): Add libc-lowlevellock.
6972 2002-10-09  Roland McGrath  <roland@redhat.com>
6974         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
6975         Under [__PIC__], call the function via the pointer fetched for
6976         comparison rather than a call by name that uses the PLT.
6977         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
6978         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
6979         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
6980         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
6981         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
6983 2002-12-04  Roland McGrath  <roland@redhat.com>
6985         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
6987         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
6988         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
6990         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
6992 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
6994         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
6995         a completely opaque, non-integer type.
6996         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6998 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
7000         * sysdeps/i386/tls.h: Include stdlib.h.
7001         * sysdeps/x86_64/tls.h: Likewise.
7003 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
7005         * Makefile (tests): Add tst-locale2.
7006         (tests-static): Likewise.
7007         * tst-locale2.c: New file.
7009         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
7010         volatile and add memory clobbers to lock operations.
7012 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
7014         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
7015         * sysdeps/i386/i486/bits/atomic.h: New file.
7016         * sysdeps/i386/i586/bits/atomic.h: New file.
7017         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
7018         include i486 version.
7019         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
7020         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
7021         Patch by Marijn Ros <marijn@mad.scientist.com>.
7023         * allocatestack.c (get_cached_stack): Don't crash if we first
7024         found a stack with a larger size then needed.
7025         Reported by Hui Huang <hui.huang@sun.com>.
7027         * Makefile (tests): Add tst-sysconf.
7028         * tst-sysconf.c: New file.
7030         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
7031         PTHREAD_THREADS_MAX.
7033 2002-12-02  Roland McGrath  <roland@redhat.com>
7035         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
7036         Declare using hidden_proto instead of attribute_hidden, so there are
7037         non-.hidden static symbols for gdb to find.
7038         (__pthread_keys): Likewise.
7039         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
7040         * allocatestack.c (__stack_user): Likewise.
7041         * pthread_create.c (__pthread_keys): Likewise.
7042         (__nptl_threads_events, __nptl_last_event): Make these static instead
7043         of hidden.
7044         * pthread_key_create.c (__pthread_pthread_keys_max,
7045         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
7047 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
7049         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
7050         statically.
7051         * tst-locale1.c: New file.
7053         * pthread_cond_timedwait.c: Include <stdlib.h>.
7055         * Makefile (tests): Add tst-fork2 and tst-fork3.
7056         * tst-fork2.c: New file.
7057         * tst-fork3.c: New file.
7059 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
7061         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
7063         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
7064         require it to 200112L.
7066         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
7067         instruction only if HAVE_CMOV is defined.
7068         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
7070         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
7072         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
7074         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
7076         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
7078 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
7080         * sysdeps/x86_64/bits/atomic.h: New file.
7082         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
7083         16-bit operations.
7085         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
7086         possible since gettid cannot fail.
7088         * sysdeps/x86_64/pthreaddef.h: New file.
7090         * sysdeps/i386/pthreaddef.h (gettid): Removed.
7092         * sysdeps/x86_64/pthread_spin_init.c: New file.
7093         * sysdeps/x86_64/pthread_spin_lock.c: New file.
7094         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
7095         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
7097         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
7098         Add missing lock prefix.  Minute optimization.
7100         * tst-spin2.c (main): Also check successful trylock call.
7102         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
7103         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
7105         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
7106         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
7108         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
7109         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
7110         value in case of an error.  Add support for INTERNAL_SYSCALL.
7112         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
7113         value in case of an error.
7115         * sysdeps/x86_64/tls.h: New file.
7117 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
7119         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
7120         takes the array member name and the index as parameters.
7121         (THREAD_SETMEM_NC): Likewise.
7122         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
7123         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
7124         interfaces.
7126         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
7127         to decide which code to use.
7128         (THREAD_SETMEM_NC): Likewise.
7130         * allocatestack.c (queue_stack): Don't remove stack from list here.
7131         Do it in the caller.  Correct condition to prematurely terminate
7132         loop to free stacks.
7133         (__deallocate_stack): Remove stack from list here.
7135 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
7137         * Makefile (tests): Add tst-stack1.
7138         * tst-stack1.c: New file.
7140         * allocatestack.c (allocate_stack): Initialize the TCB on a user
7141         provided stack.
7143         * pthread_attr_getstack.c: Return bottom of the thread area.
7145 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
7147         * Makefile (libpthread-routines): Add pt-allocrtsig and
7148         pthread_kill_other_threads.
7149         * pt-allocrtsig.c: New file.
7150         * pthread_kill_other_threads.c: New file.
7151         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
7152         all three functions.
7153         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
7154         allocrtsig.
7155         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
7156         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
7157         and __libc_allocate_rtsig_private.
7158         * Versions (libpthread): Export pthread_kill_other_threads_np,
7159         __libc_current_sigrtmin, and __libc_current_sigrtmax.
7161 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
7163         * allocatestack.c (allocate_stack): stackaddr in attribute points to
7164         the end of the stack.  Adjust computations.
7165         When mprotect call fails dequeue stack and free it.
7166         * pthread_attr_setstack.c: Store top of the stack in stackaddr
7167         attribute.
7168         * pthread_getattr_np.c: Likewise.
7170         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
7171         surprises.
7173 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
7175         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
7176         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
7178 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
7180         * pthread_getspecific.c: Optimize access to first 2nd-level array.
7181         * pthread_setspecific.c: Likewise.
7183 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
7185         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
7186         definitions.  Get them from the official place.
7187         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
7189         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
7190         Use new CLONE_ flags in clone() calls.
7192         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
7193         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
7195         * Versions: Add pthread_* functions for libc.
7196         * forward.c: New file.
7198         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
7199         errno-loc.
7200         * herrno.c: New file.
7201         * res.c: New file.
7203         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
7204         sem_trywait, and sem_timedwait.  Add herrno and res.
7205         * sem_init.c: Don't initialize lock and waiters members.
7206         * sem_open.c: Likewise.
7207         * sem_post.c: Removed.
7208         * sem_wait.c: Removed.
7209         * sem_trywait.c: Removed.
7210         * sem_timedwait.c: Removed.
7211         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
7212         Includes full implementations of sem_post, sem_wait, sem_trywait,
7213         and sem_timedwait.
7214         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
7215         for new implementation.
7216         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
7217         and waiters fields.
7219         * tst-sem3.c: Improve error message.
7220         * tst-signal3.c: Likewise.
7222         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
7223         to tell the kernel about the termination futex and to initialize tid
7224         member.  Don't initialize main_thread.
7225         * descr.h (struct pthread): Remove main_thread member.
7226         * cancelllation.c (__do_cancel): Remove code handling main thread.
7227         The main thread is not special anymore.
7229         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
7230         size of the stacks to stack_cache_actsize.
7232         * pt-readv.c: Add missing "defined".
7233         * pt-sigwait.c: Likewise.
7234         * pt-writev.c: Likewise.
7236 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
7238         * Versions: Export __connect from libpthread.
7239         Patch by Luca Barbieri <ldb@ldb.ods.org>.
7241         * Makefile (libpthread-routines): Add pt-raise.
7242         * sysdeps/unix/sysv/linux/raise.c: New file.
7243         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
7244         * sysdeps/generic/pt-raise.c: New file.
7246         * pthread_cond_init.c: Initialize all data elements of the condvar
7247         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
7249         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
7250         * pthread_create.c: Likewise.
7252         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
7253         * tst-key1.c: New file.
7254         * tst-key2.c: New file.
7255         * tst-key3.c: New file.
7257         * Versions: Export pthread_detach for version GLIBC_2.0.
7258         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
7260 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
7262         * pthread_key_create.c: Terminate search after an unused key was found.
7263         Patch by Luca Barbieri <ldb@ldb.ods.org>.
7265         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
7266         Patch by Luca Barbieri <ldb@ldb.ods.org>.
7268 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
7270         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
7271         dynamic lookup for errno in PIC.
7273         * allocatestack.c (get_cached_stack): Rearrange code slightly to
7274         release the stack lock as soon as possible.
7275         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
7276         the static TLS block.
7277         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
7279         * cancellation.c: Renamed from cancelation.c.
7280         * Makefile: Adjust accordingly.
7281         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
7282         * cleanup_defer.c: Use CANCELLATION_P.
7283         * pthread_testcancel.c: Likewise.
7284         * descr.h: Fix spelling in comments.
7285         * init.c: Likewise.
7286         * pthread_getattr_np.c: Likewise.
7287         * pthread_getschedparam.c: Likewise.
7288         * pthread_setschedparam.c: Likewise.
7289         * Versions: Likewise.
7291         * pt-pselect.c: New file.
7292         * Makefile (libpthread-routines): Add pt-pselect.
7293         * Versions: Add pselect.
7295         * tst-cancel4.c: New file.
7296         * Makefile (tests): Add tst-cancel4.
7298 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
7300         * pthread_mutex_lock.c: Always record lock ownership.
7301         * pthread_mutex_timedlock.c: Likewise.
7302         * pthread_mutex_trylock.c: Likewise.
7304         * pt-readv.c: New file.
7305         * pt-writev.c: New file.
7306         * pt-creat.c: New file.
7307         * pt-msgrcv.c: New file.
7308         * pt-msgsnd.c: New file.
7309         * pt-poll.c: New file.
7310         * pt-select.c: New file.
7311         * pt-sigpause.c: New file.
7312         * pt-sigsuspend.c: New file.
7313         * pt-sigwait.c: New file.
7314         * pt-sigwaitinfo.c: New file.
7315         * pt-waitid.c: New file.
7316         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
7317         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
7318         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
7319         * Versions: Add all the new functions.
7321         * tst-exit1.c: New file.
7322         * Makefile (tests): Add tst-exit1.
7324         * sem_timedwait.c: Minor optimization for more optimal fastpath.
7326 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
7328         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
7330         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
7331         call.  pthread_join is an official cancellation point.
7332         * pthread_timedjoin.c: Likewise.
7334         * pthread_cond_wait.c: Revert order in which internal lock are dropped
7335         and the condvar's mutex are retrieved.
7336         * pthread_cond_timedwait.c: Likewise.
7337         Reported by dice@saros.East.Sun.COM.
7339 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
7341         * pthreadP.h: Cut out all type definitions and move them...
7342         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
7343         * pthreadP.h: Include <internaltypes.h>.
7345         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
7346         performance tweaks.
7348         * sem_trywait.c: Shuffle #includes around to get right order.
7349         * sem_timedwait.c: Likewise.
7350         * sem_post.c: Likewise.
7351         * sem_wait.c: Likewise.
7353         * nptl 0.3 released.
7355         * Makefile (tests): Add tst-signal3.
7356         * tst-signal3.c: New file.
7358 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
7360         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
7361         the asms modify the sem object.
7362         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
7364         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
7365         the actual members.
7366         * pthreadP.h (struct sem): New type.  Actual semaphore type.
7367         * semaphoreP.h: Include pthreadP.h.
7368         * sem_getvalue.c: Adjust to sem_t change.
7369         * sem_init.c: Likewise.
7370         * sem_open.c: Likewise.
7371         * sem_post.c: Likewise.
7372         * sem_timedwait.c: Likewise.
7373         * sem_trywait.c: Likewise.
7374         * sem_wait.c: Likewise.
7376 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
7378         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
7379         * tst-basic2.c: New file.
7380         * tst-exec1.c: New file.
7381         * tst-exec2.c: New file.
7382         * tst-exec3.c: New file.
7384         * tst-fork1.c: Remove extra */.
7386         * nptl 0.2 released.  The API for IA-32 is complete.