* sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
[glibc.git] / nptl / ChangeLog
blob11410a3ea0beb635db431ac82a20b68289b895ca
1 2008-05-19  Jakub Jelinek  <jakub@redhat.com>
3         * elf/soinit.c (__EH_FRAME_BEGIN__): Remove.
5 2008-05-10  Ulrich Drepper  <drepper@redhat.com>
7         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Access
8         __pshared correctly.
9         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
10         Likewise.
11         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
12         Likewise.
13         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
14         Likewise.
15         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
16         Likewise.
17         Reported by Clemens Kolbitsch <clemens.kol@gmx.at>.
19 2008-04-14  David S. Miller  <davem@davemloft.net>
21         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
22         (__old_sem_wait): Fix argument to lll_futex_wait().
24 2007-11-26  Daniel Jacobowitz  <dan@codesourcery.com>
26         * pthread_create.c: Require pthread_mutex_trylock and
27         pthread_key_delete for libgcc.
29 2008-04-08  Jakub Jelinek  <jakub@redhat.com>
31         [BZ #6020]
32         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h
33         (lll_futex_wake_unlock): Add private argument to the pre-v9 macro.
34         Patch by Sunil Amitkumar Janki <devel.sjanki@gmail.com>.
36 2008-03-27  Ulrich Drepper  <drepper@redhat.com>
38         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefined ARG_MAX if
39         <linux/limits.h> has defined it.
40         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
41         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
42         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
43         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
45 2008-03-18  Jakub Jelinek  <jakub@redhat.com>
47         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Use __ASSEMBLER__ instead
48         of ASSEMBLER.
49         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
50         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Likewise.
52 2008-03-14  Ulrich Drepper  <drepper@redhat.com>
54         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
55         HAVE_DL_DISCOVER_OSVERSION.
56         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
57         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Likewise.
59 2008-03-07  Ulrich Drepper  <drepper@redhat.com>
61         [BZ #5778]
62         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Change
63         _POSIX_CHOWN_RESTRICTED value to zero.
65 2008-01-31  Roland McGrath  <roland@redhat.com>
67         * Makefile (omit-deps): Variable removed.
69 2008-01-30  Ulrich Drepper  <drepper@redhat.com>
71         * sysdeps/unix/sysv/linux/x86_64/sem_post.S (sem_post): Avoid
72         unnecessary addr32 prefix.
74 2008-01-29  Roland McGrath  <roland@redhat.com>
76         * Makeconfig (ptw-CPPFLAGS, sysd-rules-patterns): New variables.
78 2008-01-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
80         * sysdeps/unix/sysv/linux/sh/sem_post.S: Don't overflow value field.
82 2008-01-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
84         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XADD): Use
85         a scratch register.
86         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
87         (__lll_lock_wait_private): Fix typo.
88         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
89         (pthread_barrier_wait): Likewise.  Adjust XADD use.
90         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
91         Adjust XADD use.
92         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
93         (pthread_rwlock_timedrdlock): Return correct return value.
94         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
95         (pthread_rwlock_timedwrlock): Likewise.
97 2008-01-15  Ulrich Drepper  <drepper@redhat.com>
99         * tst-eintr2.c (do_test): make sure that if mutex_lock in main
100         thread returns the program exits with an error code.
102 2008-01-10  Ulrich Drepper  <drepper@redhat.com>
104         * pthread-errnos.sym: Add EOVERFLOW.
105         * sysdeps/unix/sysv/linux/structsem.sym: Add SEM_VALUE_MAX.
106         * sysdeps/unix/sysv/linux/sem_post.c: Don't overflow value field.
107         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
108         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
110 2007-12-14  Ulrich Drepper  <drepper@redhat.com>
112         * sysdeps/x86_64/pthreaddef.h (ARCH_RETRY_MMAP): Take additional
113         parameter.  Passed it as permission to mmap.
114         * allocatestack.c (allocate_stack): Pass prot as second parameter
115         to ARCH_RETRY_MMAP.
117 2007-12-12  Ulrich Drepper  <drepper@redhat.com>
119         * tst-basic7.c: Allocate memory for the stack.
121         [BZ #5465]
122         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S [!SHARED]
123         (__pthread_cond_timedwait): Don't use VDSO.
124         Patch by Michal Januszewski.
126 2007-12-07  Ulrich Drepper  <drepper@redhat.com>
128         [BZ #5455]
129         * sysdeps/pthread/pthread.h [!__EXCEPTIONS] (pthread_cleanup_pop):
130         Allow label before pthread_cleanup_pop.
131         (pthread_cleanup_pop_restore_np): Likewise.
133 2007-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
135         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
136         Store 2 before returning ETIMEDOUT.
138 2007-11-23  Ulrich Drepper  <drepper@redhat.com>
140         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
141         Store 2 before returning ETIMEDOUT.
142         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise
143         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
144         (__lll_lock_wait_private): Optimize.
145         (__lll_lock_wait): Likewise.
147 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
149         * sysdeps/pthread/pthread.h (pthread_cleanup_push,
150         pthread_cleanup_push_defer_np): Add extra (void *) cast to shut up
151         g++ 4.1 and 4.2 -Wstrict-aliasing warnings.
153 2007-11-08  Ulrich Drepper  <drepper@redhat.com>
155         [BZ #5240]
156         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
157         If we time out, try one last time to lock the futex to avoid
158         losing a wakeup signal.
159         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
160         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
162         [BZ #5245]
163         * sysdeps/pthread/createthread.c (do_clone): Translate clone error
164         if necessary.
166 2007-11-07  Ulrich Drepper  <drepper@redhat.com>
168         [BZ #5245]
169         * allocatestack.c (allocate_stack): Change ENOMEM error in case
170         mmap failed to EAGAIN.
171         * Makefile (tests): Add tst-basic7.
172         * tst-basic7.c: New file.
174 2007-11-05  Ulrich Drepper  <drepper@redhat.com>
176         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
177         Use __linkin_atfork.
179 2007-11-03  Mike Frysinger  <vapier@gentoo.org>
181         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (LOAD_FUTEX_WAIT): Add
182         missing line continuations.
183         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S (LOAD_FUTEX_WAIT,
184         LOAD_FUTEX_WAKE): Likewise.  Also add missing 3rd parameter.
186 2007-10-28  Ulrich Drepper  <drepper@redhat.com>
188         [BZ #5220]
189         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Declare
190         __active_timer_sigev_thread and __active_timer_sigev_thread_lock.
191         (struct timer): Add next element.
192         * sysdeps/unix/sysv/linux/timer_create.c: For SIGEV_THREAD timers,
193         enqueue timer structure into __active_timer_sigev_thread list.
194         * sysdeps/unix/sysv/linux/timer_delete.c: For SIGEV_THREAD timers,
195         remove timer struct from __active_timer_sigev_thread.
196         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
197         Before using timer structure make sure it is still on the
198         __active_timer_sigev_thread list.  Keep lock until done.
199         Define __active_timer_sigev_thread and
200         __active_timer_sigev_thread_lock.
202 2007-10-27  Ulrich Drepper  <drepper@redhat.com>
204         * sysdeps/pthread/malloc-machine.h: Define ATFORK_MEM.
205         Redefine thread_atfork for use of ATFORK_MEM.
206         * sysdeps/unix/sysv/linux/fork.h: Define __linkin_atfork.
207         * sysdeps/unix/sysv/linux/register-atfork.c (__linkin_atfork): New
208         function.
209         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
210         Use atomic operation when removing first element of list.
212 2007-10-17  Jakub Jelinek  <jakub@redhat.com>
214         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__old_sem_post): New
215         routine instead of an alias to __new_sem_post.
217 2007-10-15  Jakub Jelinek  <jakub@redhat.com>
219         * init.c (__pthread_initialize_minimal): Initialize word to appease
220         valgrind.
222 2007-10-10  Jakub Jelinek  <jakub@redhat.com>
224         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
225         libc.so just clear NAME.
226         (__libc_rwlock_fini): Nop inside of libc.so.
227         * tst-initializers1.c (main): Test if PTHREAD_RWLOCK_INITIALIZER is
228         all zeros.
230 2007-09-02  Ulrich Drepper  <drepper@redhat.com>
232         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
233         (__pthread_cond_wait): Fix unlocking of internal lock after mutex
234         unlocking failed.
235         Patch by Luca Barbieri <luca.barbieri@gmail.com>.
237 2007-08-21  Ulrich Drepper  <drepper@redhat.com>
239         [BZ #4938]
240         * allocatestack.c (__reclaim_stacks): Clear the TSD in the
241         reclaimed stack if necessary.
242         * Makefile (tests): Add tst-tsd6.
243         * tst-tsd6.c: New file.
245 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
247         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
248         Add private argument.
250 2007-08-20  Ulrich Drepper  <drepper@redhat.com>
252         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
253         (__pthread_cond_timedwait): Use clock_gettime from VDSO if possible.
255 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
257         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h
258         (__lll_robust_timedlock): Pass private as last argument to
259         __lll_robust_timedlock_wait.
260         (__lll_unlock): Fix a pasto.
262 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
264         * sysdeps/unix/sysv/linux/sparc/internaltypes.h (sparc_new_sem,
265         sparc_old_sem): New structs.
266         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
267         (__sem_wait_cleanup): New function.
268         (__new_sem_wait): Use sparc_new_sem structure.  Bump and afterwards
269         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
270         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
271         lll_futex_wait.
272         (__old_sem_wait): New function.
273         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: Include
274         nptl/sysdeps/unix/sysv/linux/sparc version.
275         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c:
276         Likewise.
277         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: Likewise.
278         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
279         (__new_sem_trywait): Use sparc_old_sem structure.
280         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
281         (sem_timedwait): Use sparc_new_sem structure.  Bump and afterwards
282         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
283         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
284         lll_futex_timed_wait.
285         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c (__new_sem_post):
286         Use sparc_new_sem structure.  Only wake if nwaiters > 0.  Pass
287         isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
288         lll_futex_wake.
289         (__old_sem_post): New function.
290         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: New file.
291         * sysdeps/unix/sysv/linux/sparc/sem_init.c: New file.
292         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: New file.
293         * sysdeps/unix/sysv/linux/sparc/sem_post.c: New file.
294         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: Remove.
295         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: Remove.
297 2007-08-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
299         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
300         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
301         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
302         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
303         * sysdeps/unix/sysv/linux/shpthread_cond_signal.S
304         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
305         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
306         Use FUTEX_WAKE_OP.
307         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
308         kernel-features.h and tcb-offsets.h.
309         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
310         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
311         process private.
312         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
313         tcb-offsets.h.
314         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE
315         to lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
316         process private.
317         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use #ifdef
318         __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
319         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
320         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
321         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
322         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
323         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
325 2007-08-14  Jakub Jelinek  <jakub@redhat.com>
327         * sysdeps/unix/sysv/linux/lowlevellock.c: Comment fix.
328         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
329         (__lll_timedwait_tid): Pass LLL_SHARED as 4th argument to
330         lll_futex_timed_wait.
332         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock,
333         __lll_robust_unlock): Rewrite as macros instead of inline functions.
334         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock,
335         __lll_robust_unlock, __lll_wait_tid): Likewise.
337 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
339         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
340         Fix a pasto.
341         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
342         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
343         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
344         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
345         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
346         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
347         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
348         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Include
349         kernel-features.h.
350         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
351         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
352         process private.  Switch DW_CFA_advance_loc1 and some
353         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
354         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
355         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE to
356         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
357         process private.  Switch DW_CFA_advance_loc{1,2} and some
358         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
359         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use
360         #ifdef __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
361         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
362         Likewise.
363         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
364         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
365         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
366         Likewise.
367         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
368         (__pthread_cond_broadcast): Compare %r8 instead of
369         dep_mutex-cond_*(%rdi) with $-1.
370         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
371         (__pthread_cond_signal): Xor FUTEX_WAKE_OP with FUTEX_WAKE instead
372         of oring.
374 2007-08-13  Ulrich Drepper  <drepper@redhat.com>
376         * sysdeps/unix/sysv/linux/i386/i786/Implies: New file.
378 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
380         * allocatestack.c: Include kernel-features.h.
381         * pthread_create.c: Likewise.
382         * pthread_mutex_init.c: Likewise.
383         * init.c: Likewise.
384         * pthread_cond_timedwait.c: Likewise.
385         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
386         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
387         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
388         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
389         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
390         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
391         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
392         Likewise.
393         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
394         Likewise.
395         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
396         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
397         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
398         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
400 2007-08-12  Jakub Jelinek  <jakub@redhat.com>
402         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
403         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
404         byte elements.  One of them is the new __shared element.
405         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
406         adjust names of other padding elements.
407         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
408         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
409         byte elements.  One of them is the new __shared element.
410         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
411         adjust names of other padding elements.
412         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_rwlock_t):
413         Renamed __pad1 element to __shared, adjust names of other padding
414         elements.
415         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
416         (pthread_rwlock_t): Likewise.
417         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock): Fix a
418         typo.
420 2007-08-09  Anton Blanchard  <anton@samba.org>
422         * sysdeps/unix/sysv/linux/powerpc/pthread_spin_unlock.c: New file.
424 2007-08-12  Ulrich Drepper  <drepper@redhat.com>
426         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Include
427         <kernel-features.h>.
428         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
430 2007-08-11  Ulrich Drepper  <drepper@redhat.com>
432         * pthreadP.h (PTHREAD_ROBUST_MUTEX_PSHARED): Define.
433         * pthread_mutex_lock.c: Use it instead of PTHREAD_MUTEX_PSHARED when
434         dealing with robust mutexes.
435         * pthread_mutex_timedlock.c: Likewise.
436         * pthread_mutex_trylock.c: Likewise.
437         * pthread_mutex_unlock.c: Likewise.
438         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
440 2007-08-06  Jakub Jelinek  <jakub@redhat.com>
442         * pthreadP.h (PTHREAD_MUTEX_PSHARED_BIT): Define.
443         (PTHREAD_MUTEX_TYPE): Mask __kind with 127.
444         (PTHREAD_MUTEX_PSHARED): Define.
445         * pthread_mutex_init.c (__pthread_mutex_init): Set
446         PTHREAD_MUTEX_PSHARED_BIT for pshared or robust
447         mutexes.
448         * pthread_mutex_lock.c (LLL_MUTEX_LOCK): Take mutex as argument
449         instead of its __data.__lock field, pass PTHREAD_MUTEX_PSHARED
450         as second argument to lll_lock.
451         (LLL_MUTEX_TRYLOCK): Take mutex as argument
452         instead of its __data.__lock field.
453         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
454         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
455         to lll_robust_lock.
456         (__pthread_mutex_lock): Update LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
457         LLL_ROBUST_MUTEX_LOCK users, use PTHREAD_MUTEX_TYPE (mutex)
458         instead of mutex->__data.__kind directly, pass
459         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock and lll_futex_wait.
460         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use
461         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
462         directly, pass PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock.
463         (pthread_mutex_timedlock): Pass PTHREAD_MUTEX_PSHARED (mutex)
464         to lll_timedlock, lll_robust_timedlock, lll_unlock and
465         lll_futex_timed_wait.  Use PTHREAD_MUTEX_TYPE (mutex) instead
466         of mutex->__data.__kind directly.
467         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Pass
468         PTHREAD_MUTEX_PSHARED (mutex) to lll_timedlock,
469         lll_robust_timedlock, lll_unlock and lll_futex_timed_wait.  Use
470         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind directly.
471         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Pass
472         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock, lll_robust_unlock
473         and lll_futex_wake.
474         * pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Pass
475         PTHREAD_MUTEX_PSHARED (mutex) to lll_futex_wait and lll_futex_wake.
476         Use PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
477         directly.
478         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK):
479         Take mutex as argument instead of its __data.__lock field, pass
480         PTHREAD_MUTEX_PSHARED as second argument to lll_cond_lock.
481         (LLL_MUTEX_TRYLOCK): Take mutex as argument instead of its
482         __data.__lock field.
483         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
484         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
485         to lll_robust_cond_lock.
486         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Add pshared
487         variable, pass it to lll_lock, lll_unlock, lll_futex_requeue and
488         lll_futex_wake.  Don't use lll_futex_requeue if dependent mutex
489         has PTHREAD_MUTEX_PSHARED_BIT bit set in its __data.__kind.
490         * pthread_cond_destroy.c (__pthread_cond_destroy): Add pshared
491         variable, pass it to lll_lock, lll_unlock, lll_futex_wake and
492         lll_futex_wait.
493         * pthread_cond_signal.c (__pthread_cond_signal): Add pshared
494         variable, pass it to lll_lock, lll_unlock, lll_futex_wake_unlock and
495         lll_futex_wake.
496         * pthread_cond_timedwait.c (__pthread_cond_wait): Add
497         pshared variable, pass it to lll_lock, lll_unlock,
498         lll_futex_timedwait and lll_futex_wake.
499         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait): Add
500         pshared variable, pass it to lll_lock, lll_unlock, lll_futex_wait
501         and lll_futex_wake.
502         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_requeue,
503         lll_futex_wake_unlock): Add private argument, use __lll_private_flag
504         macro.
505         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue,
506         lll_futex_wake_unlock): Likewise.
507         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_requeue):
508         Likewise.
509         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_futex_requeue,
510         lll_futex_wake_unlock): Likewise.
511         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_requeue):
512         Likewise.
513         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue,
514         lll_futex_wake_unlock): Likewise.
515         (lll_futex_wake): Fix a typo.
516         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym (PS_BIT): Add.
517         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
518         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
519         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
520         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
521         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
522         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
523         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
524         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
525         (__pthread_cond_timedwait): Likewise.
526         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
527         (__condvar_cleanup, __pthread_cond_wait): Likewise.
529 2007-08-05  Jakub Jelinek  <jakub@redhat.com>
531         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
532         Don't use CGOTSETUP and CGOTRESTORE macros.
533         (CGOTSETUP, CGOTRESTORE): Remove.
534         <IS_IN_rtld> (CENABLE, CDISABLE): Don't use JUMPTARGET, branch to
535         @local symbol.
537 2007-08-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
539         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Remove
540         definitions for private futexes.
541         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Include
542         kernel-features.h and lowlevellock.h.  Use private futexes if
543         they are available.
544         (__lll_lock_wait_private, __lll_unlock_wake_private): New.
545         (__lll_mutex_lock_wait): Rename to
546         (__lll_lock_wait): ... this.  Don't compile in for libc.so.
547         (__lll_mutex_timedlock_wait): Rename to ...
548         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.
549         Don't compile in for libc.so.
550         (__lll_mutex_unlock_wake): Rename to ...
551         (__lll_unlock_wake): ... this.  Don't compile in for libc.so.
552         (__lll_timedwait_tid): Use __NR_gettimeofday.
553         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Allow including
554         the header from assembler.  Renamed all lll_mutex_* resp.
555         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
556         Renamed all LLL_MUTEX_LOCK_* macros to LLL_LOCK_*.
557         (FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE):
558         Define.
559         (__lll_lock_wait_private): Add prototype.
560         (__lll_lock_wait, __lll_timedlock_wait, __lll_robust_lock_wait,
561         __lll_robust_timedlock_wait, __lll_unlock_wake_private,
562         __lll_unlock_wake): Likewise.
563         (lll_lock): Add private argument.  Call __lll_lock_wait_private
564         if private is constant LLL_PRIVATE.
565         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
566         lll_timedlock, lll_robust_timedlock): Add private argument.
567         (lll_unlock): Add private argument.  Call __lll_unlock_wake_private
568         if private is constant LLL_PRIVATE.
569         (lll_robust_unlock, lll_robust_dead): Add private argument.
570         (lll_lock_t): Remove.
571         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
572         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
573         lll_cond_wake, lll_cond_broadcast): Remove.
574         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: Include
575         kernel-features.h and lowlevellock.h.
576         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
577         (LOAD_FUTEX_WAIT): Define.
578         (__lll_robust_mutex_lock_wait): Rename to ...
579         (__lll_robust_lock_wait): ... this.  Add private argument.
580         Use LOAD_FUTEX_WAIT macro.
581         (__lll_robust_mutex_timedlock_wait): Rename to ...
582         (__lll_robust_timedlock_wait): ... this.    Add private argument.
583         Use __NR_gettimeofday.  Use LOAD_FUTEX_WAIT macro.
584         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Include
585         lowlevellock.h.
586         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
587         (pthread_barrier_wait): Use __lll_{lock,unlock}_* instead of
588         __lll_mutex_{lock,unlock}_*.
589         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Include
590         lowlevellock.h and pthread-errnos.h.
591         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
592         FUTEX_CMP_REQUEUE, EINVAL): Remove.
593         (__pthread_cond_broadcast): Use __lll_{lock,unlock}_* instead of
594         __lll_mutex_{lock,unlock}_*.
595         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Include
596         lowlevellock.h and pthread-errnos.h.
597         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE, EINVAL): Remove.
598         (__pthread_cond_signal): Use __lll_{lock,unlock}_* instead of
599         __lll_mutex_{lock,unlock}_*.
600         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
601         lowlevellock.h.
602         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE): Remove.
603         (__pthread_cond_timedwait): Use __lll_{lock,unlock}_* instead of
604         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
605         (__condvar_tw_cleanup): Likewise.
606         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
607         lowlevellock.h.
608         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
609         (__pthread_cond_wait): Use __lll_{lock,unlock}_* instead of
610         __lll_mutex_{lock,unlock}_*.
611         ( __condvar_w_cleanup): Likewise.
612         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Include lowlevellock.h.
613         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
614         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Include
615         lowlevellock.h.
616         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
617         (__pthread_rwlock_rdlock): Use __lll_{lock,unlock}_* instead of
618         __lll_mutex_{lock,unlock}_*.
619         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Include
620         lowlevellock.h.
621         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
622         FUTEX_PRIVATE_FLAG): Remove.
623         (pthread_rwlock_timedrdlock): Use __lll_{lock,unlock}_* instead of
624         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
625         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Include
626         lowlevellock.h.
627         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
628         FUTEX_PRIVATE_FLAG): Remove.
629         (pthread_rwlock_timedwrlock): Use __lll_{lock,unlock}_* instead of
630         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
631         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Include
632         lowlevellock.h.
633         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
634         (__pthread_rwlock_unlock): Use __lll_{lock,unlock}_* instead of
635         __lll_mutex_{lock,unlock}_*.
636         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Include
637         lowlevellock.h.
638         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
639         (__pthread_rwlock_wrlock): Use __lll_{lock,unlock}_* instead of
640         __lll_mutex_{lock,unlock}_*.
641         * sysdeps/unix/sysv/linux/sh/sem_post.S: Include lowlevellock.h.
642         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
643         (__new_sem_post): Use standard initial exec code sequences.
644         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Include
645         lowlevellock.h.
646         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
647         FUTEX_PRIVATE_FLAG): Remove.
648         (sem_timedwait): Use __NR_gettimeofday.  Use standard initial
649         exec code sequences.
650         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Include lowlevellock.h.
651         (__new_sem_trywait): Use standard initial exec code sequences.
652         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Include lowlevellock.h.
653         (__new_sem_wait): Use standard initial exec code sequences.
655 2007-07-31  Anton Blanchard  <anton@samba.org>
657         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
658         Use __asm __volatile (__lll_acq_instr ::: "memory") instead of
659         atomic_full_barrier.
661 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
663         * allocatestack.c (stack_cache_lock): Change type to int.
664         (get_cached_stack, allocate_stack, __deallocate_stack,
665         __make_stacks_executable, __find_thread_by_id, __nptl_setxid,
666         __pthread_init_static_tls, __wait_lookup_done): Add LLL_PRIVATE
667         as second argument to lll_lock and lll_unlock macros on
668         stack_cache_lock.
669         * pthread_create.c (__find_in_stack_list): Likewise.
670         (start_thread): Similarly with pd->lock.  Use lll_robust_dead
671         macro instead of lll_robust_mutex_dead, pass LLL_SHARED to it
672         as second argument.
673         * descr.h (struct pthread): Change lock and setxid_futex field
674         type to int.
675         * old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0): Use
676         LLL_LOCK_INITIALIZER instead of LLL_MUTEX_LOCK_INITIALIZER.
677         * old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
678         * old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
679         Likewise.
680         * old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
681         * pthread_cond_init.c (__pthread_cond_init): Likewise.
682         * pthreadP.h (__attr_list_lock): Change type to int.
683         * pthread_attr_init.c (__attr_list_lock): Likewise.
684         * pthread_barrier_destroy.c (pthread_barrier_destroy): Pass
685         ibarrier->private ^ FUTEX_PRIVATE_FLAG as second argument to
686         lll_{,un}lock.
687         * pthread_barrier_wait.c (pthread_barrier_wait): Likewise and
688         also for lll_futex_{wake,wait}.
689         * pthread_barrier_init.c (pthread_barrier_init): Make iattr
690         a pointer to const.
691         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Pass
692         LLL_SHARED as second argument to lll_{,un}lock.
693         * pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
694         * pthread_cond_signal.c (__pthread_cond_singal): Likewise.
695         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
696         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait):
697         Likewise.
698         * pthread_getattr_np.c (pthread_getattr_np): Add LLL_PRIVATE
699         as second argument to lll_{,un}lock macros on pd->lock.
700         * pthread_getschedparam.c (__pthread_getschedparam): Likewise.
701         * pthread_setschedparam.c (__pthread_setschedparam): Likewise.
702         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
703         * tpp.c (__pthread_tpp_change_priority, __pthread_current_priority):
704         Likewise.
705         * sysdeps/pthread/createthread.c (do_clone, create_thread):
706         Likewise.
707         * pthread_once.c (once_lock): Change type to int.
708         (__pthread_once): Pass LLL_PRIVATE as second argument to
709         lll_{,un}lock macros on once_lock.
710         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Use
711         lll_{,un}lock macros instead of lll_mutex_{,un}lock, pass
712         rwlock->__data.__shared as second argument to them and similarly
713         for lll_futex_w*.
714         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
715         Likewise.
716         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
717         Likewise.
718         * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Likewise.
719         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Likewise.
720         * pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Likewise.
721         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
722         * sem_close.c (sem_close): Pass LLL_PRIVATE as second argument
723         to lll_{,un}lock macros on __sem_mappings_lock.
724         * sem_open.c (check_add_mapping): Likewise.
725         (__sem_mappings_lock): Change type to int.
726         * semaphoreP.h (__sem_mappings_lock): Likewise.
727         * pthread_mutex_lock.c (LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
728         LLL_ROBUST_MUTEX_LOCK): Use lll_{,try,robust_}lock macros
729         instead of lll_*mutex_*, pass LLL_SHARED as last
730         argument.
731         (__pthread_mutex_lock): Use lll_unlock instead of lll_mutex_unlock,
732         pass LLL_SHARED as last argument.
733         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK,
734         LLL_MUTEX_TRYLOCK, LLL_ROBUST_MUTEX_LOCK): Use
735         lll_{cond_,cond_try,robust_cond}lock macros instead of lll_*mutex_*,
736         pass LLL_SHARED as last argument.
737         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
738         lll_{timed,try,robust_timed,un}lock instead of lll_*mutex*, pass
739         LLL_SHARED as last argument.
740         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Similarly.
741         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
742         Similarly.
743         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_lock,
744         __libc_lock_lock_recursive, __libc_lock_unlock,
745         __libc_lock_unlock_recursive): Pass LLL_PRIVATE as second
746         argument to lll_{,un}lock.
747         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_lock,
748         _IO_lock_unlock): Likewise.
749         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Don't use
750         compound literal.
751         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
752         Pass LLL_PRIVATE as second argument to lll_{,un}lock macros on
753         __fork_lock.
754         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork,
755         free_mem): Likewise.
756         (__fork_lock): Change type to int.
757         * sysdeps/unix/sysv/linux/fork.h (__fork_lock): Likewise.
758         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Pass
759         isem->private ^ FUTEX_PRIVATE_FLAG as second argument to
760         lll_futex_wake.
761         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
762         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Likewise.
763         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait_private):
764         New function.
765         (__lll_lock_wait, __lll_timedlock_wait): Add private argument and
766         pass it through to lll_futex_*wait, only compile in when
767         IS_IN_libpthread.
768         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
769         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Add private
770         argument and pass it through to lll_futex_*wait.
771         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Renamed all
772         lll_mutex_* resp. lll_robust_mutex_* macros to lll_* resp.
773         lll_robust_*.  Renamed all __lll_mutex_* resp. __lll_robust_mutex_*
774         inline functions to __lll_* resp. __lll_robust_*.
775         (LLL_MUTEX_LOCK_INITIALIZER): Remove.
776         (lll_mutex_dead): Add private argument.
777         (__lll_lock_wait_private): New prototype.
778         (__lll_lock_wait, __lll_robust_lock_wait, __lll_lock_timedwait,
779         __lll_robust_lock_timedwait): Add private argument to prototypes.
780         (__lll_lock): Add private argument, if it is constant LLL_PRIVATE,
781         call __lll_lock_wait_private, otherwise pass private to
782         __lll_lock_wait.
783         (__lll_robust_lock, __lll_cond_lock, __lll_timedlock,
784         __lll_robust_timedlock): Add private argument, pass it to
785         __lll_*wait functions.
786         (__lll_unlock): Add private argument, if it is constant LLL_PRIVATE,
787         call __lll_unlock_wake_private, otherwise pass private to
788         __lll_unlock_wake.
789         (__lll_robust_unlock): Add private argument, pass it to
790         __lll_robust_unlock_wake.
791         (lll_lock, lll_robust_lock, lll_cond_lock, lll_timedlock,
792         lll_robust_timedlock, lll_unlock, lll_robust_unlock): Add private
793         argument, pass it through to __lll_* inline function.
794         (__lll_mutex_unlock_force, lll_mutex_unlock_force): Remove.
795         (lll_lock_t): Remove.
796         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
797         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
798         lll_cond_wake, lll_cond_broadcast): Remove.
799         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
800         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
801         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
802         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
803         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Allow including
804         the header from assembler.  Renamed all lll_mutex_* resp.
805         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
806         (LOCK, FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP,
807         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
808         (LLL_MUTEX_LOCK_INITIALIZER, LLL_MUTEX_LOCK_INITIALIZER_LOCKED,
809         LLL_MUTEX_LOCK_INITIALIZER_WAITERS): Remove.
810         (__lll_mutex_lock_wait, __lll_mutex_timedlock_wait,
811         __lll_mutex_unlock_wake, __lll_lock_wait, __lll_unlock_wake):
812         Remove prototype.
813         (__lll_trylock_asm, __lll_lock_asm_start, __lll_unlock_asm): Define.
814         (lll_robust_trylock, lll_cond_trylock): Use LLL_LOCK_INITIALIZER*
815         rather than LLL_MUTEX_LOCK_INITIALIZER* macros.
816         (lll_trylock): Likewise, use __lll_trylock_asm, pass
817         MULTIPLE_THREADS_OFFSET as another asm operand.
818         (lll_lock): Add private argument, use __lll_lock_asm_start, pass
819         MULTIPLE_THREADS_OFFSET as last asm operand, call
820         __lll_lock_wait_private if private is constant LLL_PRIVATE,
821         otherwise pass private as another argument to __lll_lock_wait.
822         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
823         lll_timedlock, lll_robust_timedlock): Add private argument, pass
824         private as another argument to __lll_*lock_wait call.
825         (lll_unlock): Add private argument, use __lll_unlock_asm, pass
826         MULTIPLE_THREADS_OFFSET as another asm operand, call
827         __lll_unlock_wake_private if private is constant LLL_PRIVATE,
828         otherwise pass private as another argument to __lll_unlock_wake.
829         (lll_robust_unlock): Add private argument, pass private as another
830         argument to __lll_unlock_wake.
831         (lll_robust_dead): Add private argument, use __lll_private_flag
832         macro.
833         (lll_islocked): Use LLL_LOCK_INITIALIZER instead of
834         LLL_MUTEX_LOCK_INITIALIZER.
835         (lll_lock_t): Remove.
836         (LLL_LOCK_INITIALIZER_WAITERS): Define.
837         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
838         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
839         lll_cond_wake, lll_cond_broadcast): Remove.
840         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
841         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Revert
842         2007-05-2{3,9} changes.
843         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Include
844         kernel-features.h and lowlevellock.h.
845         (LOAD_PRIVATE_FUTEX_WAIT): Define.
846         (LOAD_FUTEX_WAIT): Rewritten.
847         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
848         define.
849         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
850         (__lll_mutex_lock_wait): Rename to ...
851         (__lll_lock_wait): ... this.  Take futex addr from %edx instead of
852         %ecx, %ecx is now private argument.  Don't compile in for libc.so.
853         (__lll_mutex_timedlock_wait): Rename to ...
854         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.  %esi
855         contains private argument.  Don't compile in for libc.so.
856         (__lll_mutex_unlock_wake): Rename to ...
857         (__lll_unlock_wake): ... this.  %ecx contains private argument.
858         Don't compile in for libc.so.
859         (__lll_timedwait_tid): Use __NR_gettimeofday.
860         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Include
861         kernel-features.h and lowlevellock.h.
862         (LOAD_FUTEX_WAIT): Define.
863         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
864         define.
865         (__lll_robust_mutex_lock_wait): Rename to ...
866         (__lll_robust_lock_wait): ... this.  Futex addr is now in %edx
867         argument, %ecx argument contains private.  Use LOAD_FUTEX_WAIT
868         macro.
869         (__lll_robust_mutex_timedlock_wait): Rename to ...
870         (__lll_robust_timedlock_wait): ... this.  Use __NR_gettimeofday.
871         %esi argument contains private, use LOAD_FUTEX_WAIT macro.
872         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Include
873         lowlevellock.h.
874         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
875         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
876         PRIVATE(%ebx) ^ LLL_SHARED as private argument in %ecx to
877         __lll_lock_wait and __lll_unlock_wake, pass MUTEX(%ebx) address
878         to __lll_lock_wait in %edx.
879         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
880         Include lowlevellock.h and pthread-errnos.h.
881         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
882         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
883         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*, pass
884         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
885         pass LLL_SHARED in %ecx to both __lll_lock_wait and
886         __lll_unlock_wake.
887         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
888         Include lowlevellock.h and pthread-errnos.h.
889         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
890         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
891         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*, pass
892         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
893         pass LLL_SHARED in %ecx to both __lll_lock_wait and
894         __lll_unlock_wake.
895         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
896         Include lowlevellock.h.
897         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
898         Don't define.
899         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*, pass
900         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
901         pass LLL_SHARED in %ecx to both __lll_lock_wait and
902         __lll_unlock_wake.  Use __NR_gettimeofday.
903         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
904         Include lowlevellock.h.
905         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
906         (__pthread_cond_wait, __condvar_w_cleanup): Rename __lll_mutex_*
907         to __lll_*, pass cond_lock address in %edx rather than %ecx to
908         __lll_lock_wait, pass LLL_SHARED in %ecx to both __lll_lock_wait
909         and __lll_unlock_wake.
910         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S:
911         Include lowlevellock.h.
912         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
913         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*, pass
914         MUTEX(%ebx) address in %edx rather than %ecx to
915         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
916         and __lll_unlock_wake.  Move return value from %ecx to %edx
917         register.
918         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
919         Include lowlevellock.h.
920         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
921         Don't define.
922         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
923         MUTEX(%ebp) address in %edx rather than %ecx to
924         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
925         and __lll_unlock_wake.  Move return value from %ecx to %edx
926         register.  Use __NR_gettimeofday.
927         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
928         Include lowlevellock.h.
929         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
930         Don't define.
931         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
932         MUTEX(%ebp) address in %edx rather than %ecx to
933         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
934         and __lll_unlock_wake.  Move return value from %ecx to %edx
935         register.  Use __NR_gettimeofday.
936         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
937         Include lowlevellock.h.
938         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
939         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*, pass
940         MUTEX(%edi) address in %edx rather than %ecx to
941         __lll_lock_wait, pass PSHARED(%edi) in %ecx to both __lll_lock_wait
942         and __lll_unlock_wake.
943         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
944         Include lowlevellock.h.
945         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
946         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
947         MUTEX(%ebx) address in %edx rather than %ecx to
948         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
949         and __lll_unlock_wake.  Move return value from %ecx to %edx
950         register.
951         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Include
952         lowlevellock.h.
953         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
954         define.
955         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Include lowlevellock.h.
956         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
957         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Include
958         lowlevellock.h.
959         (LOCK, SYS_futex, SYS_gettimeofday, FUTEX_WAIT): Don't define.
960         (sem_timedwait): Use __NR_gettimeofday.
961         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Include
962         lowlevellock.h.
963         (LOCK): Don't define.
964         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include
965         lowlevellock.h.
966         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
967         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Wake only when there
968         are waiters.
969         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Revert
970         2007-05-2{3,9} changes.
971         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Include
972         kernel-features.h and lowlevellock.h.
973         (LOAD_PRIVATE_FUTEX_WAIT): Define.
974         (LOAD_FUTEX_WAIT): Rewritten.
975         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
976         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
977         (__lll_mutex_lock_wait): Rename to ...
978         (__lll_lock_wait): ... this.  %esi is now private argument.
979         Don't compile in for libc.so.
980         (__lll_mutex_timedlock_wait): Rename to ...
981         (__lll_timedlock_wait): ... this.  %esi contains private argument.
982         Don't compile in for libc.so.
983         (__lll_mutex_unlock_wake): Rename to ...
984         (__lll_unlock_wake): ... this.  %esi contains private argument.
985         Don't compile in for libc.so.
986         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Include
987         kernel-features.h and lowlevellock.h.
988         (LOAD_FUTEX_WAIT): Define.
989         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
990         (__lll_robust_mutex_lock_wait): Rename to ...
991         (__lll_robust_lock_wait): ... this.  %esi argument contains private.
992         Use LOAD_FUTEX_WAIT macro.
993         (__lll_robust_mutex_timedlock_wait): Rename to ...
994         (__lll_robust_timedlock_wait): ... this. %esi argument contains
995         private, use LOAD_FUTEX_WAIT macro.
996         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Include
997         lowlevellock.h.
998         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
999         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
1000         PRIVATE(%rdi) ^ LLL_SHARED as private argument in %esi to
1001         __lll_lock_wait and __lll_unlock_wake.
1002         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S:
1003         Include lowlevellock.h and pthread-errnos.h.
1004         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1005         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
1006         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*,
1007         pass LLL_SHARED in %esi to both __lll_lock_wait and
1008         __lll_unlock_wake.
1009         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S:
1010         Include lowlevellock.h and pthread-errnos.h.
1011         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
1012         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
1013         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*,
1014         pass LLL_SHARED in %esi to both __lll_lock_wait and
1015         __lll_unlock_wake.
1016         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:
1017         Include lowlevellock.h.
1018         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1019         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*,
1020         pass LLL_SHARED in %esi to both __lll_lock_wait and
1021         __lll_unlock_wake.
1022         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
1023         Include lowlevellock.h.
1024         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1025         (__pthread_cond_wait, __condvar_cleanup): Rename __lll_mutex_*
1026         to __lll_*, pass LLL_SHARED in %esi to both __lll_lock_wait
1027         and __lll_unlock_wake.
1028         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:
1029         Include lowlevellock.h.
1030         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1031         Don't define.
1032         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*,
1033         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1034         and __lll_unlock_wake.
1035         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1036         Include lowlevellock.h.
1037         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1038         Don't define.
1039         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1040         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1041         and __lll_unlock_wake.
1042         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1043         Include lowlevellock.h.
1044         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1045         Don't define.
1046         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1047         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1048         and __lll_unlock_wake.
1049         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S:
1050         Include lowlevellock.h.
1051         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1052         Don't define.
1053         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*,
1054         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1055         and __lll_unlock_wake.
1056         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:
1057         Include lowlevellock.h.
1058         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1059         Don't define.
1060         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1061         pass PSHARED(%rdi) in %ecx to both __lll_lock_wait
1062         and __lll_unlock_wake.
1063         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Include
1064         lowlevellock.h.
1065         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1066         define.
1067         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Include lowlevellock.h.
1068         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1069         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Include
1070         lowlevellock.h.
1071         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1072         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Include
1073         lowlevellock.h.
1074         (LOCK): Don't define.
1075         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Include
1076         lowlevellock.h.
1077         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1078         * sysdeps/unix/sysv/linux/sparc/internaltypes.h: New file.
1079         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c: New file.
1080         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c: New file.
1081         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c: New file.
1082         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
1083         (__lll_lock_wait_private): New function.
1084         (__lll_lock_wait, __lll_timedlock_wait): Add private argument, pass
1085         it to lll_futex_*wait.  Don't compile in for libc.so.
1086         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c:
1087         Remove.
1088         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
1089         (struct sparc_pthread_barrier): Remove.
1090         (pthread_barrier_wait): Use union sparc_pthread_barrier instead of
1091         struct sparc_pthread_barrier.  Pass
1092         ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE to lll_{,un}lock
1093         and lll_futex_wait macros.
1094         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
1095         Remove.
1096         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1097         Include sparc pthread_barrier_wait.c instead of generic one.
1099 2007-07-30  Jakub Jelinek  <jakub@redhat.com>
1101         * tst-rwlock14.c (do_test): Avoid warnings on 32-bit arches.
1103         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
1104         (pthread_rwlock_timedrdlock): Copy futex retval to %esi rather than
1105         %ecx.
1106         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
1107         (pthread_rwlock_timedwrlock): Likewise.
1108         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
1109         (__pthread_rwlock_unlock): Fix MUTEX != 0 args to __lll_*.
1111 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
1113         * sysdeps/sparc/tls.h (tcbhead_t): Add private_futex field.
1115 2007-07-26  Jakub Jelinek  <jakub@redhat.com>
1117         * tst-locale2.c (useless): Add return statement.
1119 2007-07-24  Jakub Jelinek  <jakub@redhat.com>
1121         * allocatestack.c (__nptl_setxid, __wait_lookup_done): Replace
1122         lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).
1123         * pthread_create.c (start_thread): Likewise.
1124         * init.c (sighandler_setxid): Likewise.
1125         * sysdeps/alpha/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1126         * sysdeps/ia64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1127         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1128         * sysdeps/s390/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1129         * sysdeps/powerpc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1130         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1131         * sysdeps/sparc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1132         * sysdeps/sh/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1133         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY, AIO_MISC_WAIT):
1134         Likewise.
1135         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY, GAI_MISC_WAIT):
1136         Likewise.
1137         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1138         Likewise.
1139         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_waitzero,
1140         __rtld_notify): Likewise.
1141         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Likewise.
1142         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (clear_once_control,
1143         __pthread_once): Likewise.
1144         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (clear_once_control,
1145         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1146         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1147         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1148         (lll_futex_wait): Add private argument, define as wrapper around
1149         lll_futex_timed_wait.
1150         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1151         use __lll_private_flag macro.
1152         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1153         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1154         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (clear_once_control,
1155         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1156         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1157         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1158         (lll_futex_wait): Add private argument, define as wrapper around
1159         lll_futex_timed_wait.
1160         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1161         use __lll_private_flag macro.
1162         (__lll_mutex_unlock, __lll_robust_mutex_unlock, lll_wait_tid,
1163         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1164         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
1165         Define.
1166         (lll_futex_timed_wait, lll_futex_wake): Use it.
1167         (lll_private_futex_wait, lll_private_futex_timed_wait,
1168         lll_private_futex_wake): Removed.
1169         * sysdeps/unix/sysv/linux/s390/pthread_once.c (clear_once_control,
1170         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1171         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1172         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1173         (lll_futex_wait): Add private argument, define as wrapper around
1174         lll_futex_timed_wait.
1175         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1176         use __lll_private_flag macro.
1177         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1178         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1179         to lll_futex_*.
1180         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1181         (lll_private_futex_wait, lll_private_futex_timed_wait,
1182         lll_private_futex_wake): Removed.
1183         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_private_flag):
1184         Fix !__ASSUME_PRIVATE_FUTEX non-constant private case.
1185         (lll_private_futex_wait, lll_private_futex_timed_wait,
1186         lll_private_futex_wake): Removed.
1187         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (clear_once_control,
1188         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1189         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1190         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1191         (lll_futex_wait): Add private argument, define as wrapper around
1192         lll_futex_timed_wait.
1193         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1194         use __lll_private_flag macro.
1195         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1196         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1197         to lll_futex_*.
1198         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (__lll_private_flag):
1199         Define.
1200         (lll_futex_timed_wait, lll_futex_wake): Use it.
1201         (lll_private_futex_wait, lll_private_futex_timed_wait,
1202         lll_private_futex_wake): Removed.
1204 2007-07-27  Jakub Jelinek  <jakub@redhat.com>
1206         * sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
1207         of the structure for sparc32.
1209 2007-07-26  Aurelien Jarno  <aurelien@aurel32.net>
1211         * sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
1213 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1215         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1216         code used when private futexes are assumed.
1217         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1218         Likewise.
1220 2007-07-23  Jakub Jelinek  <jakub@redhat.com>
1222         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1223         (__lll_private_flag): Define.
1224         (lll_futex_wait): Define as a wrapper around lll_futex_timed_wait.
1225         (lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Use
1226         __lll_private_flag.
1227         (lll_private_futex_wait, lll_private_futex_timedwait,
1228         lll_private_futex_wake): Define as wrapper around non-_private
1229         macros.
1230         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1231         (__lll_private_flag): Define.
1232         (lll_futex_timed_wait, lll_futex_wake): Use __lll_private_flag.
1233         (lll_private_futex_wait, lll_private_futex_timedwait,
1234         lll_private_futex_wake): Define as wrapper around non-_private
1235         macros.
1237 2007-07-10  Steven Munroe  <sjmunroe@us.ibm.com>
1239         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Add LLL_SHARED
1240         parameter to lll_futex_wait call.
1241         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1243         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
1244         Replace lll_futex_wait with lll_private_futex_wait.
1245         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1246         Add LLL_SHARED parameter to lll_futex_wake().
1248         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define LLL_PRIVATE
1249         LLL_SHARED, lll_private_futex_wait, lll_private_futex_timed_wait and
1250         lll_private_futex_wake.
1251         (lll_futex_wait): Add private parameter. Adjust FUTEX_PRIVATE_FLAG
1252         bit from private parm before syscall.
1253         (lll_futex_timed_wait): Likewise.
1254         (lll_futex_wake): Likewise.
1255         (lll_futex_wake_unlock): Likewise.
1256         (lll_mutex_unlock): Add LLL_SHARED parm to lll_futex_wake call.
1257         (lll_robust_mutex_unlock): Likewise.
1258         (lll_mutex_unlock_force): Likewise.
1259         (lll_wait_tid): Add LLL_SHARED parm to lll_futex_wait call.
1261 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1263         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1264         compilation when unconditionally using private futexes.
1265         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1266         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1267         Likewise.
1268         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1269         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1271 2007-07-17  Jakub Jelinek  <jakub@redhat.com>
1273         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
1274         Define.
1276 2007-07-06  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1278         * sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and
1279         kernel-features.h.
1281 2007-05-16  Roland McGrath  <roland@redhat.com>
1283         * init.c (__nptl_initial_report_events): New variable.
1284         (__pthread_initialize_minimal_internal): Initialize pd->report_events
1285         to that.
1287 2007-06-22  Jakub Jelinek  <jakub@redhat.com>
1289         * pthread_getattr_np.c (pthread_getattr_np): Clear cpuset and
1290         cpusetsize if pthread_getaffinity_np failed with ENOSYS.
1292 2007-06-19  Ulrich Drepper  <drepper@redhat.com>
1294         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Remove mrlock
1295         implementation.
1297 2007-06-18  Ulrich Drepper  <drepper@redhat.com>
1299         * pthreadP.h: Define PTHREAD_MUTEX_TYPE.
1300         * phtread_mutex_lock.c: Use PTHREAD_MUTEX_TYPE.
1301         * pthread_mutex_timedlock.c: Likewise.
1302         * pthread_mutex_trylock.c: Likewise.
1303         * pthread_mutex_unlock.c: Likewise.
1305 2007-06-17  Andreas Schwab  <schwab@suse.de>
1307         * sysdeps/pthread/pt-initfini.c: Tell gcc about the nonstandard
1308         sections.
1310 2007-06-17  Ulrich Drepper  <drepper@redhat.com>
1312         * allocatestack.c (allocate_stack): Make code compile if
1313         __ASSUME_PRIVATE_FUTEX is set.
1315 2007-06-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1317         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S:
1318         (__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
1319         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
1320         (__pthread_rwlock_wrlock): Likewise.
1321         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
1322         (pthread_rwlock_timedrdlock): Likewise.
1323         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
1324         (pthread_rwlock_timedwrlock): Likewise.
1325         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
1326         (__pthread_rwlock_unlock): Likewise.
1328 2007-06-10  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1330         * sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
1331         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
1332         Split __flags into __flags, __shared, __pad1 and __pad2.
1333         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
1334         futexes if they are available.
1335         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
1336         in libc-lowlevellock.S allow using private futexes.
1337         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
1338         FUTEX_PRIVATE_FLAG.  Add additional parameter to lll_futex_wait,
1339         lll_futex_timed_wait and lll_futex_wake.  Change lll_futex_wait
1340         to call lll_futex_timed_wait.  Add lll_private_futex_wait,
1341         lll_private_futex_timed_wait and lll_private_futex_wake.
1342         (lll_robust_mutex_unlock): Fix typo.
1343         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
1344         field in futex command setup.
1345         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
1346         COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
1347         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
1348         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
1349         if they are available.  Remove clear_once_control.
1350         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
1351         futexes if they are available.
1352         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1353         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1354         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1355         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1356         * sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
1357         Wake only when there are waiters.
1358         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
1359         support.  Indicate that there are waiters.  Remove unnecessary
1360         extra cancellation test.
1361         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.  Removed
1362         left-over duplication of __sem_wait_cleanup.
1364 2007-06-07  Ulrich Drepper  <drepper@redhat.com>
1366         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Add additional
1367         parameter to lll_futex_wait, lll_futex_timed_wait, and
1368         lll_futex_wake.  Change lll_futex_wait to call lll_futex_timed_wait.
1369         Add lll_private_futex_wait, lll_private_futex_timed_wait, and
1370         lll_private_futex_wake.
1371         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1372         * allocatestack.c: Adjust use of lll_futex_* macros.
1373         * init.c: Likewise.
1374         * lowlevellock.h: Likewise.
1375         * pthread_barrier_wait.c: Likewise.
1376         * pthread_cond_broadcast.c: Likewise.
1377         * pthread_cond_destroy.c: Likewise.
1378         * pthread_cond_signal.c: Likewise.
1379         * pthread_cond_timedwait.c: Likewise.
1380         * pthread_cond_wait.c: Likewise.
1381         * pthread_create.c: Likewise.
1382         * pthread_mutex_lock.c: Likewise.
1383         * pthread_mutex_setprioceiling.c: Likewise.
1384         * pthread_mutex_timedlock.c: Likewise.
1385         * pthread_mutex_unlock.c: Likewise.
1386         * pthread_rwlock_timedrdlock.c: Likewise.
1387         * pthread_rwlock_timedwrlock.c: Likewise.
1388         * pthread_rwlock_unlock.c: Likewise.
1389         * sysdeps/alpha/tls.h: Likewise.
1390         * sysdeps/i386/tls.h: Likewise.
1391         * sysdeps/ia64/tls.h: Likewise.
1392         * sysdeps/powerpc/tls.h: Likewise.
1393         * sysdeps/pthread/aio_misc.h: Likewise.
1394         * sysdeps/pthread/gai_misc.h: Likewise.
1395         * sysdeps/s390/tls.h: Likewise.
1396         * sysdeps/sh/tls.h: Likewise.
1397         * sysdeps/sparc/tls.h: Likewise.
1398         * sysdeps/unix/sysv/linux/fork.c: Likewise.
1399         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
1400         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
1401         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Likewise.
1402         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
1403         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1404         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
1405         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
1406         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
1407         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
1408         Likewise.
1409         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise.
1410         * sysdeps/x86_64/tls.h: Likewise.
1412 2007-05-29  Ulrich Drepper  <drepper@redhat.com>
1414         * pthread_getattr_np.c: No need to install a cancellation handler,
1415         this is no cancellation point.
1416         * pthread_getschedparam.c: Likewise.
1417         * pthread_setschedparam.c: Likewise.
1418         * pthread_setschedprio.c: Likewise.
1419         * sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
1420         lll_unlock_wake_cb.
1421         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
1422         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1423         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1424         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1425         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1426         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1427         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
1428         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
1429         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1430         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
1431         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1432         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1434         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
1435         whether there are more than one thread makes no sense here since
1436         we only call the slow path if the locks are taken.
1437         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
1439         * sysdeps/unix/sysv/linux/internaltypes.h: Introduce
1440         COND_NWAITERS_SHIFT.
1441         * pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of
1442         COND_CLOCK_BITS.
1443         * pthread_cond_init.c: Likewise.
1444         * pthread_cond_timedwait.c: Likewise.
1445         * pthread_cond_wait.c: Likewise.
1446         * pthread_condattr_getclock.c: Likewise.
1447         * pthread_condattr_setclock.c: Likewise.
1448         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise.
1449         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1450         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1451         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1452         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1454 2007-05-28  Jakub Jelinek  <jakub@redhat.com>
1456         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
1457         unistd.h.
1459         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
1460         insn suffix.
1461         (THREAD_GSCOPE_GET_FLAG): Remove.
1462         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Remove.
1463         * allocatestack.c (__wait_lookup_done): Revert 2007-05-24
1464         changes.
1465         * sysdeps/powerpc/tls.h (tcbhead_t): Remove gscope_flag.
1466         (THREAD_GSCOPE_GET_FLAG): Remove.
1467         (THREAD_GSCOPE_RESET_FLAG): Use THREAD_SELF->header.gscope_flag
1468         instead of THREAD_GSCOPE_GET_FLAG.
1469         (THREAD_GSCOPE_SET_FLAG): Likewise.  Add atomic_write_barrier after
1470         it.
1471         * sysdeps/s390/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1472         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1473         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1474         THREAD_GSCOPE_WAIT): Define.
1475         * sysdeps/sparc/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1476         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1477         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1478         THREAD_GSCOPE_WAIT): Define.
1479         * sysdeps/sh/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1480         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1481         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1482         THREAD_GSCOPE_WAIT): Define.
1483         * sysdeps/ia64/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1484         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1485         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1486         THREAD_GSCOPE_WAIT): Define.
1488 2007-05-24  Richard Henderson  <rth@redhat.com>
1490         * descr.h (struct pthread): Add header.gscope_flag.
1491         * sysdeps/alpha/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1492         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1493         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1494         THREAD_GSCOPE_WAIT): Define.
1496 2007-05-27  Ulrich Drepper  <drepper@redhat.com>
1498         * init.c: Make it compile with older kernel headers.
1500         * tst-initializers1.c: Show through exit code which test failed.
1502         * pthread_rwlock_init.c: Also initialize __shared field.
1503         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
1504         element in rwlock structure into four byte elements.  One of them is
1505         the new __shared element.
1506         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
1507         Likewise.
1508         [__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
1509         __shared, adjust names of other padding elements.
1510         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1511         * sysdeps/pthread/pthread.h: Adjust rwlock initializers.
1512         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
1513         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
1514         FUTEX_PRIVATE_FLAG.
1515         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
1516         futex to use private operations if possible.
1517         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1518         Likewise.
1519         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1520         Likewise.
1521         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1522         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1523         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1524         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1525         Likewise.
1526         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1527         Likewise.
1528         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1529         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1531 2007-05-26  Ulrich Drepper  <drepper@redhat.com>
1533         * pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
1534         * pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
1535         * pthread_rwlock_timedrdlock.c: Likewise.
1536         * pthread_rwlock_tryrdlock.c: Likewise.
1538         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
1539         optimization.
1541         * sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
1542         * sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
1543         duplication of __sem_wait_cleanup.
1545         * allocatestack.c: Revert last change.
1546         * init.c: Likewise.
1547         * sysdeps/i386/tls.h: Likewise.
1548         * sysdeps/x86_64/tls.h: Likewise.
1549         * descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
1550         header structure.
1551         * sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
1553         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
1554         Add private field.
1555         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
1556         * pthread_barrier_init.c: Set private flag if pshared and private
1557         futexes are supported.
1558         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
1559         private field in futex command setup.
1560         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
1562 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1564         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
1565         support.
1566         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1567         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1568         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1569         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1570         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1572         * semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
1573         * sem_init.c (__new_sem_init): Rewrite to initialize all three
1574         fields in the structure.
1575         (__old_sem_init): New function.
1576         * sem_open.c: Initialize all fields of the structure.
1577         * sem_getvalue.c: Adjust for renamed element.
1578         * sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
1579         (gen-as-const-headers): Add structsem.sym.
1580         * sysdeps/unix/sysv/linux/structsem.sym: New file.
1581         * sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
1582         struct new_sem.  Add struct old_sem.
1583         * sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
1584         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
1585         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1586         * sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
1587         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1588         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1589         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1590         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1591         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1592         * Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
1593         * tst-sem10.c: New file.
1594         * tst-sem11.c: New file.
1595         * tst-sem12.c: New file.
1596         * tst-typesizes.c: Test struct new_sem and struct old_sem instead
1597         of struct sem.
1599 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1600             Jakub Jelinek  <jakub@redhat.com>
1602         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
1603         Move __pthread_enable_asynccancel right before futex syscall.
1604         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
1605         Likewise.
1607 2007-05-24  Jakub Jelinek  <jakub@redhat.com>
1609         * sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
1610         THREAD_COPY_PRIVATE_FUTEX): Define.
1611         * sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
1612         THREAD_COPY_PRIVATE_FUTEX): Define.
1613         * allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
1614         * init.c (__pthread_initialize_minimal_internal): Use
1615         THREAD_SET_PRIVATE_FUTEX.
1617         * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
1618         (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
1619         THREAD_GSCOPE_FLAG_WAIT): Define.
1620         (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG,
1621         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define.
1622         * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use
1623         PTR_DEMANGLE.
1624         (THREAD_GSCOPE_GET_FLAG): Define.
1625         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define.
1626         * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
1627         instead of ->header.gscope_flag directly.
1629 2007-05-23  Ulrich Drepper  <drepper@redhat.com>
1631         * init.c (__pthread_initialize_minimal_internal): Check whether
1632         private futexes are available.
1633         * allocatestack.c (allocate_stack): Copy private_futex field from
1634         current thread into the new stack.
1635         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
1636         futexes if they are available.
1637         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
1638         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
1639         in libc-lowlevellock.S allow using private futexes.
1640         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1641         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
1642         FUTEX_PRIVATE_FLAG.
1643         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1644         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
1645         if they are available.
1646         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
1647         * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
1648         * sysdeps/i386/tcb-offsets.sym: Likewise.
1649         * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
1650         * sysdeps/i386/tls.h (tcbhead_t): Likewise.
1652 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
1654         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1655         Remove ptr_wait_lookup_done again.
1656         * init.c (pthread_functions): Don't add .ptr_wait_lookup_done here.
1657         (__pthread_initialize_minimal_internal): Initialize
1658         _dl_wait_lookup_done pointer in _rtld_global directly.
1659         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1660         Remove code to code _dl_wait_lookup_done.
1661         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
1662         encrypted for now.
1664 2007-05-21  Jakub Jelinek  <jakub@redhat.com>
1666         * tst-robust9.c (do_test): Don't fail if ENABLE_PI and
1667         pthread_mutex_init failed with ENOTSUP.
1669 2007-05-19  Ulrich Drepper  <drepper@redhat.com>
1671         * allocatestack.c (__wait_lookup_done): New function.
1672         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1673         Add ptr_wait_lookup_done.
1674         * init.c (pthread_functions): Initialize .ptr_wait_lookup_done.
1675         * pthreadP.h: Declare __wait_lookup_done.
1676         * sysdeps/i386/tls.h (tcbhead_t): Add gscope_flag.
1677         Define macros to implement reference handling of global scope.
1678         * sysdeps/x86_64/tls.h: Likewise.
1679         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1680         Initialize GL(dl_wait_lookup_done).
1682 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
1684         [BZ #4512]
1685         * pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
1686         is detected.
1687         * pthread_mutex_timedlock.c: Likewise.
1688         * pthread_mutex_trylock.c: Likewise.
1689         Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
1691         * Makefile (tests): Add tst-robust9 and tst-robustpi9.
1692         * tst-robust9.c: New file.
1693         * tst-robustpi9.c: New file.
1695         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
1696         unnecessary extra cancellation test.
1698 2007-05-14  Ulrich Drepper  <drepper@redhat.com>
1700         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
1701         extra cancellation test.
1702         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1704 2007-05-10  Ulrich Drepper  <drepper@redhat.com>
1706         * descr.h (struct pthread): Rearrange members to fill hole in
1707         64-bit layout.
1709         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1710         (__pthread_setaffinity_new): If syscall was successful and
1711         RESET_VGETCPU_CACHE is defined, use it before returning.
1712         * sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
1714 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
1716         [BZ #4455]
1717         * tst-align2.c: Include stackinfo.h.
1718         * tst-getpid1.c: Likewise.
1720 2007-05-02  Carlos O'Donell  <carlos@systemhalted.org>
1722         [BZ #4455]
1723         * tst-align2.c (do_test): Add _STACK_GROWS_UP case.
1724         * tst-getpid1.c (do_test): Likewise.
1726         [BZ #4456]
1727         * allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
1728         (allocate_stack): Likewise.
1730 2007-05-07  Ulrich Drepper  <drepper@redhat.com>
1732         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
1733         (__lll_robust_lock_wait): Fix race caused by reloading of futex value.
1734         (__lll_robust_timedlock_wait): Likewise.
1735         Reported by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
1737 2007-05-06  Mike Frysinger  <vapier@gentoo.org>
1739         [BZ #4465]
1740         * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
1741         * tst-cancel4.c (tf_fdatasync): New test.
1743 2007-04-27  Ulrich Drepper  <drepper@redhat.com>
1745         [BZ #4392]
1746         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Treat error
1747         check mutexes like normal mutexes.
1749         [BZ #4306]
1750         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
1751         Initialize the whole sigevent structure to appease valgrind.
1753 2007-04-25  Ulrich Drepper  <drepper@redhat.com>
1755         * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
1756         * sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
1758 2007-04-06  Ulrich Drepper  <drepper@redhat.com>
1760         * tst-locale1.c: Avoid warnings.
1761         * tst-locale2.c: Likewise.
1763 2007-03-19  Steven Munroe  <sjmunroe@us.ibm.com>
1765         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1766         (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
1768 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
1770         * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
1771         __extern_always_inline where appropriate.
1772         * sysdeps/pthread/pthread.h: Likewise.
1774 2007-03-13  Richard Henderson  <rth@redhat.com>
1776         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
1777         separate cfi regions for the two subsections.
1779 2007-02-25  Ulrich Drepper  <drepper@redhat.com>
1781         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
1782         new thread, don't just decrement it.
1783         Patch by Suzuki K P <suzuki@in.ibm.com>.
1785 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
1787         * sysdeps/pthread/pthread-functions.h: Correct last patch, correct
1788         PTHFCT_CALL definition.
1790 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
1792         * sysdeps/pthread/pthread-functions.h: If PTR_DEMANGLE is not
1793         available, don't use it.
1795 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
1797         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1798         (__lll_mutex_timedlock_wait): Use correct pointer when we don't
1799         call into the kernel to delay.
1801 2007-01-18  Ulrich Drepper  <drepper@redhat.com>
1803         * tst-initializers1.c: We want to test the initializers as seen
1804         outside of libc, so undefined _LIBC.
1806         * pthread_join.c (cleanup): Avoid warning.
1808 2007-01-17  Ulrich Drepper  <drepper@redhat.com>
1810         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1811         (__lll_timedwait_tid): Add unwind info.
1813         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Don't just copy the
1814         function table, mangle the pointers.
1815         * sysdeps/pthread/pthread-functions.h: Define PTHFCT_CALL.
1816         * forward.c: Use PTHFCT_CALL and __libc_pthread_functions_init.
1817         * sysdeps/pthread/bits/libc-lock.h: When using __libc_pthread_functions
1818         demangle pointers before use.
1819         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Use PTHFCT_CALL to
1820         demangle pointer.
1821         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
1822         * sysdeps/pthread/setxid.h: Likewise.
1824 2007-01-12  Ulrich Drepper  <drepper@redhat.com>
1826         * tst-rwlock7.c: Show some more information in case of correct
1827         behavior.
1829 2007-01-11  Ulrich Drepper  <drepper@redhat.com>
1831         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1832         (lll_futex_timed_wait): Undo part of last change, don't negate
1833         return value.
1835 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
1837         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups.  Define
1838         FUTEX_CMP_REQUEUE and lll_futex_requeue.
1840 2006-12-28  David S. Miller  <davem@davemloft.net>
1842         * shlib-versions: Fix sparc64 linux target specification.
1844 2007-01-10  Jakub Jelinek  <jakub@redhat.com>
1846         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1847         Adjust include path for pthread_barrier_wait.c move.
1849 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
1851         * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
1852         tid isn't reread from pd->tid in between ESRCH test and the syscall.
1854 2006-12-06  Jakub Jelinek  <jakub@redhat.com>
1856         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
1857         6 argument cancellable syscalls.
1858         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
1859         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
1860         6 argument cancellable syscalls.
1861         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
1863 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
1865         * sysdeps/unix/sysv/linux/rtld-lowlevel.h
1866         (__rtld_mrlock_initialize): Add missing closing parenthesis.
1868 2006-10-30  Jakub Jelinek  <jakub@redhat.com>
1870         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
1871         __sync_lock_release instead of __sync_lock_release_si.
1873 2006-10-29  Jakub Jelinek  <jakub@redhat.com>
1875         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P):
1876         Define.
1877         (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld.
1878         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
1879         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
1880         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
1881         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
1882         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
1883         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
1884         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
1885         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
1886         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
1887         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
1889 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
1891         * sysdeps/pthread/pthread_barrier_wait.c: Move to...
1892         * pthread_barrier_wait.c: ...here.
1893         * sysdeps/pthread/pthread_cond_broadcast.c: Move to...
1894         * pthread_cond_broadcast.c: ...here.
1895         * sysdeps/pthread/pthread_cond_signal.c: Move to...
1896         * pthread_cond_signal.c: ...here.
1897         * sysdeps/pthread/pthread_cond_timedwait.c: Move to...
1898         * pthread_cond_timedwait.c: ...here.
1899         * sysdeps/pthread/pthread_cond_wait.c: Move to...
1900         * pthread_cond_wait.c: ...here.
1901         * sysdeps/pthread/pthread_once.c: Move to...
1902         * pthread_once.c: ...here.
1903         * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to...
1904         * pthread_rwlock_rdlock.c: ...here.
1905         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to...
1906         * pthread_rwlock_timedrdlock.c: ...here.
1907         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to...
1908         * pthread_rwlock_timedwrlock.c: ...here.
1909         * sysdeps/pthread/pthread_rwlock_unlock.c: Move to...
1910         * pthread_rwlock_unlock.c: ...here.
1911         * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to...
1912         * pthread_rwlock_wrlock.c: ...here.
1913         * sysdeps/pthread/pthread_spin_destroy.c: Move to...
1914         * pthread_spin_destroy.c: ...here.
1915         * sysdeps/pthread/pthread_spin_init.c: Move to...
1916         * pthread_spin_init.c: ...here.
1917         * sysdeps/pthread/pthread_spin_unlock.c: Move to...
1918         * pthread_spin_unlock.c: ...here.
1919         * sysdeps/pthread/pthread_getcpuclockid.c: Move to...
1920         * pthread_getcpuclockid.c: ...here.
1922         * init.c: USE_TLS support is now always enabled.
1923         * tst-tls5.h: Likewise.
1924         * sysdeps/alpha/tls.h: Likewise.
1925         * sysdeps/i386/tls.h: Likewise.
1926         * sysdeps/ia64/tls.h: Likewise.
1927         * sysdeps/powerpc/tls.h: Likewise.
1928         * sysdeps/s390/tls.h: Likewise.
1929         * sysdeps/sh/tls.h: Likewise.
1930         * sysdeps/sparc/tls.h: Likewise.
1931         * sysdeps/x86_64/tls.h: Likewise.
1933 2006-10-27  Jakub Jelinek  <jakub@redhat.com>
1935         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
1936         __rtld_mrlock_change): Update oldval if atomic compare and exchange
1937         failed.
1939         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
1940         Define to THREAD_SELF->header.multiple_threads.
1941         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
1942         Likewise.
1943         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
1944         Likewise.
1945         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
1946         (SINGLE_THREAD_P): Likewise.
1947         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
1948         (SINGLE_THREAD_P): Likewise.
1949         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
1950         (SINGLE_THREAD_P): Likewise.
1951         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
1952         (SINGLE_THREAD_P): Likewise.
1953         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P):
1954         Likewise.
1955         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
1956         (SINGLE_THREAD_P): Likewise.
1957         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
1958         (SINGLE_THREAD_P): Likewise.
1959         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P):
1960         Likewise.
1962 2006-10-26  Jakub Jelinek  <jakub@redhat.com>
1964         * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3
1965         by default rather than 2_3_3.
1967 2006-10-17  Jakub Jelinek  <jakub@redhat.com>
1969         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
1970         __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
1971         atomic_* instead of catomic_* macros.
1973 2006-10-12  Ulrich Drepper  <drepper@redhat.com>
1975         [BZ #3285]
1976         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX.
1977         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
1978         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
1979         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
1980         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
1981         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX.
1982         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
1983         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
1984         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
1985         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise.
1986         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
1987         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
1988         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
1990 2006-10-11  Ulrich Drepper  <drepper@redhat.com>
1992         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for
1993         cancelable syscalls with six parameters.
1995         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
1996         operations instead of atomic_*.
1998 2006-10-09  Ulrich Drepper  <drepper@redhat.com>
2000         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
2002 2006-10-07  Ulrich Drepper  <drepper@redhat.com>
2004         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file.
2005         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file.
2006         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c:
2007         New file.
2008         * pthread_attr_setstack.c: Allow overwriting the version number of the
2009         new symbol.
2010         * pthread_attr_setstacksize.c: Likewise.
2011         (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use
2012         it.
2013         * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add
2014         pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6.
2016 2006-09-24  Ulrich Drepper  <drepper@redhat.com>
2018         [BZ #3251]
2019         * descr.h (ENQUEUE_MUTEX_BOTH): Add cast to avoid warning.
2020         Patch by Petr Baudis.
2022 2006-09-18  Jakub Jelinek  <jakub@redhat.com>
2024         * tst-kill4.c (do_test): Explicitly set tf thread's stack size.
2026         * tst-cancel2.c (tf): Loop as long as something was written.
2028 2006-09-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2030         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: For PI
2031         mutexes wake all mutexes.
2032         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Don't increment
2033         WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2034         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2036 2006-09-12  Ulrich Drepper  <drepper@redhat.com>
2038         * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use
2039         to guarantee the thread is always canceled.
2041 2006-09-08  Jakub Jelinek  <jakub@redhat.com>
2043         * tst-cond22.c: Include pthread.h instead of pthreadP.h.
2044         Include stdlib.h.
2045         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Only
2046         increase FUTEX if increasing WAKEUP_SEQ.  Fix comment typo.
2047         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2048         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2049         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2051 2006-09-08  Ulrich Drepper  <drepper@redhat.com>
2053         [BZ #3123]
2054         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Don't
2055         increment WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2056         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2057         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2058         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2059         * Makefile (tests): Add tst-cond22.
2060         * tst-cond22.c: New file.
2062 2006-09-05  Ulrich Drepper  <drepper@redhat.com>
2064         [BZ #3124]
2065         * descr.h (struct pthread): Add parent_cancelhandling.
2066         * sysdeps/pthread/createthread.c (create_thread): Pass parent
2067         cancelhandling value to child.
2068         * pthread_create.c (start_thread): If parent thread was canceled
2069         reset the SIGCANCEL mask.
2070         * Makefile (tests): Add tst-cancel25.
2071         * tst-cancel25.c: New file.
2073 2006-09-05  Jakub Jelinek  <jakub@redhat.com>
2074             Ulrich Drepper  <drepper@redhat.com>
2076         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
2077         counterp if it is already zero.
2078         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
2080 2006-03-04  Jakub Jelinek  <jakub@redhat.com>
2081             Roland McGrath  <roland@redhat.com>
2083         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2084         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2085         LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
2086         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2087         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2088         lll_robust_mutex_timedlock, lll_mutex_unlock,
2089         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2090         Add _L_*_ symbols around the subsection.
2091         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
2092         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2094 2006-03-03  Jakub Jelinek  <jakub@redhat.com>
2095             Roland McGrath  <roland@redhat.com>
2097         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2098         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2099         LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
2100         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2101         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2102         lll_robust_mutex_timedlock, lll_mutex_unlock,
2103         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2104         Add _L_*_ symbols around the subsection.
2105         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
2106         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2108 2006-08-31  Ulrich Drepper  <drepper@redhat.com>
2110         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Undo last
2111         change because it can disturb too much existing code.  If real hard
2112         reader preference is needed we'll introduce another type.
2113         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2114         (pthread_rwlock_timedwrlock): Likewise.
2115         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2116         Likewise.
2118 2006-08-30  Ulrich Drepper  <drepper@redhat.com>
2120         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Respect
2121         reader preference.
2122         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2123         (pthread_rwlock_timedwrlock): Likewise.
2124         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2125         Likewise.
2127 2006-08-25  Jakub Jelinek  <jakub@redhat.com>
2129         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
2130         Only define ifdef SHARED.
2132 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
2134         * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
2135         (free_stacks): ...here.
2136         (__free_stack_cache): New function.
2137         * pthreadP.h: Declare __free_stack_cache.
2138         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
2139         ptr_freeres.
2140         * init.c (pthread_functions): Initialize ptr_freeres.
2141         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
2142         New freeres function.
2144 2006-07-30  Joseph S. Myers  <joseph@codesourcery.com>
2146         [BZ #3018]
2147         * Makefile (extra-objs): Add modules to extra-test-objs instead.
2149 2006-08-20  Ulrich Drepper  <drepper@redhat.com>
2151         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2152         _XOPEN_REALTIME_THREADS.
2154 2006-08-15  Jakub Jelinek  <jakub@redhat.com>
2156         * sysdeps/unix/sysv/linux/clock_settime.c (INTERNAL_VSYSCALL): Use
2157         HAVE_CLOCK_GETRES_VSYSCALL as guard macro rather than
2158         HAVE_CLOCK_GETTIME_VSYSCALL.
2159         (maybe_syscall_settime_cpu): Use plain INTERNAL_VSYSCALL here.
2161 2006-08-14  Jakub Jelinek  <jakub@redhat.com>
2163         * sysdeps/unix/sysv/linux/bits/posix_opt.h
2164         (_POSIX_THREAD_PRIO_PROTECT): Define to 200112L.
2165         * descr.h (struct priority_protection_data): New type.
2166         (struct pthread): Add tpp field.
2167         * pthreadP.h (PTHREAD_MUTEX_PP_NORMAL_NP,
2168         PTHREAD_MUTEX_PP_RECURSIVE_NP, PTHREAD_MUTEX_PP_ERRORCHECK_NP,
2169         PTHREAD_MUTEX_PP_ADAPTIVE_NP): New enum values.
2170         * pthread_mutex_init.c (__pthread_mutex_init): Handle non-robust
2171         TPP mutexes.
2172         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle TPP mutexes.
2173         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
2174         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
2175         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
2176         * tpp.c: New file.
2177         * pthread_setschedparam.c (__pthread_setschedparam): Handle priority
2178         boosted by TPP.
2179         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
2180         * pthread_mutexattr_getprioceiling.c
2181         (pthread_mutexattr_getprioceiling): If ceiling is 0, ensure it is
2182         in the SCHED_FIFO priority range.
2183         * pthread_mutexattr_setprioceiling.c
2184         (pthread_mutexattr_setprioceiling): Fix prioceiling validation.
2185         * pthread_mutex_getprioceiling.c (pthread_mutex_getprioceiling): Fail
2186         if mutex is not TPP.  Ceiling is now in __data.__lock.
2187         * pthread_mutex_setprioceiling.c: Include stdbool.h.
2188         (pthread_mutex_setprioceiling): Fix prioceiling validation.  Ceiling
2189         is now in __data.__lock.  Add locking.
2190         * pthread_create.c (__free_tcb): Free pd->tpp structure.
2191         * Makefile (libpthread-routines): Add tpp.
2192         (xtests): Add tst-mutexpp1, tst-mutexpp6 and tst-mutexpp10.
2193         * tst-tpp.h: New file.
2194         * tst-mutexpp1.c: New file.
2195         * tst-mutexpp6.c: New file.
2196         * tst-mutexpp10.c: New file.
2197         * tst-mutex1.c (TEST_FUNCTION): Don't redefine if already defined.
2198         * tst-mutex6.c (TEST_FUNCTION): Likewise.
2200 2006-08-12  Ulrich Drepper  <drepper@redhat.com>
2202         [BZ #2843]
2203         * pthread_join.c (pthread_join): Account for self being canceled
2204         when checking for deadlocks.
2205         * tst-join5.c: Cleanups.  Allow to be used in tst-join6.
2206         (tf1): Don't print anything after pthread_join returns, this would be
2207         another cancellation point.
2208         (tf2): Likewise.
2209         * tst-join6.c: New file.
2210         * Makefile (tests): Add tst-join6.
2212 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
2214         [BZ #2892]
2215         * pthread_setspecific.c (__pthread_setspecific): Check
2216         out-of-range index before checking for unused key.
2218         * sysdeps/pthread/gai_misc.h: New file.
2220 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
2222         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
2223         file.  Don't use sysctl.
2224         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
2225         overwrite the file if this is likely not true.
2227 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
2229         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
2230         * Makefile (tests): Add tst-getpid3.
2231         * tst-getpid3.c: New file.
2233 2006-07-30  Roland McGrath  <roland@redhat.com>
2235         * Makefile (libpthread-routines): Add ptw-sigsuspend.
2237         * sysdeps/unix/sysv/linux/i386/not-cancel.h
2238         (pause_not_cancel): New macro.
2239         (nanosleep_not_cancel): New macro.
2240         (sigsuspend_not_cancel): New macro.
2241         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
2242         nanosleep_not_cancel macro from <not-cancel.h>.
2243         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
2244         macro from <not-cancel.h>.
2246 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
2247             Jakub Jelinek  <jakub@redhat.com>
2249         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
2250         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
2251         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
2252         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
2253         * pthread_mutex_init.c: Add support for priority inheritance mutex.
2254         * pthread_mutex_lock.c: Likewise.
2255         * pthread_mutex_timedlock.c: Likewise.
2256         * pthread_mutex_trylock.c: Likewise.
2257         * pthread_mutex_unlock.c: Likewise.
2258         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
2259         all mutexes.
2260         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
2261         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
2262         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
2263         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
2264         pthread-pi-defines.sym.
2265         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
2266         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
2267         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2268         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2269         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2270         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2271         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2272         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2273         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2274         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2275         _POSIX_THREAD_PRIO_INHERIT to 200112L.
2276         * tst-mutex1.c: Adjust to allow use in PI mutex test.
2277         * tst-mutex2.c: Likewise.
2278         * tst-mutex3.c: Likewise.
2279         * tst-mutex4.c: Likewise.
2280         * tst-mutex5.c: Likewise.
2281         * tst-mutex6.c: Likewise.
2282         * tst-mutex7.c: Likewise.
2283         * tst-mutex7a.c: Likewise.
2284         * tst-mutex8.c: Likewise.
2285         * tst-mutex9.c: Likewise.
2286         * tst-robust1.c: Likewise.
2287         * tst-robust7.c: Likewise.
2288         * tst-robust8.c: Likewise.
2289         * tst-mutexpi1.c: New file.
2290         * tst-mutexpi2.c: New file.
2291         * tst-mutexpi3.c: New file.
2292         * tst-mutexpi4.c: New file.
2293         * tst-mutexpi5.c: New file.
2294         * tst-mutexpi6.c: New file.
2295         * tst-mutexpi7.c: New file.
2296         * tst-mutexpi7a.c: New file.
2297         * tst-mutexpi8.c: New file.
2298         * tst-mutexpi9.c: New file.
2299         * tst-robust1.c: New file.
2300         * tst-robust2.c: New file.
2301         * tst-robust3.c: New file.
2302         * tst-robust4.c: New file.
2303         * tst-robust5.c: New file.
2304         * tst-robust6.c: New file.
2305         * tst-robust7.c: New file.
2306         * tst-robust8.c: New file.
2307         * Makefile (tests): Add the new tests.
2309         * pthread_create.c (start_thread): Add some casts to avoid warnings.
2310         * pthread_mutex_destroy.c: Remove unneeded label.
2312 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
2314         * pthread_mutex_init.c (__pthread_mutex_init): Move some
2315         computations to compile time.
2317 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
2319         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
2321 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
2323         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
2325 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
2327         * pthread_key_create.c (__pthread_key_create): Do away with
2328         __pthread_keys_lock.
2330         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2331         (__kernel_cpumask_size): Mark as hidden.
2332         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
2334         * sem_open.c (__sem_mappings_lock): Mark as hidden.
2335         * semaphoreP.h (__sem_mappings_lock): Likewise.
2337 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
2339         * pthread_atfork.c: Mark __dso_handle as hidden.
2341 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
2343         [BZ #2644]
2344         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
2345         the reload problem.  Change the one path in pthread_cancel_init
2346         which causes the problem.  Force gcc to reload.  Simplify callers.
2347         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
2348         (_Unwind_GetBSP): Undo last patch.
2350 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
2352         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
2353         function pointer is reloaded after pthread_cancel_init calls.
2355         [BZ #2644]
2356         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
2357         pointers are reloaded after pthread_cancel_init calls.
2359 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
2361         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
2362         __always_inline.
2364 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
2366         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
2367         Allocate new object which is passed to timer_sigev_thread so that
2368         the timer can be deleted before the new thread is scheduled.
2370 2006-04-26  Roland McGrath  <roland@redhat.com>
2372         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
2374 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
2376         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
2377         suffix for conditional jumps.
2378         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
2379         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2380         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
2381         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
2382         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2383         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2385         * init.c (sigcancel_handler): Compare with correct PID even if the
2386         thread is in the middle of a fork call.
2387         (sighandler_setxid): Likewise.
2388         Reported by Suzuki K P <suzuki@in.ibm.com> .
2390 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
2392         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
2394 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
2396         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
2397         fails [Coverity CID 105].
2399 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
2401         * sysdeps/pthread/pthread.h: Add nonnull attributes.
2403 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
2405         [BZ #2505]
2406         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
2407         Define __lll_rel_instr using lwsync.
2409 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
2411         * allocatestack.c (allocate_stack): Always initialize robust_head.
2412         * descr.h: Define struct robust_list_head.
2413         (struct pthread): Use robust_list_head in robust mutex list definition.
2414         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
2415         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
2416         (__pthread_initialize_minimal_internal): Register robust_list with
2417         the kernel.
2418         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
2419         Declare __set_robust_list_avail.
2420         * pthread_create.c (start_thread): Register robust_list of new thread.
2421         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
2422         waiters.
2423         * pthread_mutex_destroy.c: For robust mutexes don't look at the
2424         number of users, it's unreliable.
2425         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
2426         set_robust_list syscall is available.
2427         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
2428         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
2429         Set robust_head.list_op_pending before trying to lock a robust mutex.
2430         * pthread_mutex_timedlock.c: Likewise.
2431         * pthread_mutex_trylock.c: Likewise.
2432         * pthread_mutex_unlock.c: Likewise for unlocking.
2433         * Makefile (tests): Add tst-robust8.
2434         * tst-robust8.c: New file.
2436 2006-03-08  Andreas Schwab  <schwab@suse.de>
2438         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
2439         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
2441 2006-03-05  Roland McGrath  <roland@redhat.com>
2443         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
2444         and $config_os doesn't match *linux*.
2446 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
2448         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
2449         Use __syscall_error.
2450         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2451         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
2452         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
2453         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2454         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
2455         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
2457 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
2459         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
2461 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
2463         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
2464         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
2465         mutex.
2466         (__lll_robust_timedlock_wait): Likewise.
2467         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
2468         (__lll_robust_lock_wait): Likewise.
2469         (__lll_robust_timedlock_wait): Likewise.
2470         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
2471         (__lll_robust_lock_wait): Likewise.
2472         (__lll_robust_timedlock_wait): Likewise.
2474 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
2476         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
2477         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2478         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2479         lll_robust_mutex_unlock): Define.
2480         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2482 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
2484         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
2485         instead of <clone.S>.
2487 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
2489         * Makefile (libpthread-routines): Add
2490         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
2491         and pthread_mutex_[sg]etprioceiling.
2492         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
2493         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
2494         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
2495         pthread_mutex_setprioceiling.
2496         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
2497         PTHREAD_PRIO_PROTECT): New enum values.
2498         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
2499         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
2500         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
2501         prototypes.
2502         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
2503         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
2504         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
2505         Define.
2506         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
2507         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
2508         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
2509         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
2510         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
2511         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
2512         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
2513         protocol mutexes.
2514         * pthread_mutex_getprioceiling.c: New file.
2515         * pthread_mutex_setprioceiling.c: New file.
2516         * pthread_mutexattr_getprioceiling.c: New file.
2517         * pthread_mutexattr_setprioceiling.c: New file.
2518         * pthread_mutexattr_getprotocol.c: New file.
2519         * pthread_mutexattr_setprotocol.c: New file.
2521 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
2523         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
2525 2006-02-27  Roland McGrath  <roland@redhat.com>
2527         * sysdeps/pthread/Subdirs: List nptl here too.
2528         * configure (libc_add_on_canonical): New variable.
2530         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
2532         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
2533         self to get main source tree's file.
2534         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
2535         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
2536         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
2537         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
2538         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
2539         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
2540         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
2541         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
2542         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
2543         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
2544         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
2545         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
2546         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
2548         * Makefile: Use $(sysdirs) in vpath directive.
2550         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
2551         (CPPFLAGS-timer_routines.c): Likewise.
2553         * Makeconfig (includes): Variable removed.
2555 2006-02-26  Roland McGrath  <roland@redhat.com>
2557         * sysdeps/generic/pt-raise.c: Moved to ...
2558         * pt-raise.c: ... here.
2559         * sysdeps/generic/lowlevellock.h: Moved to ...
2560         * lowlevellock.h: ... here.
2562 2006-02-23  Roland McGrath  <roland@redhat.com>
2564         * descr.h (struct pthread): Add final member `end_padding'.
2565         (PTHREAD_STRUCT_END_PADDING): Use it.
2567 2006-02-20  Roland McGrath  <roland@redhat.com>
2569         * sysdeps/mips: Directory removed, saved in ports repository.
2570         * sysdeps/unix/sysv/linux/mips: Likewise.
2572 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
2574         * tst-robust1.c: Add second mutex to check that the mutex list is
2575         handled correctly.
2577 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
2579         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
2580         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2581         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2582         lll_robust_mutex_unlock): New macros.
2583         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2584         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2585         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2586         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2587         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
2589 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2591         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
2592         definitions.
2593         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
2595 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
2597         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2598         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
2599         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2600         (lll_robust_mutex_unlock): Likewise.
2602 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
2604         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
2605         Set robust_list.__next rather than robust_list.
2606         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
2607         (__pthread_list_t): New typedef.
2608         (pthread_mutex_t): Replace __next and __prev fields with __list.
2609         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
2610         (__pthread_list_t): New typedef.
2611         (pthread_mutex_t): Replace __next and __prev fields with __list.
2612         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2613         (__pthread_list_t, __pthread_slist_t): New typedefs.
2614         (pthread_mutex_t): Replace __next and __prev fields with __list.
2615         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
2616         (__pthread_list_t, __pthread_slist_t): New typedefs.
2617         (pthread_mutex_t): Replace __next and __prev fields with __list.
2618         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
2619         (__pthread_list_t, __pthread_slist_t): New typedefs.
2620         (pthread_mutex_t): Replace __next and __prev fields with __list.
2621         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
2622         (__pthread_slist_t): New typedef.
2623         (pthread_mutex_t): Replace __next field with __list.
2625 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
2627         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
2628         PTHREAD_MUTEX_OWNERDEAD.
2629         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
2630         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
2631         * Makefile (libpthread-routines): Add lowlevelrobustlock.
2632         * pthread_create.c (start_thread): Very much simplify robust_list loop.
2633         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
2634         to PTHREAD_MUTEX_INCONSISTENT.
2635         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
2636         * pthread_mutex_lock.c: Reimplement robust mutex handling.
2637         * pthread_mutex_trylock.c: Likewise.
2638         * pthread_mutex_timedlock.c: Likewise.
2639         * pthread_mutex_unlock.c: Likewise.
2640         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
2641         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
2642         lowlevelrobustlock.sym.
2643         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
2644         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
2645         definitions.
2646         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2647         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
2648         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
2649         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
2650         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
2652 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
2654         * allocatestack.c (allocate_stack): Initialize robust_list.
2655         * init.c (__pthread_initialize_minimal_internal): Likewise.
2656         * descr.h (struct xid_command): Pretty printing.
2657         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
2658         robust_list.  Adjust macros.
2659         * pthread_create.c (start_thread): Adjust robust_list handling.
2660         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
2661         but the owner for all robust mutex types.
2662         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
2663         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
2664         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2665         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
2667         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
2668         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
2670 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
2672         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
2673         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
2675 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2677         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
2678         Return status.
2679         (lll_futex_timed_wait): Define.
2681 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
2683         * tst-cancel4.c: Test ppoll.
2685 2006-01-18  Andreas Jaeger  <aj@suse.de>
2687         [BZ #2167]
2688         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
2689         (pthread_mutex_t): Follow changes for other archs.  Based on patch
2690         by Jim Gifford <patches@jg555.com>.
2692 2006-01-13  Richard Henderson  <rth@redhat.com>
2694         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
2696 2006-01-10  Roland McGrath  <roland@redhat.com>
2698         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
2699         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
2700         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
2701         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
2702         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
2703         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
2704         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
2705         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
2706         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
2707         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
2709 2006-01-09  Roland McGrath  <roland@redhat.com>
2711         * tst-initializers1-c89.c: New file.
2712         * tst-initializers1-c99.c: New file.
2713         * tst-initializers1-gnu89.c: New file.
2714         * tst-initializers1-gnu99.c: New file.
2715         * Makefile (tests): Add them.
2716         (CFLAGS-tst-initializers1-c89.c): New variable.
2717         (CFLAGS-tst-initializers1-c99.c): New variable.
2718         (CFLAGS-tst-initializers1-gnu89.c): New variable.
2719         (CFLAGS-tst-initializers1-gnu99.c): New variable.
2721         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2722         Use __extension__ on anonymous union definition.
2723         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2724         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2725         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2726         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2727         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2729 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
2731         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
2732         Don't give the union a name because it changes the mangled name.
2733         Instead name the struct for __data.
2734         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
2735         Likewise.
2736         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
2737         Likewise.
2739 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
2741         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
2742         stack bias to mc_ftp field.
2744 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
2746         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
2747         being too clever and reloading the futex value where it shouldn't.
2749 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
2751         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
2752         correct type.
2754 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
2756         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
2757         Add cfi directives.
2759 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
2761         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
2762         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
2763         rename in tcbhead_t.
2765         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2766         Don't give the union a name because it changes the mangled name.
2767         Instead name the struct for __data.
2768         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2769         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2770         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2771         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2772         * pthread_create.c (start_thread): Adjust robust mutex free loop.
2773         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
2775 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
2777         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
2778         Return status.
2779         (lll_futex_timed_wait): Define.
2780         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2781         * sysdeps/pthread/aio_misc.h: New file.
2783 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
2785         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
2787 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
2789         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2790         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
2791         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2793 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
2795         * tst-cancel24.cc: Use C headers instead of C++ headers.
2797 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
2799         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
2800         sparc-linux configured glibc.
2801         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
2802         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
2803         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
2804         atomic_compare_and_exchange_val_24_acq instead of
2805         atomic_compare_and_exchange_val_acq.
2806         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
2807         instead of atomic_exchange_rel.
2808         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
2809         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
2810         file.
2811         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
2812         file.
2813         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
2814         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
2815         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
2816         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
2817         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
2818         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
2819         New file.
2820         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2821         New file.
2822         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
2823         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
2824         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
2825         file.
2826         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
2827         file.
2828         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
2830 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
2832         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
2833         mutex initializers.
2835 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
2837         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
2838         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2839         THREAD_COPY_POINTER_GUARD): Define.
2840         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
2841         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
2843 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
2845         * version.c: Update copyright year.
2847 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2849         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
2850         .eh_frame section, use cfi_* directives.
2851         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
2853 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
2855         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
2856         now.
2858 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
2860         * sysdeps/pthread/sigaction.c: Removed.
2861         * sigaction.c: New file.
2862         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
2864 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
2866         * Makefile (tests): Add tst-signal7.
2867         * tst-signal7.c: New file.
2869 2005-12-27  Roland McGrath  <roland@redhat.com>
2871         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
2872         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
2873         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
2874         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
2875         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
2876         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
2877         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
2878         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
2879         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
2880         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
2881         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
2883 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
2885         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
2886         and __prev field to pthread_mutex_t.
2887         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2888         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2889         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2890         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2891         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
2892         to pthread_mutex_t.
2894 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
2896         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
2897         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
2898         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
2899         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
2900         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
2901         and PTHREAD_MUTEXATTR_FLAG_BITS.
2902         * descr.h (struct pthread): Add robust_list field and define
2903         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
2904         * pthread_mutexattr_getrobust.c: New file.
2905         * pthread_mutexattr_setrobust.c: New file.
2906         * pthread_mutex_consistent.c: New file.
2907         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
2908         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
2909         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
2910         Adjust pthread_mutex_t initializers.
2911         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
2912         field to pthread_mutex_t.
2913         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
2914         and __prev field to pthread_mutex_t.
2915         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
2916         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
2917         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
2918         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
2919         * pthread_mutexattr_gettype.c: Likewise.
2920         * pthread_mutexattr_setpshared.c: Likewise.
2921         * pthread_mutexattr_settype.c: Likewise.
2922         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
2923         Initialize mutex kind according to robust flag.
2924         * pthread_mutex_lock.c: Implement local robust mutex.
2925         * pthread_mutex_timedlock.c: Likewise.
2926         * pthread_mutex_trylock.c: Likewise.
2927         * pthread_mutex_unlock.c: Likewise.
2928         * pthread_create.c (start_thread): Mark robust mutexes which remained
2929         locked as dead.
2930         * tst-robust1.c: New file.
2931         * tst-robust2.c: New file.
2932         * tst-robust3.c: New file.
2933         * tst-robust4.c: New file.
2934         * tst-robust5.c: New file.
2935         * tst-robust6.c: New file.
2936         * tst-robust7.c: New file.
2937         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
2938         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
2939         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
2940         tst-robust5, tst-robust6, and tst-robust7.
2942         * tst-typesizes.c: New file.
2943         * Makefile (tests): Add tst-typesizes.
2945         * tst-once3.c: More debug output.
2947 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
2949         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
2950         missing after last change.
2952         * version.c: Update copyright year.
2954 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
2956         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
2957         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
2958         * pthread_mutex_trylock.c: Likewise.
2959         * pthread_mutex_timedlock.c: Likewise.
2960         * pthread_mutex_unlock.c: Likewise.
2962 2005-12-22  Roland McGrath  <roland@redhat.com>
2964         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
2965         so that #include_next's search location is not reset to the -I..
2966         directory where <nptl/...> can be found.
2968 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
2970         [BZ #1913]
2971         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
2972         Fix unwind info.  Remove useless branch prediction prefix.
2973         * tst-cancel24.cc: New file.
2974         * Makefile: Add rules to build and run tst-cancel24.
2976 2005-12-21  Roland McGrath  <roland@redhat.com>
2978         * libc-cancellation.c: Use <> rather than "" #includes.
2979         * pt-cleanup.c: Likewise.
2980         * pthread_create.c: Likewise.
2981         * pthread_join.c: Likewise.
2982         * pthread_timedjoin.c: Likewise.
2983         * pthread_tryjoin.c: Likewise.
2984         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
2985         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
2986         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
2987         * unwind.c: Likewise.
2989 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2991         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
2992         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
2993         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2994         THREAD_COPY_POINTER_GUARD): Define.
2996 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
2998         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
2999         rather than one.
3000         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3001         THREAD_COPY_POINTER_GUARD): Define.
3002         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
3003         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
3004         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3005         THREAD_COPY_POINTER_GUARD): Define.
3006         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
3007         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
3008         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
3009         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
3010         Use PTR_DEMANGLE for B0 if defined.
3012 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
3014         * pthread_create.c (__pthread_create_2_1): Use
3015         THREAD_COPY_POINTER_GUARD if available.
3016         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
3017         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3018         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
3019         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
3020         * sysdeps/x86_64/tls.h: Likewise.
3022 2005-12-15  Roland McGrath  <roland@redhat.com>
3024         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
3026 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
3028         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
3029         sysdeps/generic.
3030         * errno-loc.c: New file.
3032 2005-12-12  Roland McGrath  <roland@redhat.com>
3034         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
3035         adjustments before choosing stack size.  Update minimum stack size
3036         calculation to match allocate_stack change.
3038 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
3040         * allocatestack.c (allocate_stack): Don't demand that there is an
3041         additional full page available on the stack beside guard, TLS, the
3042         minimum stack.
3044 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
3046         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3047         (__cleanup_fct_attribute): Use __regparm__ not regparm.
3049         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
3050         compiling 32-bit code we must define __cleanup_fct_attribute.
3052 005-11-24  Jakub Jelinek  <jakub@redhat.com>
3054         [BZ #1920]
3055         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
3056         __attribute__ instead of __attribute.
3057         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3058         (__cleanup_fct_attribute): Likewise.
3060 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
3062         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
3063         a write barrier before writing libgcc_s_getcfa.
3065 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
3067         * sysdeps/unix/sysv/linux/configure: Removed.
3069 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
3071         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
3072         optional init_array/fini_array support.
3074 2005-10-24  Roland McGrath  <roland@redhat.com>
3076         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
3077         versioned_symbol use.
3079 2005-10-16  Roland McGrath  <roland@redhat.com>
3081         * init.c (__pthread_initialize_minimal_internal): Even when using a
3082         compile-time default stack size, apply the minimum that allocate_stack
3083         will require, and round up to page size.
3085 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
3087         * Makefile ($(test-modules)): Remove static pattern rule.
3089 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
3090             Ulrich Drepper  <drepper@redhat.com>
3092         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
3093         alignment in callback function.
3094         * Makefile: Add rules to build and run tst-align3.
3095         * tst-align3.c: New file.
3097 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
3099         * allocatestack.c (setxid_signal_thread): Add
3100         INTERNAL_SYSCALL_DECL (err).
3102 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
3104         * allocatestack.c (setxid_signal_thread): Need to use
3105         atomic_compare_and_exchange_bool_acq.
3107 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
3108             Jakub Jelinek  <jakub@redhat.com>
3110         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
3111         CANCEL_RESTMASK.
3112         (struct pthread): Move specific_used field to avoid padding.
3113         Add setxid_futex field.
3114         * init.c (sighandler_setxid): Reset setxid flag and release the
3115         setxid futex.
3116         * allocatestack.c (setxid_signal_thread): New function.  Broken
3117         out of the bodies of the two loops in __nptl_setxid.  For undetached
3118         threads check whether they are exiting and if yes, don't send a signal.
3119         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
3120         * pthread_create.c (start_thread): For undetached threads, check
3121         whether setxid bit is set.  If yes, wait until signal has been
3122         processed.
3124         * allocatestack.c (STACK_VARIABLES): Initialize them.
3125         * pthread_create.c (__pthread_create_2_1): Initialize pd.
3127 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
3129         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
3130         waiters, awake all waiters on the associated mutex.
3132 2005-09-22  Roland McGrath  <roland@redhat.com>
3134         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
3135         ../sysdeps/x86_64/hp-timing.h).
3137 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
3139         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
3140         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3141         (lll_futex_wake_unlock): Define.
3142         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
3143         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3144         (lll_futex_wake_unlock): Define.
3145         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
3146         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3147         (lll_futex_wake_unlock): Define.
3148         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
3149         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3150         (lll_futex_wake_unlock): Define.
3151         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
3152         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3153         (lll_futex_wake_unlock): Define.
3154         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
3155         lll_futex_wake_unlock.
3156         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3157         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3158         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3159         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
3160         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3161         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3163 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3165         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
3166         Fix typo in register name.
3168 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
3170         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3171         Use __sigfillset.  Document that sigfillset does the right thing wrt
3172         to SIGSETXID.
3174 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3176         [BZ #1102]
3177         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
3178         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
3179         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
3180         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
3181         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
3182         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
3183         in the structure.
3184         * Makefile (tests): Add tst-initializers1.
3185         (CFLAGS-tst-initializers1.c): Set.
3186         * tst-initializers1.c: New test.
3188 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3190         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
3191         Make sure __flags are located at offset 48 from the start of the
3192         structure.
3194 2005-07-02  Roland McGrath  <roland@redhat.com>
3196         * Makeconfig: Comment fix.
3198 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
3200         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
3201         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
3202         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
3203         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
3204         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3205         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3206         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
3207         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
3208         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
3209         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3211 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
3213         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
3214         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3215         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
3216         fields.
3217         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3218         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
3219         field.  Put in sysinfo field unconditionally.
3220         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3221         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
3222         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3223         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
3224         fields.
3225         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3226         * pthread_create.c (__pthread_create_2_1): Use
3227         THREAD_COPY_STACK_GUARD macro.
3228         * Makefile: Add rules to build and run tst-stackguard1{,-static}
3229         tests.
3230         * tst-stackguard1.c: New file.
3231         * tst-stackguard1-static.c: New file.
3233 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
3235         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
3236         Invoke CGOTSETUP and CGOTRESTORE.
3237         (CGOTSETUP, CGOTRESTORE): Define.
3239 2005-05-29  Richard Henderson  <rth@redhat.com>
3241         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
3242         (tf_write, tf_writev): Use it.
3243         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
3244         the system minimum.
3246 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
3248         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3249         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
3250         __librt_*_asynccancel@local.
3252 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
3254         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
3255         all occurrences of JUMPTARGET.  Instead append @local to labels.
3257 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
3259         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
3260         size/alignment of struct pthread rather than tcbhead_t.
3261         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3262         Likewise.
3263         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3264         Likewise.
3265         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3266         Likewise.
3268 2005-05-19  Richard Henderson  <rth@redhat.com>
3270         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
3271         __sync_val_compare_and_swap, not explicit _si variant.
3272         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
3274 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
3276         [BZ #915]
3277         * sysdeps/pthread/pthread.h: Avoid empty initializers.
3279 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
3281         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
3282         .eh_frame section, use cfi_* directives.
3284 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
3286         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
3287         of "" includes.
3289 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
3291         [BZ #1075]
3292         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
3293         aio_write blocks.
3295 2005-04-27  Roland McGrath  <roland@redhat.com>
3297         * Makefile (tests): Remove tst-clock2.
3299         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
3300         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
3301         translating to the kernel clockid_t for our own process/thread clock.
3303         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
3305 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
3307         * old_pthread_cond_init.c: Include <errno.h>.
3308         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
3309         process shared or uses clock other than CLOCK_REALTIME.
3310         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
3312 2005-04-13  David S. Miller  <davem@davemloft.net>
3314         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
3315         * sysdeps/sparc/sparc64/clone.S: New file.
3317 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
3319         [BZ #1102]
3320         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
3321         __inline instead of inline.
3322         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
3324 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
3326         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
3327         functionally equivalent, but shorter instructions.
3328         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
3329         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3330         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
3331         Likewise.
3332         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
3333         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3334         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3335         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3336         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3337         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
3338         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3339         Likewise.
3340         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3341         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
3342         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3343         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
3344         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3346 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
3348         * sysdeps/mips/Makefile: New file.
3349         * sysdeps/mips/nptl-sysdep.S: New file.
3350         * sysdeps/mips/tcb-offsets.sym: New file.
3351         * sysdeps/mips/pthread_spin_lock.S: New file.
3352         * sysdeps/mips/pthread_spin_trylock.S: New file.
3353         * sysdeps/mips/pthreaddef.h: New file.
3354         * sysdeps/mips/tls.h: New file.
3355         * sysdeps/mips/jmpbuf-unwind.h: New file.
3356         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
3357         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
3358         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
3359         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
3360         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
3361         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
3362         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
3363         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
3364         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
3365         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
3367 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
3369         [BZ #1112]
3370         * pthread_create.c (__pthread_create_2_1): Rename syscall error
3371         variable to scerr.
3373 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
3375         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
3377 2005-02-25  Roland McGrath  <roland@redhat.com>
3379         * alloca_cutoff.c: Correct license text.
3380         * tst-unload.c: Likewise.
3381         * sysdeps/pthread/allocalim.h: Likewise.
3382         * sysdeps/pthread/pt-initfini.c: Likewise.
3383         * sysdeps/pthread/bits/libc-lock.h: Likewise.
3384         * sysdeps/pthread/bits/sigthread.h: Likewise.
3385         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
3386         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
3388 2005-02-16  Roland McGrath  <roland@redhat.com>
3390         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
3391         Use unsigned int * for ptr_nthreads.
3393 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
3395         [BZ #721]
3396         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
3397         gcc4.
3399 2005-02-07  Richard Henderson  <rth@redhat.com>
3401         [BZ #787]
3402         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
3403         argument.
3405 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
3407         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
3408         order of arguments in invocation of atomic_add_zero.
3410 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
3412         [BZ #737]
3413         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
3414         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
3415         at least gotntpoff relocation and addition.
3416         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
3417         Likewise.
3418         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
3419         Likewise.
3420         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3421         Likewise.
3423 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
3425         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
3426         entry for static tls deallocation fix.
3427         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
3428         also contains information whether the memory pointed to is static
3429         TLS or not.
3430         * sysdeps/i386/tls.h: Likewise.
3431         * sysdeps/ia64/tls.h: Likewise.
3432         * sysdeps/powerpc/tls.h: Likewise.
3433         * sysdeps/s390/tls.h: Likewise.
3434         * sysdeps/sh/tls.h: Likewise.
3435         * sysdeps/sparc/tls.h: Likewise.
3436         * sysdeps/x86_64/tls.h: Likewise.
3438 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
3440         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
3442 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
3444         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
3445         %esp.
3446         * Makefile (tests): Add tst-align2.
3447         * tst-align2.c: New test.
3448         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
3449         -mpreferred-stack-boundary=4.
3451 2004-12-18  Roland McGrath  <roland@redhat.com>
3453         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
3454         New file removed withdrawn for the moment.
3456 2004-12-17  Richard Henderson  <rth@redhat.com>
3458         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
3459         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
3461 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
3463         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
3464         Increased PTHREAD_STACK_MIN.
3466         * tst-context1.c (stacks): Use bigger stack size.
3468 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
3470         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
3471         * sysdeps/sparc/tcb-offsets.sym: Add TID.
3473 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
3475         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
3476         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
3477         * sysdeps/s390/tcb-offsets.sym (TID): Add.
3479 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
3481         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
3483 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
3485         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
3486         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
3488         * tst-getpid1.c: If child crashes, report this first.  Print which
3489         signal.
3491 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
3493         * init.c (__pthread_initialize_minimal_internal): Also unblock
3494         SIGSETXID.
3496 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
3498         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
3499         _POSIX_THREAD_CPUTIME): Define to 0.
3500         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
3501         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
3502         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
3503         __timer_signal_thread_tclk): Remove.
3504         (init_module): Remove their initialization.
3505         (thread_cleanup): Remove their cleanup assertions.
3506         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
3507         __timer_signal_thread_tclk): Remove.
3508         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
3509         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
3510         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
3512 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
3514         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
3515         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
3517         * Makefile (tests): Add tst-getpid2.
3518         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
3519         (do_test): Use it.  Use __clone2 instead of clone on ia64.
3520         * tst-getpid2.c: New test.
3522 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3524         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
3526 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
3528         * Makefile (tests): Add tst-getpid1.
3529         * tst-getpid1.c: New file.
3530         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
3531         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
3533 2004-12-02  Roland McGrath  <roland@redhat.com>
3535         * Makefile (libpthread-nonshared): Variable removed.
3536         ($(objpfx)libpthread_nonshared.a): Target removed.
3537         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
3538         These are now handled by generic magic from
3539         libpthread-static-only-routines being set.
3541 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
3543         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
3544         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
3545         _POSIX_THREAD_PRIO_PROTECT): Define.
3546         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3547         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3548         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3550 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
3552         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
3553         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
3554         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
3555         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
3556         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3557         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3558         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3560 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
3562         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
3564         * Makefile (libpthread-routines): Add pthread_setschedprio.
3565         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
3566         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
3567         * pthread_setschedprio.c: New file.
3569 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
3571         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
3572         * pthread_cancel.c (pthread_create): Likewise.
3574         * Makefile (libpthread-routines): Add vars.
3575         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
3576         * init.c (__default_stacksize, __is_smp): Remove.
3577         * vars.c: New file.
3578         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
3579         and define a wrapper macro.
3580         (PTHREAD_STATIC_FN_REQUIRE): Define.
3581         * allocatestack.c (__find_thread_by_id): Undefine.
3582         * pthread_create (__pthread_keys): Remove.
3583         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
3584         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
3585         PTHREAD_STATIC_FN_REQUIRE.
3587 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3589         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
3590         parameter to REGISTER macro.
3592 2004-11-17  Roland McGrath  <roland@redhat.com>
3594         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
3595         Make sure SIGCANCEL is blocked as well.
3597 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3599         * sysdeps/pthread/setxid.h: New file.
3600         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
3601         (struct xid_command): Add forward decl.
3602         (struct pthread_functions): Change return type of __nptl_setxid hook
3603         to int.
3604         * pthreadP.h (__nptl_setxid): Change return type to int.
3605         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
3606         calling thread, return its return value and set errno on failure.
3607         * descr.h (struct xid_command): Change id type to long array.
3609         * Makefile: Add rules to build and test tst-setuid1 and
3610         tst-setuid1-static.
3611         * tst-setuid1.c: New test.
3612         * tst-setuid1-static.c: New test.
3614 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3616         * Makefile (tests): Add tst-exit3.
3617         * tst-exit3.c: New test.
3619 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
3621         * Makefile (tests): Add tst-exit2.
3622         * tst-exit2.c: New file.
3624 2004-11-09  Roland McGrath  <roland@redhat.com>
3626         [BZ #530]
3627         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
3628         here, before calling clone.
3629         * pthread_create.c (start_thread): Don't do it here.
3631 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
3633         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
3635 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
3637         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
3638         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
3639         assembler warning.
3641 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
3643         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
3644         if sched_priority is not between minprio and maxprio.
3646 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3648         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
3649         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
3651         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3652         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
3654 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
3656         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
3657         not-cancelable I/O functions.
3659 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3661         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3662         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3663         make sure 2 is stored in the futex and we looked at the old value.
3664         Fix a few other problems to return the correct value.
3666 2004-10-14  Richard Henderson  <rth@redhat.com>
3668         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
3669         make gcc4 happy.
3671 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
3673         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
3674         of pthread-functions.h and pthreaddef.h.
3675         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
3677         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
3678         Change __data.__nwaiters from int to unsigned int.
3680         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
3681         sysconf (_SC_THREAD_CPUTIME) returns negative value.
3683         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
3684         before return type.
3686         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
3687         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
3689 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
3691         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
3692         test fails, remove message queue.
3693         (tf_msgsnd): Likewise.
3695 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3697         * tst-clock1.c: Change #ifdef to #if defined.
3698         * tst-clock2.c: Likewise.
3699         * tst-cond11.c: Likewise.
3701         * sysdeps/pthread/timer_create.c (timer_create): Use
3702         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
3703         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
3704         THREAD_CPUTIME.
3706 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3708         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
3709         _POSIX_THREAD_CPUTIME): Define to 0.
3711 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
3713         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
3714         and _POSIX_THREAD_CPUTIME to zero.
3715         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3716         * tst-barrier2.c: Fix testing for POSIX feature.
3717         * tst-clock1.c: Likewise.
3718         * tst-clock2.c: Likewise.
3719         * tst-cond11.c: Likewise.
3720         * tst-cond4.c: Likewise.
3721         * tst-cond6.c: Likewise.
3722         * tst-flock2.c: Likewise.
3723         * tst-mutex4.c: Likewise.
3724         * tst-mutex9.c: Likewise.
3725         * tst-rwlock12.c: Likewise.
3726         * tst-rwlock4.c: Likewise.
3727         * tst-signal1.c: Likewise.
3728         * tst-spin2.c: Likewise.
3729         * sysdeps/pthread/posix-timer.h: Likewise.
3730         * sysdeps/pthread/timer_create.c: Likewise.
3731         * sysdeps/pthread/timer_routines.c: Likewise.
3733 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
3735         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3736         (__lll_mutex_timedlock_wait): Address futex correctly.
3738         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
3739         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3740         make sure 2 is stored in the futex and we looked at the old value.
3741         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3742         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
3743         which might very well made the code not working at all before.
3744         [BZ #417]
3746 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
3748         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
3749         allow SIGSETXID to be sent.
3750         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
3751         for SIGSETXID to be defined.
3752         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
3753         SIGSETXID cannot be blocked.
3755         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3756         Add __extension__ to long long types.
3757         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3758         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3759         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3760         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3761         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
3762         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3763         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3765 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
3767         * descr.h (struct pthread): Add stopped_start field.
3768         * sysdeps/pthread/createthread.c (create_thread): Set
3769         start_stopped flag in descriptor for new thread appropriately.
3770         * pthread_create.c (start_thread): Only take lock to be stopped on
3771         startup if stopped_start flag says so.
3773 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
3775         * pthread_create.c (__pthread_create_2_1): Remember whether thread
3776         is created detached and if yes, do not try to free the stack in case
3777         the thread creation failed.
3778         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
3779         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
3780         case there has been no error.  [BZ #405]
3782         * pthread_create.c (start_thread): Don't wait for scheduler data
3783         etc to be set at the beginning of the function.  The cancellation
3784         infrastructure must have been set up.  And enable async
3785         cancellation before potentially going to sleep.  [BZ #401]
3787 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
3789         * Versions: Remove exports for pthread_set*id_np functions.
3790         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
3791         for now.
3792         * Makefile: Don't build pthread_set*id code for now.
3794 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
3796         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
3797         internal use.
3798         * allocatestack.c (__nptl_setxid): New function.
3799         * descr.h (struct xid_command): Define type.
3800         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
3801         (sighandler_setxid): New function.
3802         (__pthread_initialize_minimal): Register sighandler_setxid for
3803         SIGCANCEL.
3804         * pt-allocrtsig.c: Update comment.
3805         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
3806         Declare __nptl_setxid.
3807         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
3808         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
3809         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
3810         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
3811         and pthread_setresuid_np.
3812         * pthread_setgid_np.c: New file.
3813         * pthread_setuid_np.c: New file.
3814         * pthread_setegid_np.c: New file.
3815         * pthread_seteuid_np.c: New file.
3816         * pthread_setregid_np.c: New file.
3817         * pthread_setreuid_np.c: New file.
3818         * pthread_setresgid_np.c: New file.
3819         * pthread_setresuid_np.c: New file.
3820         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
3821         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
3822         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
3823         and pthread_setresuid_np.
3824         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
3825         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
3826         pthread_setregid, and pthread_setresgid.
3828 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
3830         * allocatestack.c (allocate_stack): Return EAGAIN instead of
3831         ENOMEM when out of memory.
3833 2004-09-10  Roland McGrath  <roland@redhat.com>
3835         [BZ #379]
3836         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
3837         code, since we don't try to use the broken CLONE_STOPPED any more.
3838         * pthread_create.c (start_thread): Likewise.
3840 2004-09-15  Richard Henderson  <rth@redhat.com>
3842         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
3844 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
3846         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
3847         (__libc_unwind_longjmp): Delete macro and declare as function.
3848         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
3849         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
3850         nptl directory.
3851         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
3852         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
3853         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
3855 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
3857         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
3858         for __USE_XOPEN2K.
3859         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
3860         types also for __USE_XOPEN2K.
3861         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3862         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3863         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3864         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3865         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3866         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3867         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3868         [BZ #320]
3870 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
3872         * sysdeps/pthread/pthread.h
3873         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
3874         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
3875         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
3876         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
3877         [BZ #375]
3879 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
3881         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
3882         PSEUDO to be used with . prefix.
3884         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
3885         Use atomic_increment instead of atomic_exchange_and_add.
3886         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
3887         Likewise.
3888         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
3889         Likewise.
3890         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
3891         Likewise.
3893         * allocatestack.c (allocate_stack): Use atomic_increment_val
3894         instead of atomic_exchange_and_add.
3895         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
3896         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
3897         Likewise.
3898         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
3899         Likewise.
3901         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
3902         the initialization function might throw.
3904 2005-09-05  Richard Henderson  <rth@redhat.com>
3906         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
3907         Move definition inside libpthread, libc, librt check.  Provide
3908         definition for rtld.
3910 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
3912         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
3913         * sysdeps/i386/jmpbuf-unwind.h: Likewise
3914         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3915         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3916         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3917         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3918         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3919         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
3920         * unwind.c: Use it.
3922         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3923         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
3924         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
3925         Likewise.
3926         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
3927         Decrement __nwaiters.  If pthread_cond_destroy has been called and
3928         this is the last waiter, signal pthread_cond_destroy caller and
3929         avoid using the pthread_cond_t structure after unlock.
3930         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3931         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
3932         Read clock type from the least significant bits of __nwaiters instead
3933         of __clock.
3934         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3935         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
3937 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
3939         [BZ #342]
3940         * Makefile (tests): Add tst-cond20 and tst-cond21.
3941         * tst-cond20.c: New test.
3942         * tst-cond21.c: New test.
3943         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
3944         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
3945         it unsigned int.
3946         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
3947         Likewise.
3948         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
3949         (pthread_cond_t): Likewise.
3950         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
3951         Likewise.
3952         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3953         Likewise.
3954         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
3955         Likewise.
3956         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
3957         (cond_nwaiters): New.
3958         (clock_bits): New.
3959         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
3960         if there are waiters not signalled yet.
3961         Wait until all already signalled waiters wake up.
3962         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
3963         __nwaiters.  If pthread_cond_destroy has been called and this is the
3964         last waiter, signal pthread_cond_destroy caller and avoid using
3965         the pthread_cond_t structure after unlock.
3966         (__pthread_cond_wait): Increment __nwaiters in the beginning,
3967         decrement it when leaving.  If pthread_cond_destroy has been called
3968         and this is the last waiter, signal pthread_cond_destroy caller.
3969         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
3970         Likewise.  Read clock type from the least significant bits of
3971         __nwaiters instead of __clock.
3972         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
3973         whether clock ID can be encoded in COND_CLOCK_BITS bits.
3974         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
3975         clock type just from the last COND_CLOCK_BITS bits of value.
3976         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
3977         instead of __clock, just from second bit of condattr's value.
3979 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
3981         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
3982         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
3983         != 64.
3984         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
3986 2004-08-15  Roland McGrath  <roland@frob.com>
3988         * pthread_atfork.c: Update copyright terms including special exception
3989         for these trivial files, which are statically linked into executables
3990         that use dynamic linking for the significant library code.
3992 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
3994         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
3995         pthread_rwlock_rdlock.
3996         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
3997         Decrease __nr_readers_queued after reacquiring lock.
3998         * sysdeps/pthread/pthread_rwlock_timedrdlock
3999         (pthread_rwlock_timedrdlock): Likewise.
4000         Reported by Bob Cook <bobcook47@hotmail.com>.
4002 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
4004         * tst-rwlock14.c (tf): Read main thread handle from *ARG
4005         before pthread_barrier_wait.
4007 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
4009         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
4010         Remove unnecessary exception handling data.
4012 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
4014         [BZ #284]
4015         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
4016         instead of clockid_t.
4018 2004-07-21  Roland McGrath  <roland@redhat.com>
4020         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
4022 2004-07-19  Roland McGrath  <roland@redhat.com>
4024         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
4026 2004-07-02  Roland McGrath  <roland@redhat.com>
4028         * configure: Don't exit.
4030 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4032         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4033         (__pthread_cond_timedwait): Check for invalid nanosecond in
4034         timeout value.
4036 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
4038         * Makefile: Add rules to build and run tst-fini1.
4039         * tst-fini1.c: New file.
4040         * tst-fini1mod.c: New file.
4042 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
4044         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
4045         if no cancellation support is needed.
4046         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
4047         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
4048         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4049         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
4050         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
4051         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
4052         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
4053         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
4054         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
4056         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
4057         only if not already defined.
4059 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
4061         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
4062         constraint "m" instead of "0" for futex.
4064         * shlib-versions: Add powerpc64-.*-linux.*.
4066 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
4068         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
4069         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
4070         for valid tv_nsec.
4071         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
4072         1 billion and 64-bit tv_nsec which is valid when truncated to 32
4073         bits.
4075 2004-06-29  Roland McGrath  <roland@redhat.com>
4077         * Banner: NPTL no longer has its own version number.
4078         * Makefile (nptl-version): Variable removed.
4079         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
4080         using $(version), the glibc version number.
4082 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4084         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4085         Fix branch offset for a PLT entry.
4086         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
4087         Likewise.
4088         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
4089         Likewise.
4090         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
4091         Likewise.
4092         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
4093         Likewise.
4095 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4097         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
4098         unconditionally.
4100 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4102         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
4103         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
4104         instead of tv_sec.
4105         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
4106         (pthread_rwlock_timedrdlock): Likewise.
4108 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
4110         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4111         Set __r7 to val, not mutex.
4113 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
4115         * Makefile: Add rules to build tst-rwlock14.
4116         * tst-rwlock14.c: New file.
4118 2004-06-24  Boris Hu  <boris.hu@intel.com>
4120         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
4121         check.
4122         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
4124 2004-06-19  Andreas Jaeger  <aj@suse.de>
4126         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
4127         assembler in last patch.
4129 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
4131         * sysdeps/pthread/pthread_cond_timedwait.c
4132         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
4133         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4134         (__pthread_cond_timedwait): Check for invalid nanosecond in
4135         timeout value.
4136         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4137         * tst-cond19.c: New file.
4138         * Makefile: Add rules to build and run tst-cond19.
4140 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
4142         * tst-context1.c (GUARD_PATTERN): Defined.
4143         (tst_context_t): Define struct containing ucontext_t & guard words.
4144         (ctx): Declare as an array of tst_context_t.
4145         (fct): Verify uc_link & guard words are still valid.
4146         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
4148 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4150         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4151         Add __data.__futex field, reshuffle __data.__clock.
4152         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
4153         (__pthread_cond_signal): Increment __futex at the same time as
4154         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4155         address of low 32-bits of __wakeup_seq to futex syscall.
4156         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4157         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4158         releasing internal lock to FUTEX_WAIT.
4159         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4160         (__pthread_cond_timedwait): Likewise.
4161         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4162         (FUTEX_CMP_REQUEUE): Define.
4163         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4164         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4165         Pass __futex value from before the unlock and __futex address instead
4166         of address of low 32-bits of __wakeup_seq to futex syscall.
4167         Fallback to FUTEX_WAKE all on any errors.
4169 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
4171         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
4172         comment typo.
4173         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
4174         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
4175         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
4176         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
4177         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
4179 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4181         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
4182         Add memory clobber to inline assembly.
4183         (__lll_mutex_trylock): Likewise.
4184         (__lll_mutex_cond_trylock): Likewise.
4186 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4188         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4189         Pass val argument as 6th system call argument in %r7.
4191 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4193         * Makefile (tests): Add tst-cond16.
4194         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
4195         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
4196         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4197         Add __data.__futex field, reshuffle __data.__clock.
4198         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
4199         (__pthread_cond_signal): Increment __futex at the same time as
4200         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4201         address of low 32-bits of __wakeup_seq to futex syscall.
4202         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
4203         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4204         releasing internal lock to FUTEX_WAIT.
4205         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
4206         (__pthread_cond_timedwait): Likewise.
4207         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
4208         (FUTEX_CMP_REQUEUE): Define.
4209         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4210         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4211         Pass __futex value from before the unlock and __futex address instead
4212         of address of low 32-bits of __wakeup_seq to futex syscall.
4213         Fallback to FUTEX_WAKE all on any errors.
4214         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
4215         Define.
4216         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4217         internally.  Return non-zero if error, zero if success.
4218         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4219         Add __data.__futex field, reshuffle __data.__clock.
4220         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
4221         Define.
4222         (lll_futex_requeue): Add val argument, return 1 unconditionally
4223         for the time being.
4224         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4225         Add __data.__futex field, reshuffle __data.__clock.
4226         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4227         Define.
4228         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4229         internally.  Return non-zero if error, zero if success.
4230         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4231         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
4232         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4233         Define.
4234         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4235         internally.  Return non-zero if error, zero if success.
4236         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4237         Add __data.__futex field, reshuffle __data.__clock.
4238         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
4239         Define.
4240         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4241         internally.  Return non-zero if error, zero if success.
4242         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4243         Add __data.__futex field, reshuffle __data.__clock.
4244         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4245         Add __data.__futex field, reshuffle __data.__clock.
4246         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
4247         Increment __futex at the same time as __wakeup_seq or __total_seq.
4248         Pass address of __futex instead of address of low 32-bits of
4249         __wakeup_seq to futex syscall.
4250         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4251         Pass __futex value from before releasing internal lock
4252         to FUTEX_WAIT.
4253         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4254         Likewise.  Avoid unnecessary shadowing of variables.
4255         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
4256         Set __futex to 2 * __total_seq.  Pass __futex value from before the
4257         unlock and __futex address instead of address of low 32-bits of
4258         __wakeup_seq to futex_requeue macro, adjust for new return value
4259         meaning.
4260         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
4261         (__pthread_cond_signal): Increment __futex at the same time as
4262         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4263         address of low 32-bits of __wakeup_seq to futex syscall.
4264         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
4265         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4266         releasing internal lock to FUTEX_WAIT.
4267         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4268         (__pthread_cond_timedwait): Likewise.
4269         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4270         (FUTEX_CMP_REQUEUE): Define.
4271         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4272         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4273         Pass __futex value from before the unlock and __futex address instead
4274         of address of low 32-bits of __wakeup_seq to futex syscall.
4275         Fallback to FUTEX_WAKE all on any errors.
4277 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4279         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
4280         Add nop to align the end of critical section.
4281         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
4283 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4285         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4286         Add __broadcast_seq field.
4287         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
4288         all waiters as woken with woken_seq and bump broadcast counter.
4289         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
4290         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
4291         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4292         Comment typo fixes.  Avoid returning -ETIMEDOUT.
4294 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
4296         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4297         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
4298         Reported by Kaz Kojima.
4300 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
4302         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
4304 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4306         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
4307         __broadcast_seq with bc_seq after acquiring internal lock instead of
4308         before it.
4310 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
4312         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
4313         compilation.
4314         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4315         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
4316         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4317         (pthread_cond_t): Add __data.__broadcast_seq field.
4318         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4319         (FRAME_SIZE): Define.
4320         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
4321         Comment typo fixes.
4322         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
4323         Define.
4324         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
4325         typo fixes.
4326         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4327         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
4328         fixes.
4330 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
4332         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
4333         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4334         Add __broadcast_seq field.
4335         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4336         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4337         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4338         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4339         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4340         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
4341         all waiters as woken with woken_seq and bump broadcast counter.
4342         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
4343         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
4344         __broadcast_seq field.
4345         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4346         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4347         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
4348         * pthread_cond_init.c: Initialize __broadcast_seq field.
4349         * Makefile (tests): Add tst-cond17 and tst-cond18.
4350         Add .NOTPARALLEL goal.
4351         * tst-cond16.c: New file.  From Jakub.
4352         * tst-cond17.c: New file.  From Jakub.
4353         * tst-cond18.c: New file.  From Jakub.
4355 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
4357         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
4358         unwind info.
4360         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4361         Parametrize frame size.  Correct some unwind info.
4362         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4364 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4366         * tst-stack3.c: Note testing functionality beyond POSIX.
4368 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4370         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
4371         Change conditional from ifdef to if.
4373 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
4375         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
4376         SYSDEP_CANCEL_ERROR): Define.
4377         (PSEUDO): Use it.
4379 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
4381         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
4383 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
4385         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
4387 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4389         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
4390         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4391         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
4392         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4394 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
4396         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
4397         thread has all signals blocked.
4399 2004-04-18  Andreas Jaeger  <aj@suse.de>
4401         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
4402         (SEM_VALUE_MAX): Add missing brace.
4404 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4406         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
4407         in rt subdir.
4408         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
4409         * sysdeps/pthread/tst-mqueue8x.c: New test.
4410         * tst-cancel4.c: Update comment about message queues.
4412         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
4413         return it_value { 0, 0 }.
4414         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
4415         like SIGEV_SIGNAL.
4416         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
4417         assertion for SIGEV_NONE.
4418         (thread_attr_compare): Compare all attributes, not just a partial
4419         subset.
4421 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4423         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
4425 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
4427         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
4428         Just use a plain number.
4429         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
4430         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
4431         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
4432         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
4433         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
4434         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
4435         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4437 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4439         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
4440         frame info.
4441         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4443 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
4445         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
4446         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
4447         of calling sigwaitinfo.
4449 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
4451         * allocatestack.c (allocate_stack): Set reported_guardsize
4452         unconditionally.
4453         * pthread_getattr_np.c (pthread_getattr_np): Use
4454         reported_guardsize instead of guardsize.
4455         * descr.h (struct pthread): Add reported_guardsize field.
4457 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
4459         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
4461 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
4463         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
4465 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
4467         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
4468         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
4469         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
4470         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
4471         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
4472         Define.
4473         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
4474         (_POSIX_MESSAGE_PASSING): Define.
4475         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
4476         (_POSIX_MESSAGE_PASSING): Define.
4477         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
4478         (_POSIX_MESSAGE_PASSING): Define.
4480 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
4482         * tst-context1.c (fct): Check whether correct stack is used.
4484 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
4486         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
4487         matching constraints for asm mem parameters.
4489         * tst-clock2.c (tf): Don't define unless needed.
4491 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
4493         * Makefile (link-libc-static): Use $(static-gnulib) instead of
4494         $(gnulib).
4496 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
4498         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
4499         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
4500         * pthreadP.h: Declare __nptl_deallocate_tsd.
4501         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
4502         Adjust caller.
4504         * Makefile (tests): Add tst-tsd5.
4505         * tst-tsd5.c: New file.
4507 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
4509         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4510         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
4511         is SHLIB_COMPAT check.
4512         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
4513         (__pthread_attr_getaffinity_old): Likewise.
4514         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4515         (__pthread_getaffinity_old): Likewise.
4516         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4517         (__pthread_setaffinity_old): Likewise.
4519 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
4521         * allocatestack.c (_make_stacks_executable): Call
4522         _dl_make_stack_executable first.
4524 2004-03-24  Roland McGrath  <roland@redhat.com>
4526         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
4527         constraint instead of "0".
4529 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
4531         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4532         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
4534         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
4535         code to avoid warning.
4537 2004-03-24  Andreas Jaeger  <aj@suse.de>
4539         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4540         (__pthread_attr_setaffinity_old): Remove const.
4542 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
4544         * sysdeps/unix/sysv/linux/smp.h: New file.
4545         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
4546         * init.c: Define __is_smp.
4547         (__pthread_initialize_minimal_internal): Call is_smp_system to
4548         initialize __is_smp.
4549         * pthreadP.h: Declare __is_smp.
4550         Define MAX_ADAPTIVE_COUNT is necessary.
4551         * pthread_mutex_init.c: Add comment regarding __spins field.
4552         * pthread_mutex_lock.c: Implement adaptive mutex type.
4553         * pthread_mutex_timedlock.c: Likewise.
4554         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
4555         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
4556         Add __spins field.
4557         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4558         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4559         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4560         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4561         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4562         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4563         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4564         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
4565         lll_mutex_cond_trylock.
4566         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4567         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4568         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4569         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4570         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4571         Define BUSY_WAIT_NOP.
4572         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4573         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4575         * tst-mutex5.c: Add support for testing adaptive mutexes.
4576         * tst-mutex7.c: Likewise.
4577         * tst-mutex5a.c: New file.
4578         * tst-mutex7a.c: New file.
4579         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
4581         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4582         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
4583         vgettimeofday call might destroy the content.
4585         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
4586         @pause in the loop.
4588         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4589         No need to restrict type of ret.  Make it int.  Add comment.
4591         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4592         Remove unnecessary setne instruction.
4594 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
4596         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4597         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
4598         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
4599         If realloc fails, break out of the loop.
4601 2004-03-20  Andreas Jaeger  <aj@suse.de>
4603         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4604         (__pthread_setaffinity_old): Fix interface.
4605         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4606         (__pthread_getaffinity_old): Likewise.
4608         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4609         (__pthread_setaffinity_new): Remove duplicate declaration.
4611 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4613         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
4614         the return value to a safe register.
4615         (CDISABLE): Set the function argument correctly.
4617 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4619         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
4620         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
4621         Rewrite so that only one locked memory operation per round is needed.
4622         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
4623         (pthread_barrier_wait): After wakeup, release lock only when the
4624         last thread stopped using the barrier object.
4625         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4626         (__pthread_cond_wait): Don't store mutex address if the current
4627         value is ~0l.  Add correct cleanup support and unwind info.
4628         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4629         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4630         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
4631         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
4632         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4633         Add correct cleanup support and unwind info.
4634         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
4635         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
4636         information for syscall wrappers.
4638 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
4640         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
4641         cpusetsize field, remove next.
4642         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
4643         parameter for size of the CPU set.
4644         (pthread_setaffinity_np): Likewise.
4645         (pthread_attr_getaffinity_np): Likewise.
4646         (pthread_attr_setaffinity_np): Likewise.
4647         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
4648         interface change, keep compatibility code.
4649         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
4650         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
4651         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
4652         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
4653         __pthread_getaffinity_np.
4654         * Versions: Add version for changed interfaces.
4655         * tst-attr3.c: Adjust test for interface change.
4656         * pthread_getattr_np.c: Query the kernel about the affinity mask with
4657         increasing buffer sizes.
4658         * pthread_attr_destroy.c: Remove unused list handling.
4659         * pthread_attr_init.c: Likewise.
4661 2004-03-17  Roland McGrath  <roland@redhat.com>
4663         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
4664         first argument to clock_getres so we ever enable kernel timers.
4666 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
4668         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
4670 2004-03-12  Richard Henderson  <rth@redhat.com>
4672         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
4673         oldvalue from CENABLE to CDISABLE.
4675 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
4677         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
4678         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
4679         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
4680         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
4682 2004-03-11  Richard Henderson  <rth@redhat.com>
4684         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
4685         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
4686         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
4688 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4690         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
4691         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
4692         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
4694 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4696         * forward.c (__pthread_cond_broadcast_2_0,
4697         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
4698         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
4699         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
4701 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4703         * sysdeps/sh/tcb-offsets.sym: Add PID.
4704         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
4705         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
4707 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
4709         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
4710         include <sysdep-cancel.h>, vfork is no cancellation point.
4711         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
4712         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
4713         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
4715 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
4717         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
4718         libc_hidden_def.
4719         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
4720         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
4721         Likewise.
4722         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
4723         Likewise.
4724         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
4725         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
4726         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
4727         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
4728         of DO_CALL_VIA_BREAK.  Work around a gas problem.
4730         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
4731         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
4732         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
4733         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
4734         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
4735         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
4737         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
4738         a local register for saving old PID.  Negate PID in parent upon exit.
4740         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
4741         tcb-offsets.h.
4742         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
4743         before syscall, set to the old value in the parent afterwards.
4744         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
4745         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
4746         tcb-offsets.h.
4747         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
4748         before syscall, set to the old value in the parent afterwards.
4749         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
4750         * sysdeps/s390/tcb-offsets.sym: Add PID.
4752         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
4753         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
4754         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
4755         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
4756         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
4757         * sysdeps/sparc/tcb-offsets.sym: Add PID.
4759 2004-03-10  Andreas Schwab  <schwab@suse.de>
4761         * sysdeps/ia64/tcb-offsets.sym: Add PID.
4762         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
4763         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
4765 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
4767         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
4768         * tst-cancel21.c (do_one_test): Likewise.
4769         Reported by Gordon Jin <gordon.jin@intel.com>.
4771 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
4773         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
4774         if non-zero and set to INT_MIN if zero.
4775         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
4776         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
4777         (SAVE_PID, RESTORE_PID): Define.
4778         (__vfork): Use it.
4779         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
4780         Use relative path to avoid including NPTL i386/vfork.S.
4781         (SAVE_PID, RESTORE_PID): Define.
4782         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
4783         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
4784         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
4785         tst-vfork2x.
4786         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
4787         * tst-vfork1.c: New test.
4788         * tst-vfork2.c: New test.
4789         * tst-vfork1x.c: New test.
4790         * tst-vfork2x.c: New test.
4792 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
4794         * sysdeps/i386/tcb-offsets.sym: Add PID.
4795         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4796         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
4797         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
4799 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
4801         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
4803 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
4805         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
4806         _rtld_global_ro.
4808 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
4810         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
4811         _rtld_global_ro.
4813         * tst-once4.c: Remove unnecessary macro definition.
4815         * tst-mutex7.c (do_test): Limit thread stack size.
4816         * tst-once2.c (do_test): Likewise.
4817         * tst-tls3.c (do_test): Likewise.
4818         * tst-tls1.c (do_test): Likewise.
4819         * tst-signal3.c (do_test): Likewise.
4820         * tst-kill6.c (do_test): Likewise.
4821         * tst-key4.c (do_test): Likewise.
4822         * tst-join4.c (do_test): Likewise.
4823         * tst-fork1.c (do_test): Likewise.
4824         * tst-context1.c (do_test): Likewise.
4825         * tst-cond2.c (do_test): Likewise.
4826         * tst-cond10.c (do_test): Likewise.
4827         * tst-clock2.c (do_test): Likewise.
4828         * tst-cancel10.c (do_test): Likewise.
4829         * tst-basic2.c (do_test): Likewise.
4830         * tst-barrier4.c (do_test): Likewise.
4832 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
4834         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
4836 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
4838         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4839         (__pthread_cond_timedwait): Optimize wakeup test.
4840         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
4841         (__pthread_cond_wait): Likewise.
4842         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4843         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4844         Likewise.
4846 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
4848         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4849         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
4850         the atomic instruction needed.
4851         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4852         (__lll_mutex_lock_wait): Likewise.
4854 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
4856         * Makefile (tests): Add tst-cond14 and tst-cond15.
4857         * tst-cond14.c: New file.
4858         * tst-cond15.c: New file.
4860 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
4862         * sysdeps/pthread/createthread.c (create_thread): Remove use of
4863         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
4864         needs to be implemented differently to be useful.
4866 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
4868         * pthread_attr_setschedparam.c: Don't test priority against limits
4869         here.  Set ATTR_FLAG_SCHED_SET flag.
4870         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
4871         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
4872         from parent thread to child.  If attribute is used and scheduling
4873         parameters are not inherited, copy parameters from attribute or
4874         compute them.  Check priority value.
4875         * pthread_getschedparam.c: If the parameters aren't known yet get
4876         them from the kernel.
4877         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
4878         ATTR_FLAG_POLICY_SET flag for thread.
4879         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
4880         and ATTR_FLAG_POLICY_SET.
4882         * sysdeps/pthread/createthread.c: Use tgkill if possible.
4884         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
4885         fail if stack address hasn't been set.  Just return 0.
4887 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
4889         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
4890         libpthread for the files in this list.
4891         (CFLAGS-tst-unload): Removed.
4892         * tst-unload.c (do_test): Don't use complete path for
4893         LIBPHREAD_SO.
4895         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
4896         tst-_res1mod2.
4898 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
4900         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4901         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
4902         operation per round is needed.
4903         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4904         (__lll_mutex_lock_wait): Likewise.
4906 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
4908         * tst-cancel9.c (cleanup): Don't print to stderr.
4910 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4912         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
4914 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
4916         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
4917         (__syscall_error_handler2): Call CDISABLE.
4918         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
4919         (__syscall_error_handler2): Call CDISABLE.
4921         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4922         Release lock before the loop, don't reacquire it.
4924         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
4926 2004-02-19  Andreas Schwab  <schwab@suse.de>
4928         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4929         Fix last change.
4931 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
4933         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
4934         (pthread_barrier_wait): After wakeup, release lock only when the
4935         last thread stopped using the barrier object.
4936         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
4937         (pthread_barrier_wait): Likewise.
4938         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4939         Likewise.
4940         * Makefile (tests): Add tst-barrier4.
4941         * tst-barrier4.c: New file.
4943         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4944         (__pthread_cond_timedwait): Perform timeout test while holding
4945         internal lock to prevent wakeup race.
4946         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
4947         * sysdeps/pthread/pthread_cond_timedwait.c
4948         (__pthread_cond_timedwait): Likewise.
4949         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4950         (__pthread_cond_timedwait): Likewise.
4952 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
4954         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
4955         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
4956         * Makefile (tests): Add tst-rwlock13.
4957         * tst-rwlock13.c: New test.
4959 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
4961         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4962         (__condvar_tw_cleanup): Little optimization.
4963         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
4965 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
4967         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
4968         libpthread as "lib" parameter to SHLIB_COMPAT.
4969         (__novmx_siglongjmp): Fix typo in function name.
4970         (__novmx_longjmp): Fix typo in function name.
4972 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
4974         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
4975         __builtin_expect.
4977         * sysdeps/generic/pt-longjmp.c: Moved to...
4978         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
4980 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
4982         * Makefile (libpthread-routines): Add pt-cleanup.
4983         * pt-longjmp.c: Removed.
4984         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
4985         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
4986         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
4987         Version longjmp, siglongjmp for GLIBC_2.3.4.
4988         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
4990 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
4992         * sysdeps/pthread/pthread_cond_timedwait.c
4993         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
4994         Reuse code.  Add __builtin_expects.
4996         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4997         (__pthread_cond_timedwait): Get internal lock in case timeout has
4998         passed before the futex syscall.
4999         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5001 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
5003         * allocatestack.c: Pretty printing.
5005         * sysdeps/pthread/createthread.c (create_thread): Don't add
5006         CLONE_DETACHED bit if it is not necessary.
5008 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
5010         * pthread_getattr_np.c: Include ldsodefs.h.
5012 2004-01-16  Richard Henderson  <rth@redhat.com>
5014         * allocatestack.c: Don't declare __libc_stack_end.
5015         * init.c (__pthread_initialize_minimal_internal): Likewise.
5016         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
5018 2004-01-15  Richard Henderson  <rth@redhat.com>
5020         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
5021         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
5022         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
5023         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
5024         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
5025         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
5026         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
5027         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
5029 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
5031         * init.c (pthread_functions): Make array const.
5033 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
5035         * allocatestack.c (__make_stacks_executable): Change interface.
5036         Check parameters.  Pass parameter on to libc counterpart.
5037         * pthreadP.h: Change declaration.
5039 2004-01-13  Richard Henderson  <rth@redhat.com>
5041         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
5042         prototype form.
5043         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
5044         Likewise.
5046         * sysdeps/alpha/Makefile: New file.
5047         * sysdeps/alpha/tcb-offsets.sym: New file.
5048         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
5049         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
5051         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
5052         on powerpc version.
5054 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
5056         * Makefile (tests): Add tst-backtrace1.
5057         * tst-backtrace1.c: New test.
5059 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
5061         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
5062         register as second parameter to the REGISTER macro.
5063         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
5064         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
5065         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
5066         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
5067         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
5068         of thread register as second parameter to REGISTER macro in 64 case.
5070 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
5072         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
5073         (CFLAGS-getpid.o): Defined.
5074         (CFLAGS-getpid.os): Defined.
5076 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
5078         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
5079         returned for main thread does not overlap with any other VMA.
5080         Patch by Jakub Jelinek.
5082 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
5084         * tst-raise1.c: Include stdio.h.
5086 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
5088         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
5089         setting with __ASSUME_TGKILL || defined __NR_tgkill.
5090         If pid is 0, set it to selftid.
5091         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
5092         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
5093         != 0, return self->tid without doing a syscall.
5094         * descr.h (struct pthread): Move pid field after tid.
5096         * Makefile (tests): Add tst-raise1.
5097         * tst-raise1.c: New file.
5099 2003-12-23  Roland McGrath  <roland@redhat.com>
5101         * tst-oddstacklimit.c: New file.
5102         * Makefile (tests): Add it.
5103         (tst-oddstacklimit-ENV): New variable.
5105         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
5106         value up to page size for __default_stacksize.
5108 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
5110         * Makefile (tests): Add tst-eintr5.
5111         * tst-eintr5.c: New file.
5113         * eintr.c (eintr_source): Prevent sending signal to self.
5115         * tst-eintr2.c (tf1): Improve error message.
5117 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
5119         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
5120         * sysdeps/unix/sysv/linux/getpid.c: New file.
5121         * pthread_cancel.c: Add comment explaining use of PID field.
5122         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
5123         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
5124         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
5125         temporarily to signal the field must not be relied on and updated
5126         by getpid().
5127         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
5128         temporarily negative.
5129         * sysdeps/unix/sysv/linux/raise.c: Likewise.
5131 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
5133         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
5134         (eintr_source): If ARG != NULL, use pthread_kill.
5135         * tst-eintr1.c: Adjust for this change.
5136         * tst-eintr2.c: Likewise.
5137         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
5138         * tst-eintr3.c: New file.
5139         * tst-eintr4.c: New file.
5141 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
5143         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
5144         if CANCELSTATE_BITMASK is set.
5145         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
5146         Likewise.
5148         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
5149         (tests-reverse): Add tst-cancel23.
5150         * tst-cancel22.c: New test.
5151         * tst-cancel23.c: New test.
5153 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
5155         * tst-eintr1.c: Better error messages.
5157         * Makefile (tests): Add tst-eintr2.
5158         * tst-eintr2.c: New file.
5160 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
5162         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
5163         (CFLAGS-tst-cancelx21.c): Set.
5164         * tst-cancel21.c: New test.
5165         * tst-cancelx21.c: New test.
5167         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
5168         comparison operand.
5169         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
5170         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
5171         * pt-longjmp.c: Include jmpbuf-unwind.h.
5172         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
5173         _JMPBUF_UNWINDS.  Adjust compared pointers.
5174         * init.c (__pthread_initialize_minimal_internal): Initialize
5175         pd->stackblock_size.
5176         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
5177         * sysdeps/alpha/jmpbuf-unwind.h: New file.
5178         * sysdeps/i386/jmpbuf-unwind.h: New file.
5179         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
5180         * sysdeps/s390/jmpbuf-unwind.h: New file.
5181         * sysdeps/sh/jmpbuf-unwind.h: New file.
5182         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
5183         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
5184         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
5185         (_JMPBUF_CFA_UNWINDS): Remove.
5186         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
5188 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
5190         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
5191         (CFLAGS-tst-cancelx20.c): Set.
5192         * tst-cancel20.c: New test.
5193         * tst-cancelx20.c: New test.
5195 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
5197         * init.c (__pthread_initialize_minimal_internal): Don't treat
5198         architectures with separate register stack special here when
5199         computing default stack size.
5201 2003-12-17  Roland McGrath  <roland@redhat.com>
5203         * Makefile (tst-cancelx7-ARGS): New variable.
5204         Reportd by Greg Schafer <gschafer@zip.com.au>.
5206 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
5208         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
5209         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
5210         (tst-stack3-ENV): Set.
5211         ($(objpfx)tst-stack3-mem): New.
5212         * tst-stack3.c: New test.
5214 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
5216         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
5217         Add unwind directives.  Drop unused .regstk directive.
5218         (_fini_EPILOG_BEGINS): Add unwind directives.
5220 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
5222         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
5223         Assume parameter is a pointer.
5224         (lll_futex_wake): Likewise.
5225         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
5226         Likewise.
5227         (lll_futex_wake): Likewise.
5228         Reported by Boris Hu.
5229         * sysdeps/unix/sysv/linux/unregister-atfork.c
5230         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
5232         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
5234 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
5236         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
5237         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
5238         __rtld_lock_initialize for ld.so lock.
5239         Patch in part by Adam Li <adam.li@intel.com>.
5241 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
5243         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
5244         in $(gnulib).  Also, remove stale comment.
5246 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
5248         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
5249         advantage of new syscall stub and optimize accordingly.
5251         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
5252         from SYS_futex, to match expectations of
5253         sysdep.h:DO_INLINE_SYSCALL.
5254         (lll_futex_clobbers): Remove.
5255         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
5256         (lll_futex_wake): Likewise.
5257         (lll_futex_requeue): Likewise.
5258         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
5259         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
5260         Jelinek).
5261         (__lll_mutex_lock): Likewise.
5262         (__lll_mutex_cond_lock): Likewise.
5263         (__lll_mutex_timed_lock): Likewise.
5264         (__lll_mutex_unlock): Likewise.
5265         (__lll_mutex_unlock_force): Likewise.
5267         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
5268         comes before the include of <sysdep.h>.
5269         (THREAD_SELF_SYSINFO): New macro.
5270         (THREAD_SYSINFO): Likewise.
5271         (INIT_SYSINFO): New macro.
5272         (TLS_INIT_TP): Call INIT_SYSINFO.
5274         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
5276         * sysdeps/pthread/createthread.c (create_thread): Use
5277         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
5278         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
5279         THREAD_SELF_SYSINFO instead of open code.
5280         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
5281         (THREAD_SYSINFO): Likewise.
5283         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
5285         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
5287 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
5289         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
5290         instead of .init.  Patch by David Mosberger.
5292 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
5294         * sysdeps/pthread/configure.in: Remove broken declaration in C
5295         cleanup handling check.
5297 2003-11-30  Andreas Jaeger  <aj@suse.de>
5299         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
5300         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
5301         Likewise.
5303 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
5305         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
5306         * pthread_attr_destroy.c: Include shlib-compat.h.
5307         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
5308         is set in iattr->flags.
5309         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
5311 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
5313         * Makefile (distribute): Add tst-cleanup4aux.c.
5315         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
5316         include.
5318 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
5320         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
5321         pthread_cond_signal.
5323         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
5324         store mutex address if the current value is ~0l.
5325         * sysdeps/pthread/pthread_cond_timedwait.c
5326         (__pthread_cond_timedwait): Likewise.
5327         * sysdeps/pthread/pthread_cond_broadcast.c
5328         (__pthread_cond_broadcast): Don't use requeue for pshared
5329         condvars.
5331         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5332         (__pthread_cond_wait): Don't store mutex address if the current
5333         value is ~0l.
5334         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5335         (__pthread_cond_timedwait): Likewise.
5336         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5337         (__pthread_cond_broadcast): Don't use requeue for pshared
5338         condvars.
5340         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
5341         element with ~0l for pshared condvars, with NULL otherwise.
5343         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5344         (__pthread_cond_wait): Don't store mutex address if the current
5345         value is ~0l.
5346         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5347         (__pthread_cond_timedwait): Likewise.
5348         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
5349         (__pthread_cond_broadcast): Don't use requeue for pshared
5350         condvars.
5352         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
5353         * tst-cond12.c: New file.
5354         * tst-cond13.c: New file.
5356 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
5358         * sysdeps/pthread/configure.in: Make missing forced unwind support
5359         fatal.
5361 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
5363         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
5365 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
5367         * Makefile: Add magic to clean up correctly.
5369 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
5371         * unwind.c (FRAME_LEFT): Define.
5372         (unwind_stop): Handle old style cleanups here.
5373         (__pthread_unwind): Handle old style cleanups only if
5374         !HAVE_FORCED_UNWIND.
5375         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
5376         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
5377         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
5378         ($(objpfx)tst-cleanupx4): Likewise.
5379         * tst-cleanup4.c: New test.
5380         * tst-cleanup4aux.c: New.
5381         * tst-cleanupx4.c: New test.
5383 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
5385         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
5386         lll_mutex_*lock macros to skip atomic operations on some archs.
5388 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
5390         * sysdeps/pthread/tst-timer.c (main): Initialize
5391         sigev2.sigev_value as well.
5393 2003-10-15  Roland McGrath  <roland@redhat.com>
5395         * sysdeps/pthread/configure.in: Barf if visibility attribute support
5396         is missing.
5397         * sysdeps/pthread/configure: Regenerated.
5399 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5401         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
5402         locking macros.  No distinction between normal and mutex locking
5403         anymore.
5404         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
5405         Merge bits from lowlevelmutex.S we still need.
5406         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
5407         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
5408         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
5409         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
5410         new mutex implementation.
5411         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
5412         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
5413         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5414         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
5415         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
5416         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
5417         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
5418         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
5419         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5420         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
5421         symbol for entry point to avoid cancellation.
5423 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
5425         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
5426         changes.
5427         (SAVE_OLDTYPE_0): Fix a typo.
5429 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
5431         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
5432         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
5434 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5436         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
5437         correct offset.
5439 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
5441         * Makefile (tests): Add tst-cancel19.
5442         * tst-cancel19.c: New test.
5444 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5446         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
5447         restoring of the old cancellation type.
5449 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
5451         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
5453 2003-09-27  Wolfram Gloger  <wg@malloc.de>
5455         * sysdeps/pthread/malloc-machine.h: New file
5457 2003-09-24  Roland McGrath  <roland@redhat.com>
5459         * allocatestack.c (__make_stacks_executable): Don't ignore return
5460         value from _dl_make_stack_executable.
5462 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
5464         * allocatestack.c (__make_stacks_executable): Also change
5465         permission of the currently unused stacks.
5467         * allocatestack.c (change_stack_perm): Split out from
5468         __make_stacks_executable.
5469         (allocate_stack): If the required permission changed between the time
5470         we started preparing the stack and queueing it, change the permission.
5471         (__make_stacks_executable): Call change_stack_perm.
5473         * Makefile: Build tst-execstack-mod locally.
5474         * tst-execstack-mod.c: New file.
5476 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
5478         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
5480 2003-09-23  Roland McGrath  <roland@redhat.com>
5482         * tst-execstack.c: New file.
5483         * Makefile (tests): Add it.
5484         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
5485         (LDFLAGS-tst-execstack): New variable.
5487         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
5488         whether to use PROT_EXEC for stack mmap.
5489         (__make_stacks_executable): New function.
5490         * pthreadP.h: Declare it.
5491         * init.c (__pthread_initialize_minimal_internal): Set
5492         GL(dl_make_stack_executable_hook) to that.
5494 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5496         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
5497         recommendation from AMD re avoidance of lock prefix.
5499 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
5501         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
5502         lll_futex_timed_wait instead of lll_futex_wait.
5503         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
5504         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
5505         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
5506         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
5507         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
5508         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
5509         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
5510         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
5511         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
5512         Completely revamp the locking macros.  No distinction between
5513         normal and mutex locking anymore.
5514         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
5515         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
5516         __lll_lock_timedwait): Fix prototypes.
5517         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
5518         __lll_lock_timedwait): Likewise.
5519         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
5520         macros, add __builtin_expect.
5521         (lll_mutex_timedlock): Likewise.  Fix return value.
5522         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
5523         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
5524         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
5525         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
5526         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
5527         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
5528         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
5529         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
5531 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5533         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5534         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
5535         operation if possible.
5537         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
5538         like jumping over the lock prefix.
5540 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
5542         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
5543         locking macros.  No distinction between normal and mutex locking
5544         anymore.
5545         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
5546         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
5547         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
5548         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
5549         locking.  Merge bits from lowlevelmutex.S we still need.
5550         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
5551         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
5552         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
5553         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
5554         * Makefile (routines): Remove libc-lowlevelmutex.
5555         (libpthread-rountines): Remove lowlevelmutex.
5556         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
5557         for new mutex implementation.
5558         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5559         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5560         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5561         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5562         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5563         Likewise.
5564         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5565         Likewise.
5566         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
5567         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5568         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
5569         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
5570         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5571         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5572         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
5573         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
5574         Likewise.
5575         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
5576         Likewise.
5577         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
5578         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
5579         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5580         Don't use requeue.
5581         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
5582         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
5584 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
5586         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
5587         in parameters of asm with output parameters.
5589         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
5590         type of DECR parameter to int.
5591         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
5593 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
5595         * tst-attr3.c (tf, do_test): Print stack start/end/size and
5596         guardsize for each thread.
5598 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5600         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
5601         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5602         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
5604         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
5605         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
5606         NULL.
5607         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
5608         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
5609         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5610         (pthread_getaffinity_np): Add hidden_def.
5612         * Makefile (tests): Add tst-attr3.
5613         * tst-attr3.c: New test.
5615         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
5617 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5619         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
5620         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
5622 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5624         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
5625         * tst-align.c: Include tst-stack-align.h.
5626         (tf, do_test): Use TEST_STACK_ALIGN macro.
5628 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
5630         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
5631         variable.
5633 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
5635         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
5636         stack-related values for the initial thread.
5638 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5640         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
5642 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
5644         * pthread_mutex_lock.c: Minor code rearrangements.
5646 2003-09-05  Roland McGrath  <roland@redhat.com>
5648         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
5649         Instead, include ../nptl_db/db_info.c to do its magic.
5650         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
5651         (__pthread_pthread_key_2ndlevel_size): Likewise.
5652         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
5653         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
5654         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
5655         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
5656         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
5657         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
5658         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
5659         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
5660         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
5661         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
5662         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
5663         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
5664         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
5665         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
5666         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
5667         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
5668         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
5670 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
5672         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
5673         of pthread_t to be compatible with LT.
5674         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5675         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5676         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5677         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5678         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
5679         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5680         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5682 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
5684         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
5686 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
5688         * unwind-forcedunwind.c: Move to...
5689         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
5690         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
5691         * sysdeps/pthread/jmpbuf-unwind.h: New file.
5692         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
5693         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
5694         * unwind.c: Include jmpbuf-unwind.h.
5695         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
5697 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
5699         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
5700         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
5701         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
5702         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
5703         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
5704         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
5705         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
5706         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
5707         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
5708         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
5709         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
5710         function.
5711         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
5712         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
5713         * Makefile (tests): Add tst-stack2.
5714         * tst-stack2.c: New test.
5715         * tst-stack1.c: Include limits.h and sys/param.h.
5716         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
5718         * pthread_condattr_setpshared.c: Include errno.h.
5719         (pthread_condattr_setpshared): Return EINVAL if pshared
5720         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
5722         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
5723         defined symbol for entry point to avoid cancellation.
5724         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
5725         Likewise.
5726         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
5727         Likewise.
5728         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
5729         Likewise.
5730         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
5731         Likewise.
5732         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
5733         Likewise.
5734         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
5735         __close_nocancel, __read_nocancel, __write_nocancel,
5736         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
5737         libpthread.so or librt.so, define to corresponding function
5738         without _nocancel suffix.
5739         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
5740         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
5741         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
5743         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
5745 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
5747         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
5748         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
5750         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
5751         in subsections has a symbol associated with it.
5753         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
5754         defined symbol for entry point to avoid cancellation.
5755         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
5757 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
5759         * Makefile (tests): Add tst-tls5.
5760         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
5761         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
5762         ($(objpfx)tst-tls5): New.
5763         ($(objpfx)tst-tls6.out): Likewise.
5764         (tests): Depend on $(objpfx)tst-tls6.out.
5765         * tst-tls3.c: Include stdint.h and pthreaddef.h.
5766         (do_test): Check pthread_self () return value alignment.
5767         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
5768         (tf): Check pthread_self () return value alignment.
5769         * tst-tls5.c: New test.
5770         * tst-tls5.h: New.
5771         * tst-tls5mod.c: New.
5772         * tst-tls5moda.c: New.
5773         * tst-tls5modb.c: New.
5774         * tst-tls5modc.c: New.
5775         * tst-tls5modd.c: New.
5776         * tst-tls5mode.c: New.
5777         * tst-tls5modf.c: New.
5778         * tst-tls6.sh: New test.
5780         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
5781         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
5782         * init.c (pthread_functions): Initialize them.
5783         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
5784         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
5785         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
5786         pthread_cond_timedwait@@GLIBC_2.3.2.
5788 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
5790         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
5791         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
5792         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
5793         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
5794         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
5795         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
5797         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
5799         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
5800         _POSIX_THREAD_PRIORITY_SCHEDULING.
5801         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
5803 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
5805         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
5806         nested function, use static inline function from libio.h.
5807         Code by Richard Henderson.
5809         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
5810         weak.
5812 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
5814         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
5815         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
5816         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
5817         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
5818         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
5819         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
5820         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
5821         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
5822         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
5823         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
5824         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
5825         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
5826         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
5827         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
5828         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
5829         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
5830         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
5831         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
5832         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
5833         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
5834         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
5835         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
5836         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
5837         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
5838         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
5839         * sysdeps/sparc/tls.h: New file.
5840         * sysdeps/sparc/tcb-offsets.sym: New file.
5841         * sysdeps/sparc/Makefile: New file.
5842         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
5843         * init.c [__sparc__] (__NR_set_tid_address): Define.
5845 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
5847         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
5848         _IO_release_lock): Define.
5850 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
5852         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
5853         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
5855 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
5857         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
5858         (__pthread_cleanup_class): Add missing return types of member
5859         functions.
5861 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
5863         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
5864         (lll_mutex_unlock_force): Add memory barrier between store and futex
5865         syscall.
5867 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
5869         * tst-cancel4.c (do_test): Also unlink tempfname and remove
5870         tempmsg in first loop.
5872 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
5874         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
5875         _POSIX_THREAD_PRIORITY_SCHEDULING.
5876         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
5878 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
5880         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
5881         (__rtld_lock_default_lock_recursive,
5882         __rtld_lock_default_unlock_recursive): Define.
5883         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
5884         __rtld_lock_unlock_recursive): Define using
5885         GL(_dl_rtld_*lock_recursive).
5886         * init.c (__pthread_initialize_minimal_internal): Initialize
5887         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
5888         Lock GL(_dl_load_lock) the same number of times as
5889         GL(_dl_load_lock) using non-mt implementation was nested.
5891         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
5892         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
5894 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
5896         * tst-cancel17.c (do_test): Make len2 maximum of page size and
5897         PIPE_BUF.
5899 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
5901         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
5903 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
5905         * sysdeps/pthread/createthread.c (do_clone): Move error handling
5906         to first syscall error check.  Move syscall error check for tkill
5907         into __ASSUME_CLONE_STOPPED #ifdef.
5909 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
5911         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
5912         is not defined, do explicit synchronization.
5913         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
5914         is not defined also unlock pd->lock for non-debugging case in case
5915         it is necessary.
5916         * pthread_create.c (start_thread): Always get and release pd->lock
5917         if __ASSUME_CLONE_STOPPED is not defined.
5918         (start_thread_debug): Removed.  Adjust users.
5919         * allocatestack.c (allocate_stack): Always initialize lock if
5920         __ASSUME_CLONE_STOPPED is not defined.
5921         * Makefile (tests): Add tst-sched1.
5922         * tst-sched1.c: New file.
5924         * sysdeps/pthread/createthread.c (do_clone): Only use
5925         sched_setschduler and pass correct parameters.
5927 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
5929         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
5930         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
5931         PTHREAD_STACK_MIN in comments.
5933 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
5935         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
5936         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
5937         argument.
5938         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
5939         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
5940         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
5941         (__pthread_cleanup_upto): Fix prototype.
5942         (_longjmp_unwind): Adjust caller.
5943         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
5944         Change second argument to const struct pointer.
5945         * tst-sem8.c (main): Remove unused s2 and s3 variables.
5946         * tst-sem9.c (main): Likewise.
5947         * unwind.c: Include string.h for strlen prototype.
5949 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
5951         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5952         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
5953         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
5954         Define HAVE_CMOV.
5955         Patch by Nicholas Miell <nmiell@attbi.com>.
5957 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
5959         * init.c (__pthread_initialize_minimal_internal): Initialize
5960         GL(dl_init_static_tls).
5961         * pthreadP.h (__pthread_init_static_tls): New prototype.
5962         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
5963         New functions.
5964         * Makefile (tests): Add tst-tls4.
5965         (modules-names): Add tst-tls4moda and tst-tls4modb.
5966         ($(objpfx)tst-tls4): Link against libdl and libpthread.
5967         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
5968         tst-tls4modb.so.
5969         * tst-tls4.c: New file.
5970         * tst-tls4moda.c: New file.
5971         * tst-tls4modb.c: New file.
5973 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
5975         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
5976         before __timer_dealloc.
5977         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
5978         Don't call list_unlink.
5980 2003-07-29  Roland McGrath  <roland@redhat.com>
5982         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
5984 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
5986         * tst-cancel17.c (do_test): Check if aio_cancel failed.
5987         Don't reuse struct aiocb A if it failed.
5988         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
5989         not just one byte, as that does not block.
5991 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
5993         * sysdeps/pthread/unwind-resume.c: New file.
5994         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
5995         unwind-resume in csu subdir.
5996         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
5997         exceptions.
5998         (librt-sysdep_routines, librt-shared-only-routines): Add
5999         rt-unwind-resume.
6000         * sysdeps/pthread/rt-unwind-resume.c: New file.
6001         * unwind-forcedunwind.c: New file.
6002         * Makefile (libpthread-routines): Add unwind-forcedunwind.
6003         (libpthread-shared-only-routines): Likewise.
6004         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
6005         * pthreadP.h (pthread_cancel_init): New prototype.
6006         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
6008         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
6009         attr argument const struct pthread_attr *.
6011         * res.c (__res_state): Return __resp.
6012         * descr.h: Include resolv.h.
6013         (struct pthread): Add res field.
6014         * pthread_create.c: Include resolv.h.
6015         (start_thread): Initialize __resp.
6016         * Makefile (tests): Add tst-_res1.
6017         (module-names): Add tst-_res1mod1, tst-_res1mod2.
6018         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
6019         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
6020         libpthread.
6021         * tst-_res1.c: New file.
6022         * tst-_res1mod1.c: New file.
6023         * tst-_res1mod2.c: New file.
6025 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
6027         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
6029         * Makefile: Define various *-no-z-defs variables for test DSOs
6030         which has undefined symbols.
6032 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
6034         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
6035         Retry if the stwcx fails to store once_control.
6037 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
6039         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
6040         pthread_attr_setaffinity.
6041         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
6042         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
6043         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
6044         * pthread_attr_destroy.c: Free cpuset element if allocated.
6045         * pthread_create.c: Pass iattr as additional parameter to
6046         create_thread.
6047         * sysdeps/pthread/createthread.c: If attribute is provided and
6048         a new thread is created with affinity set or scheduling parameters,
6049         start thread with CLONE_STOPPED.
6050         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
6051         pthread_attr_setaffinity.
6052         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
6053         cpuset element.
6055 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
6057         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
6059 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
6061         * sysdeps/pthread/configure.in: Require CFI directives also for
6062         ppc and s390.
6064 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
6066         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
6067         Add cfi directives.
6069 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6071         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
6072         CLEANUP_JMP_BUF.
6073         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
6074         registers as variables.  Call __pthread_mutex_unlock_usercnt.
6075         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6076         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
6077         not self pointer in __writer.  Compare with TID to determine
6078         deadlocks.
6079         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6080         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
6081         Likewise.
6082         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
6083         Likewise.
6084         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
6085         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
6086         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
6087         macros also when compiling librt.
6089 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
6091         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
6092         -fasynchronous-unwind-tables.
6093         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
6094         (PSEUDO): Add cfi directives.
6095         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
6096         Likewise.
6097         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
6098         Likewise.
6100 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
6102         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
6103         __pthread_unregister_cancel): Add prototypes and hidden_proto.
6104         * unwind.c (__pthread_unwind_next): Add hidden_def.
6105         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
6106         Likewise.
6107         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
6108         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
6109         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
6110         Likewise.
6111         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
6112         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
6113         Likewise.
6114         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
6115         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
6116         __pthread_unregister_cancel and __pthread_unwind_next.
6118 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
6120         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
6121         different symbol for the cancellation syscall wrapper and
6122         non-cancellation syscall wrapper.
6123         (PSEUDO_END): Define.
6125 2003-07-05  Richard Henderson  <rth@redhat.com>
6127         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
6128         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
6129         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6130         return actual return value from the syscall, not 0.
6132 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
6134         * descr.h (struct pthread): Add pid field.
6135         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
6136         (__reclaim_stacks): Likewise.
6137         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
6138         also check for PID of the signal source.
6139         (__pthread_initialize_minimal_internal): Also initialize pid field
6140         of initial thread's descriptor.
6141         * pthread_cancel.c: Use tgkill instead of tkill if possible.
6142         * sysdeps/unix/sysv/linux/fork.c: Likewise.
6143         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
6144         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
6145         * sysdeps/unix/sysv/linux/raise.c: Likewise.
6147 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
6149         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
6150         Fix use of parameter.
6151         (__libc_cleanup_pop): Likewise.
6153 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
6155         * init.c (sigcancel_handler): Change parameters to match handler
6156         for SA_SIGACTION.  Check signal number and code to recognize
6157         invalid invocations.
6159 2003-07-03  Roland McGrath  <roland@redhat.com>
6161         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
6162         Apply sizeof (struct pthread) bias to r13 value.
6164 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
6166         * sysdeps/pthread/configure.in: Require CFI directives.
6168         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
6169         definition.
6170         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
6171         libpthread compilation.
6172         * unwind.c (__pthread_unwind): Add hidden_def.
6173         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
6175 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6177         * libc-cancellation.c (__libc_cleanup_routine): Define.
6178         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
6179         (__pthread_cleanup_pop): Define.
6181 2003-07-01  Richard Henderson  <rth@redhat.com>
6183         * sysdeps/alpha/elf/pt-initfini.c: New file.
6184         * sysdeps/alpha/pthread_spin_lock.S: New file.
6185         * sysdeps/alpha/pthread_spin_trylock.S: New file.
6186         * sysdeps/alpha/pthreaddef.h: New file.
6187         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
6188         * sysdeps/alpha/tls.h: New file.
6189         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
6190         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
6191         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
6192         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
6193         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
6194         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
6195         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
6196         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
6197         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
6198         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
6200 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6202         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
6203         cleanup support and unwind info.
6205 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
6207         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
6208         Use correct cleanup handler registration.  Add unwind info.
6209         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
6210         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
6211         * tst-once3.c: Add cleanup handler and check it is called.
6212         * tst-once4.c: Likewise.
6213         * tst-oncex3.c: New file.
6214         * tst-oncex4.c: New file.
6215         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
6217 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
6219         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
6221 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
6223         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
6224         (tf_msgsnd): Likewise.
6226         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
6227         premature returns a bit more.
6229 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
6231         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
6232         definition to the front.
6234         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
6235         the cleanup functions to make the names unique.  Fix dwarf opcode
6236         un unwind table.
6237         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
6238         functions to make the names unique.  Fix CFA offset for two blocks.
6240 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
6242         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
6243         missing closing braces.
6244         Patch by Christophe Saout <christophe@saout.de>.
6246 2003-06-24  Roland McGrath  <roland@redhat.com>
6248         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
6250 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
6252         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
6253         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
6255         * pthreadP.h: Declare __find_thread_by_id.
6256         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
6257         * pthread_clock_gettime.c: Allow using other thread's clock.
6258         * pthread_clock_settime.c: Likewise.
6259         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
6260         * Makefile: Add rules to build and run tst-clock2.
6261         * tst-clock2.c: New file.
6263 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
6265         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
6266         to use exception-based cleanup handler.
6267         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6269         * tst-cond8.c (ch): Announce that we are done.
6271         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
6273         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
6274         Also test aio_suspend with timeout value.
6276 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
6278         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
6279         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
6280         attribute_hidden.
6282         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
6283         (__pthread_mutex_lock_internal): Likewise.
6284         (__pthread_mutex_unlock_internal): Likewise.
6285         (__pthread_mutex_unlock_usercnt): Declare.
6286         * pthread_mutex_destroy.c: Always fail if used in any way.
6287         * pthread_mutex_init.c: Update comment.
6288         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
6289         * pthread_mutex_timedlock.c: Adjust __nusers.
6290         * pthread_mutex_trylock.c: Adjust __nusers.
6291         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
6292         and public interfaces are wrapper with pass additional parameter.
6293         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
6294         parameter zero.
6295         * tst-mutex8.c: New file.
6296         * Makefile (tests): Add tst-mutex8.
6297         * sysdeps/pthread/pthread_cond_timedwait.c: Call
6298         __pthread_mutex_unlock_usercnt.
6299         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6300         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6301         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6302         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6303         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6304         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
6305         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6306         Add __nusers.
6307         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6308         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6309         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6310         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6311         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6313         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
6314         * pthread_mutex_timedlock.c: Likewise.
6315         * pthread_mutex_trylock.c: Adjust __nusers.
6316         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
6317         * tst-mutex9.c: New file.
6318         * Makefile (tests): Add tst-mutex9.
6319         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
6320         * sysdeps/ia64/tls.h: Likewise.
6321         * sysdeps/powerpc/tls.h: Likewise.
6322         * sysdeps/s390/tls.h: Likewise.
6323         * sysdeps/sh/tls.h: Likewise.
6324         * sysdeps/x86_64/tls.h: Likewise.
6325         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6326         Change type of __owner.
6327         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6328         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6329         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6330         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6331         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6333 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
6335         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
6336         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
6338         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
6339         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
6340         instead of nr to lll_futex_wake.  Only set errno and return -1
6341         if err < 0.
6343         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
6344         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6345         return actual return value from the syscall, not 0.
6347 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
6349         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
6350         find a random value.
6351         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
6352         errno==EIDRM.
6354         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
6355         compat_timer_settime.
6356         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
6357         compat_timer_gettime.
6358         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
6359         compat_timer_getoverrun.
6360         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
6361         compat_timer_delete.
6363         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
6364         error-checking mutex detect busy mutexes.
6366 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6368         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
6369         Add ax to clobber list.
6370         (lll_mutex_cond_lock): Likewise.
6371         (lll_mutex_unlock): Likewise.
6372         (lll_lock): Likewise.
6373         (lll_unlock): Likewise.
6375         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
6376         * tst-cancel18.c: New file.
6377         * tst-cancelx18.c: New file.
6379         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
6380         and tcdrain.
6382         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
6383         * tst-cancel17.c: New file.
6384         * tst-cancelx17.c: New file.
6386         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
6387         * sysdeps/unix/sysv/linux/sigwait.c: New file.
6388         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
6390         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
6392 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
6394         * sysdeps/pthread/createthread.c (create_thread): Set
6395         header.multiple_threads unconditionally.
6396         * allocatestack.c (allocate_stack): Likewise.
6397         * descr.h (struct pthread): Add header.multiple_threads
6398         unconditionally.
6399         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
6400         Define for librt.  #error if neither libpthread, libc nor librt.
6401         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
6402         Likewise.
6403         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
6404         CDISABLE): Likewise.
6405         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
6406         CDISABLE): Likewise.
6407         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
6408         CDISABLE): Likewise.
6409         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
6410         CDISABLE): Likewise.  Access header.multiple_threads outside of
6411         libc and libpthread.
6412         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
6413         Likewise.
6414         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
6415         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
6417 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6419         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
6420         Also test early cancellation before the thread reaches the cancellation
6421         point.
6423         * Makefile: Compile forward.c with exceptions.
6425         * sysdeps/unix/sysv/linux/sleep.c: New file.
6427 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
6429         * Makefile: Add CFLAGS definition to compile function wrappers
6430         duplicated from libc with exceptions.
6431         * tst-cancel4.c: Also check cancellation handlers.
6433         * Makefile: Add rules to build and run tst-cancel16 and
6434         tst-cancelx16.  Add missing CFLAGS definitions.
6435         * tst-cancel16.c: New file.
6436         * tst-cancelx16.c: New file.
6438 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
6440         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6441         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
6442         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
6443         (DL_SYSINFO_IMPLEMENTATION): Likewise.
6445         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
6446         (LIBC_CANCEL_RESET): Likewise.
6447         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
6448         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
6449         librt-cancellation.
6450         (CFLAGS-libcrt-cancellation.c): Define.
6451         * sysdeps/pthread/librt-cancellation.c: New file.
6452         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
6453         macros also when compiling librt.
6454         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
6455         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
6456         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
6457         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
6458         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
6459         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
6460         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
6462         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
6463         compat_timer_create.
6465 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
6467         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
6469         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
6470         __register_atfork.
6471         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
6472         Add libc_hidden_def.
6474 2003-06-13  Roland McGrath  <roland@redhat.com>
6476         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
6477         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
6479 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
6481         * allocatestack.c (queue_stack): Always inline.
6482         * ptreadhP.h (__do_cancel): Likewise.
6484 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
6486         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
6487         a typo.
6489 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
6491         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6492         (__pthread_cond_signal): Remove incorrect second addition for
6493         cond_lock!=0.
6495 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
6497         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6498         (__pthread_cond_signal): Use correct futex pointer in
6499         __lll_mutex_lock_wait call.
6501         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6502         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
6504 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
6506         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
6507         cancelable.
6508         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6509         Likewise.
6511         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
6512         hand-written CFI generation code.  Since ENTRY/END also initiated
6513         CFI frames this caused two CFI sets to be generated.
6515 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
6517         * cleanup_routine.c: New file.
6518         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
6519         * sysdeps/pthread/pthread.h: Add support for fully exception-based
6520         cleanup handling.
6521         * Makefile (libpthread-routines): Add cleanup_routine.
6522         Add more CFLAGS variables to compile with exceptions.  Add comments
6523         why which file needs unwind tables.
6524         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
6525         tests.
6526         * tst-cancelx1.c: New file.
6527         * tst-cancelx2.c: New file.
6528         * tst-cancelx3.c: New file.
6529         * tst-cancelx4.c: New file.
6530         * tst-cancelx5.c: New file.
6531         * tst-cancelx6.c: New file.
6532         * tst-cancelx7.c: New file.
6533         * tst-cancelx8.c: New file.
6534         * tst-cancelx9.c: New file.
6535         * tst-cancelx10.c: New file.
6536         * tst-cancelx11.c: New file.
6537         * tst-cancelx12.c: New file.
6538         * tst-cancelx13.c: New file.
6539         * tst-cancelx14.c: New file.
6540         * tst-cancelx15.c: New file.
6541         * tst-cleanupx0.c: New file.
6542         * tst-cleanupx0.expect: New file.
6543         * tst-cleanupx1.c: New file.
6544         * tst-cleanupx2.c: New file.
6545         * tst-cleanupx3.c: New file.
6547         * tst-cleanup0.c: Make standard compliant.
6548         * tst-cleanup1.c: Likewise.
6550         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
6551         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
6552         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
6553         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
6554         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
6555         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
6556         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
6557         CLEANUP_JMP_BUF.
6558         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6559         * tst-cancel12.c: New file.
6560         * tst-cancel13.c: New file.
6561         * tst-cancel14.c: New file.
6562         * tst-cancel15.c: New file.
6563         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
6564         and tst-cancel15.
6566         * tst-cancel1.c: Add some comments.
6568         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
6569         timeout correctly.
6571 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
6573         * Makefile (CFLAGS-pthread_cancel.c): Define.
6575 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
6577         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
6578         Change type of __writer element to int.
6579         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6580         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6581         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6582         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6583         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6584         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
6585         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6586         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
6587         Compare with TID to determine deadlocks.
6588         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
6589         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6590         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
6591         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6592         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6593         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6594         Likewise.
6595         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6596         Likewise.
6597         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6598         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
6599         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
6600         Likewise.
6601         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
6602         Likewise.
6603         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
6604         * Makefile (tests): Add tst-rwlock12.
6605         * tst-rwlock12.c: New file.
6607 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
6609         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
6610         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
6611         Remove bogus hidden_proto.
6612         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
6613         Likewise.
6614         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
6615         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
6616         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
6617         ___lll_mutex_timedlock): Likewise.
6619 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
6621         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6622         (__pthread_cond_signal): Add some code to eventually handle
6623         cond_lock!=0.
6625 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
6627         * Makefile (tests): Add tst-exec4.
6628         (tst-exec4-ARGS): Define.
6629         * tst-exec4.c: New file.
6631 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
6633         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
6634         Also fail if tv_nsec < 0.
6635         (__lll_timedwait_tid): Likewise.
6636         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
6637         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
6638         Likewise.
6639         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
6640         Likewise.
6641         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
6642         Likewise.
6643         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6644         Likewise.
6645         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
6646         Likewise.
6647         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
6648         Likewise.
6650         * Makefile (tests): Add tst-sem8 and tst-sem9.
6651         * tst-sem8.c: New file.
6652         * tst-sem9.c: New file.
6653         * sem_open.c: Fix creation of in_use record if the file exists but
6654         no internal record.
6656         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
6657         definitions.
6659         * sysdeps/pthread/timer_create.c (timer_create): In case
6660         evp==NULL, assign timer ID to sival_ptr.
6662         * descr.h (struct pthread_unwind_buf): Change type of prev element to
6663         struct pthread_unwind_buf *.
6664         (struct pthread): Likewise for cleanup_jmp_buf element.
6666         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
6667         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
6668         * unwind.c (__pthread_unwind_next): Likewise.
6670 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
6672         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6673         (lll_futex_timed_wait): Use int for futex value parameter.
6674         (lll_futex_wake): Likewise.
6675         (lll_futex_requeue): Likewise.
6677         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
6678         Replace one memory operation with one register operation.
6680         * tst-join4.c (do_test): Fix error message.
6682         * tst-rwlock6.c (do_test): Use correct format specifier.
6684         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
6685         (__lll_mutex_lock_wait): Replace one memory operation with one
6686         register operation.
6687         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
6688         (__lll_mutex_lock_wait): Likewise.
6690         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6691         (__lll_mutex_cond_lock): Add one to value parameter of
6692         __lll_lock_wait to reflect reality in the futex syscall.
6693         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6694         (lll_mutex_cond_lock): Likewise.
6696 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
6698         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
6699         New function.
6700         (lll_mutex_cond_lock): Define.
6702 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
6704         * Makefile (tests): Add tst-signal6.
6705         * tst-signal6.c: New file.
6707         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
6708         (__lll_mutex_unlock_force): New function
6709         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
6711         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6712         (__lll_mutex_unlock_force): New function.
6713         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
6715         * tst-rwlock7.c (do_test): Use correct format specifier.
6717         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
6718         Find break parameter in correct asm argument.
6720 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
6722         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
6723         Remove out4.
6724         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
6725         error occured.
6726         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
6727         Add __mutex.
6728         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
6729         lll_futex_requeue, lll_mutex_unlock_force): Define.
6731 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
6733         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6734         (pthread_cond_t): Add __mutex.
6735         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
6736         lll_futex_requeue, lll_mutex_unlock_force): Define.
6738 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6740         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
6741         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
6742         Add __mutex field.
6743         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
6744         Define.
6745         (lll_futex_wait, lll_futex_wake): Define.
6746         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
6747         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
6748         FUTEX_REQUEUE instead of FUTEX_WAIT.
6749         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
6750         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
6751         mutex which was used in condvar structure.  Call
6752         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
6753         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
6755         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
6756         include tcb-offsets.h.  Read wakeup value in locked region.
6757         Use the value of gbr register as THREAD_ID.
6758         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6759         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
6760         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
6762         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
6763         macros.
6765 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
6767         * sysdeps/pthread/pthread_cond_broadcast.c
6768         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
6770 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
6772         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
6773         typo in register name.
6774         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
6775         correctly.  Actually use requeue.  Little optimization.
6776         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
6777         mutex address early.  Handle cancellation state as 32-bit value.
6778         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6779         Remove unnecessary label.
6781 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
6783         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
6784         instead of FUTEX_WAIT.
6785         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
6786         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6787         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6788         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
6789         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
6790         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
6791         used in condvar structure.  Call __pthread_mutex_cond_lock instead
6792         of __pthread_mutex_lock_internal.
6793         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6794         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6795         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6796         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
6797         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6798         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6799         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
6800         Add pthread_mutex_cond_lock.
6801         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
6802         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
6803         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
6804         lll_mutex_cond_lock.
6805         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
6806         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6807         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
6808         Add __mutex field.
6809         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6810         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6812         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
6813         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6815         * pthreadP.h: Declare __pthread_mutex_cond_lock.
6816         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
6817         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
6818         macro don't define aliases.
6820         * cancellation.c: Remove __pthread_enable_asynccancel_2.
6821         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
6822         * sysdeps/pthread/pthread_cond_timedwait.c: Use
6823         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
6824         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6825         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6826         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6827         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6828         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6830 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
6832         * sem_open.c: Fix one endless loop.  Implement correct semantics
6833         wrt opening the same semaphore more then once.
6834         * sem_close.c: Adjust for sem_open change.
6835         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
6836         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
6837         * Makefile (tests): Add tst-sem7.
6838         * tst-sem7.c: New file.
6840 2003-05-16  Roland McGrath  <roland@redhat.com>
6842         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
6843         uninitialized variable braino.
6845 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
6847         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
6848         test for syscall availability.
6850         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
6851         __no_posix_timers to -1 if the syscalls don't exist.
6853         * pthread_join.c (pthread_join): Set tid field of the joined
6854         thread to -1.  This isn't necessary but helps to recognize some
6855         error conditions with almost no cost.
6857         * allocatestack.c (FREE_P): Also negative values indicate an
6858         unused stack.
6860         * unwind.c: Include <unistd.h>.
6862 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
6864         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
6866 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
6868         * Makefile (crti-objs, crtn-objs): New variables.
6869         (omit-deps, extra-objs): Add crtn.
6870         ($(objpfx)libpthread.so): Depend on both crti and crtn
6871         and links to them in multidir.
6872         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
6874 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
6876         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6877         (lll_mutex_unlock): Use atomic_exchange_rel.
6879 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
6881         * cond-perf.c (cons): Add missing locking around setting of alldone.
6883 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
6885         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
6886         related macros.
6887         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
6889 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
6891         * tst-sem6.c: New file.
6892         * Makefile (tests): Add tst-sem6.
6894         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
6895         Use atomic_exchange_rel instead of atomic_exchange.
6896         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
6897         Likewise.
6899         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
6900         code for lll_futex_wait and lll_futex_wake in static apps.  Use
6901         vsyscall is possible.
6903         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
6904         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
6905         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
6906         pthread_setaffinity_np.
6907         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
6908         and pthread_setaffinity_np.
6909         * Makefile (libpthread-routines): Add pthread_getaffinity and
6910         pthread_setaffinity.
6912         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
6913         use it in case mmap to allocate the stack fails.
6914         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
6915         ARCH_MAP_FLAGS here.
6916         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
6917         ARCH_RETRY_MMAP.
6919 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
6921         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
6922         handler implementation.  It is now lockless in fork().
6923         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
6924         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
6925         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
6926         declare the __fork_*_lists.
6927         (struct fork_handler): Include pointers to all three functions.
6928         Add next, refcntr and need_signal elements.
6929         (__fork_handlers): New declaration.
6930         (__register_atfork_malloc): Remove declaration.
6931         (HAVE_register_atfork_malloc): Remove definition.
6932         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
6933         __pthread_child_handler variable.
6934         (__libc_pthread_init): Use __register_atfork instead of explicitly
6935         adding to the list.
6936         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
6937         and lll_futex_wake.
6938         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6940         * unwind.c (unwind_cleanup): Print error message and then abort.  This
6941         function must never be reached.
6943         * cond-perf.c: New file.
6945 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
6947         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
6949 2003-05-04  Roland McGrath  <roland@redhat.com>
6951         * Makefile ($(objpfx)../libc.so): New target.
6953 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
6955         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6956         (pthread_condattr_t): Size is only an int, don't use long for
6957         alignment.
6958         (pthread_mutexattr_t): Likewise.
6959         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6960         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6961         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6963 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
6965         * sysdeps/i386/tls.h: Define THREAD_ID.
6966         * sysdeps/ia64/tls.h: Likewise.
6967         * sysdeps/powerpc/tls.h: Likewise.
6968         * sysdeps/s390/tls.h: Likewise.
6969         * sysdeps/sh/tls.h: Likewise.
6970         * sysdeps/x86_64/tls.h: Likewise.
6971         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
6972         record ownership.
6973         * pthread_mutex_timedlock.c: Likewise.
6974         * pthread_mutex_trylock.c: Likewise.
6975         * pthread_mutex_unlock.c: Likewise.
6976         * pthread_rwlock_trywrlock.c: Likewise.
6977         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
6978         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6979         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
6980         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6982         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
6983         flag.
6985 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
6987         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
6988         (__SIZEOF_PTHREAD_COND_T): Define to 48.
6989         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
6990         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
6991         Make __align long long instead of long.
6992         (pthread_rwlock_t): Formatting.
6993         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
6994         (pthread_rwlock_t): Formatting.
6995         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6996         (pthread_cond_t): Make __align long long instead of long.
6997         (pthread_rwlock_t): Move __flags field to the same position as in
6998         linuxthreads.
7000 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
7002         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
7003         * tst-rwlock7.c (do_test): Likewise.
7005 2003-04-26  Roland McGrath  <roland@redhat.com>
7007         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
7009 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
7011         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
7012         sizeof (struct pthread).
7013         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
7014         1 struct pthread.
7015         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
7016         to 0.
7017         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
7018         struct pthread.
7019         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
7020         to 32-bit bytes.
7021         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
7022         tcbp.
7023         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
7024         unneccessarily.
7025         (NO_TLS_OFFSET): Define.
7026         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
7027         add TLS_TCB_SIZE unnecessarily.
7029 2003-04-22  Roland McGrath  <roland@redhat.com>
7031         * Makeconfig (shared-thread-library): Reverse link order to work
7032         around linker bug.
7034 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
7036         * semaphore.h: Fix typo in comment.
7038 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
7040         * sysdeps/pthread/sigfillset.c: New file.
7042         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
7043         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
7044         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
7045         * sysdeps/pthread/sigaction.c: Likewise.
7046         * sysdeps/pthread/sigprocmask.c: New file.
7047         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
7048         __SIGRTMIN+1.
7049         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7050         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
7051         in this case.
7053 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
7055         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
7056         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
7058         * sysdeps/unix/sysv/linux/unregister-atfork.c
7059         (__unregister_atfork): Don't free memory not allocated dynamically.
7061         * semaphore.h: Remove __THROW marker from cancellation points.
7062         * nptl/sysdeps/pthread/pthread.h: Likewise.
7064 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
7066         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
7067         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
7068         __THROW.
7070 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
7072         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
7074 2003-04-15  Roland McGrath  <roland@redhat.com>
7076         * forward.c (__pthread_unwind): Tweak to avoid warning.
7078 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
7080         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
7082 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
7084         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
7085         overflow CFA advance instructions.
7086         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7088 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
7090         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
7091         * sysdeps/i386/pthread_spin_lock.c: Likewise.
7092         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
7093         defined.
7095         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
7096         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
7097         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
7098         DW_CFA_advance_loc for .Laddl-.Lsubl.
7100 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
7102         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
7103         position-independent unwind data for static libraries.
7104         Add missing unwind info.  Add comments.
7106         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
7107         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7108         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7109         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7111 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
7113         * Makefile: Make sure all cancellation points are compiled with
7114         exception and asynchronous unwind tables.
7116         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
7117         which mishandles loading of global object addresses in PIC.
7118         (THREAD_SETMEM_NC): Likewise.
7120 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7122         * pthread.h: Define new data structure for cleanup buffer.  Declare
7123         new cleanup handler interfaces.
7124         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
7125         (struct pthread): Add cleanup_jmp_buf pointer.  Define
7126         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
7127         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
7128         it.  Declare old cleanup handler installation functions.
7129         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
7130         handling.
7131         * cleanup_defer.c: Likewise.
7132         * cleanup_compat.c: New file.  Old cleanup code.
7133         * cleanup_def_compat.c: New file.  Old cleanup code.
7134         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
7135         if own thread descriptor.
7136         * unwind.c: New file.
7137         * forward.c: Add __pthread_unwind.
7138         * init.c (pthread_functions): Add __pthread_unwind.
7139         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
7140         Add ptr___pthread_unwind.
7141         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
7142         and unwind function.
7143         * Makefile (libpthread-routines): Add cleanup_compat,
7144         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
7145         table generation if necessary.
7146         * version.c: Record whether unwind support is compiled in.
7147         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
7148         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
7149         handler interfaces.
7150         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
7151         complication to generate unwind information for syscall wrappers.
7152         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
7153         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
7154         __cleanup_fct_attribute.
7156         * Makefile: Add rules to build and run tst-cleanup0.
7157         * tst-cleanup0.c: New file.
7158         * tst-cleanup0.expect: New file.
7160         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
7161         caller.  Optimize to avoid often unecessary local variable.
7163 2003-04-11  Roland McGrath  <roland@redhat.com>
7165         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
7166         sets variable `multidir'; include that.
7167         (generated): Add it.
7168         ($(objpfx)$(multidir)/crti.o): New target.
7169         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
7171 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7173         * tst-attr2.c (do_test): Add cast to avoid warning.
7174         * tst-mutex4.c (do_test): Likewise.
7176 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
7178         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
7179         in child.
7181 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
7183         * Makefile (tests): Add tst-detach1.
7184         * tst-detach1.c: New file.
7186 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
7188         * sysdeps/pthread/pthread.h: Remove duplicate
7189         pthread_cleanup_{push,pop} definitions.
7191         * tst-barrier2.c: Eliminate warnings.
7192         * tst-cancel4.c: Likewise.
7193         * tst-cond4.c: Likewise.
7194         * tst-cond6.c: Likewise.
7195         * tst-detach1.c: Likewise.
7196         * tst-rwlock4.c: Likewise.
7197         * tst-rwlock6.c: Likewise.
7198         * tst-rwlock7.c: Likewise.
7199         * tst-sem3.c: Likewise.
7200         * tst-spin2.c: Likewise.
7201         * tst-umask1.c: Likewise.
7203 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
7205         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
7207 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
7209         * descr.h (struct pthread): Move cancelhandling member to the front.
7211 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
7213         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
7214         malloc_parent, and malloc_child statically.
7215         (__register_atfork_malloc): New function.
7216         (free_mem): Don't free any of the malloc_* variables on the list.
7217         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
7218         Define HAVE_register_atfork_malloc.
7220 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
7222         * sysdeps/pthread/createthread.c (create_thread): Add some more
7223         comments explaining when to set multiple_threads and when not.
7225         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7226         THREAD_ATOMIC_BIT_SET if not already defined.
7227         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7228         THREAD_ATOMIC_BIT_SET:
7229         * sysdeps/x86_64/tls.h: Likewise.
7230         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
7231         THREAD_ATOMIC_CMPXCHG_VAL.
7232         (_pthread_cleanup_pop_restore): Likewise.
7233         * cancellation.c (__pthread_enable_asynccancel): Likewise.
7234         (__pthread_enable_asynccancel_2): Likewise.
7235         (__pthread_disable_asynccancel): Likewise.
7236         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7237         (__libc_disable_asynccancel): Likewise.
7238         * init.c (sigcancel_handler): Likewise.
7239         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
7240         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
7242 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
7244         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
7245         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7246         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
7247         * Makefile (tests): Add tst-cancel11.
7248         * tst-cancel11.c: New file.
7250 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
7252         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
7253         round, not the first.  Use specific_used flag instead of local
7254         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
7255         (__free_tcb): Don't call deallocate_tsd here.
7256         (start_thread): Call deallocate_tsd here.
7257         * pthread_setspecific.c: Set specific_used flag really only when
7258         needed.
7259         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
7260         * tst-tsd3.c: New file.
7261         * tst-tsd4.c: New file.
7263 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7265         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
7266         Use atomic_exchange_and_add instead of __lll_add.
7267         (__lll_mutex_timedlock): Likewise.
7268         Patch by Ian Wienand.
7270 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
7272         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7273         (SINGLE_THREAD_P): Fix typo.
7274         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
7276 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7278         * Makefile (tests): Add tst-align.
7279         * tst-align.c: New file.
7280         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
7282         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
7283         function correctly.
7285         * tst-tsd2.c: Add casts to avoid warnings.
7287 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
7289         * descr.h (struct pthread): Move most often used elements to the front.
7291 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
7293         * Makefile (libpthread-routines): Add pthread_atfork.
7294         (libpthread-static-only-routines): Add pthread_atfork.
7296 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7298         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
7299         of TLS_DTV_AT_TP.
7300         (INSTALL_DTV): Add parens.
7301         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
7302         Use passed descr instead of THREAD_SELF.
7303         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
7304         (__lll_mutex_timedlock_wait): Correct expected value after
7305         spurious wakeup.
7306         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
7307         Release lock before waking up the waiters.
7308         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
7309         criteria.  Reorderstruct passed to cleanup handler.  Fix
7310         handling of cancellation and failung pthread_mutex_unlock call.
7311         Use __pthread_enable_asynccancel_2 instead of
7312         __pthread_enable_asynccancel.
7313         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7314         Return result of lock re-get if it fails.
7315         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
7316         for __pthread_cleanup_push.
7317         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
7318         completely broken rwlock implementation.
7319         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7320         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7321         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7322         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
7323         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7324         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
7325         versioned_symbol macro.
7326         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
7327         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
7329 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
7331         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
7332         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
7333         and __helper_tid.
7334         (struct timer): Remove th and bar field.
7335         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
7336         debugging code.  Create only one helper thread.
7337         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
7338         helper thread.
7339         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7340         Renamed.  Define statically.  Use thread info from siginfo.
7341         (__helper_once): New variable.
7342         (__helper_tid): New variable.
7343         (__reset_helper_control): New function.
7344         (__start_helper_thread): New function.
7346         * pthread_create.c (start_thread): Don't use setjmp inside
7347         __builtin_expect to work around gcc bug.
7349         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
7350         timer_delete syscall fails, but not with ENOSYS, set
7351         __no_posix_timers.
7353         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
7354         (timer_settime): Fix typo.
7355         * sysdeps/unix/sysv/linux/timer_getoverr.c
7356         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
7358 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
7360         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
7361         offset of cleanupbuf.__prev.
7363 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
7365         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
7366         of included file.
7368 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
7370         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
7371         NULL provide default definition to syscall.
7373 2003-03-25  Roland McGrath  <roland@redhat.com>
7375         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
7376         (timer_id2ptr): Fix typo.
7378 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
7380         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
7381         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
7382         * sysdeps/ia64/pthreaddef.h: Likewise.
7383         * sysdeps/powerpc/pthreaddef.h: Likewise.
7384         * sysdeps/s390/pthreaddef.h: Likewise.
7385         * sysdeps/sh/pthreaddef.h: Likewise.
7386         * sysdeps/x86_64/pthreaddef.h: Likewise.
7387         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
7388         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
7389         being changed.
7390         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
7391         SIGTIMER is not unblocked.
7392         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
7393         RT signal taken.
7394         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
7395         be send.
7396         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
7397         pass pointer through as ID.
7398         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
7399         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
7400         * sysdeps/unix/sysv/linux/timer_create.c: New file.
7401         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
7402         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
7403         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
7404         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
7405         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
7406         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
7407         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
7408         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
7409         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
7410         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
7411         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
7412         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
7413         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
7414         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
7415         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
7416         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
7417         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
7418         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
7419         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
7420         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
7421         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
7422         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
7423         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
7424         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
7425         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
7426         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
7427         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
7428         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
7429         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
7430         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
7432         * pthreadP.h: Remove FRAME_LEFT definition.
7433         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
7434         already left frame.  Programs which have this problem are not POSIX
7435         compliant.
7436         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
7438 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
7440         * sysdeps/pthread/tst-timer.c: Check return values of the
7441         functions we test.
7443 2003-03-23  Roland McGrath  <roland@redhat.com>
7445         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
7446         * tst-tls3mod.c: Likewise.
7447         * tst-tls1.c: Likewise.
7448         * tst-tls2.c: Likewise.
7450         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
7451         undefined behavior.
7453         * tst-join5.c (tf1, tf2): Add a cast.
7455         * Makeconfig (includes): Append -I$(..)nptl to this variable.
7457         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
7458         Don't test anything.
7459         * tst-cond4.c: Likewise.
7460         * tst-cond6.c: Likewise.
7461         * tst-flock2.c: Likewise.
7462         * tst-mutex4.c: Likewise.
7463         * tst-rwlock4.c: Likewise.
7464         * tst-signal1.c: Likewise.
7465         * tst-spin2.c: Likewise.
7466         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
7468         * tst-mutex4.c: Use test-skeleton.c.
7469         * tst-spin2.c: Likewise.
7470         * tst-sysconf.c: Likewise.
7471         * tst-barrier2.c: Likewise.
7472         * tst-cond4.c: Likewise.
7473         * tst-cond6.c: Likewise.
7474         * tst-rwlock4.c: Likewise.
7475         * tst-unload.c: Likewise.
7476         * tst-flock2.c (do_test): Use return instead of exit.
7478 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
7480         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
7482 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
7484         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7485         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
7486         instead of __lll_compare_and_swap.
7487         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
7488         Likewise.
7489         Removed definition if __lll_compare_and_swap.
7491         * cancellation.c: Adjust for new form of compare&exchange macros.
7492         * cleanup_defer.c: Likewise.
7493         * init.c: Likewise.
7494         * libc-cancellation.c: Likewise.
7495         * old_pthread_cond_broadcast.c: Likewise.
7496         * old_pthread_cond_signal.c: Likewise.
7497         * old_pthread_cond_timedwait.c: Likewise.
7498         * old_pthread_cond_wait.c: Likewise.
7499         * pthread_cancel.c: Likewise.
7500         * pthread_create.c: Likewise.
7501         * pthread_detach.c: Likewise.
7502         * pthread_join.c: Likewise.
7503         * pthread_key_delete.c: Likewise.
7504         * pthread_setcancelstate.c: Likewise.
7505         * pthread_setcanceltype.c: Likewise.
7506         * pthread_timedjoin.c: Likewise.
7507         * pthread_tryjoin.c: Likewise.
7508         * sysdeps/pthread/createthread.c: Likewise.
7510 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
7512         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
7513         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
7514         definitions.  Replace uses with calls to atomic_* functions.
7515         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
7516         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
7517         __lll_test_and_set calls with atomic_exchange_and_add and
7518         atomic_exchange calls respectively.
7519         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
7520         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
7521         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
7522         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
7523         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
7524         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
7525         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
7527         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
7528         returns the old value.
7530 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
7532         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
7533         int for variable OLDVAL and correct inline assembler contraint.
7534         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
7535         type int for variable OLD.
7537         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
7538         only for s390-32.
7539         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7540         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
7541         instead of multiple_threads field in the TCB.
7543 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
7545         * sysdeps/i386/i686/bits/atomic.h: Removed.
7546         * sysdeps/i386/i586/bits/atomic.h: Removed.
7547         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
7548         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
7549         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
7550         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
7551         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
7552         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
7553         * atomic.h: Removed.  Moved to glibc.
7555         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
7556         support for clock selection.
7558         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
7559         signalling waiters.
7561 2003-03-18  Roland McGrath  <roland@redhat.com>
7563         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7564         Add __lll_rel_instr first.  Add memory clobber.
7565         (lll_mutex_unlock): Use __lll_test_and_set.
7566         From Paul Mackerras <paulus@samba.org>.
7568         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
7569         unconditionally.
7570         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7571         (SINGLE_THREAD_P):  Add `header.' prefix.
7572         From Paul Mackerras <paulus@samba.org>.
7574         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
7575         pthread_timedjoin_np to ...
7576         (libpthread: GLIBC_2.3.3): ... here.
7577         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
7579         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
7580         Avoid shadowing VAL variable.
7582         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7583         New macro.
7585 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
7587         * Makefile (tests): Add tst-cond11.
7588         * tst-cond11.c: New file.
7590         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
7591         struct passed to cleanup handler to eliminate one more
7592         instruction.
7593         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7595         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7596         (pthrad_cond_t): Replace __unused field with __clock.
7598         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
7599         waken all waiters in cleanup handler.
7600         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7601         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7603         * pthread_condattr_getclock.c: New file.
7604         * pthread_condattr_setclock.c: New file.
7605         * sysdeps/pthread/pthread.h: Declare these new functions.
7606         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
7607         * Makefile (libpthread-routines): Add the new functions.
7608         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
7609         Renamed field to value.  Document use of the bits.
7610         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
7611         change.
7612         * pthread_condattr_setpshared.c: Likewise.
7613         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
7614         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
7615         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
7616         Add __clock field.
7617         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7618         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7619         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7620         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7621         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
7622         Implement clock selection.
7623         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7624         * pthread-errnos.sym: Add ENOSYS.
7625         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
7626         _POSIX_CLOCK_SELECTION.
7627         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
7629         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
7630         invalid .size directive.
7632 2003-03-17  Roland McGrath  <roland@redhat.com>
7634         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
7635         Formatting tweaks.
7637 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7639         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
7640         Use __lll_add instead of spelling it out.  Use protected symbol names.
7641         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
7642         Use __lll_add.
7643         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
7644         Renamed from lll_compare_and_swap.  Use new name where necessary.
7645         (__lll_add): Defined.
7646         (__lll_dec_if_positive): Defined.
7647         (__lll_test_and_set): Defined.
7648         * sysdeps/ia64/pthread_spin_init.c: Removed.
7649         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
7650         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
7651         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
7652         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
7653         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
7654         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
7655         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
7656         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
7657         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
7658         __sync_lock_release_si.
7659         Patch by Jakub Jelinek.
7661         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
7662         Fix timeout handling.
7663         (__lll_timedwait_tid): Likewise.
7664         (lll_unlock_wake_cb): Wake up other waiters if necessary.
7665         Patch by Jakub Jelinek.
7667         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
7669 2003-03-17  Roland McGrath  <roland@redhat.com>
7671         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
7672         * sysdeps/pthread/pthread_spin_init.c: New file.
7673         * sysdeps/pthread/pthread_spin_unlock.c: New file.
7674         * sysdeps/powerpc/Makefile: New file.
7675         * sysdeps/powerpc/pthread_spin_lock.c: New file.
7676         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
7677         * sysdeps/powerpc/pthreaddef.h: New file.
7678         * sysdeps/powerpc/tcb-offsets.sym: New file.
7679         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
7680         * sysdeps/powerpc/tls.h: New file.
7681         * sysdeps/powerpc/bits/atomic.h: New file.
7682         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
7683         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
7684         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
7686         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
7687         * sysdeps/unix/sysv/linux/sem_post.c: New file.
7688         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
7689         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
7690         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
7691         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
7692         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
7693         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
7694         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
7695         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
7696         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
7697         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
7698         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
7699         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
7700         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
7702         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
7703         not gettimeofday.
7704         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
7705         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
7706         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
7707         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
7708         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
7710 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7712         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
7713         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7714         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7715         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7716         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
7718 2003-03-16  Roland McGrath  <roland@redhat.com>
7720         * tst-fork4.c: Include <string.h>.
7721         * tst-signal2.c: Likewise.
7722         * tst-mutex5.c (do_test): exit -> return.
7723         * tst-mutex2.c: Include <stdlib.h>.
7725 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
7727         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
7728         (__lll_mutex_timedlock_wait): Correct expected value after
7729         spurious wakeup.  Otherwise we would never wait again.
7731         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
7732         zone versus inline asm stupidity.  Use correct instructions.
7734         * tst-rwlock6.c: Add some more status output.
7736 2003-03-15  Roland McGrath  <roland@redhat.com>
7738         * sysdeps/pthread/configure.in: New file.
7739         * sysdeps/pthread/configure: New file (generated).
7741 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
7743         * allocatestack.c (allocate_stack): Store the exact stack size of
7744         user allocated stacks.
7746 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
7748         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
7749         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
7750         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
7751         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
7752         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
7753         Use `header.' prefix.
7754         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
7756 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
7758         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
7759         __builtin_frame_address, use stack pointer.
7761         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
7762         instead of __builtin_frame_pointer.
7764 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
7766         * tst-basic1.c (do_test): Add cast to avoid warning.
7767         * tst-basic2.c (do_test): Likewise.
7769         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
7770         amount of stack correction.
7772         * tst-fork4.c: Use test-skeleton.c.
7774 2003-03-14  Roland McGrath  <roland@redhat.com>
7776         * init.c: Fix typo "#eli" for "#else".
7778 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
7780         * allocatestack.c (__stack_user): Use hidden_data_def.
7781         * pthread_create.c (__pthread_keys): Likewise.
7783         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
7785 2003-03-14  Roland McGrath  <roland@redhat.com>
7787         * tst-fork4.c: New file.
7788         * Makefile (tests): Add it.
7790         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
7791         we always define the padding space.
7792         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
7793         stopped supporting its own extensions fully.
7794         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
7795         struct also called `header', so `header.multiple_threads' is the field
7796         name to use on all machines.
7797         * allocatestack.c (allocate_stack): Use `header.' prefix.
7798         * sysdeps/pthread/createthread.c (create_thread): Likewise.
7799         * pthread_create.c (__pthread_create_2_1): Likewise.
7800         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
7801         (THREAD_SELF): Likewise.
7802         * sysdeps/x86_64/tls.h: Likewise.
7803         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
7804         (SINGLE_THREAD_P): Likewise.
7805         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
7806         (SINGLE_THREAD_P): Likewise.
7807         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7808         (SINGLE_THREAD_P): Likewise.
7810         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
7811         value directly.
7813 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
7815         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
7816         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
7818         * pthread_create.c (start_thread): setjmp is expected to return 0.
7820         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
7821         (THREAD_GETMEM_NC): Likewise.
7823 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
7825         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
7826         and the size of the stack which must be allocated is a multiple,
7827         allocate one more page.
7828         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
7829         MULTI_PAGE_ALIASING.
7831 2003-03-13  Roland McGrath  <roland@redhat.com>
7833         * pthread_create.c (start_thread): Set EXITING_BIT after the
7834         event-reporting (and destructors), not before.
7836 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
7838         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
7839         lll_futex_wake): Declare register variables as long int instead of
7840         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
7841         Make syscall arguments clobbered by the syscall.
7842         (lll_futex_wait): Define using lll_futex_timed_wait.
7844         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
7845         to void *.
7847         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
7848         PPID if [! NDEBUG].
7850         * allocatestack.c (nptl_ncreated): Only declare if
7851         COLORING_INCREMENT != 0.
7853         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
7854         (__libc_enable_asynccancel_2): Remove prototype.
7856         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
7857         ctid to match kernel.
7859 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
7861         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
7862         libc_multiple_threads.
7863         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
7864         __libc_multiple_threads to...
7865         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
7867         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
7868         versioning.
7869         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7870         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7872         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
7873         (__pthread_once_internal): Define.
7875         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
7876         macros instead of .symver directly.
7877         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
7878         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
7880         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
7881         * sysdeps/x86_64/tcb-offsets.sym: New file.
7882         * sysdeps/x86_64/Makefile: New file.
7884         * sysdeps/i386/tcb-offsets.sym: Add SELF.
7885         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
7886         to access own pthread_t in TCB.
7887         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7888         Likewise.
7889         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7890         Likewise.
7891         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7893 2003-03-12  Roland McGrath  <roland@redhat.com>
7895         * pthread-errnos.sym: New file.
7896         * Makefile (gen-as-const-headers): New variable, list that file.
7897         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
7898         header <pthread-errnos.h> instead of defining errno values here.
7899         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
7900         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
7901         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
7902         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7903         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7904         Likewise.
7905         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7906         Likewise.
7907         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
7908         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7909         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
7910         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
7911         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7912         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7913         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7914         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
7915         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7916         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
7917         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
7918         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
7919         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
7920         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
7921         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
7922         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7923         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7924         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7925         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7926         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
7927         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
7928         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
7929         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
7930         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
7931         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
7932         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
7933         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
7935         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
7936         CLONE_CHILD_SETTID worked.
7938 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
7940         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
7941         file.
7942         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
7943         file.
7945         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7946         (pthread_cond_t): Add padding.
7948         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
7949         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
7950         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
7952         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
7953         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
7954         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
7955         (__pthread_rwlock_timedrdlock): Likewise.
7956         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
7957         (__pthread_rwlock_wrlock): Likewise.
7958         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
7959         (__pthread_rwlock_rdlock): Likewise.
7961         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
7963         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
7964         result of lock re-get if it fails.
7966 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
7968         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
7969         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7970         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
7971         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
7972         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7973         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
7974         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
7975         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7976         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7977         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7979         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
7980         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
7982         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
7983         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
7984         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
7985         (create_thread): Likewise.
7986         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
7987         * init.c (__pthread_initialize_minimal_internal): Initialize
7988         __libc_multiple_threads_ptr if necessary.
7989         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
7990         __pthread_multiple_threads and __libc_multiple_threads_ptr.
7991         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
7992         __libc_multiple_threads.
7993         (__libc_pthread_init): Return pointer to __libc_pthread_init if
7994         necessary.
7996         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
7997         (THREAD_SETMEM_NC): Likewise.
7999         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
8000         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
8001         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
8002         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
8004         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
8005         Eliminate one entire instruction.
8007         * cancellation.c (__pthread_enable_asynccancel_2): New function.
8008         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
8009         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
8010         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
8011         instead of __pthread_enable_asynccancel.
8012         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8013         (__pthread_cond_wait): Likewise.
8014         * sysdeps/pthread/pthread_cond_timedwait.c
8015         (__pthread_cond_timedwait): Likewise.
8016         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
8018         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8019         (__condvar_cleanup): Wake up all waiters in case we got signaled
8020         after being woken up but before disabling asynchronous
8021         cancellation.
8022         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8023         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
8024         (__condvar_cleanup): Likewise.
8026         * init.c (__NR_set_tid_address): If already defined, don't redefine.
8027         Make it an error if architecture has no #if case.  Add x86-64.
8029         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
8030         pt-initfini.s generation.
8032         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
8033         (TLS_INIT_TP): Fix typo.
8035 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8037         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
8038         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
8040         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
8041         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
8042         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
8043         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
8044         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
8045         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8046         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8047         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8049 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8051         * sysdeps/pthread/pthread_cond_timedwait.c
8052         (__pthread_cond_timedwait): Return the result of the final
8053         locking.  If it succeeds, the regular function return value.
8055         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
8056         Return result of the final locking.
8057         * version.c (__nptl_main): Work around problems with the strange
8058         INTERNAL_SYSCALL macro on ppc32.
8059         * init.c (__pthread_initialize_minimal_internal): Unblock
8060         SIGCANCEL in case the parent blocked it.
8061         Reported by Paul Mackerras <paulus@samba.org>.
8063         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
8064         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
8065         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
8067 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8069         * sysdeps/pthread/pthread_cond_timedwait.c
8070         (__pthread_cond_timedwait): Unlock and fail if
8071         __pthread_mutex_unlock_internal failed.
8073         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
8074         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
8075         Use ARCH_CLONE.
8076         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
8077         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
8078         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
8079         ALLOCATE_STACK): New macros.
8080         (TLS_TPADJ): New macro.
8081         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
8082         (allocate_stack): Handle TLS_DTV_AT_TP and
8083         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
8084         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
8085         Don't set PD->self.
8086         * init.c [__ia64__] (__NR_set_tid_address): Define.
8088         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
8089         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
8090         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
8091         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
8092         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
8093         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
8094         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
8095         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
8096         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
8097         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
8098         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
8099         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
8100         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
8101         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
8102         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
8103         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
8104         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
8105         * sysdeps/ia64/bits/atomic.h: New file.
8106         * sysdeps/ia64/Makefile: New file.
8107         * sysdeps/ia64/pthread_spin_init.c: New file.
8108         * sysdeps/ia64/pthread_spin_lock.c: New file.
8109         * sysdeps/ia64/pthread_spin_trylock.c: New file.
8110         * sysdeps/ia64/pthread_spin_unlock.c: New file.
8111         * sysdeps/ia64/pthreaddef.h: New file.
8112         * sysdeps/ia64/tcb-offsets.sym: New file.
8113         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
8114         * sysdeps/ia64/tls.h: New file.
8116         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
8117         to syscall instead of no arguments.
8119 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
8121         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
8122         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
8123         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
8124         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
8126         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
8127         unused code.
8129         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
8131         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8132         lowlevelbarrier.sym.
8133         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
8134         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
8135         Include lowlevelbarrier.h and don't define offsets locally.
8136         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
8138         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
8139         (__lll_mutex_lock_wait): Reverse order of first two parameters.
8140         (__lll_mutex_timedlock_wait): Likewise.
8141         (lll_mutex_lock): Adjust asm for that.
8142         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
8143         (lll_lock): Adjust asm for operand order change.
8144         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
8145         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
8147         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
8148         Reverse order of parameters.
8149         (__lll_timedwait_tid): Remove regparms attribute.
8150         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
8151         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
8153         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8154         (__lll_timedwait_tid): Remove one unnecessary instruction.
8156         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
8157         __lll_mutex_timedlock_wait only for NOT_IN_libc.
8158         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
8159         lowlevelmutex.S.
8161         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
8162         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
8163         for NOT_IN_libc.
8164         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
8165         lowlevellock.S.
8167         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
8168         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
8169         for libc.so.
8170         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
8171         define LOCK here (if UP is not defined).  The actual code is in
8172         lowlevelmutex.S.
8174         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
8175         LOCK is already defined.  Don't define lll_unlock_wake_cb and
8176         __lll_timedwait_tid for libc.so.
8177         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
8178         define LOCK here (if UP is not defined).  The actual code is in
8179         lowlevellock.S.
8181         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
8182         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
8183         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
8184         instead of lowlevelsem.h.
8185         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8186         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8187         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8189         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8190         lowlevelrwlock.sym.
8191         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
8192         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
8193         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
8195         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
8196         register loading.
8197         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
8198         last changed.  D'oh.
8200         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
8202         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
8203         of __libc_locking_needed.
8204         (lll_trylock): Initialize %eax to zero.
8206         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
8207         pthread_cond_t definition.
8209 2003-03-10  Roland McGrath  <roland@redhat.com>
8211         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
8212         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
8213         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
8214         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
8215         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
8217         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
8218         Instead of setting PD->multiple_threads, set globals
8219         __pthread_multiple_threads and __libc_multiple_threads.
8220         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8221         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
8222         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
8224         * descr.h (struct pthread): Conditionalize first member on
8225         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
8226         containing an anonymous tcbhead_t.  Move `list' member out.
8227         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
8228         * allocatestack.c: Remove use of `header.data.' prefix.
8229         * pthread_create.c: Likewise.
8230         * init.c (__pthread_initialize_minimal_internal): Likewise.
8231         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8232         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
8233         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
8234         * sysdeps/x86_64/tls.h: Likewise.
8235         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
8236         (SINGLE_THREAD_P): Likewise.
8237         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
8238         (SINGLE_THREAD_P): Likewise.
8239         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
8240         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
8242 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
8244         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
8246         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
8247         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8249         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
8250         leftovers from the ia32 code.
8252         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
8253         memory load.
8254         (clear_once_control): Don't load %esi.
8256         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
8257         handling.
8259         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8261         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
8262         * sysdeps/unix/sysv/linux/createthread.c: ...here.
8264         * Makefile (tests): Add tst-cond10.
8265         * tst-cond10.c: New file.
8267 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
8269         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
8270         * tst-signal3.c (do_test): Likewise.
8271         * tst-sem5.c (do_test): Likewise.
8272         * tst-kill6.c (do_test): Likewise.
8273         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
8275         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
8276         of inc/dec.
8277         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
8278         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
8279         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8280         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8281         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8282         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8283         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8284         Likewise.
8285         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8286         Likewise.
8287         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8288         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8289         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8290         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
8291         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
8292         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
8293         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8294         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8296         * allocatestack.c (allocate_stack): If mprotect() fails free the
8297         TLS memory.
8299 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
8301         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
8303         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
8304         lll_wake_tid.  This was used only to work around kernel limits in
8305         the early days.
8306         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
8307         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
8308         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8309         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
8311         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
8312         (__pthread_initialize_minimal_internal): Change initialization of
8313         __static_tls_align_m1 appropriately.
8314         * pthreadP.h (__static_tls_align_m1): Renamed from
8315         __static_tls_align.
8316         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
8317         instead of __static_tls_align-1.
8319 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
8321         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
8323         * pthread_create.c: Define __pthread_keys using nocommon
8324         attribute, not by placing it explicitly in bss.
8325         Remove DEFINE_DEALLOC definition.  Not needed anymore.
8327         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
8328         Use it in mmap call to allocate stacks.
8330         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
8332         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
8333         result of the thread function.
8335 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
8337         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
8338         version is just fine.
8340         * sysdeps/unix/sysv/linux/libc_pthread_init.c
8341         (__pthread_child_handler): Renamed from pthread_child_handler,
8342         exported, and marked hidden.  Change all users.
8343         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
8344         free __pthread_child_handler from child list.
8346 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8348         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
8350         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
8351         Fix handling of cancellation and failing pthread_mutex_unlock call.
8352         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8353         (__pthread_cond_wait): Likewise.
8355         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
8356         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
8357         lll_futex_timed_wait call.
8358         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
8359         (pthread_rwlock_timedwrlock): Likewise.
8361         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
8362         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
8363         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
8365         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
8366         check of lll_futex_wake return value.
8368 2003-03-03  Roland McGrath  <roland@redhat.com>
8370         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
8372         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8373         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
8374         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
8376 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
8378         * sysdeps/pthread/timer_create.c (timer_create): Return correct
8379         error for CPU clocks.
8381         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
8382         _POSIX_MONOTONIC_CLOCK.
8383         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
8385         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
8386         recent kernels.
8388 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8390         * descr.h (struct pthread): Move cleanup field to the front.
8392 2003-03-01  Roland McGrath  <roland@redhat.com>
8394         * sem_open.c (sem_open): Braino fix.
8396 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8398         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
8399         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
8400         __pthread_cleanup_pop functionality.
8401         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8403         * descr.h (struct pthread): Move tid field to the front now that
8404         it is often used.
8406         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
8407         (__lll_mutex_timedlock_wait): Remove.
8408         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8409         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
8410         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8411         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8412         (lll_unlock_wake_cb): Don't save and restore %esi.
8413         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8414         %esi.
8415         (__lll_timedwait_tid): Add alignment.
8416         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
8417         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8418         %esi.
8419         (__lll_timedwait_tid): Removed.
8420         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
8421         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
8422         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
8423         (pthread_barrier_wait): Don't save, load, and restore %esi for
8424         last thread.
8425         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
8426         (__pthread_cond_signal): Don't save, load, and restore %esi.
8427         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
8428         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
8429         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
8430         Don't save, load, and restore %esi.
8432 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
8434         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
8435         Release lock before waking up the waiters.
8437         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
8439         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
8440         (reader_thread): Likewise.
8442         * sysdeps/pthread/pthread_rwlock_unlock.c
8443         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
8444         to wake up readers if there are none.
8446         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
8447         Release internal lock before wake threads.
8449 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
8451         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
8452         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
8453         predefined.
8454         * tst-rwlock9.c: Likewise.
8455         * tst-rwlock10.c: New file.
8456         * tst-rwlock11.c: New file.
8458         * Makefile (tests): Add tst-dlsym1.
8459         * tst-dlsym1.c: New file.
8461         * init.c (__pthread_initialize_minimal_internal): Set
8462         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
8463         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
8465 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
8467         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
8469         * tst-cond2.c: Fix sychronization with child.
8471         * tst-rwlock8.c (reader_thread): Remove unused variable.
8473         * Makefile: Add rules to build and run tst-tls3.
8474         * tst-tls3.c: New file.
8475         * tst-tls3mod.c: New file.
8477         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
8478         * tst-rwlock8.c: New file.
8479         * tst-rwlock9.c: New file.
8480         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
8481         complete broken rwlock implementation.
8482         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8483         Likewise.
8484         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8485         Likewise.
8486         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8487         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8488         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
8489         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
8490         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
8491         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
8492         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
8494 2003-02-23  Roland McGrath  <roland@redhat.com>
8496         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
8498 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
8500         * Makefile (tests): Add tst-context1.
8501         * tst-context1.c: New file.
8503         * Makefile (tests): Add tst-tls1 and tst-tls2.
8504         * tst-tls1.c: New file.
8505         * tst-tls2.c: New file.
8507         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
8508         for failed cmpxchg.
8510         * pthread_create.c (start_thread): Set EXITING_BIT early.
8512         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
8513         (THREAD_GETMEM_NC): Likewise.
8515 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
8517         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
8518         off 3 more bytes by using offset-less instructions when possible.
8520         * Makefile: Add dependency for $(objpfx)version.d.
8522         * eintr.c (eintr_source): Add unnecessary return but the compiler
8523         insists.
8525         * tst-kill3.c: Include <unistd.h>.
8527 2003-02-21  Roland McGrath  <roland@redhat.com>
8529         * pthread_create.c (start_thread): Call __libc_thread_freeres.
8531 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8533         * Makefile (tests): Add tst-eintr1.
8534         (distribute): Add eintr.c.
8535         * tst-eintr1.c: New file.
8536         * eintr.c: New file.
8538         * pthread_cancel.c (pthread_cancel): Use tkill directly.
8540         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
8541         Disallow sending SIGCANCEL.
8543         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
8544         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
8545         * tst-kill1.c: New file.
8546         * tst-kill2.c: New file.
8547         * tst-kill3.c: New file.
8548         * tst-kill5.c: New file.
8549         * tst-kill6.c: New file.
8550         * tst-basic7.c: Renamed to...
8551         * tst-kill4.c: ...this.
8553 2003-02-21  Roland McGrath  <roland@redhat.com>
8555         * Makefile (install-lib-ldscripts): New variable.
8557 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8559         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
8560         * pthread_cancel.c: Use INVALID_TD_P.
8561         * pthread_detach.c: Likewise.
8562         * pthread_getschedparam.c: Likewise.
8563         * pthread_setschedparam.c: Likewise.
8564         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
8565         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
8566         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
8567         * pthread_timedjoin.c: Likewise.
8569         * tst-basic7.c: Include <signal.h>.
8571         * pthread_join.c (pthread_join): Limited checking for invalid
8572         descriptors.
8573         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
8575 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
8577         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
8578         beginning of the loop.  Clear the entire first block of TSD.
8579         * Makefile (tests): Add tst-key4.
8580         * tst-key4.c: New file.
8582 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
8584         * Makefile (tests): Add tst-basic7.
8585         * tst-basic7.c: New file.
8587         * pthread_create.c (deallocate_tsd): Mark as internal_function.
8588         Add some more __builtin_expect.
8590         * pthreadP.h: Define dummy version of DEBUGGING_P.
8592 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
8594         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
8595         _POSIX_THREAD_PRIORITY_SCHEDULING.
8596         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
8597         _XOPEN_REALTIME_THREADS.
8598         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
8600         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
8601         kernel returns EINVAL for PID <= 0, work around it.
8603         * Makefile (tests): Add tst-signal5.
8604         * tst-signal5.c: New file.
8606         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
8607         and LOGIN_NAME_MAX.
8609         * tst-cancel1.c (tf): Block all signals.
8611         * Makefile (tests): Add tst-basic6.
8612         * tst-basic6.c: New file.
8614         * tst-basic1.c: Add test for process ID.
8616         * Makefile (tests): Add tst-cancel10.
8617         * tst-cancel10.c: New file.
8619         * Makefile (tests): Add tst-signal4.
8620         * tst-signal4.c: New file.
8622         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
8623         __sigismember instead of sigismember.  Add __builtin_expect.
8625 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
8627         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
8628         pthread_setcancelstate, and pthread_rwlock_setpshared.
8630         * tst-cancel7.c (do_test): Make sure the pid file exists before
8631         canceling the thread.
8633         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
8634         pthread_rwlock_timedrdlock tests.
8635         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
8636         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8637         Check for invalid tv_nsec field.
8638         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8639         Likewise.
8641         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
8642         recursive mutex of overflow.
8644         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
8646         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
8647         going into an endless loop.
8648         * Makefile (tests): Add tst-cancel9.
8649         * tst-cancel9.c: New file.
8651         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
8653 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
8655         * tst-mutex5.c (do_test): Add more timedlock tests.
8657         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
8658         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
8660         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
8661         use INLINE_SYSCALL.  Error number is returned, not -1.
8663         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
8664         and __deallocate_stack with internal_function.
8665         * pthread_create.c: Adjust definitions appropriately.
8666         * allocatestack.c: Likewise.
8668         * pthread_join.c: Add one more __builtin_expect.
8669         * pthread_timedjoin.c: Likewise.
8671         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
8672         not data of sequence number does not match.
8673         Add one __builtin_expect.
8675         * Makefile (tests): Add tst-clock1.
8676         * tst-clock1.c: New file.
8678         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
8679         negative arguments.
8680         * Makefile (tests): Add tst-basic5.
8681         * tst-basic5.c: New file.
8683 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
8685         * Makefile (tests): Add tst-basic4.
8686         * tst-basic4.c: New file.
8688         * pthreadP.h: Add declaraction for __nptl_nthreads.
8689         * pthread_create.c: Define __nptl_nthreads
8690         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
8691         after thread is done.  If then zero, call exit(0).
8692         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8693         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
8694         * init.c (pthread_functions): Initialize ptr_nthreads.
8695         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
8696         (__reclaim_stacks): Decrement __nptl_nthreads.
8697         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
8698         Define.
8699         * Makefile (tests): Add tst-basic3.
8700         * tst-basic3.c: New file.
8702         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
8703         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
8704         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
8705         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
8706         if asynchronous canceling is enabled.
8707         * pthread_join.c (pthread_join): When recognizing circular joins,
8708         take into account the other thread might be already canceled.
8709         * Makefile (tests): Add tst-join5.
8710         * tst-join5.c: New file.
8712         * Makefile (tests): Add tst-join4.
8713         * tst-join4.c: New file.
8715 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
8717         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
8719 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8721         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
8722         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
8723         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
8724         warning.
8725         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
8726         to avoid warning.
8727         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
8728         error if lll_futex_wake failed.
8730 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
8732         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
8733         handling of cancellation and failung pthread_mutex_unlock call.
8734         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8735         * Makefile (tests): Add tst-cond8 and tst-cond9.
8736         * tst-cond8.c: New file.
8737         * tst-cond9.c: New file.
8739         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
8741         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
8742         non-standard initializers with __USE_GNU.
8744         * Makefile (tests): Add tst-cleanup3.
8745         * tst-cleanup3.c: New file.
8747 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
8749         * Makefile (tests): Add tst-attr1 and tst-attr2.
8750         * tst-attr1.c: New file.
8751         * tst-attr2.c: New file.
8753         * Makefile: Add rules to build and run tst-atfork2 test.
8754         * tst-atfork2.c: New file.
8755         * tst-atfork2mod.c: New file.
8757         * sysdeps/unix/sysv/linux/unregister-atfork.c
8758         (__unregister_atfork): Free the memory allocated for the handlers
8759         after removing them from the lists.
8761         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
8762         cleanup function.
8764         * tst-atfork1.c (do_test): Wait for the child we forked.
8765         Report error in child.
8767         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
8769         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
8771 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
8773         * Makefile (tests): Add tst-cancel8.
8774         * tst-cancel8.c: New file.
8776         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
8777         clearing of control variable.
8778         * Makefile (tests): Add tst-once3 and tst-once4.
8779         * tst-once3.c: New file.
8780         * tst-once4.c: New file.
8782 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
8784         * sysdeps/sh/Makefile: New file.
8785         * sysdeps/sh/bits/atomic.h: New file.
8786         * sysdeps/sh/pthread_spin_init.c: New file.
8787         * sysdeps/sh/pthread_spin_lock.c: New file.
8788         * sysdeps/sh/pthread_spin_trylock.S: New file.
8789         * sysdeps/sh/pthread_spin_unlock.S: New file.
8790         * sysdeps/sh/pthreaddef.h: New file.
8791         * sysdeps/sh/tcb-offsets.sym: New file.
8792         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
8793         * sysdeps/sh/tls.h: New file.
8794         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
8795         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
8796         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
8797         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
8798         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
8799         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
8800         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
8801         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
8802         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
8803         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
8804         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
8805         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
8806         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
8807         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
8808         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
8809         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
8810         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
8811         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
8812         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
8813         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
8814         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
8815         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
8816         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
8817         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
8818         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
8819         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
8820         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
8821         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
8822         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
8823         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
8825 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
8827         * tst-cond2.c: Rearrange code to not rely on behavior undefined
8828         according to POSIX.
8830         * tst-basic2.c (do_test): Lock mutex before creating the thread.
8832 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
8834         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
8835         (TLS_GET_FS): New #define.
8836         (TLS_SET_FS): New #define.
8837         Correct value of __NR_set_thread_area.
8839         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
8841 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
8843         * Makefile (tests): Add tst-popen1.
8844         * tst-popen1.c: New file.
8846         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
8847         but inactive generalization.
8848         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8849         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
8850         Minor optimization, remove one instruction.
8851         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
8853 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8855         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
8857 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8859         * init.c (__NR_set_tid_address): Add #ifdef for s390.
8860         * sysdeps/pthread/pthread_barrier_wait.c: New file.
8861         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
8862         * sysdeps/pthread/pthread_cond_signal.c: New file.
8863         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
8864         * sysdeps/pthread/pthread_cond_wait.c: New file.
8865         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
8866         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
8867         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
8868         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
8869         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
8870         * sysdeps/s390/Makefile: New file.
8871         * sysdeps/s390/bits/atomic.h: New file.
8872         * sysdeps/s390/pthread_spin_init.c: New file.
8873         * sysdeps/s390/pthread_spin_lock.c: New file.
8874         * sysdeps/s390/pthread_spin_trylock.c: New file.
8875         * sysdeps/s390/pthread_spin_unlock.c: New file.
8876         * sysdeps/s390/pthreaddef.h: New file.
8877         * sysdeps/s390/tcb-offsets.sym: New file.
8878         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
8879         * sysdeps/s390/tls.h: New file.
8880         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
8881         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
8882         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
8883         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
8884         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
8885         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
8886         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
8887         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
8888         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
8889         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
8890         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
8891         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
8892         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
8893         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
8894         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
8895         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
8896         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
8897         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
8898         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
8899         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
8900         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
8901         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
8902         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
8904 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
8906         * atomic.h: Add a couple more default implementations.
8907         (atomic_compare_and_exchange_acq): Use
8908         __arch_compare_and_exchange_32_acq in return value definition.  It
8909         always exists.
8910         (atomic_bit_set): Renamed from atomic_set_bit.
8911         Add missing atomic_ prefixes.
8913         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
8914         thread library is available, use correct value to mark initialized
8915         once variable.
8917 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
8919         * allocatestack.c (allocate_stack): Use __getpagesize instead of
8920         __sysconf to determine pagesize.
8922         * pthread_create.c: Include <atomic.h>.
8923         * allocatestack.c (allocate_stack): Implement coloring of the
8924         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
8925         size minus one.  Adjust users.
8926         * sysdeps/i386/i686/Makefile: New file.
8928 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
8930         * allocatestack.c: Improve comment throughout the file.
8932         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8933         (__lll_lock_wait): Add branch prediction.
8934         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
8935         (__lll_lock_wait): Likewise.
8936         (lll_unlock_wake_cb): Removed.
8938 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
8940         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
8941         _POSIX_THREAD_PRIORITY_SCHEDULING.
8943 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
8945         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8946         Fix return type of ptr___pthread_getspecific.
8948 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
8950         * Makefile (tests): Add tst-umask1.
8951         (tst-umask1-ARGS): Define.
8952         * tst-umask1.c: New file.
8954 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
8956         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
8957         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
8958         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
8959         pthread_rwlock_unlock.
8960         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
8961         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
8962         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
8963         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
8964         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8965         New file.
8966         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
8967         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8968         New file.
8969         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
8970         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
8971         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
8972         New file.
8973         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
8974         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
8975         New file.
8976         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
8977         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
8978         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
8979         New file.
8980         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
8981         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
8982         New file.
8983         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
8985         * Makefile (libpthread-routines): Remove lowlevelcond and
8986         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
8987         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
8988         and pthread_cond_broadcast.
8989         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
8990         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
8991         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
8992         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
8993         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
8994         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
8995         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
8996         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
8997         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
8998         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
8999         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
9000         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
9001         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
9002         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
9003         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
9004         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
9005         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
9006         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
9007         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
9008         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
9009         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
9010         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
9011         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
9012         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
9013         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
9014         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
9015         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
9016         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
9017         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
9018         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
9019         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
9021         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
9022         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
9023         of the code is moved to ...
9024         * sysdeps/pthread/createthread.c: ...here.  New file.
9026 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
9028         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
9029         (__new_sem_post): Clear %eax before returning.
9030         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
9032         * Makefile (tests): Add tst-cleanup2.
9033         * tst-cleanup2.c: New file.
9035         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
9036         Interpret first parameter correctly.
9038 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
9040         * Makefile (headers): Add bits/semaphore.h.
9042 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
9044         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
9045         if not SHARED.
9047 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
9049         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
9050         must be used and mapping failed.
9051         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
9053         * Makefile (CFLAGS-pthread_self.os): Define this, not
9054         CFLAGS-pthread_self.c.
9056 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9058         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
9059         lll_unlock_wake_cb.
9061         * Makefile (libpthread-routines): Add version.  Add rules to build
9062         version.os and banner.h.
9063         * version.c: New file.
9065 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
9067         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
9068         the alias unconditional.
9069         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
9071 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9073         * Makefile (CFLAGS-pthread_self.c): New definition.
9075 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9077         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
9078         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
9079         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
9080         * init.c (__pthread_initialize_minimal_internal): Likewise.
9082 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
9084         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
9086         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
9087         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9088         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9089         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
9090         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9091         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9093 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9095         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
9096         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
9097         * tst-cancel-wrappers.sh: Remove all exceptions.
9099 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
9101         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
9102         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
9104         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
9105         Use __libc_pthread_functions array if SHARED.
9107         * pthreadP.h: Move pthread_cond_2_0_t definition to...
9108         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
9110         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
9111         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
9112         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
9113         __libc_ptf_call instead of __libc_maybe_call.
9114         (PTF): New #define.
9115         (__libc_cleanup_region_start): Wrap function name with PTF call.
9116         (__libc_cleanup_region_end): Likewise.
9117         (__libc_cleanup_end): Likewise.
9119         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
9120         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
9121         * pthread_key_create.c: Add __pthread_key_create_internal alias.
9122         * pthreadP.h: Add prototypes.
9124         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
9125         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
9126         __pthread_rwlock_unlock aliases.
9127         * pthreadP.h: Add prototypes for new aliases.
9129         * pthreadP.h (struct pthead_functions): Moved to...
9130         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
9131         * init.c (pthread_functions): Add initializers for new elements.
9133         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
9134         __pthread_cleanup_pop_restore aliases.
9135         * pthreadP.h: Add prototypes.
9137         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
9138         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
9139         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
9140         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
9141         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
9142         * pthreadP.h: Adjust prototypes and callers.
9144 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
9146         * Makefile (tests): Add tst-cancel7.
9147         (tst-cancel7-ARGS): New variable.
9148         * tst-cancel7.c: New file.
9150         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
9151         around gcc defficiencies.
9152         * old_pthread_cond_signal.c: Likewise.
9153         * old_pthread_cond_timedwait.c: Likewise.
9154         * old_pthread_cond_wait.c: Likewise.
9156         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
9158 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9160         * Makefile (tests): Add tst-cond7.
9161         * tst-cond7.c: New file.
9163         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9164         (condvar_cleanup): Get condvar address from the right place.
9166         * atomic.h: Correct definitions of atomic_full_barrier,
9167         atomic_read_barrier, atomic_write_barrier.
9169         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
9170         race-free.
9171         * old_pthread_cond_signal.c: Likewise.
9172         * old_pthread_cond_timedwait.c: Likewise.
9173         * old_pthread_cond_wait.c: Likewise.
9175 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
9177         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
9179 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9181         * pthreadP.h (pthread_cond_2_0_t): New type.
9182         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
9183         Use new type for the 2.0 condvar function prototypes.
9184         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
9185         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
9186         parameter.
9187         * old_pthread_cond_destroy.c: Likewise.
9188         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
9189         * old_pthread_cond_signal.c: Likewise.
9190         * old_pthread_cond_timedwait.c: Likewise.
9191         * old_pthread_cond_wait.c: Likewise.
9193         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9194         (__pthread_cond_wait): Don't save cancellation mode and seq value
9195         in same location.
9197         * herrno.c (__h_errno_location): Don't define as weak.
9199 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9201         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
9202         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
9203         and pthread_cond_wait.
9204         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
9205         Renamed to...
9206         (__pthread_cond_broadcast_2_0): ... this.
9207         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
9208         Renamed to...
9209         (__pthread_cond_destroy_2_0): ... this.
9210         * old_pthread_cond_init.c (__old_pthread_cond_init):
9211         Renamed to...
9212         (__pthread_cond_init_2_0): ... this.
9213         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
9214         Renamed to...
9215         (__pthread_cond_signal_2_0): ... this.
9216         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
9217         Renamed to...
9218         (__pthread_cond_wait_2_0): ... this.
9219         * pthread_cond_destroy.c: Include shlib-compat.h.
9220         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
9221         * pthread_cond_init.c: Include shlib-compat.h.
9222         (pthread_cond_init): Change strong_alias into versioned_symbol.
9223         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
9224         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
9225         fields.
9226         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
9227         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
9228         __pthread_cond_wait_2_0): New prototypes.
9229         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
9230         __old_pthread_cond_init, __old_pthread_cond_signal,
9231         __old_pthread_cond_wait): Removed.
9232         * init.c: Include shlib-compat.h.
9233         (pthread_functions): Guard ptr___pthread_attr_init_2_0
9234         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
9235         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
9236         ptr___pthread_cond_*_2_0 fields.
9237         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
9238         pthread_cond_*@GLIBC_2.0 compatibility symbols.
9240         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
9241         LIBC_SIGACTION was not yet defined.
9242         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
9243         [!defined LIBC_SIGACTION] (__sigaction): New function and
9244         libc_hidden_weak.
9245         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
9246         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
9248 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9250         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
9252 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
9254         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
9255         New, larger type definition.
9256         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
9257         implementation.
9258         * Versions [libpthread]: Add definitions for new pthread_cond_*
9259         interfaces for version GLIBC_2.3.2.
9260         * pthread_cond_init.c: Update initialization for new type definition.
9261         * Makefile (libpthread-routines): Remove pthread_cond_wait,
9262         pthread_cond_timedwait, pthread_cond_signal, and
9263         pthread_cond_broadcast.  Add old_pthread_cond_init,
9264         old_pthread_cond_destroy, old_pthread_cond_wait,
9265         old_pthread_cond_timedwait, old_pthread_cond_signal, and
9266         old_pthread_cond_broadcast.
9267         * old_pthread_cond_broadcast.c: New file.
9268         * old_pthread_cond_destroy.c: New file.
9269         * old_pthread_cond_init.c: New file.
9270         * old_pthread_cond_signal.c: New file.
9271         * old_pthread_cond_timedwait.c: New file.
9272         * old_pthread_cond_wait.c: New file.
9273         * pthreadP.h: Add prototypes for the compatibility interfaces.
9275         * pthread_cond_destroy.c: Don't include <errno.h>.
9277 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
9279         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
9280         unnecessary zero offset when addressing MUTEX.
9282 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9284         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
9285         __register_atfork.
9286         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
9287         for __register_atfork.
9289 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9291         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
9292         instead of ASSEMBLER test macro.
9294         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
9295         __libc_current_sigrtmax): Add libc_hidden_def.
9297         * sysdeps/pthread/list.h: Remove assert.h include.
9299 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9301         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
9302         __pthread_initialize_minimal_internal not
9303         __pthread_initialize_minimal.
9305 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
9307         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
9308         __pthread_initialize_minimal as hidden.
9310         * init.c (__pthread_initialize_minimal_internal): Don't mark as
9311         constructor.
9313 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9315         * Makefile ($(inst_libdir)/libpthread.so): Depend on
9316         $(common-objpfx)format.lds, include that into the output script.
9317         Fix comment.
9318         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
9320 2002-12-28  Andreas Jaeger  <aj@suse.de>
9322         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
9323         nsec resolution changes.
9324         (xstat64_conv): Likewise.
9325         (xstat32_conv): Likewise.
9326         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
9327         struct kernel_stat.
9328         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
9329         structs stat and stat64.
9330         * time/time.h (__timespec_defined): Define for __USE_MISC.
9331         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
9333 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
9335         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
9336         argument.
9337         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
9338         (pthread_exit): Use strong_alias to avoid warnings.
9339         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
9340         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
9341         ptr___pthread_attr_init_2_*.
9342         * init.c (pthread_functions): Adjust.
9344 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
9346         * forward.c: Make all functions available by default again.  It
9347         caused too much trouble.
9349         * pt-siglongjmp.c: Removed.
9351 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
9353         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
9354         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
9355         * sysdeps/i386/Makefile: New file.
9356         * sysdeps/i386/tcb-offsets.sym: New file.
9357         * sysdeps/pthread/tcb-offsets.h: New file.
9358         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9359         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
9361         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
9362         __register_atfork...
9363         (GLIBC_2.3.2): ...here.
9365 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9367         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
9368         pthread_attr_setstackaddr with __attribute_deprecated__.
9370 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9372         * pt-system.c (system): Remove cancellation handling.
9373         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
9374         cancellation routines.
9376 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9378         * descr.h: Include <dl-sysdep.h>.
9379         (struct pthread): Move header.data.list to the back of the struct.
9380         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
9381         (MULTIPLE_THREADS_OFFSET): Adjust offset.
9382         (SYSINFO_OFFSEET): Likewise.
9384 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9386         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
9387         Define.
9388         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
9389         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
9390         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
9391         (USE_DL_SYSINFO): Undef.
9393 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
9395         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
9396         $(common-objpfx)libc.so.
9397         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
9398         it is bigger than pipe buffer size even on arches with bigger
9399         page size.
9400         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
9402 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
9404         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
9405         correct errno access for case that USE___THREAD is not defined.
9407 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
9409         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
9410         Patch by Marijn Ros <marijn@mad.scientist.com>.
9412 2002-12-22  Roland McGrath  <roland@redhat.com>
9414         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
9416 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
9418         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
9420 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
9422         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
9423         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
9424         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
9426         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
9427         of int $0x80.
9428         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9429         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
9430         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
9431         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
9432         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
9433         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
9434         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
9435         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
9437         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
9438         sysenter.
9439         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
9441         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
9443         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
9444         in new TCB.
9445         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
9446         that sysinfo is properly initialized.
9447         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
9448         to 1 only for ld.so.
9450         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
9451         RTLD_CORRECT_DYNAMIC_WEAK.
9453 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
9455         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
9456         Use return 0 as 6th argument to FORWARD4.
9457         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
9459 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9461         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
9462         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
9463         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
9464         (INIT_SYSINFO): New #define.
9465         (TLS_TP_INIT): Use INIT_SYSINFO.
9466         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9467         At test to make sure SYSINFO_OFFSET value is correct.
9468         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
9470 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
9472         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
9473         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
9474         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
9475         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
9476         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
9477         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
9478         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
9480 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9482         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
9483         macro instead of using int $0x80 directly.
9485         * sysdeps/pthread/bits/stdio-lock.h: New file.
9486         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
9487         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
9488         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
9489         * Makefile (routines): Add libc-lowlevelmutex.
9491         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
9492         __i686.get_pc_thunk.dx.
9494 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9496         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
9497         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
9498         ($(objpfx)tst-cancel-wrappers.out): New rule.
9499         * tst-cancel-wrappers.sh: New test.
9500         * tst-locale1.c: Include signal.h.
9501         (uselocale): Test static linking of __libc_current_sigrt*.
9503 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
9505         * Makefile (tests): Add tst-cancel6.
9506         * tst-cancel6.c: New file
9508 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9510         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
9511         Define meaningfully for assembler as well.
9512         * pthreadP.h (struct pthread_functions): Remove
9513         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
9514         and ptr_pthread_attr_init_2_1 fields.
9515         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
9516         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
9517         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
9518         (FORWARD3): Define using FORWARD4.
9519         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
9520         versions.
9521         * pt-system.c: Remove duplicate stdlib.h include.
9523 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
9525         * sem_init.c: Define sem_init@GLIBC_2.0.
9526         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
9527         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
9529         * flockfile.c: Moved to...
9530         * sysdeps/pthread/flockfile.c: ...here.  New file.
9531         * funlockfile.c: Moved to...
9532         * sysdeps/pthread/funlockfile.c: ...here.  New file.
9533         * ftrylockfile.c: Moved to...
9534         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
9536 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
9538         * libc-cancellation.c: Guard both function with
9539         #if !defined NOT_IN_libc.
9540         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
9541         automatically provided pthread wrappers.
9542         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
9543         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
9544         nor in libpthread.
9545         * pt-open.c: Removed.
9546         * pt-fcntl.c: Removed.
9547         * pt-fsync.c: Removed.
9548         * pt-lseek.c: Removed.
9549         * pt-msgrcv.c: Removed.
9550         * pt-msgsnd.c: Removed.
9551         * pt-msync.c: Removed.
9552         * pt-nanosleep.c: Removed.
9553         * pt-open64.c: Removed.
9554         * pt-pause.c: Removed.
9555         * pt-pread.c: Removed.
9556         * pt-pread64.c: Removed.
9557         * pt-pwrite.c: Removed.
9558         * pt-pwrite64.c: Removed.
9559         * pt-read.c: Removed.
9560         * pt-recv.c: Removed.
9561         * pt-recvfrom.c: Removed.
9562         * pt-recvmsg.c: Removed.
9563         * pt-send.c: Removed.
9564         * pt-sendto.c: Removed.
9565         * pt-sigtimedwait.c: Removed.
9566         * pt-sigwait.c: Removed.
9567         * pt-wait.c: Removed.
9568         * pt-waitpid.c: Removed.
9569         * pt-write.c: Removed.
9570         * pt-accept.c: Removed.
9571         * pt-close.c: Removed.
9572         * pt-connect.c: Removed.
9573         * pt-lseek64.c: Removed.
9574         * pt-sendmsg.c: Removed.
9575         * pt-tcdrain.c: Removed.
9577 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
9579         * init.c (__pthread_initialize_minimal_internal): Renamed from
9580         __pthread_initialize_minimal.  Make old name an alias.  This
9581         converts a normal relocation into a relative relocation.
9583         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
9585         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
9586         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
9587         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
9588         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
9589         pt-sigwaitinfo, pt-waitid, and pt-writev.
9590         * pt-creat.c: Removed.
9591         * pt-poll.c: Removed.
9592         * pt-pselect.c: Removed.
9593         * pt-readv.c: Removed.
9594         * pt-select.c: Removed.
9595         * pt-sigpause.c: Removed.
9596         * pt-sigsuspend.c: Removed.
9597         * pt-sigwaitinfo.c: Removed.
9598         * pt-waitid.c: Removed.
9599         * pt-writev.c: Removed.
9601         * init.c (pthread_functions): New variable.
9602         (__pthread_initialize_minimal): Pass pointer to pthread_functions
9603         (or NULL) to __libc_pthread_init.
9604         * forward.c: Rewrite to use __libc:pthread_functions array to get
9605         function addresses.
9606         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
9607         prototype.
9608         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9609         Take new parameter.  Copy content of variable pointed to by it
9610         to __libc_pthread_init.
9612         * pthreadP.h (struct pthread_functions): New type.
9613         (__libc_pthread_init): Declare.
9615         * pthread_attr_destroy.c: Add namespace protected alias.
9616         * pthread_attr_getdetachstate.c: Likewise.
9617         * pthread_attr_getinheritsched.c: Likewise.
9618         * pthread_attr_getschedparam.c: Likewise.
9619         * pthread_attr_getschedpolicy.c: Likewise.
9620         * pthread_attr_getscope.c: Likewise.
9621         * pthread_attr_setdetachstate.c: Likewise.
9622         * pthread_attr_setinheritsched.c: Likewise.
9623         * pthread_attr_setschedparam.c: Likewise.
9624         * pthread_attr_setschedpolicy.c: Likewise.
9625         * pthread_attr_setscope.c: Likewise.
9626         * pthread_cond_broadcast.c: Likewise.
9627         * pthread_cond_destroy.c: Likewise.
9628         * pthread_cond_init.c: Likewise.
9629         * pthread_cond_signal.c: Likewise.
9630         * pthread_cond_wait.c: Likewise.
9631         * pthread_condattr_destroy.c: Likewise.
9632         * pthread_condattr_init.c: Likewise.
9633         * pthread_equal.c: Likewise.
9634         * pthread_exit.c: Likewise.
9635         * pthread_getschedparam.c: Likewise.
9636         * pthread_self.c: Likewise.
9637         * pthread_setcancelstate.c: Likewise.
9638         * pthread_setschedparam.c: Likewise.
9639         * pthread_mutex_destroy.c: Likewise.
9640         * pthread_mutex_init.c: Likewise.
9641         * pthreadP.h: Add prototypes for the aliases.
9643         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
9644         multiple_threads member in correct TCB to 1.
9646         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
9647         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
9648         member of thread decriptor, otherwise return unconditionally 1.
9650 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9652         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
9653         regular Linux version.  Remove file.
9654         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
9655         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
9656         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
9657         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
9658         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
9659         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
9660         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
9661         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
9662         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
9663         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
9664         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
9665         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
9666         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
9667         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
9668         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
9669         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
9670         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
9671         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
9672         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
9673         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
9674         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
9675         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
9676         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
9677         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
9678         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
9679         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
9680         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
9681         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
9682         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
9683         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
9685 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9687         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
9688         * sysdeps/unix/sysv/linux/open.c: Removed.
9689         * sysdeps/unix/sysv/linux/fsync.c: Removed.
9690         * sysdeps/unix/sysv/linux/lseek.c: Removed.
9691         * sysdeps/unix/sysv/linux/msync.c: Removed.
9692         * sysdeps/unix/sysv/linux/read.c: Removed.
9693         * sysdeps/unix/sysv/linux/close.c: Removed.
9694         * sysdeps/unix/sysv/linux/creat.c: Removed.
9695         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
9696         * sysdeps/unix/sysv/linux/pause.c: Removed.
9697         * sysdeps/unix/sysv/linux/select.c: Removed.
9698         * sysdeps/unix/sysv/linux/write.c: Removed.
9700 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9702         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
9703         element in TCB to see whether locking is needed.
9705         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
9706         MULTIPLE_THREADS_OFFSET value is correct.
9708         * sysdeps/unix/sysv/linux/close.c: New file.
9709         * sysdeps/unix/sysv/linux/connect.S: New file.
9710         * sysdeps/unix/sysv/linux/creat.c: New file.
9711         * sysdeps/unix/sysv/linux/fsync.c: New file.
9712         * sysdeps/unix/sysv/linux/llseek.c: New file.
9713         * sysdeps/unix/sysv/linux/lseek.c: New file.
9714         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
9715         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
9716         * sysdeps/unix/sysv/linux/msync.c: New file.
9717         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
9718         * sysdeps/unix/sysv/linux/open.c: New file.
9719         * sysdeps/unix/sysv/linux/open64.c: New file.
9720         * sysdeps/unix/sysv/linux/pause.c: New file.
9721         * sysdeps/unix/sysv/linux/poll.c: New file.
9722         * sysdeps/unix/sysv/linux/pread.c: New file.
9723         * sysdeps/unix/sysv/linux/pread64.c: New file.
9724         * sysdeps/unix/sysv/linux/pselect.c: New file.
9725         * sysdeps/unix/sysv/linux/pwrite.c: New file.
9726         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
9727         * sysdeps/unix/sysv/linux/readv.c: New file.
9728         * sysdeps/unix/sysv/linux/recv.S: New file.
9729         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
9730         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
9731         * sysdeps/unix/sysv/linux/select.c: New file.
9732         * sysdeps/unix/sysv/linux/send.S: New file.
9733         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
9734         * sysdeps/unix/sysv/linux/sendto.S: New file.
9735         * sysdeps/unix/sysv/linux/sigpause.c: New file.
9736         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
9737         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
9738         * sysdeps/unix/sysv/linux/sigwait.c: New file.
9739         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
9740         * sysdeps/unix/sysv/linux/system.c: New file.
9741         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
9742         * sysdeps/unix/sysv/linux/wait.c: New file.
9743         * sysdeps/unix/sysv/linux/waitid.c: New file.
9744         * sysdeps/unix/sysv/linux/waitpid.c: New file.
9745         * sysdeps/unix/sysv/linux/writev.c: New file.
9746         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
9748         * pt-readv.c: Fix comment.
9750 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9752         * tst-cleanup1.c: Include stdlib.h.
9754         * tst-cancel5.c: New test.
9755         * Makefile (tests): Add tst-cancel5.
9756         (tst-cancel5): Link against libc.so libpthread.so in that order.
9758 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
9760         * forward.c (test_loaded): Prevent recursive calls.
9762         * Makefile (routines): Add libc-cancellation.
9763         * libc-cancellation.c: New file.
9764         * descr.h (struct pthread): Add multiple_threads field.
9765         * allocatestack.c (allocate_stack): Initialize multiple_header field of
9766         new thread descriptor to 1.
9767         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
9768         Initialize multiple_thread field after successful thread creation.
9769         * cancellation.c (__do_cancel): Move to pthreadP.h.
9770         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
9771         (__pthread_disable_asynccancel): Add internal_function attribute.
9772         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
9773         * pthread_setcancelstate.c: Likewise.
9774         * pthread_setcanceltype.c: Likewise.
9775         * pthread_exit.c: Likewise.
9776         * pthreadP.h (CANCELLATION_P): Likewise.
9777         (__do_cancel): Define as static inline.
9778         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
9779         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
9780         declarations.
9781         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
9782         fields.  Define MULTIPLE_THREADS_OFFSET.
9783         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
9784         declaration.
9785         * sysdeps/unix/sysv/linux/accept.S: New file.
9786         * sysdeps/unix/sysv/linux/read.c: New file.
9787         * sysdeps/unix/sysv/linux/write.c: New file.
9788         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
9789         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
9790         initialization of __libc_locking_needed.
9791         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
9792         __libc_locking_needed, use multiple_threads field in TCB.
9793         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9795 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
9797         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
9798         version.
9799         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
9801         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
9802         access to __libc_locking_needed for PIC.
9804 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
9806         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
9807         declare for libc.so.
9808         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
9809         expression.
9810         (__libc_lock_lock): Put into statement expression.
9811         (__libc_lock_unlock): Remove trailing semicolon.
9812         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
9814 2002-12-12  Roland McGrath  <roland@redhat.com>
9816         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
9817         "m" constraint to refer to __libc_locking_needed.  Declare it here.
9819 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
9821         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
9822         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
9823         Initialize __libc_locking_needed.
9824         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
9825         instead of __register_pthread_fork_handler.
9826         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
9827         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
9828         fork-gen with libc_pthread_init.
9829         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
9830         of __register_pthread_fork_handler.
9831         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
9832         of __register_pthread_fork_handler.
9833         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
9834         __libc_locking_needed to determine whether lock prefix can be avoided.
9835         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9837 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
9839         * Makefile (tests): Add tst-cleanup1.
9840         * tst-cleanup1.c: New file.
9841         * cancellation.c (__cleanup_thread): Removed.
9842         (__do_cancel): Remove call to __cleanup_thread.
9843         * pthreadP.h: Remove __cleanup_thread prorotype.
9845         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
9846         Remember function and argument even if cancellation handler
9847         function is not available.
9848         (__libc_cleanup_region_end): Execute registered function directly if
9849         pthread functions are not available.
9850         (__libc_cleanup_end): Likewise.
9852         * init.c (__pthread_initialize_minimal): Fix initialization in
9853         static lib by preventing gcc from being too clever.
9855 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
9857         * init.c (__pthread_initialize_minimal): Remove unneccesary
9858         sigaddset call.
9860         * Makefile (tests): We can run tst-locale2 now.
9862 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
9864         * Versions: Remove duplicated sigwait entry.
9866 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
9868         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
9869         inside libpthread.
9871         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
9873         * pthreadP.h: Declare __pthread_enable_asynccancel and
9874         __pthread_disable_asynccancel.
9875         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
9876         (CANCEL_RESET): Use __pthread_disable_asynccancel.
9877         * cancellation.c (__pthread_enable_asynccancel): New function.
9878         (__pthread_disable_asynccancel): New function.
9879         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
9880         * pt-close.c: Likewise.
9881         * pt-connect.c: Likewise.
9882         * pt-creat.c: Likewise.
9883         * pt-fcntl.c: Likewise.
9884         * pt-fsync.c: Likewise.
9885         * pt-lseek.c: Likewise.
9886         * pt-lseek64.c: Likewise.
9887         * pt-msgrcv.c: Likewise.
9888         * pt-msgsnd.c: Likewise.
9889         * pt-msync.c: Likewise.
9890         * pt-nanosleep.c: Likewise.
9891         * pt-open.c: Likewise.
9892         * pt-open64.c: Likewise.
9893         * pt-pause.c: Likewise.
9894         * pt-poll.c: Likewise.
9895         * pt-pread.c: Likewise.
9896         * pt-pread64.c: Likewise.
9897         * pt-pselect.c: Likewise.
9898         * pt-pwrite.c: Likewise.
9899         * pt-pwrite64.c: Likewise.
9900         * pt-read.c: Likewise.
9901         * pt-readv.c: Likewise.
9902         * pt-recv.c: Likewise.
9903         * pt-recvfrom.c: Likewise.
9904         * pt-recvmsg.c: Likewise.
9905         * pt-select.c: Likewise.
9906         * pt-send.c: Likewise.
9907         * pt-sendmsg.c: Likewise.
9908         * pt-sendto.c: Likewise.
9909         * pt-sigpause.c: Likewise.
9910         * pt-sigsuspend.c: Likewise.
9911         * pt-sigtimedwait.c: Likewise.
9912         * pt-sigwait.c: Likewise.
9913         * pt-sigwaitinfo.c: Likewise.
9914         * pt-system.c: Likewise.
9915         * pt-tcdrain.c: Likewise.
9916         * pt-wait.c: Likewise.
9917         * pt-waitid.c: Likewise.
9918         * pt-waitpid.c: Likewise.
9919         * pt-write.c: Likewise.
9920         * pt-writev.c: Likewise.
9921         * pthread_join.c: Likewise.
9922         * pthread_timedjoin.c: Likewise.
9924         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
9925         (__xpg_sigpause): New function.
9926         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
9928 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
9930         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
9932         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
9933         _GI_pthread_cleanup_pop to pthreadP.h.
9935         * ftrylockfile.c: Use _IO_lock_trylock instead of
9936         pthread_mutex_trylock.
9938         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
9939         (CANCEL_RESET): Likewise.
9940         (__pthread_setcanceltype_): Declare.
9941         (__pthread_mutex_lock_internal): Declare.
9942         (__pthread_mutex_unlock_internal): Declare.
9943         (__pthread_once_internal): Declare.
9944         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
9945         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
9947         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
9948         and pthread_mutex_unlock.
9949         * pthread_cond_wait.c: Likewise.
9950         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
9951         * pthread_mutex_unlock.c: Likewise.
9953         * pthread_setcanceltype.c: Add additional alias
9954         __pthread_setcanceltype.
9956         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
9957         * sem_open.c (sem_open): Likewise.
9958         Use __libc_open, __libc_write, and __libc_close instead of
9959         open, write, and close respectively.
9961         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
9962         Rewrite as statement expression since it must return a value.
9964         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
9965         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
9966         __pthread_kill.
9968         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
9969         alias __pthread_once_internal.
9971         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
9973 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
9975         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
9976         * tst-stdio1.c: New file.
9977         * tst-stdio2.c: New file.
9979         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
9981         * Makefile (tests): Comment out tst-locale2 for now.
9982         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
9984         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
9985         -D_IO_MTSAFE_IO.
9986         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
9987         Use _IO_lock_init instead of explicit assignment.
9989         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
9990         Define __libc_lock_* and __libc_lock_recursive macros with
9991         lowlevellock macros, not pthread mutexes.
9993         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
9994         of pthread_mutex_lock.
9995         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
9996         instead of pthread_mutex_unlock.
9998 2002-12-06  Roland McGrath  <roland@redhat.com>
10000         * allocatestack.c (__stack_user): Use uninitialized defn.
10001         * init.c (__pthread_initialize_minimal): Initialize it here.
10003 2002-12-05  Roland McGrath  <roland@redhat.com>
10005         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
10006         string.
10007         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
10009         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
10010         missing & here too.
10012 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
10014         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10015         lowlevellock.
10016         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
10017         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
10018         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
10019         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
10020         for __libc_lock_* macros.
10021         * Makefile (routines): Add libc-lowlevellock.
10023 2002-10-09  Roland McGrath  <roland@redhat.com>
10025         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
10026         Under [__PIC__], call the function via the pointer fetched for
10027         comparison rather than a call by name that uses the PLT.
10028         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
10029         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
10030         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
10031         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
10032         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
10034 2002-12-04  Roland McGrath  <roland@redhat.com>
10036         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
10038         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
10039         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
10041         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
10043 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10045         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
10046         a completely opaque, non-integer type.
10047         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
10049 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
10051         * sysdeps/i386/tls.h: Include stdlib.h.
10052         * sysdeps/x86_64/tls.h: Likewise.
10054 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10056         * Makefile (tests): Add tst-locale2.
10057         (tests-static): Likewise.
10058         * tst-locale2.c: New file.
10060         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
10061         volatile and add memory clobbers to lock operations.
10063 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
10065         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
10066         * sysdeps/i386/i486/bits/atomic.h: New file.
10067         * sysdeps/i386/i586/bits/atomic.h: New file.
10068         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
10069         include i486 version.
10070         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
10071         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
10072         Patch by Marijn Ros <marijn@mad.scientist.com>.
10074         * allocatestack.c (get_cached_stack): Don't crash if we first
10075         found a stack with a larger size then needed.
10076         Reported by Hui Huang <hui.huang@sun.com>.
10078         * Makefile (tests): Add tst-sysconf.
10079         * tst-sysconf.c: New file.
10081         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
10082         PTHREAD_THREADS_MAX.
10084 2002-12-02  Roland McGrath  <roland@redhat.com>
10086         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
10087         Declare using hidden_proto instead of attribute_hidden, so there are
10088         non-.hidden static symbols for gdb to find.
10089         (__pthread_keys): Likewise.
10090         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
10091         * allocatestack.c (__stack_user): Likewise.
10092         * pthread_create.c (__pthread_keys): Likewise.
10093         (__nptl_threads_events, __nptl_last_event): Make these static instead
10094         of hidden.
10095         * pthread_key_create.c (__pthread_pthread_keys_max,
10096         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
10098 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
10100         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
10101         statically.
10102         * tst-locale1.c: New file.
10104         * pthread_cond_timedwait.c: Include <stdlib.h>.
10106         * Makefile (tests): Add tst-fork2 and tst-fork3.
10107         * tst-fork2.c: New file.
10108         * tst-fork3.c: New file.
10110 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
10112         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
10114         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
10115         require it to 200112L.
10117         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
10118         instruction only if HAVE_CMOV is defined.
10119         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
10121         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
10123         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
10125         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
10127         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
10129 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
10131         * sysdeps/x86_64/bits/atomic.h: New file.
10133         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
10134         16-bit operations.
10136         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
10137         possible since gettid cannot fail.
10139         * sysdeps/x86_64/pthreaddef.h: New file.
10141         * sysdeps/i386/pthreaddef.h (gettid): Removed.
10143         * sysdeps/x86_64/pthread_spin_init.c: New file.
10144         * sysdeps/x86_64/pthread_spin_lock.c: New file.
10145         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
10146         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
10148         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
10149         Add missing lock prefix.  Minute optimization.
10151         * tst-spin2.c (main): Also check successful trylock call.
10153         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
10154         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
10156         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
10157         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
10159         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
10160         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
10161         value in case of an error.  Add support for INTERNAL_SYSCALL.
10163         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
10164         value in case of an error.
10166         * sysdeps/x86_64/tls.h: New file.
10168 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10170         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
10171         takes the array member name and the index as parameters.
10172         (THREAD_SETMEM_NC): Likewise.
10173         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
10174         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
10175         interfaces.
10177         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
10178         to decide which code to use.
10179         (THREAD_SETMEM_NC): Likewise.
10181         * allocatestack.c (queue_stack): Don't remove stack from list here.
10182         Do it in the caller.  Correct condition to prematurely terminate
10183         loop to free stacks.
10184         (__deallocate_stack): Remove stack from list here.
10186 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10188         * Makefile (tests): Add tst-stack1.
10189         * tst-stack1.c: New file.
10191         * allocatestack.c (allocate_stack): Initialize the TCB on a user
10192         provided stack.
10194         * pthread_attr_getstack.c: Return bottom of the thread area.
10196 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
10198         * Makefile (libpthread-routines): Add pt-allocrtsig and
10199         pthread_kill_other_threads.
10200         * pt-allocrtsig.c: New file.
10201         * pthread_kill_other_threads.c: New file.
10202         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
10203         all three functions.
10204         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10205         allocrtsig.
10206         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
10207         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
10208         and __libc_allocate_rtsig_private.
10209         * Versions (libpthread): Export pthread_kill_other_threads_np,
10210         __libc_current_sigrtmin, and __libc_current_sigrtmax.
10212 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
10214         * allocatestack.c (allocate_stack): stackaddr in attribute points to
10215         the end of the stack.  Adjust computations.
10216         When mprotect call fails dequeue stack and free it.
10217         * pthread_attr_setstack.c: Store top of the stack in stackaddr
10218         attribute.
10219         * pthread_getattr_np.c: Likewise.
10221         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
10222         surprises.
10224 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
10226         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
10227         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10229 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
10231         * pthread_getspecific.c: Optimize access to first 2nd-level array.
10232         * pthread_setspecific.c: Likewise.
10234 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
10236         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
10237         definitions.  Get them from the official place.
10238         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
10240         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
10241         Use new CLONE_ flags in clone() calls.
10243         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
10244         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
10246         * Versions: Add pthread_* functions for libc.
10247         * forward.c: New file.
10249         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
10250         errno-loc.
10251         * herrno.c: New file.
10252         * res.c: New file.
10254         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
10255         sem_trywait, and sem_timedwait.  Add herrno and res.
10256         * sem_init.c: Don't initialize lock and waiters members.
10257         * sem_open.c: Likewise.
10258         * sem_post.c: Removed.
10259         * sem_wait.c: Removed.
10260         * sem_trywait.c: Removed.
10261         * sem_timedwait.c: Removed.
10262         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
10263         Includes full implementations of sem_post, sem_wait, sem_trywait,
10264         and sem_timedwait.
10265         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
10266         for new implementation.
10267         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
10268         and waiters fields.
10270         * tst-sem3.c: Improve error message.
10271         * tst-signal3.c: Likewise.
10273         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
10274         to tell the kernel about the termination futex and to initialize tid
10275         member.  Don't initialize main_thread.
10276         * descr.h (struct pthread): Remove main_thread member.
10277         * cancelllation.c (__do_cancel): Remove code handling main thread.
10278         The main thread is not special anymore.
10280         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
10281         size of the stacks to stack_cache_actsize.
10283         * pt-readv.c: Add missing "defined".
10284         * pt-sigwait.c: Likewise.
10285         * pt-writev.c: Likewise.
10287 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
10289         * Versions: Export __connect from libpthread.
10290         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10292         * Makefile (libpthread-routines): Add pt-raise.
10293         * sysdeps/unix/sysv/linux/raise.c: New file.
10294         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
10295         * sysdeps/generic/pt-raise.c: New file.
10297         * pthread_cond_init.c: Initialize all data elements of the condvar
10298         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10300         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
10301         * pthread_create.c: Likewise.
10303         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
10304         * tst-key1.c: New file.
10305         * tst-key2.c: New file.
10306         * tst-key3.c: New file.
10308         * Versions: Export pthread_detach for version GLIBC_2.0.
10309         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
10311 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
10313         * pthread_key_create.c: Terminate search after an unused key was found.
10314         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10316         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
10317         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10319 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
10321         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
10322         dynamic lookup for errno in PIC.
10324         * allocatestack.c (get_cached_stack): Rearrange code slightly to
10325         release the stack lock as soon as possible.
10326         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
10327         the static TLS block.
10328         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
10330         * cancellation.c: Renamed from cancelation.c.
10331         * Makefile: Adjust accordingly.
10332         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
10333         * cleanup_defer.c: Use CANCELLATION_P.
10334         * pthread_testcancel.c: Likewise.
10335         * descr.h: Fix spelling in comments.
10336         * init.c: Likewise.
10337         * pthread_getattr_np.c: Likewise.
10338         * pthread_getschedparam.c: Likewise.
10339         * pthread_setschedparam.c: Likewise.
10340         * Versions: Likewise.
10342         * pt-pselect.c: New file.
10343         * Makefile (libpthread-routines): Add pt-pselect.
10344         * Versions: Add pselect.
10346         * tst-cancel4.c: New file.
10347         * Makefile (tests): Add tst-cancel4.
10349 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
10351         * pthread_mutex_lock.c: Always record lock ownership.
10352         * pthread_mutex_timedlock.c: Likewise.
10353         * pthread_mutex_trylock.c: Likewise.
10355         * pt-readv.c: New file.
10356         * pt-writev.c: New file.
10357         * pt-creat.c: New file.
10358         * pt-msgrcv.c: New file.
10359         * pt-msgsnd.c: New file.
10360         * pt-poll.c: New file.
10361         * pt-select.c: New file.
10362         * pt-sigpause.c: New file.
10363         * pt-sigsuspend.c: New file.
10364         * pt-sigwait.c: New file.
10365         * pt-sigwaitinfo.c: New file.
10366         * pt-waitid.c: New file.
10367         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
10368         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
10369         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
10370         * Versions: Add all the new functions.
10372         * tst-exit1.c: New file.
10373         * Makefile (tests): Add tst-exit1.
10375         * sem_timedwait.c: Minor optimization for more optimal fastpath.
10377 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
10379         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
10381         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
10382         call.  pthread_join is an official cancellation point.
10383         * pthread_timedjoin.c: Likewise.
10385         * pthread_cond_wait.c: Revert order in which internal lock are dropped
10386         and the condvar's mutex are retrieved.
10387         * pthread_cond_timedwait.c: Likewise.
10388         Reported by dice@saros.East.Sun.COM.
10390 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
10392         * pthreadP.h: Cut out all type definitions and move them...
10393         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
10394         * pthreadP.h: Include <internaltypes.h>.
10396         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
10397         performance tweaks.
10399         * sem_trywait.c: Shuffle #includes around to get right order.
10400         * sem_timedwait.c: Likewise.
10401         * sem_post.c: Likewise.
10402         * sem_wait.c: Likewise.
10404         * nptl 0.3 released.
10406         * Makefile (tests): Add tst-signal3.
10407         * tst-signal3.c: New file.
10409 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
10411         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
10412         the asms modify the sem object.
10413         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
10415         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
10416         the actual members.
10417         * pthreadP.h (struct sem): New type.  Actual semaphore type.
10418         * semaphoreP.h: Include pthreadP.h.
10419         * sem_getvalue.c: Adjust to sem_t change.
10420         * sem_init.c: Likewise.
10421         * sem_open.c: Likewise.
10422         * sem_post.c: Likewise.
10423         * sem_timedwait.c: Likewise.
10424         * sem_trywait.c: Likewise.
10425         * sem_wait.c: Likewise.
10427 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
10429         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
10430         * tst-basic2.c: New file.
10431         * tst-exec1.c: New file.
10432         * tst-exec2.c: New file.
10433         * tst-exec3.c: New file.
10435         * tst-fork1.c: Remove extra */.
10437         * nptl 0.2 released.  The API for IA-32 is complete.