* sysdeps/unix/sysv/linux/x86_64/bits/mman.h: Define MAP_STACK.
[glibc.git] / nptl / ChangeLog
blobd638dde58548d34ffc575f03034c9a8b3664abab
1 2008-08-15  Ulrich Drepper  <drepper@redhat.com>
3         * sysdeps/x86_64/pthreaddef.h: Remove ARCH_MAP_FLAGS and
4         ARCH_RETRY_MMAP definitions.
5         * allocatestack.c: Remove definition of ARCH_MAP_FLAGS.
6         Define MAP_STACK when not defined.
7         (allocate_stack): Use MAP_STACK instead of ARCH_MAP_FLAGS.  Remove
8         handling of ARCH_RETRY_MMAP.
10 2008-07-30  Ulrich Drepper  <drepper@redhat.com>
12         * tst-align2.c (f): Print message that f is reached.
14 2008-04-28  Hiroki Kaminaga  <kaminaga@sm.sony.co.jp>
16         [BZ #6740]
17         * sysdeps/powerpc/tcb-offsets.sym (PRIVATE_FUTEX_OFFSET): Guard symbol
18         definition with #ifndef __ASSUME_PRIVATE_FUTEX.
20 2008-07-25  Ulrich Drepper  <drepper@redhat.com>
22         * sysdeps/unix/sysv/linux/mq_notify.c (init_mq_netlink): Use
23         SOCK_CLOEXEC if possible.
25 2008-05-29  Ulrich Drepper  <drepper@redhat.com>
27         * Makefile (tests): Add tst-rwlock2a.
28         * tst-rwlock2.c: Use TYPE macro to decide what rwlock type to use.
29         * tst-rwlock2a.c: New file.
31 2008-06-12  Ulrich Drepper  <drepper@redhat.com>
33         * sysdeps/pthread/pthread.h: Remove inadvertant checkin.
35 2008-05-17  Samuel Thibault  <samuel.thibault@ens-lyon.org>
37         * sysdeps/pthread/pthread.h: Fix typo in comment.
39 2008-05-28  Ulrich Drepper  <drepper@redhat.com>
41         * sysdeps/pthread/createthread.c (do_clone): Pass accurate length
42         of CPU set to the kernel.
44 2008-05-23  Paul Pluzhnikov  <ppluzhnikov@google.com>
46         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Add
47         cfi directives.
48         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
49         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
50         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
51         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
52         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
53         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
55 2008-05-22  Paul Pluzhnikov  <ppluzhnikov@google.com>
57         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S: Add
58         cfi directives.
59         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
60         Likewise.
61         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
62         Likewise.
63         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
64         Likewise.
66 2008-05-26  Ulrich Drepper  <drepper@redhat.com>
68         * tst-typesizes.c: Explicitly check __SIZEOF_PTHREAD_* constants.
70 2008-05-20  Jakub Jelinek  <jakub@redhat.com>
72         David S. Miller  <davem@davemloft.net>
74         * sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: New file.
76 2008-05-10  Ulrich Drepper  <drepper@redhat.com>
78         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Access
79         __pshared correctly.
80         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
81         Likewise.
82         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
83         Likewise.
84         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
85         Likewise.
86         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
87         Likewise.
88         Reported by Clemens Kolbitsch <clemens.kol@gmx.at>.
90 2008-04-14  David S. Miller  <davem@davemloft.net>
92         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
93         (__old_sem_wait): Fix argument to lll_futex_wait().
95 2007-11-26  Daniel Jacobowitz  <dan@codesourcery.com>
97         * pthread_create.c: Require pthread_mutex_trylock and
98         pthread_key_delete for libgcc.
100 2008-04-08  Jakub Jelinek  <jakub@redhat.com>
102         [BZ #6020]
103         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h
104         (lll_futex_wake_unlock): Add private argument to the pre-v9 macro.
105         Patch by Sunil Amitkumar Janki <devel.sjanki@gmail.com>.
107 2008-03-27  Ulrich Drepper  <drepper@redhat.com>
109         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine ARG_MAX if
110         <linux/limits.h> has defined it.
111         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
112         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
113         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
114         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
116 2008-03-18  Jakub Jelinek  <jakub@redhat.com>
118         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Use __ASSEMBLER__ instead
119         of ASSEMBLER.
120         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
121         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Likewise.
123 2008-03-14  Ulrich Drepper  <drepper@redhat.com>
125         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
126         HAVE_DL_DISCOVER_OSVERSION.
127         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: Likewise.
128         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: Likewise.
130 2008-03-07  Ulrich Drepper  <drepper@redhat.com>
132         [BZ #5778]
133         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Change
134         _POSIX_CHOWN_RESTRICTED value to zero.
136 2008-01-31  Roland McGrath  <roland@redhat.com>
138         * Makefile (omit-deps): Variable removed.
140 2008-01-30  Ulrich Drepper  <drepper@redhat.com>
142         * sysdeps/unix/sysv/linux/x86_64/sem_post.S (sem_post): Avoid
143         unnecessary addr32 prefix.
145 2008-01-29  Roland McGrath  <roland@redhat.com>
147         * Makeconfig (ptw-CPPFLAGS, sysd-rules-patterns): New variables.
149 2008-01-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
151         * sysdeps/unix/sysv/linux/sh/sem_post.S: Don't overflow value field.
153 2008-01-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
155         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XADD): Use
156         a scratch register.
157         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
158         (__lll_lock_wait_private): Fix typo.
159         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
160         (pthread_barrier_wait): Likewise.  Adjust XADD use.
161         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
162         Adjust XADD use.
163         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
164         (pthread_rwlock_timedrdlock): Return correct return value.
165         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
166         (pthread_rwlock_timedwrlock): Likewise.
168 2008-01-15  Ulrich Drepper  <drepper@redhat.com>
170         * tst-eintr2.c (do_test): make sure that if mutex_lock in main
171         thread returns the program exits with an error code.
173 2008-01-10  Ulrich Drepper  <drepper@redhat.com>
175         * pthread-errnos.sym: Add EOVERFLOW.
176         * sysdeps/unix/sysv/linux/structsem.sym: Add SEM_VALUE_MAX.
177         * sysdeps/unix/sysv/linux/sem_post.c: Don't overflow value field.
178         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
179         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
181 2007-12-14  Ulrich Drepper  <drepper@redhat.com>
183         * sysdeps/x86_64/pthreaddef.h (ARCH_RETRY_MMAP): Take additional
184         parameter.  Passed it as permission to mmap.
185         * allocatestack.c (allocate_stack): Pass prot as second parameter
186         to ARCH_RETRY_MMAP.
188 2007-12-12  Ulrich Drepper  <drepper@redhat.com>
190         * tst-basic7.c: Allocate memory for the stack.
192         [BZ #5465]
193         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S [!SHARED]
194         (__pthread_cond_timedwait): Don't use VDSO.
195         Patch by Michal Januszewski.
197 2007-12-07  Ulrich Drepper  <drepper@redhat.com>
199         [BZ #5455]
200         * sysdeps/pthread/pthread.h [!__EXCEPTIONS] (pthread_cleanup_pop):
201         Allow label before pthread_cleanup_pop.
202         (pthread_cleanup_pop_restore_np): Likewise.
204 2007-12-04  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
206         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
207         Store 2 before returning ETIMEDOUT.
209 2007-11-23  Ulrich Drepper  <drepper@redhat.com>
211         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
212         Store 2 before returning ETIMEDOUT.
213         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise
214         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
215         (__lll_lock_wait_private): Optimize.
216         (__lll_lock_wait): Likewise.
218 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
220         * sysdeps/pthread/pthread.h (pthread_cleanup_push,
221         pthread_cleanup_push_defer_np): Add extra (void *) cast to shut up
222         g++ 4.1 and 4.2 -Wstrict-aliasing warnings.
224 2007-11-08  Ulrich Drepper  <drepper@redhat.com>
226         [BZ #5240]
227         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
228         If we time out, try one last time to lock the futex to avoid
229         losing a wakeup signal.
230         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
231         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
233         [BZ #5245]
234         * sysdeps/pthread/createthread.c (do_clone): Translate clone error
235         if necessary.
237 2007-11-07  Ulrich Drepper  <drepper@redhat.com>
239         [BZ #5245]
240         * allocatestack.c (allocate_stack): Change ENOMEM error in case
241         mmap failed to EAGAIN.
242         * Makefile (tests): Add tst-basic7.
243         * tst-basic7.c: New file.
245 2007-11-05  Ulrich Drepper  <drepper@redhat.com>
247         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
248         Use __linkin_atfork.
250 2007-11-03  Mike Frysinger  <vapier@gentoo.org>
252         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (LOAD_FUTEX_WAIT): Add
253         missing line continuations.
254         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S (LOAD_FUTEX_WAIT,
255         LOAD_FUTEX_WAKE): Likewise.  Also add missing 3rd parameter.
257 2007-10-28  Ulrich Drepper  <drepper@redhat.com>
259         [BZ #5220]
260         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Declare
261         __active_timer_sigev_thread and __active_timer_sigev_thread_lock.
262         (struct timer): Add next element.
263         * sysdeps/unix/sysv/linux/timer_create.c: For SIGEV_THREAD timers,
264         enqueue timer structure into __active_timer_sigev_thread list.
265         * sysdeps/unix/sysv/linux/timer_delete.c: For SIGEV_THREAD timers,
266         remove timer struct from __active_timer_sigev_thread.
267         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
268         Before using timer structure make sure it is still on the
269         __active_timer_sigev_thread list.  Keep lock until done.
270         Define __active_timer_sigev_thread and
271         __active_timer_sigev_thread_lock.
273 2007-10-27  Ulrich Drepper  <drepper@redhat.com>
275         * sysdeps/pthread/malloc-machine.h: Define ATFORK_MEM.
276         Redefine thread_atfork for use of ATFORK_MEM.
277         * sysdeps/unix/sysv/linux/fork.h: Define __linkin_atfork.
278         * sysdeps/unix/sysv/linux/register-atfork.c (__linkin_atfork): New
279         function.
280         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
281         Use atomic operation when removing first element of list.
283 2007-10-17  Jakub Jelinek  <jakub@redhat.com>
285         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__old_sem_post): New
286         routine instead of an alias to __new_sem_post.
288 2007-10-15  Jakub Jelinek  <jakub@redhat.com>
290         * init.c (__pthread_initialize_minimal): Initialize word to appease
291         valgrind.
293 2007-10-10  Jakub Jelinek  <jakub@redhat.com>
295         * sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
296         libc.so just clear NAME.
297         (__libc_rwlock_fini): Nop inside of libc.so.
298         * tst-initializers1.c (main): Test if PTHREAD_RWLOCK_INITIALIZER is
299         all zeros.
301 2007-09-02  Ulrich Drepper  <drepper@redhat.com>
303         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
304         (__pthread_cond_wait): Fix unlocking of internal lock after mutex
305         unlocking failed.
306         Patch by Luca Barbieri <luca.barbieri@gmail.com>.
308 2007-08-21  Ulrich Drepper  <drepper@redhat.com>
310         [BZ #4938]
311         * allocatestack.c (__reclaim_stacks): Clear the TSD in the
312         reclaimed stack if necessary.
313         * Makefile (tests): Add tst-tsd6.
314         * tst-tsd6.c: New file.
316 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
318         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_dead):
319         Add private argument.
321 2007-08-20  Ulrich Drepper  <drepper@redhat.com>
323         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
324         (__pthread_cond_timedwait): Use clock_gettime from VDSO if possible.
326 2007-08-16  Jakub Jelinek  <jakub@redhat.com>
328         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h
329         (__lll_robust_timedlock): Pass private as last argument to
330         __lll_robust_timedlock_wait.
331         (__lll_unlock): Fix a pasto.
333 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
335         * sysdeps/unix/sysv/linux/sparc/internaltypes.h (sparc_new_sem,
336         sparc_old_sem): New structs.
337         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
338         (__sem_wait_cleanup): New function.
339         (__new_sem_wait): Use sparc_new_sem structure.  Bump and afterwards
340         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
341         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
342         lll_futex_wait.
343         (__old_sem_wait): New function.
344         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: Include
345         nptl/sysdeps/unix/sysv/linux/sparc version.
346         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c:
347         Likewise.
348         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: Likewise.
349         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
350         (__new_sem_trywait): Use sparc_old_sem structure.
351         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
352         (sem_timedwait): Use sparc_new_sem structure.  Bump and afterwards
353         decrease nwaiters.  Register __sem_wait_cleanup as cleanup handler.
354         Pass isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
355         lll_futex_timed_wait.
356         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c (__new_sem_post):
357         Use sparc_new_sem structure.  Only wake if nwaiters > 0.  Pass
358         isem->private ^ FUTEX_PRIVATE_FLAG as last argument to
359         lll_futex_wake.
360         (__old_sem_post): New function.
361         * sysdeps/unix/sysv/linux/sparc/sem_wait.c: New file.
362         * sysdeps/unix/sysv/linux/sparc/sem_init.c: New file.
363         * sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: New file.
364         * sysdeps/unix/sysv/linux/sparc/sem_post.c: New file.
365         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: Remove.
366         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: Remove.
368 2007-08-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
370         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
371         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
372         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
373         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
374         * sysdeps/unix/sysv/linux/shpthread_cond_signal.S
375         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
376         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
377         Use FUTEX_WAKE_OP.
378         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
379         kernel-features.h and tcb-offsets.h.
380         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
381         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
382         process private.
383         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
384         tcb-offsets.h.
385         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE
386         to lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
387         process private.
388         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use #ifdef
389         __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
390         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
391         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
392         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
393         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
394         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
396 2007-08-14  Jakub Jelinek  <jakub@redhat.com>
398         * sysdeps/unix/sysv/linux/lowlevellock.c: Comment fix.
399         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
400         (__lll_timedwait_tid): Pass LLL_SHARED as 4th argument to
401         lll_futex_timed_wait.
403         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (__lll_unlock,
404         __lll_robust_unlock): Rewrite as macros instead of inline functions.
405         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_unlock,
406         __lll_robust_unlock, __lll_wait_tid): Likewise.
408 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
410         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
411         Fix a pasto.
412         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
413         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
414         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
415         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
416         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
417         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
418         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
419         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Include
420         kernel-features.h.
421         (__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
422         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
423         process private.  Switch DW_CFA_advance_loc1 and some
424         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
425         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
426         (__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE to
427         lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
428         process private.  Switch DW_CFA_advance_loc{1,2} and some
429         DW_CFA_advance_loc .eh_frame opcodes to DW_CFA_advance_loc4.
430         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use
431         #ifdef __ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
432         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
433         Likewise.
434         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
435         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
436         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
437         Likewise.
438         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
439         (__pthread_cond_broadcast): Compare %r8 instead of
440         dep_mutex-cond_*(%rdi) with $-1.
441         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
442         (__pthread_cond_signal): Xor FUTEX_WAKE_OP with FUTEX_WAKE instead
443         of oring.
445 2007-08-13  Ulrich Drepper  <drepper@redhat.com>
447         * sysdeps/unix/sysv/linux/i386/i786/Implies: New file.
449 2007-08-13  Jakub Jelinek  <jakub@redhat.com>
451         * allocatestack.c: Include kernel-features.h.
452         * pthread_create.c: Likewise.
453         * pthread_mutex_init.c: Likewise.
454         * init.c: Likewise.
455         * pthread_cond_timedwait.c: Likewise.
456         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
457         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
458         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
459         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
460         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
461         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
462         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
463         Likewise.
464         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
465         Likewise.
466         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
467         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
468         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
469         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
471 2007-08-12  Jakub Jelinek  <jakub@redhat.com>
473         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
474         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
475         byte elements.  One of them is the new __shared element.
476         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
477         adjust names of other padding elements.
478         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
479         [__WORDSIZE=32] (pthread_rwlock_t): Split __flags element into four
480         byte elements.  One of them is the new __shared element.
481         [__WORDSIZE=64] (pthread_rwlock_t): Renamed __pad1 element to __shared,
482         adjust names of other padding elements.
483         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_rwlock_t):
484         Renamed __pad1 element to __shared, adjust names of other padding
485         elements.
486         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
487         (pthread_rwlock_t): Likewise.
488         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock): Fix a
489         typo.
491 2007-08-09  Anton Blanchard  <anton@samba.org>
493         * sysdeps/unix/sysv/linux/powerpc/pthread_spin_unlock.c: New file.
495 2007-08-12  Ulrich Drepper  <drepper@redhat.com>
497         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Include
498         <kernel-features.h>.
499         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
501 2007-08-11  Ulrich Drepper  <drepper@redhat.com>
503         * pthreadP.h (PTHREAD_ROBUST_MUTEX_PSHARED): Define.
504         * pthread_mutex_lock.c: Use it instead of PTHREAD_MUTEX_PSHARED when
505         dealing with robust mutexes.
506         * pthread_mutex_timedlock.c: Likewise.
507         * pthread_mutex_trylock.c: Likewise.
508         * pthread_mutex_unlock.c: Likewise.
509         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
511 2007-08-06  Jakub Jelinek  <jakub@redhat.com>
513         * pthreadP.h (PTHREAD_MUTEX_PSHARED_BIT): Define.
514         (PTHREAD_MUTEX_TYPE): Mask __kind with 127.
515         (PTHREAD_MUTEX_PSHARED): Define.
516         * pthread_mutex_init.c (__pthread_mutex_init): Set
517         PTHREAD_MUTEX_PSHARED_BIT for pshared or robust
518         mutexes.
519         * pthread_mutex_lock.c (LLL_MUTEX_LOCK): Take mutex as argument
520         instead of its __data.__lock field, pass PTHREAD_MUTEX_PSHARED
521         as second argument to lll_lock.
522         (LLL_MUTEX_TRYLOCK): Take mutex as argument
523         instead of its __data.__lock field.
524         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
525         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
526         to lll_robust_lock.
527         (__pthread_mutex_lock): Update LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
528         LLL_ROBUST_MUTEX_LOCK users, use PTHREAD_MUTEX_TYPE (mutex)
529         instead of mutex->__data.__kind directly, pass
530         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock and lll_futex_wait.
531         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use
532         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
533         directly, pass PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock.
534         (pthread_mutex_timedlock): Pass PTHREAD_MUTEX_PSHARED (mutex)
535         to lll_timedlock, lll_robust_timedlock, lll_unlock and
536         lll_futex_timed_wait.  Use PTHREAD_MUTEX_TYPE (mutex) instead
537         of mutex->__data.__kind directly.
538         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Pass
539         PTHREAD_MUTEX_PSHARED (mutex) to lll_timedlock,
540         lll_robust_timedlock, lll_unlock and lll_futex_timed_wait.  Use
541         PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind directly.
542         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Pass
543         PTHREAD_MUTEX_PSHARED (mutex) to lll_unlock, lll_robust_unlock
544         and lll_futex_wake.
545         * pthread_mutex_setprioceiling.c (pthread_mutex_setprioceiling): Pass
546         PTHREAD_MUTEX_PSHARED (mutex) to lll_futex_wait and lll_futex_wake.
547         Use PTHREAD_MUTEX_TYPE (mutex) instead of mutex->__data.__kind
548         directly.
549         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK):
550         Take mutex as argument instead of its __data.__lock field, pass
551         PTHREAD_MUTEX_PSHARED as second argument to lll_cond_lock.
552         (LLL_MUTEX_TRYLOCK): Take mutex as argument instead of its
553         __data.__lock field.
554         (LLL_ROBUST_MUTEX_LOCK): Take mutex as argument instead of its
555         __data.__lock field, pass PTHREAD_MUTEX_PSHARED as second argument
556         to lll_robust_cond_lock.
557         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Add pshared
558         variable, pass it to lll_lock, lll_unlock, lll_futex_requeue and
559         lll_futex_wake.  Don't use lll_futex_requeue if dependent mutex
560         has PTHREAD_MUTEX_PSHARED_BIT bit set in its __data.__kind.
561         * pthread_cond_destroy.c (__pthread_cond_destroy): Add pshared
562         variable, pass it to lll_lock, lll_unlock, lll_futex_wake and
563         lll_futex_wait.
564         * pthread_cond_signal.c (__pthread_cond_signal): Add pshared
565         variable, pass it to lll_lock, lll_unlock, lll_futex_wake_unlock and
566         lll_futex_wake.
567         * pthread_cond_timedwait.c (__pthread_cond_wait): Add
568         pshared variable, pass it to lll_lock, lll_unlock,
569         lll_futex_timedwait and lll_futex_wake.
570         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait): Add
571         pshared variable, pass it to lll_lock, lll_unlock, lll_futex_wait
572         and lll_futex_wake.
573         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_requeue,
574         lll_futex_wake_unlock): Add private argument, use __lll_private_flag
575         macro.
576         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue,
577         lll_futex_wake_unlock): Likewise.
578         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_requeue):
579         Likewise.
580         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_futex_requeue,
581         lll_futex_wake_unlock): Likewise.
582         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_requeue):
583         Likewise.
584         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue,
585         lll_futex_wake_unlock): Likewise.
586         (lll_futex_wake): Fix a typo.
587         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym (PS_BIT): Add.
588         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
589         (__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
590         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
591         Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
592         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
593         (__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
594         FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
595         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
596         (__pthread_cond_timedwait): Likewise.
597         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
598         (__condvar_cleanup, __pthread_cond_wait): Likewise.
600 2007-08-05  Jakub Jelinek  <jakub@redhat.com>
602         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
603         Don't use CGOTSETUP and CGOTRESTORE macros.
604         (CGOTSETUP, CGOTRESTORE): Remove.
605         <IS_IN_rtld> (CENABLE, CDISABLE): Don't use JUMPTARGET, branch to
606         @local symbol.
608 2007-08-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
610         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Remove
611         definitions for private futexes.
612         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Include
613         kernel-features.h and lowlevellock.h.  Use private futexes if
614         they are available.
615         (__lll_lock_wait_private, __lll_unlock_wake_private): New.
616         (__lll_mutex_lock_wait): Rename to
617         (__lll_lock_wait): ... this.  Don't compile in for libc.so.
618         (__lll_mutex_timedlock_wait): Rename to ...
619         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.
620         Don't compile in for libc.so.
621         (__lll_mutex_unlock_wake): Rename to ...
622         (__lll_unlock_wake): ... this.  Don't compile in for libc.so.
623         (__lll_timedwait_tid): Use __NR_gettimeofday.
624         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Allow including
625         the header from assembler.  Renamed all lll_mutex_* resp.
626         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
627         Renamed all LLL_MUTEX_LOCK_* macros to LLL_LOCK_*.
628         (FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE):
629         Define.
630         (__lll_lock_wait_private): Add prototype.
631         (__lll_lock_wait, __lll_timedlock_wait, __lll_robust_lock_wait,
632         __lll_robust_timedlock_wait, __lll_unlock_wake_private,
633         __lll_unlock_wake): Likewise.
634         (lll_lock): Add private argument.  Call __lll_lock_wait_private
635         if private is constant LLL_PRIVATE.
636         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
637         lll_timedlock, lll_robust_timedlock): Add private argument.
638         (lll_unlock): Add private argument.  Call __lll_unlock_wake_private
639         if private is constant LLL_PRIVATE.
640         (lll_robust_unlock, lll_robust_dead): Add private argument.
641         (lll_lock_t): Remove.
642         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
643         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
644         lll_cond_wake, lll_cond_broadcast): Remove.
645         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: Include
646         kernel-features.h and lowlevellock.h.
647         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
648         (LOAD_FUTEX_WAIT): Define.
649         (__lll_robust_mutex_lock_wait): Rename to ...
650         (__lll_robust_lock_wait): ... this.  Add private argument.
651         Use LOAD_FUTEX_WAIT macro.
652         (__lll_robust_mutex_timedlock_wait): Rename to ...
653         (__lll_robust_timedlock_wait): ... this.    Add private argument.
654         Use __NR_gettimeofday.  Use LOAD_FUTEX_WAIT macro.
655         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Include
656         lowlevellock.h.
657         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
658         (pthread_barrier_wait): Use __lll_{lock,unlock}_* instead of
659         __lll_mutex_{lock,unlock}_*.
660         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Include
661         lowlevellock.h and pthread-errnos.h.
662         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
663         FUTEX_CMP_REQUEUE, EINVAL): Remove.
664         (__pthread_cond_broadcast): Use __lll_{lock,unlock}_* instead of
665         __lll_mutex_{lock,unlock}_*.
666         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Include
667         lowlevellock.h and pthread-errnos.h.
668         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE, EINVAL): Remove.
669         (__pthread_cond_signal): Use __lll_{lock,unlock}_* instead of
670         __lll_mutex_{lock,unlock}_*.
671         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
672         lowlevellock.h.
673         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE): Remove.
674         (__pthread_cond_timedwait): Use __lll_{lock,unlock}_* instead of
675         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
676         (__condvar_tw_cleanup): Likewise.
677         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
678         lowlevellock.h.
679         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Remove.
680         (__pthread_cond_wait): Use __lll_{lock,unlock}_* instead of
681         __lll_mutex_{lock,unlock}_*.
682         ( __condvar_w_cleanup): Likewise.
683         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Include lowlevellock.h.
684         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
685         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Include
686         lowlevellock.h.
687         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
688         (__pthread_rwlock_rdlock): Use __lll_{lock,unlock}_* instead of
689         __lll_mutex_{lock,unlock}_*.
690         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Include
691         lowlevellock.h.
692         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
693         FUTEX_PRIVATE_FLAG): Remove.
694         (pthread_rwlock_timedrdlock): Use __lll_{lock,unlock}_* instead of
695         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
696         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Include
697         lowlevellock.h.
698         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
699         FUTEX_PRIVATE_FLAG): Remove.
700         (pthread_rwlock_timedwrlock): Use __lll_{lock,unlock}_* instead of
701         __lll_mutex_{lock,unlock}_*.  Use __NR_gettimeofday.
702         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Include
703         lowlevellock.h.
704         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
705         (__pthread_rwlock_unlock): Use __lll_{lock,unlock}_* instead of
706         __lll_mutex_{lock,unlock}_*.
707         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Include
708         lowlevellock.h.
709         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
710         (__pthread_rwlock_wrlock): Use __lll_{lock,unlock}_* instead of
711         __lll_mutex_{lock,unlock}_*.
712         * sysdeps/unix/sysv/linux/sh/sem_post.S: Include lowlevellock.h.
713         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Remove.
714         (__new_sem_post): Use standard initial exec code sequences.
715         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Include
716         lowlevellock.h.
717         (SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE,
718         FUTEX_PRIVATE_FLAG): Remove.
719         (sem_timedwait): Use __NR_gettimeofday.  Use standard initial
720         exec code sequences.
721         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Include lowlevellock.h.
722         (__new_sem_trywait): Use standard initial exec code sequences.
723         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Include lowlevellock.h.
724         (__new_sem_wait): Use standard initial exec code sequences.
726 2007-07-31  Anton Blanchard  <anton@samba.org>
728         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
729         Use __asm __volatile (__lll_acq_instr ::: "memory") instead of
730         atomic_full_barrier.
732 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
734         * allocatestack.c (stack_cache_lock): Change type to int.
735         (get_cached_stack, allocate_stack, __deallocate_stack,
736         __make_stacks_executable, __find_thread_by_id, __nptl_setxid,
737         __pthread_init_static_tls, __wait_lookup_done): Add LLL_PRIVATE
738         as second argument to lll_lock and lll_unlock macros on
739         stack_cache_lock.
740         * pthread_create.c (__find_in_stack_list): Likewise.
741         (start_thread): Similarly with pd->lock.  Use lll_robust_dead
742         macro instead of lll_robust_mutex_dead, pass LLL_SHARED to it
743         as second argument.
744         * descr.h (struct pthread): Change lock and setxid_futex field
745         type to int.
746         * old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0): Use
747         LLL_LOCK_INITIALIZER instead of LLL_MUTEX_LOCK_INITIALIZER.
748         * old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
749         * old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
750         Likewise.
751         * old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
752         * pthread_cond_init.c (__pthread_cond_init): Likewise.
753         * pthreadP.h (__attr_list_lock): Change type to int.
754         * pthread_attr_init.c (__attr_list_lock): Likewise.
755         * pthread_barrier_destroy.c (pthread_barrier_destroy): Pass
756         ibarrier->private ^ FUTEX_PRIVATE_FLAG as second argument to
757         lll_{,un}lock.
758         * pthread_barrier_wait.c (pthread_barrier_wait): Likewise and
759         also for lll_futex_{wake,wait}.
760         * pthread_barrier_init.c (pthread_barrier_init): Make iattr
761         a pointer to const.
762         * pthread_cond_broadcast.c (__pthread_cond_broadcast): Pass
763         LLL_SHARED as second argument to lll_{,un}lock.
764         * pthread_cond_destroy.c (__pthread_cond_destroy): Likewise.
765         * pthread_cond_signal.c (__pthread_cond_singal): Likewise.
766         * pthread_cond_timedwait.c (__pthread_cond_timedwait): Likewise.
767         * pthread_cond_wait.c (__condvar_cleanup, __pthread_cond_wait):
768         Likewise.
769         * pthread_getattr_np.c (pthread_getattr_np): Add LLL_PRIVATE
770         as second argument to lll_{,un}lock macros on pd->lock.
771         * pthread_getschedparam.c (__pthread_getschedparam): Likewise.
772         * pthread_setschedparam.c (__pthread_setschedparam): Likewise.
773         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
774         * tpp.c (__pthread_tpp_change_priority, __pthread_current_priority):
775         Likewise.
776         * sysdeps/pthread/createthread.c (do_clone, create_thread):
777         Likewise.
778         * pthread_once.c (once_lock): Change type to int.
779         (__pthread_once): Pass LLL_PRIVATE as second argument to
780         lll_{,un}lock macros on once_lock.
781         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Use
782         lll_{,un}lock macros instead of lll_mutex_{,un}lock, pass
783         rwlock->__data.__shared as second argument to them and similarly
784         for lll_futex_w*.
785         * pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
786         Likewise.
787         * pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
788         Likewise.
789         * pthread_rwlock_tryrdlock.c (__pthread_rwlock_tryrdlock): Likewise.
790         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Likewise.
791         * pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Likewise.
792         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
793         * sem_close.c (sem_close): Pass LLL_PRIVATE as second argument
794         to lll_{,un}lock macros on __sem_mappings_lock.
795         * sem_open.c (check_add_mapping): Likewise.
796         (__sem_mappings_lock): Change type to int.
797         * semaphoreP.h (__sem_mappings_lock): Likewise.
798         * pthread_mutex_lock.c (LLL_MUTEX_LOCK, LLL_MUTEX_TRYLOCK,
799         LLL_ROBUST_MUTEX_LOCK): Use lll_{,try,robust_}lock macros
800         instead of lll_*mutex_*, pass LLL_SHARED as last
801         argument.
802         (__pthread_mutex_lock): Use lll_unlock instead of lll_mutex_unlock,
803         pass LLL_SHARED as last argument.
804         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c (LLL_MUTEX_LOCK,
805         LLL_MUTEX_TRYLOCK, LLL_ROBUST_MUTEX_LOCK): Use
806         lll_{cond_,cond_try,robust_cond}lock macros instead of lll_*mutex_*,
807         pass LLL_SHARED as last argument.
808         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
809         lll_{timed,try,robust_timed,un}lock instead of lll_*mutex*, pass
810         LLL_SHARED as last argument.
811         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Similarly.
812         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt):
813         Similarly.
814         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_lock,
815         __libc_lock_lock_recursive, __libc_lock_unlock,
816         __libc_lock_unlock_recursive): Pass LLL_PRIVATE as second
817         argument to lll_{,un}lock.
818         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_lock,
819         _IO_lock_unlock): Likewise.
820         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Don't use
821         compound literal.
822         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
823         Pass LLL_PRIVATE as second argument to lll_{,un}lock macros on
824         __fork_lock.
825         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork,
826         free_mem): Likewise.
827         (__fork_lock): Change type to int.
828         * sysdeps/unix/sysv/linux/fork.h (__fork_lock): Likewise.
829         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Pass
830         isem->private ^ FUTEX_PRIVATE_FLAG as second argument to
831         lll_futex_wake.
832         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
833         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Likewise.
834         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait_private):
835         New function.
836         (__lll_lock_wait, __lll_timedlock_wait): Add private argument and
837         pass it through to lll_futex_*wait, only compile in when
838         IS_IN_libpthread.
839         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
840         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): Add private
841         argument and pass it through to lll_futex_*wait.
842         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Renamed all
843         lll_mutex_* resp. lll_robust_mutex_* macros to lll_* resp.
844         lll_robust_*.  Renamed all __lll_mutex_* resp. __lll_robust_mutex_*
845         inline functions to __lll_* resp. __lll_robust_*.
846         (LLL_MUTEX_LOCK_INITIALIZER): Remove.
847         (lll_mutex_dead): Add private argument.
848         (__lll_lock_wait_private): New prototype.
849         (__lll_lock_wait, __lll_robust_lock_wait, __lll_lock_timedwait,
850         __lll_robust_lock_timedwait): Add private argument to prototypes.
851         (__lll_lock): Add private argument, if it is constant LLL_PRIVATE,
852         call __lll_lock_wait_private, otherwise pass private to
853         __lll_lock_wait.
854         (__lll_robust_lock, __lll_cond_lock, __lll_timedlock,
855         __lll_robust_timedlock): Add private argument, pass it to
856         __lll_*wait functions.
857         (__lll_unlock): Add private argument, if it is constant LLL_PRIVATE,
858         call __lll_unlock_wake_private, otherwise pass private to
859         __lll_unlock_wake.
860         (__lll_robust_unlock): Add private argument, pass it to
861         __lll_robust_unlock_wake.
862         (lll_lock, lll_robust_lock, lll_cond_lock, lll_timedlock,
863         lll_robust_timedlock, lll_unlock, lll_robust_unlock): Add private
864         argument, pass it through to __lll_* inline function.
865         (__lll_mutex_unlock_force, lll_mutex_unlock_force): Remove.
866         (lll_lock_t): Remove.
867         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
868         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
869         lll_cond_wake, lll_cond_broadcast): Remove.
870         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
871         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
872         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
873         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
874         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Allow including
875         the header from assembler.  Renamed all lll_mutex_* resp.
876         lll_robust_mutex_* macros to lll_* resp. lll_robust_*.
877         (LOCK, FUTEX_CMP_REQUEUE, FUTEX_WAKE_OP,
878         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
879         (LLL_MUTEX_LOCK_INITIALIZER, LLL_MUTEX_LOCK_INITIALIZER_LOCKED,
880         LLL_MUTEX_LOCK_INITIALIZER_WAITERS): Remove.
881         (__lll_mutex_lock_wait, __lll_mutex_timedlock_wait,
882         __lll_mutex_unlock_wake, __lll_lock_wait, __lll_unlock_wake):
883         Remove prototype.
884         (__lll_trylock_asm, __lll_lock_asm_start, __lll_unlock_asm): Define.
885         (lll_robust_trylock, lll_cond_trylock): Use LLL_LOCK_INITIALIZER*
886         rather than LLL_MUTEX_LOCK_INITIALIZER* macros.
887         (lll_trylock): Likewise, use __lll_trylock_asm, pass
888         MULTIPLE_THREADS_OFFSET as another asm operand.
889         (lll_lock): Add private argument, use __lll_lock_asm_start, pass
890         MULTIPLE_THREADS_OFFSET as last asm operand, call
891         __lll_lock_wait_private if private is constant LLL_PRIVATE,
892         otherwise pass private as another argument to __lll_lock_wait.
893         (lll_robust_lock, lll_cond_lock, lll_robust_cond_lock,
894         lll_timedlock, lll_robust_timedlock): Add private argument, pass
895         private as another argument to __lll_*lock_wait call.
896         (lll_unlock): Add private argument, use __lll_unlock_asm, pass
897         MULTIPLE_THREADS_OFFSET as another asm operand, call
898         __lll_unlock_wake_private if private is constant LLL_PRIVATE,
899         otherwise pass private as another argument to __lll_unlock_wake.
900         (lll_robust_unlock): Add private argument, pass private as another
901         argument to __lll_unlock_wake.
902         (lll_robust_dead): Add private argument, use __lll_private_flag
903         macro.
904         (lll_islocked): Use LLL_LOCK_INITIALIZER instead of
905         LLL_MUTEX_LOCK_INITIALIZER.
906         (lll_lock_t): Remove.
907         (LLL_LOCK_INITIALIZER_WAITERS): Define.
908         (__lll_cond_wait, __lll_cond_timedwait, __lll_cond_wake,
909         __lll_cond_broadcast, lll_cond_wait, lll_cond_timedwait,
910         lll_cond_wake, lll_cond_broadcast): Remove.
911         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
912         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Revert
913         2007-05-2{3,9} changes.
914         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Include
915         kernel-features.h and lowlevellock.h.
916         (LOAD_PRIVATE_FUTEX_WAIT): Define.
917         (LOAD_FUTEX_WAIT): Rewritten.
918         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
919         define.
920         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
921         (__lll_mutex_lock_wait): Rename to ...
922         (__lll_lock_wait): ... this.  Take futex addr from %edx instead of
923         %ecx, %ecx is now private argument.  Don't compile in for libc.so.
924         (__lll_mutex_timedlock_wait): Rename to ...
925         (__lll_timedlock_wait): ... this.  Use __NR_gettimeofday.  %esi
926         contains private argument.  Don't compile in for libc.so.
927         (__lll_mutex_unlock_wake): Rename to ...
928         (__lll_unlock_wake): ... this.  %ecx contains private argument.
929         Don't compile in for libc.so.
930         (__lll_timedwait_tid): Use __NR_gettimeofday.
931         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Include
932         kernel-features.h and lowlevellock.h.
933         (LOAD_FUTEX_WAIT): Define.
934         (LOCK, SYS_gettimeofday, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't
935         define.
936         (__lll_robust_mutex_lock_wait): Rename to ...
937         (__lll_robust_lock_wait): ... this.  Futex addr is now in %edx
938         argument, %ecx argument contains private.  Use LOAD_FUTEX_WAIT
939         macro.
940         (__lll_robust_mutex_timedlock_wait): Rename to ...
941         (__lll_robust_timedlock_wait): ... this.  Use __NR_gettimeofday.
942         %esi argument contains private, use LOAD_FUTEX_WAIT macro.
943         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Include
944         lowlevellock.h.
945         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
946         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
947         PRIVATE(%ebx) ^ LLL_SHARED as private argument in %ecx to
948         __lll_lock_wait and __lll_unlock_wake, pass MUTEX(%ebx) address
949         to __lll_lock_wait in %edx.
950         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
951         Include lowlevellock.h and pthread-errnos.h.
952         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
953         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
954         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*, pass
955         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
956         pass LLL_SHARED in %ecx to both __lll_lock_wait and
957         __lll_unlock_wake.
958         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
959         Include lowlevellock.h and pthread-errnos.h.
960         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
961         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
962         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*, pass
963         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
964         pass LLL_SHARED in %ecx to both __lll_lock_wait and
965         __lll_unlock_wake.
966         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
967         Include lowlevellock.h.
968         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
969         Don't define.
970         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*, pass
971         cond_lock address in %edx rather than %ecx to __lll_lock_wait,
972         pass LLL_SHARED in %ecx to both __lll_lock_wait and
973         __lll_unlock_wake.  Use __NR_gettimeofday.
974         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
975         Include lowlevellock.h.
976         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
977         (__pthread_cond_wait, __condvar_w_cleanup): Rename __lll_mutex_*
978         to __lll_*, pass cond_lock address in %edx rather than %ecx to
979         __lll_lock_wait, pass LLL_SHARED in %ecx to both __lll_lock_wait
980         and __lll_unlock_wake.
981         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S:
982         Include lowlevellock.h.
983         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
984         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*, pass
985         MUTEX(%ebx) address in %edx rather than %ecx to
986         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
987         and __lll_unlock_wake.  Move return value from %ecx to %edx
988         register.
989         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
990         Include lowlevellock.h.
991         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
992         Don't define.
993         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
994         MUTEX(%ebp) address in %edx rather than %ecx to
995         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
996         and __lll_unlock_wake.  Move return value from %ecx to %edx
997         register.  Use __NR_gettimeofday.
998         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
999         Include lowlevellock.h.
1000         (SYS_futex, SYS_gettimeofday, FUTEX_WAIT, FUTEX_WAKE, LOCK):
1001         Don't define.
1002         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1003         MUTEX(%ebp) address in %edx rather than %ecx to
1004         __lll_lock_wait, pass PSHARED(%ebp) in %ecx to both __lll_lock_wait
1005         and __lll_unlock_wake.  Move return value from %ecx to %edx
1006         register.  Use __NR_gettimeofday.
1007         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
1008         Include lowlevellock.h.
1009         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1010         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*, pass
1011         MUTEX(%edi) address in %edx rather than %ecx to
1012         __lll_lock_wait, pass PSHARED(%edi) in %ecx to both __lll_lock_wait
1013         and __lll_unlock_wake.
1014         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S:
1015         Include lowlevellock.h.
1016         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1017         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*, pass
1018         MUTEX(%ebx) address in %edx rather than %ecx to
1019         __lll_lock_wait, pass PSHARED(%ebx) in %ecx to both __lll_lock_wait
1020         and __lll_unlock_wake.  Move return value from %ecx to %edx
1021         register.
1022         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Include
1023         lowlevellock.h.
1024         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1025         define.
1026         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Include lowlevellock.h.
1027         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1028         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Include
1029         lowlevellock.h.
1030         (LOCK, SYS_futex, SYS_gettimeofday, FUTEX_WAIT): Don't define.
1031         (sem_timedwait): Use __NR_gettimeofday.
1032         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Include
1033         lowlevellock.h.
1034         (LOCK): Don't define.
1035         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include
1036         lowlevellock.h.
1037         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1038         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Wake only when there
1039         are waiters.
1040         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Revert
1041         2007-05-2{3,9} changes.
1042         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Include
1043         kernel-features.h and lowlevellock.h.
1044         (LOAD_PRIVATE_FUTEX_WAIT): Define.
1045         (LOAD_FUTEX_WAIT): Rewritten.
1046         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
1047         (__lll_lock_wait_private, __lll_unlock_wake_private): New functions.
1048         (__lll_mutex_lock_wait): Rename to ...
1049         (__lll_lock_wait): ... this.  %esi is now private argument.
1050         Don't compile in for libc.so.
1051         (__lll_mutex_timedlock_wait): Rename to ...
1052         (__lll_timedlock_wait): ... this.  %esi contains private argument.
1053         Don't compile in for libc.so.
1054         (__lll_mutex_unlock_wake): Rename to ...
1055         (__lll_unlock_wake): ... this.  %esi contains private argument.
1056         Don't compile in for libc.so.
1057         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Include
1058         kernel-features.h and lowlevellock.h.
1059         (LOAD_FUTEX_WAIT): Define.
1060         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE): Don't define.
1061         (__lll_robust_mutex_lock_wait): Rename to ...
1062         (__lll_robust_lock_wait): ... this.  %esi argument contains private.
1063         Use LOAD_FUTEX_WAIT macro.
1064         (__lll_robust_mutex_timedlock_wait): Rename to ...
1065         (__lll_robust_timedlock_wait): ... this. %esi argument contains
1066         private, use LOAD_FUTEX_WAIT macro.
1067         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Include
1068         lowlevellock.h.
1069         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1070         (pthread_barrier_wait): Rename __lll_mutex_* to __lll_*, pass
1071         PRIVATE(%rdi) ^ LLL_SHARED as private argument in %esi to
1072         __lll_lock_wait and __lll_unlock_wake.
1073         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S:
1074         Include lowlevellock.h and pthread-errnos.h.
1075         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_REQUEUE,
1076         FUTEX_CMP_REQUEUE, EINVAL, LOCK): Don't define.
1077         (__pthread_cond_broadcast): Rename __lll_mutex_* to __lll_*,
1078         pass LLL_SHARED in %esi to both __lll_lock_wait and
1079         __lll_unlock_wake.
1080         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S:
1081         Include lowlevellock.h and pthread-errnos.h.
1082         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_WAKE_OP,
1083         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE, EINVAL, LOCK): Don't define.
1084         (__pthread_cond_signal): Rename __lll_mutex_* to __lll_*,
1085         pass LLL_SHARED in %esi to both __lll_lock_wait and
1086         __lll_unlock_wake.
1087         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:
1088         Include lowlevellock.h.
1089         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1090         (__pthread_cond_timedwait): Rename __lll_mutex_* to __lll_*,
1091         pass LLL_SHARED in %esi to both __lll_lock_wait and
1092         __lll_unlock_wake.
1093         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:
1094         Include lowlevellock.h.
1095         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, LOCK): Don't define.
1096         (__pthread_cond_wait, __condvar_cleanup): Rename __lll_mutex_*
1097         to __lll_*, pass LLL_SHARED in %esi to both __lll_lock_wait
1098         and __lll_unlock_wake.
1099         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S:
1100         Include lowlevellock.h.
1101         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1102         Don't define.
1103         (__pthread_rwlock_rdlock): Rename __lll_mutex_* to __lll_*,
1104         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1105         and __lll_unlock_wake.
1106         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1107         Include lowlevellock.h.
1108         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1109         Don't define.
1110         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1111         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1112         and __lll_unlock_wake.
1113         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1114         Include lowlevellock.h.
1115         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1116         Don't define.
1117         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1118         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1119         and __lll_unlock_wake.
1120         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S:
1121         Include lowlevellock.h.
1122         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1123         Don't define.
1124         (__pthread_rwlock_unlock): Rename __lll_mutex_* to __lll_*,
1125         pass PSHARED(%rdi) in %esi to both __lll_lock_wait
1126         and __lll_unlock_wake.
1127         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:
1128         Include lowlevellock.h.
1129         (SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG, LOCK):
1130         Don't define.
1131         (__pthread_rwlock_wrlock): Rename __lll_mutex_* to __lll_*,
1132         pass PSHARED(%rdi) in %ecx to both __lll_lock_wait
1133         and __lll_unlock_wake.
1134         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Include
1135         lowlevellock.h.
1136         (LOCK, SYS_futex, FUTEX_WAIT, FUTEX_WAKE, FUTEX_PRIVATE_FLAG): Don't
1137         define.
1138         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Include lowlevellock.h.
1139         (LOCK, SYS_futex, FUTEX_WAKE): Don't define.
1140         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Include
1141         lowlevellock.h.
1142         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1143         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Include
1144         lowlevellock.h.
1145         (LOCK): Don't define.
1146         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Include
1147         lowlevellock.h.
1148         (LOCK, SYS_futex, FUTEX_WAIT): Don't define.
1149         * sysdeps/unix/sysv/linux/sparc/internaltypes.h: New file.
1150         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c: New file.
1151         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c: New file.
1152         * sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c: New file.
1153         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
1154         (__lll_lock_wait_private): New function.
1155         (__lll_lock_wait, __lll_timedlock_wait): Add private argument, pass
1156         it to lll_futex_*wait.  Don't compile in for libc.so.
1157         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c:
1158         Remove.
1159         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
1160         (struct sparc_pthread_barrier): Remove.
1161         (pthread_barrier_wait): Use union sparc_pthread_barrier instead of
1162         struct sparc_pthread_barrier.  Pass
1163         ibarrier->s.pshared ? LLL_SHARED : LLL_PRIVATE to lll_{,un}lock
1164         and lll_futex_wait macros.
1165         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
1166         Remove.
1167         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1168         Include sparc pthread_barrier_wait.c instead of generic one.
1170 2007-07-30  Jakub Jelinek  <jakub@redhat.com>
1172         * tst-rwlock14.c (do_test): Avoid warnings on 32-bit arches.
1174         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
1175         (pthread_rwlock_timedrdlock): Copy futex retval to %esi rather than
1176         %ecx.
1177         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
1178         (pthread_rwlock_timedwrlock): Likewise.
1179         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
1180         (__pthread_rwlock_unlock): Fix MUTEX != 0 args to __lll_*.
1182 2007-07-31  Jakub Jelinek  <jakub@redhat.com>
1184         * sysdeps/sparc/tls.h (tcbhead_t): Add private_futex field.
1186 2007-07-26  Jakub Jelinek  <jakub@redhat.com>
1188         * tst-locale2.c (useless): Add return statement.
1190 2007-07-24  Jakub Jelinek  <jakub@redhat.com>
1192         * allocatestack.c (__nptl_setxid, __wait_lookup_done): Replace
1193         lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).
1194         * pthread_create.c (start_thread): Likewise.
1195         * init.c (sighandler_setxid): Likewise.
1196         * sysdeps/alpha/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1197         * sysdeps/ia64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1198         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1199         * sysdeps/s390/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1200         * sysdeps/powerpc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1201         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1202         * sysdeps/sparc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1203         * sysdeps/sh/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
1204         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY, AIO_MISC_WAIT):
1205         Likewise.
1206         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY, GAI_MISC_WAIT):
1207         Likewise.
1208         * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
1209         Likewise.
1210         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_waitzero,
1211         __rtld_notify): Likewise.
1212         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Likewise.
1213         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (clear_once_control,
1214         __pthread_once): Likewise.
1215         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (clear_once_control,
1216         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1217         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1218         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1219         (lll_futex_wait): Add private argument, define as wrapper around
1220         lll_futex_timed_wait.
1221         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1222         use __lll_private_flag macro.
1223         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1224         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1225         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (clear_once_control,
1226         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1227         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1228         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1229         (lll_futex_wait): Add private argument, define as wrapper around
1230         lll_futex_timed_wait.
1231         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1232         use __lll_private_flag macro.
1233         (__lll_mutex_unlock, __lll_robust_mutex_unlock, lll_wait_tid,
1234         __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
1235         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
1236         Define.
1237         (lll_futex_timed_wait, lll_futex_wake): Use it.
1238         (lll_private_futex_wait, lll_private_futex_timed_wait,
1239         lll_private_futex_wake): Removed.
1240         * sysdeps/unix/sysv/linux/s390/pthread_once.c (clear_once_control,
1241         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1242         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1243         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1244         (lll_futex_wait): Add private argument, define as wrapper around
1245         lll_futex_timed_wait.
1246         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1247         use __lll_private_flag macro.
1248         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1249         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1250         to lll_futex_*.
1251         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1252         (lll_private_futex_wait, lll_private_futex_timed_wait,
1253         lll_private_futex_wake): Removed.
1254         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_private_flag):
1255         Fix !__ASSUME_PRIVATE_FUTEX non-constant private case.
1256         (lll_private_futex_wait, lll_private_futex_timed_wait,
1257         lll_private_futex_wake): Removed.
1258         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (clear_once_control,
1259         __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
1260         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_PRIVATE_FLAG,
1261         LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
1262         (lll_futex_wait): Add private argument, define as wrapper around
1263         lll_futex_timed_wait.
1264         (lll_futex_timed_wait, lll_futex_wake): Add private argument,
1265         use __lll_private_flag macro.
1266         (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
1267         lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
1268         to lll_futex_*.
1269         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (__lll_private_flag):
1270         Define.
1271         (lll_futex_timed_wait, lll_futex_wake): Use it.
1272         (lll_private_futex_wait, lll_private_futex_timed_wait,
1273         lll_private_futex_wake): Removed.
1275 2007-07-27  Jakub Jelinek  <jakub@redhat.com>
1277         * sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
1278         of the structure for sparc32.
1280 2007-07-26  Aurelien Jarno  <aurelien@aurel32.net>
1282         * sysdeps/sparc/tls.h (tcbhead_t): Add gscope_flag.
1284 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1286         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1287         code used when private futexes are assumed.
1288         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1289         Likewise.
1291 2007-07-23  Jakub Jelinek  <jakub@redhat.com>
1293         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1294         (__lll_private_flag): Define.
1295         (lll_futex_wait): Define as a wrapper around lll_futex_timed_wait.
1296         (lll_futex_timed_wait, lll_futex_wake, lll_futex_wake_unlock): Use
1297         __lll_private_flag.
1298         (lll_private_futex_wait, lll_private_futex_timedwait,
1299         lll_private_futex_wake): Define as wrapper around non-_private
1300         macros.
1301         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1302         (__lll_private_flag): Define.
1303         (lll_futex_timed_wait, lll_futex_wake): Use __lll_private_flag.
1304         (lll_private_futex_wait, lll_private_futex_timedwait,
1305         lll_private_futex_wake): Define as wrapper around non-_private
1306         macros.
1308 2007-07-10  Steven Munroe  <sjmunroe@us.ibm.com>
1310         * pthread_rwlock_rdlock.c (__pthread_rwlock_rdlock): Add LLL_SHARED
1311         parameter to lll_futex_wait call.
1312         * pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Likewise.
1314         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
1315         Replace lll_futex_wait with lll_private_futex_wait.
1316         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
1317         Add LLL_SHARED parameter to lll_futex_wake().
1319         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define LLL_PRIVATE
1320         LLL_SHARED, lll_private_futex_wait, lll_private_futex_timed_wait and
1321         lll_private_futex_wake.
1322         (lll_futex_wait): Add private parameter. Adjust FUTEX_PRIVATE_FLAG
1323         bit from private parm before syscall.
1324         (lll_futex_timed_wait): Likewise.
1325         (lll_futex_wake): Likewise.
1326         (lll_futex_wake_unlock): Likewise.
1327         (lll_mutex_unlock): Add LLL_SHARED parm to lll_futex_wake call.
1328         (lll_robust_mutex_unlock): Likewise.
1329         (lll_mutex_unlock_force): Likewise.
1330         (lll_wait_tid): Add LLL_SHARED parm to lll_futex_wait call.
1332 2007-07-23  Ulrich Drepper  <drepper@redhat.com>
1334         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: Fix
1335         compilation when unconditionally using private futexes.
1336         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
1337         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1338         Likewise.
1339         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1340         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1342 2007-07-17  Jakub Jelinek  <jakub@redhat.com>
1344         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock_clear_flags2):
1345         Define.
1347 2007-07-06  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1349         * sysdeps/sh/tls.h: Include stdlib.h, list.h, sysdep.h and
1350         kernel-features.h.
1352 2007-05-16  Roland McGrath  <roland@redhat.com>
1354         * init.c (__nptl_initial_report_events): New variable.
1355         (__pthread_initialize_minimal_internal): Initialize pd->report_events
1356         to that.
1358 2007-06-22  Jakub Jelinek  <jakub@redhat.com>
1360         * pthread_getattr_np.c (pthread_getattr_np): Clear cpuset and
1361         cpusetsize if pthread_getaffinity_np failed with ENOSYS.
1363 2007-06-19  Ulrich Drepper  <drepper@redhat.com>
1365         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Remove mrlock
1366         implementation.
1368 2007-06-18  Ulrich Drepper  <drepper@redhat.com>
1370         * pthreadP.h: Define PTHREAD_MUTEX_TYPE.
1371         * phtread_mutex_lock.c: Use PTHREAD_MUTEX_TYPE.
1372         * pthread_mutex_timedlock.c: Likewise.
1373         * pthread_mutex_trylock.c: Likewise.
1374         * pthread_mutex_unlock.c: Likewise.
1376 2007-06-17  Andreas Schwab  <schwab@suse.de>
1378         * sysdeps/pthread/pt-initfini.c: Tell gcc about the nonstandard
1379         sections.
1381 2007-06-17  Ulrich Drepper  <drepper@redhat.com>
1383         * allocatestack.c (allocate_stack): Make code compile if
1384         __ASSUME_PRIVATE_FUTEX is set.
1386 2007-06-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1388         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S:
1389         (__pthread_rwlock_rdlock): Don't use non SH-3/4 instruction.
1390         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S:
1391         (__pthread_rwlock_wrlock): Likewise.
1392         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
1393         (pthread_rwlock_timedrdlock): Likewise.
1394         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
1395         (pthread_rwlock_timedwrlock): Likewise.
1396         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S:
1397         (__pthread_rwlock_unlock): Likewise.
1399 2007-06-10  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
1401         * sysdeps/sh/tcb-offsets.sym: Add PRIVATE_FUTEX.
1402         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
1403         Split __flags into __flags, __shared, __pad1 and __pad2.
1404         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
1405         futexes if they are available.
1406         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
1407         in libc-lowlevellock.S allow using private futexes.
1408         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
1409         FUTEX_PRIVATE_FLAG.  Add additional parameter to lll_futex_wait,
1410         lll_futex_timed_wait and lll_futex_wake.  Change lll_futex_wait
1411         to call lll_futex_timed_wait.  Add lll_private_futex_wait,
1412         lll_private_futex_timed_wait and lll_private_futex_wake.
1413         (lll_robust_mutex_unlock): Fix typo.
1414         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
1415         field in futex command setup.
1416         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
1417         COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
1418         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
1419         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
1420         if they are available.  Remove clear_once_control.
1421         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
1422         futexes if they are available.
1423         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
1424         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
1425         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
1426         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
1427         * sysdeps/unix/sysv/linux/sh/sem_post.S: Add private futex support.
1428         Wake only when there are waiters.
1429         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
1430         support.  Indicate that there are waiters.  Remove unnecessary
1431         extra cancellation test.
1432         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.  Removed
1433         left-over duplication of __sem_wait_cleanup.
1435 2007-06-07  Ulrich Drepper  <drepper@redhat.com>
1437         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Add additional
1438         parameter to lll_futex_wait, lll_futex_timed_wait, and
1439         lll_futex_wake.  Change lll_futex_wait to call lll_futex_timed_wait.
1440         Add lll_private_futex_wait, lll_private_futex_timed_wait, and
1441         lll_private_futex_wake.
1442         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1443         * allocatestack.c: Adjust use of lll_futex_* macros.
1444         * init.c: Likewise.
1445         * lowlevellock.h: Likewise.
1446         * pthread_barrier_wait.c: Likewise.
1447         * pthread_cond_broadcast.c: Likewise.
1448         * pthread_cond_destroy.c: Likewise.
1449         * pthread_cond_signal.c: Likewise.
1450         * pthread_cond_timedwait.c: Likewise.
1451         * pthread_cond_wait.c: Likewise.
1452         * pthread_create.c: Likewise.
1453         * pthread_mutex_lock.c: Likewise.
1454         * pthread_mutex_setprioceiling.c: Likewise.
1455         * pthread_mutex_timedlock.c: Likewise.
1456         * pthread_mutex_unlock.c: Likewise.
1457         * pthread_rwlock_timedrdlock.c: Likewise.
1458         * pthread_rwlock_timedwrlock.c: Likewise.
1459         * pthread_rwlock_unlock.c: Likewise.
1460         * sysdeps/alpha/tls.h: Likewise.
1461         * sysdeps/i386/tls.h: Likewise.
1462         * sysdeps/ia64/tls.h: Likewise.
1463         * sysdeps/powerpc/tls.h: Likewise.
1464         * sysdeps/pthread/aio_misc.h: Likewise.
1465         * sysdeps/pthread/gai_misc.h: Likewise.
1466         * sysdeps/s390/tls.h: Likewise.
1467         * sysdeps/sh/tls.h: Likewise.
1468         * sysdeps/sparc/tls.h: Likewise.
1469         * sysdeps/unix/sysv/linux/fork.c: Likewise.
1470         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
1471         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
1472         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Likewise.
1473         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
1474         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1475         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
1476         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
1477         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: Likewise.
1478         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
1479         Likewise.
1480         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Likewise.
1481         * sysdeps/x86_64/tls.h: Likewise.
1483 2007-05-29  Ulrich Drepper  <drepper@redhat.com>
1485         * pthread_getattr_np.c: No need to install a cancellation handler,
1486         this is no cancellation point.
1487         * pthread_getschedparam.c: Likewise.
1488         * pthread_setschedparam.c: Likewise.
1489         * pthread_setschedprio.c: Likewise.
1490         * sysdeps/unix/sysv/linux/lowlevellock.c: Remove all traces of
1491         lll_unlock_wake_cb.
1492         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
1493         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1494         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1495         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
1496         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
1497         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
1498         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
1499         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
1500         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
1501         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Likewise.
1502         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
1503         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
1505         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Checking
1506         whether there are more than one thread makes no sense here since
1507         we only call the slow path if the locks are taken.
1508         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
1510         * sysdeps/unix/sysv/linux/internaltypes.h: Introduce
1511         COND_NWAITERS_SHIFT.
1512         * pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of
1513         COND_CLOCK_BITS.
1514         * pthread_cond_init.c: Likewise.
1515         * pthread_cond_timedwait.c: Likewise.
1516         * pthread_cond_wait.c: Likewise.
1517         * pthread_condattr_getclock.c: Likewise.
1518         * pthread_condattr_setclock.c: Likewise.
1519         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise.
1520         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
1521         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
1522         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
1523         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
1525 2007-05-28  Jakub Jelinek  <jakub@redhat.com>
1527         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
1528         unistd.h.
1530         * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
1531         insn suffix.
1532         (THREAD_GSCOPE_GET_FLAG): Remove.
1533         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Remove.
1534         * allocatestack.c (__wait_lookup_done): Revert 2007-05-24
1535         changes.
1536         * sysdeps/powerpc/tls.h (tcbhead_t): Remove gscope_flag.
1537         (THREAD_GSCOPE_GET_FLAG): Remove.
1538         (THREAD_GSCOPE_RESET_FLAG): Use THREAD_SELF->header.gscope_flag
1539         instead of THREAD_GSCOPE_GET_FLAG.
1540         (THREAD_GSCOPE_SET_FLAG): Likewise.  Add atomic_write_barrier after
1541         it.
1542         * sysdeps/s390/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1543         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1544         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1545         THREAD_GSCOPE_WAIT): Define.
1546         * sysdeps/sparc/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1547         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1548         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1549         THREAD_GSCOPE_WAIT): Define.
1550         * sysdeps/sh/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1551         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1552         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1553         THREAD_GSCOPE_WAIT): Define.
1554         * sysdeps/ia64/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1555         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1556         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1557         THREAD_GSCOPE_WAIT): Define.
1559 2007-05-24  Richard Henderson  <rth@redhat.com>
1561         * descr.h (struct pthread): Add header.gscope_flag.
1562         * sysdeps/alpha/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
1563         THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
1564         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
1565         THREAD_GSCOPE_WAIT): Define.
1567 2007-05-27  Ulrich Drepper  <drepper@redhat.com>
1569         * init.c: Make it compile with older kernel headers.
1571         * tst-initializers1.c: Show through exit code which test failed.
1573         * pthread_rwlock_init.c: Also initialize __shared field.
1574         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
1575         element in rwlock structure into four byte elements.  One of them is
1576         the new __shared element.
1577         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
1578         Likewise.
1579         [__WORDSIZE=64]: Renamed __pad1 element int rwlock structure to
1580         __shared, adjust names of other padding elements.
1581         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
1582         * sysdeps/pthread/pthread.h: Adjust rwlock initializers.
1583         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
1584         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
1585         FUTEX_PRIVATE_FLAG.
1586         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
1587         futex to use private operations if possible.
1588         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
1589         Likewise.
1590         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
1591         Likewise.
1592         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
1593         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
1594         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
1595         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
1596         Likewise.
1597         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
1598         Likewise.
1599         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
1600         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
1602 2007-05-26  Ulrich Drepper  <drepper@redhat.com>
1604         * pthreadP.h (PTHREAD_RWLOCK_PREFER_READER_P): Define.
1605         * pthread_rwlock_rdlock.c: Use PTHREAD_RWLOCK_PREFER_READER_P.
1606         * pthread_rwlock_timedrdlock.c: Likewise.
1607         * pthread_rwlock_tryrdlock.c: Likewise.
1609         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S (sem_trywait): Tiny
1610         optimization.
1612         * sysdeps/unix/sysv/linux/sem_wait.c: Add missing break.
1613         * sysdeps/unix/sysv/linux/sem_timedwait.c: Removed left-over
1614         duplication of __sem_wait_cleanup.
1616         * allocatestack.c: Revert last change.
1617         * init.c: Likewise.
1618         * sysdeps/i386/tls.h: Likewise.
1619         * sysdeps/x86_64/tls.h: Likewise.
1620         * descr.h [TLS_DTV_AT_TP] (struct pthread): Add private_futex field to
1621         header structure.
1622         * sysdeps/powerpc/tcb-offsets.sym: Add PRIVATE_FUTEX_OFFSET.
1624         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_barrier):
1625         Add private field.
1626         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: Add PRIVATE definition.
1627         * pthread_barrier_init.c: Set private flag if pshared and private
1628         futexes are supported.
1629         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Use
1630         private field in futex command setup.
1631         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
1633 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1635         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Add private futex
1636         support.
1637         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1638         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1639         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1640         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1641         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1643         * semaphoreP.h: Declare __old_sem_init and __old_sem_wait.
1644         * sem_init.c (__new_sem_init): Rewrite to initialize all three
1645         fields in the structure.
1646         (__old_sem_init): New function.
1647         * sem_open.c: Initialize all fields of the structure.
1648         * sem_getvalue.c: Adjust for renamed element.
1649         * sysdeps/unix/sysv/linux/Makefile [subdir=nptl]
1650         (gen-as-const-headers): Add structsem.sym.
1651         * sysdeps/unix/sysv/linux/structsem.sym: New file.
1652         * sysdeps/unix/sysv/linux/internaltypes.h: Rename struct sem to
1653         struct new_sem.  Add struct old_sem.
1654         * sysdeps/unix/sysv/linux/sem_post.c: Wake only when there are waiters.
1655         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
1656         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
1657         * sysdeps/unix/sysv/linux/sem_wait.c: Indicate that there are waiters.
1658         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
1659         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
1660         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
1661         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
1662         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1663         * Makefile (tests): Add tst-sem10, tst-sem11, tst-sem12.
1664         * tst-sem10.c: New file.
1665         * tst-sem11.c: New file.
1666         * tst-sem12.c: New file.
1667         * tst-typesizes.c: Test struct new_sem and struct old_sem instead
1668         of struct sem.
1670 2007-05-25  Ulrich Drepper  <drepper@redhat.com>
1671             Jakub Jelinek  <jakub@redhat.com>
1673         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
1674         Move __pthread_enable_asynccancel right before futex syscall.
1675         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
1676         Likewise.
1678 2007-05-24  Jakub Jelinek  <jakub@redhat.com>
1680         * sysdeps/i386/tls.h (THREAD_SET_PRIVATE_FUTEX,
1681         THREAD_COPY_PRIVATE_FUTEX): Define.
1682         * sysdeps/x86_64/tls.h (THREAD_SET_PRIVATE_FUTEX,
1683         THREAD_COPY_PRIVATE_FUTEX): Define.
1684         * allocatestack.c (allocate_stack): Use THREAD_COPY_PRIVATE_FUTEX.
1685         * init.c (__pthread_initialize_minimal_internal): Use
1686         THREAD_SET_PRIVATE_FUTEX.
1688         * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.
1689         (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED,
1690         THREAD_GSCOPE_FLAG_WAIT): Define.
1691         (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG,
1692         THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define.
1693         * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use
1694         PTR_DEMANGLE.
1695         (THREAD_GSCOPE_GET_FLAG): Define.
1696         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define.
1697         * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG
1698         instead of ->header.gscope_flag directly.
1700 2007-05-23  Ulrich Drepper  <drepper@redhat.com>
1702         * init.c (__pthread_initialize_minimal_internal): Check whether
1703         private futexes are available.
1704         * allocatestack.c (allocate_stack): Copy private_futex field from
1705         current thread into the new stack.
1706         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Use private
1707         futexes if they are available.
1708         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise
1709         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Adjust so that change
1710         in libc-lowlevellock.S allow using private futexes.
1711         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
1712         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
1713         FUTEX_PRIVATE_FLAG.
1714         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
1715         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use private futexes
1716         if they are available.
1717         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
1718         * sysdeps/x86_64/tcb-offsets.sym: Add PRIVATE_FUTEX.
1719         * sysdeps/i386/tcb-offsets.sym: Likewise.
1720         * sysdeps/x86_64/tls.h (tcbhead_t): Add private_futex field.
1721         * sysdeps/i386/tls.h (tcbhead_t): Likewise.
1723 2007-05-21  Ulrich Drepper  <drepper@redhat.com>
1725         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1726         Remove ptr_wait_lookup_done again.
1727         * init.c (pthread_functions): Don't add .ptr_wait_lookup_done here.
1728         (__pthread_initialize_minimal_internal): Initialize
1729         _dl_wait_lookup_done pointer in _rtld_global directly.
1730         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1731         Remove code to code _dl_wait_lookup_done.
1732         * sysdeps/x86_64/tls.h (THREAD_GSCOPE_WAIT): The pointer is not
1733         encrypted for now.
1735 2007-05-21  Jakub Jelinek  <jakub@redhat.com>
1737         * tst-robust9.c (do_test): Don't fail if ENABLE_PI and
1738         pthread_mutex_init failed with ENOTSUP.
1740 2007-05-19  Ulrich Drepper  <drepper@redhat.com>
1742         * allocatestack.c (__wait_lookup_done): New function.
1743         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
1744         Add ptr_wait_lookup_done.
1745         * init.c (pthread_functions): Initialize .ptr_wait_lookup_done.
1746         * pthreadP.h: Declare __wait_lookup_done.
1747         * sysdeps/i386/tls.h (tcbhead_t): Add gscope_flag.
1748         Define macros to implement reference handling of global scope.
1749         * sysdeps/x86_64/tls.h: Likewise.
1750         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
1751         Initialize GL(dl_wait_lookup_done).
1753 2007-05-17  Ulrich Drepper  <drepper@redhat.com>
1755         [BZ #4512]
1756         * pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
1757         is detected.
1758         * pthread_mutex_timedlock.c: Likewise.
1759         * pthread_mutex_trylock.c: Likewise.
1760         Patch in part by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
1762         * Makefile (tests): Add tst-robust9 and tst-robustpi9.
1763         * tst-robust9.c: New file.
1764         * tst-robustpi9.c: New file.
1766         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
1767         unnecessary extra cancellation test.
1769 2007-05-14  Ulrich Drepper  <drepper@redhat.com>
1771         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
1772         extra cancellation test.
1773         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
1775 2007-05-10  Ulrich Drepper  <drepper@redhat.com>
1777         * descr.h (struct pthread): Rearrange members to fill hole in
1778         64-bit layout.
1780         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
1781         (__pthread_setaffinity_new): If syscall was successful and
1782         RESET_VGETCPU_CACHE is defined, use it before returning.
1783         * sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
1785 2007-05-10  Jakub Jelinek  <jakub@redhat.com>
1787         [BZ #4455]
1788         * tst-align2.c: Include stackinfo.h.
1789         * tst-getpid1.c: Likewise.
1791 2007-05-02  Carlos O'Donell  <carlos@systemhalted.org>
1793         [BZ #4455]
1794         * tst-align2.c (do_test): Add _STACK_GROWS_UP case.
1795         * tst-getpid1.c (do_test): Likewise.
1797         [BZ #4456]
1798         * allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
1799         (allocate_stack): Likewise.
1801 2007-05-07  Ulrich Drepper  <drepper@redhat.com>
1803         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
1804         (__lll_robust_lock_wait): Fix race caused by reloading of futex value.
1805         (__lll_robust_timedlock_wait): Likewise.
1806         Reported by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
1808 2007-05-06  Mike Frysinger  <vapier@gentoo.org>
1810         [BZ #4465]
1811         * tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
1812         * tst-cancel4.c (tf_fdatasync): New test.
1814 2007-04-27  Ulrich Drepper  <drepper@redhat.com>
1816         [BZ #4392]
1817         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Treat error
1818         check mutexes like normal mutexes.
1820         [BZ #4306]
1821         * sysdeps/unix/sysv/linux/timer_create.c (timer_create):
1822         Initialize the whole sigevent structure to appease valgrind.
1824 2007-04-25  Ulrich Drepper  <drepper@redhat.com>
1826         * sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
1827         * sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
1829 2007-04-06  Ulrich Drepper  <drepper@redhat.com>
1831         * tst-locale1.c: Avoid warnings.
1832         * tst-locale2.c: Likewise.
1834 2007-03-19  Steven Munroe  <sjmunroe@us.ibm.com>
1836         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
1837         (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
1839 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
1841         * sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
1842         __extern_always_inline where appropriate.
1843         * sysdeps/pthread/pthread.h: Likewise.
1845 2007-03-13  Richard Henderson  <rth@redhat.com>
1847         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Use two
1848         separate cfi regions for the two subsections.
1850 2007-02-25  Ulrich Drepper  <drepper@redhat.com>
1852         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset refcntr in
1853         new thread, don't just decrement it.
1854         Patch by Suzuki K P <suzuki@in.ibm.com>.
1856 2007-02-21  Ulrich Drepper  <drepper@redhat.com>
1858         * sysdeps/pthread/pthread-functions.h: Correct last patch, correct
1859         PTHFCT_CALL definition.
1861 2007-02-18  Ulrich Drepper  <drepper@redhat.com>
1863         * sysdeps/pthread/pthread-functions.h: If PTR_DEMANGLE is not
1864         available, don't use it.
1866 2007-02-09  Jakub Jelinek  <jakub@redhat.com>
1868         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1869         (__lll_mutex_timedlock_wait): Use correct pointer when we don't
1870         call into the kernel to delay.
1872 2007-01-18  Ulrich Drepper  <drepper@redhat.com>
1874         * tst-initializers1.c: We want to test the initializers as seen
1875         outside of libc, so undefined _LIBC.
1877         * pthread_join.c (cleanup): Avoid warning.
1879 2007-01-17  Ulrich Drepper  <drepper@redhat.com>
1881         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
1882         (__lll_timedwait_tid): Add unwind info.
1884         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Don't just copy the
1885         function table, mangle the pointers.
1886         * sysdeps/pthread/pthread-functions.h: Define PTHFCT_CALL.
1887         * forward.c: Use PTHFCT_CALL and __libc_pthread_functions_init.
1888         * sysdeps/pthread/bits/libc-lock.h: When using __libc_pthread_functions
1889         demangle pointers before use.
1890         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Use PTHFCT_CALL to
1891         demangle pointer.
1892         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
1893         * sysdeps/pthread/setxid.h: Likewise.
1895 2007-01-12  Ulrich Drepper  <drepper@redhat.com>
1897         * tst-rwlock7.c: Show some more information in case of correct
1898         behavior.
1900 2007-01-11  Ulrich Drepper  <drepper@redhat.com>
1902         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
1903         (lll_futex_timed_wait): Undo part of last change, don't negate
1904         return value.
1906 2007-01-10  Ulrich Drepper  <drepper@redhat.com>
1908         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Cleanups.  Define
1909         FUTEX_CMP_REQUEUE and lll_futex_requeue.
1911 2006-12-28  David S. Miller  <davem@davemloft.net>
1913         * shlib-versions: Fix sparc64 linux target specification.
1915 2007-01-10  Jakub Jelinek  <jakub@redhat.com>
1917         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
1918         Adjust include path for pthread_barrier_wait.c move.
1920 2006-12-21  Jakub Jelinek  <jakub@redhat.com>
1922         * sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
1923         tid isn't reread from pd->tid in between ESRCH test and the syscall.
1925 2006-12-06  Jakub Jelinek  <jakub@redhat.com>
1927         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
1928         6 argument cancellable syscalls.
1929         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
1930         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
1931         6 argument cancellable syscalls.
1932         (STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
1934 2006-12-09  Ulrich Drepper  <drepper@redhat.com>
1936         * sysdeps/unix/sysv/linux/rtld-lowlevel.h
1937         (__rtld_mrlock_initialize): Add missing closing parenthesis.
1939 2006-10-30  Jakub Jelinek  <jakub@redhat.com>
1941         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
1942         __sync_lock_release instead of __sync_lock_release_si.
1944 2006-10-29  Jakub Jelinek  <jakub@redhat.com>
1946         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (RTLD_SINGLE_THREAD_P):
1947         Define.
1948         (SINGLE_THREAD_P): Define to 1 if IS_IN_rtld.
1949         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
1950         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
1951         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
1952         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
1953         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
1954         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
1955         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
1956         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
1957         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
1958         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
1960 2006-10-27  Ulrich Drepper  <drepper@redhat.com>
1962         * sysdeps/pthread/pthread_barrier_wait.c: Move to...
1963         * pthread_barrier_wait.c: ...here.
1964         * sysdeps/pthread/pthread_cond_broadcast.c: Move to...
1965         * pthread_cond_broadcast.c: ...here.
1966         * sysdeps/pthread/pthread_cond_signal.c: Move to...
1967         * pthread_cond_signal.c: ...here.
1968         * sysdeps/pthread/pthread_cond_timedwait.c: Move to...
1969         * pthread_cond_timedwait.c: ...here.
1970         * sysdeps/pthread/pthread_cond_wait.c: Move to...
1971         * pthread_cond_wait.c: ...here.
1972         * sysdeps/pthread/pthread_once.c: Move to...
1973         * pthread_once.c: ...here.
1974         * sysdeps/pthread/pthread_rwlock_rdlock.c: Move to...
1975         * pthread_rwlock_rdlock.c: ...here.
1976         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Move to...
1977         * pthread_rwlock_timedrdlock.c: ...here.
1978         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Move to...
1979         * pthread_rwlock_timedwrlock.c: ...here.
1980         * sysdeps/pthread/pthread_rwlock_unlock.c: Move to...
1981         * pthread_rwlock_unlock.c: ...here.
1982         * sysdeps/pthread/pthread_rwlock_wrlock.c: Move to...
1983         * pthread_rwlock_wrlock.c: ...here.
1984         * sysdeps/pthread/pthread_spin_destroy.c: Move to...
1985         * pthread_spin_destroy.c: ...here.
1986         * sysdeps/pthread/pthread_spin_init.c: Move to...
1987         * pthread_spin_init.c: ...here.
1988         * sysdeps/pthread/pthread_spin_unlock.c: Move to...
1989         * pthread_spin_unlock.c: ...here.
1990         * sysdeps/pthread/pthread_getcpuclockid.c: Move to...
1991         * pthread_getcpuclockid.c: ...here.
1993         * init.c: USE_TLS support is now always enabled.
1994         * tst-tls5.h: Likewise.
1995         * sysdeps/alpha/tls.h: Likewise.
1996         * sysdeps/i386/tls.h: Likewise.
1997         * sysdeps/ia64/tls.h: Likewise.
1998         * sysdeps/powerpc/tls.h: Likewise.
1999         * sysdeps/s390/tls.h: Likewise.
2000         * sysdeps/sh/tls.h: Likewise.
2001         * sysdeps/sparc/tls.h: Likewise.
2002         * sysdeps/x86_64/tls.h: Likewise.
2004 2006-10-27  Jakub Jelinek  <jakub@redhat.com>
2006         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
2007         __rtld_mrlock_change): Update oldval if atomic compare and exchange
2008         failed.
2010         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
2011         Define to THREAD_SELF->header.multiple_threads.
2012         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
2013         Likewise.
2014         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
2015         Likewise.
2016         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
2017         (SINGLE_THREAD_P): Likewise.
2018         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
2019         (SINGLE_THREAD_P): Likewise.
2020         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2021         (SINGLE_THREAD_P): Likewise.
2022         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
2023         (SINGLE_THREAD_P): Likewise.
2024         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (SINGLE_THREAD_P):
2025         Likewise.
2026         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
2027         (SINGLE_THREAD_P): Likewise.
2028         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
2029         (SINGLE_THREAD_P): Likewise.
2030         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P):
2031         Likewise.
2033 2006-10-26  Jakub Jelinek  <jakub@redhat.com>
2035         * pthread_attr_setstacksize.c (NEW_VERNUM): Define to GLIBC_2_3_3
2036         by default rather than 2_3_3.
2038 2006-10-17  Jakub Jelinek  <jakub@redhat.com>
2040         * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_mrlock_lock,
2041         __rtld_mrlock_unlock, __rtld_mrlock_change, __rtld_mrlock_done): Use
2042         atomic_* instead of catomic_* macros.
2044 2006-10-12  Ulrich Drepper  <drepper@redhat.com>
2046         [BZ #3285]
2047         * sysdeps/unix/sysv/linux/bits/local_lim.h: Add SEM_VALUE_MAX.
2048         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: Likewise.
2049         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
2050         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
2051         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
2052         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Remove SEM_VALUE_MAX.
2053         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
2054         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
2055         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
2056         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: Likewise.
2057         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
2058         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
2059         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
2061 2006-10-11  Ulrich Drepper  <drepper@redhat.com>
2063         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add support for
2064         cancelable syscalls with six parameters.
2066         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: Use catomic_*
2067         operations instead of atomic_*.
2069 2006-10-09  Ulrich Drepper  <drepper@redhat.com>
2071         * sysdeps/unix/sysv/linux/rtld-lowlevel.h: New file..
2073 2006-10-07  Ulrich Drepper  <drepper@redhat.com>
2075         * sysdeps/unix/sysv/linux/powerpc/bits/local_lim.h: New file.
2076         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstack.c: New file.
2077         * sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c:
2078         New file.
2079         * pthread_attr_setstack.c: Allow overwriting the version number of the
2080         new symbol.
2081         * pthread_attr_setstacksize.c: Likewise.
2082         (__old_pthread_attr_setstacksize): If STACKSIZE_ADJUST is defined use
2083         it.
2084         * sysdeps/unix/sysv/linux/powerpc/Versions (libpthread): Add
2085         pthread_attr_setstack and pthread_attr_setstacksize to GLIBC_2.6.
2087 2006-09-24  Ulrich Drepper  <drepper@redhat.com>
2089         [BZ #3251]
2090         * descr.h (ENQUEUE_MUTEX_BOTH): Add cast to avoid warning.
2091         Patch by Petr Baudis.
2093 2006-09-18  Jakub Jelinek  <jakub@redhat.com>
2095         * tst-kill4.c (do_test): Explicitly set tf thread's stack size.
2097         * tst-cancel2.c (tf): Loop as long as something was written.
2099 2006-09-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2101         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: For PI
2102         mutexes wake all mutexes.
2103         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Don't increment
2104         WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2105         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
2107 2006-09-12  Ulrich Drepper  <drepper@redhat.com>
2109         * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use
2110         to guarantee the thread is always canceled.
2112 2006-09-08  Jakub Jelinek  <jakub@redhat.com>
2114         * tst-cond22.c: Include pthread.h instead of pthreadP.h.
2115         Include stdlib.h.
2116         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Only
2117         increase FUTEX if increasing WAKEUP_SEQ.  Fix comment typo.
2118         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2119         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2120         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2122 2006-09-08  Ulrich Drepper  <drepper@redhat.com>
2124         [BZ #3123]
2125         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Don't
2126         increment WAKEUP_SEQ if this would increase the value beyond TOTAL_SEQ.
2127         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
2128         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2129         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2130         * Makefile (tests): Add tst-cond22.
2131         * tst-cond22.c: New file.
2133 2006-09-05  Ulrich Drepper  <drepper@redhat.com>
2135         [BZ #3124]
2136         * descr.h (struct pthread): Add parent_cancelhandling.
2137         * sysdeps/pthread/createthread.c (create_thread): Pass parent
2138         cancelhandling value to child.
2139         * pthread_create.c (start_thread): If parent thread was canceled
2140         reset the SIGCANCEL mask.
2141         * Makefile (tests): Add tst-cancel25.
2142         * tst-cancel25.c: New file.
2144 2006-09-05  Jakub Jelinek  <jakub@redhat.com>
2145             Ulrich Drepper  <drepper@redhat.com>
2147         * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
2148         counterp if it is already zero.
2149         * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
2151 2006-03-04  Jakub Jelinek  <jakub@redhat.com>
2152             Roland McGrath  <roland@redhat.com>
2154         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2155         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2156         LLL_STUB_UNWIND_INFO_3, LLL_STUB_UNWIND_INFO_4): Define.
2157         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2158         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2159         lll_robust_mutex_timedlock, lll_mutex_unlock,
2160         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2161         Add _L_*_ symbols around the subsection.
2162         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Add unwind info.
2163         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
2165 2006-03-03  Jakub Jelinek  <jakub@redhat.com>
2166             Roland McGrath  <roland@redhat.com>
2168         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2169         (LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
2170         LLL_STUB_UNWIND_INFO_5, LLL_STUB_UNWIND_INFO_6): Define.
2171         (lll_mutex_lock, lll_robust_mutex_lock, lll_mutex_cond_lock,
2172         lll_robust_mutex_cond_lock, lll_mutex_timedlock,
2173         lll_robust_mutex_timedlock, lll_mutex_unlock,
2174         lll_robust_mutex_unlock, lll_lock, lll_unlock): Use them.
2175         Add _L_*_ symbols around the subsection.
2176         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Add unwind info.
2177         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
2179 2006-08-31  Ulrich Drepper  <drepper@redhat.com>
2181         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Undo last
2182         change because it can disturb too much existing code.  If real hard
2183         reader preference is needed we'll introduce another type.
2184         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2185         (pthread_rwlock_timedwrlock): Likewise.
2186         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2187         Likewise.
2189 2006-08-30  Ulrich Drepper  <drepper@redhat.com>
2191         * pthread_rwlock_trywrlock.c (__pthread_rwlock_trywrlock): Respect
2192         reader preference.
2193         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
2194         (pthread_rwlock_timedwrlock): Likewise.
2195         * sysdeps/pthread/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock):
2196         Likewise.
2198 2006-08-25  Jakub Jelinek  <jakub@redhat.com>
2200         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libpthread):
2201         Only define ifdef SHARED.
2203 2006-08-23  Ulrich Drepper  <drepper@redhat.com>
2205         * allocatestack.c (queue_stack): Move freeing of surplus stacks to...
2206         (free_stacks): ...here.
2207         (__free_stack_cache): New function.
2208         * pthreadP.h: Declare __free_stack_cache.
2209         * sysdeps/pthread/pthread-functions.h (pthread_functions): Add
2210         ptr_freeres.
2211         * init.c (pthread_functions): Initialize ptr_freeres.
2212         * sysdeps/unix/sysv/linux/libc_pthread_init.c (freeres_libptread):
2213         New freeres function.
2215 2006-07-30  Joseph S. Myers  <joseph@codesourcery.com>
2217         [BZ #3018]
2218         * Makefile (extra-objs): Add modules to extra-test-objs instead.
2220 2006-08-20  Ulrich Drepper  <drepper@redhat.com>
2222         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2223         _XOPEN_REALTIME_THREADS.
2225 2006-08-15  Jakub Jelinek  <jakub@redhat.com>
2227         * sysdeps/unix/sysv/linux/clock_settime.c (INTERNAL_VSYSCALL): Use
2228         HAVE_CLOCK_GETRES_VSYSCALL as guard macro rather than
2229         HAVE_CLOCK_GETTIME_VSYSCALL.
2230         (maybe_syscall_settime_cpu): Use plain INTERNAL_VSYSCALL here.
2232 2006-08-14  Jakub Jelinek  <jakub@redhat.com>
2234         * sysdeps/unix/sysv/linux/bits/posix_opt.h
2235         (_POSIX_THREAD_PRIO_PROTECT): Define to 200112L.
2236         * descr.h (struct priority_protection_data): New type.
2237         (struct pthread): Add tpp field.
2238         * pthreadP.h (PTHREAD_MUTEX_PP_NORMAL_NP,
2239         PTHREAD_MUTEX_PP_RECURSIVE_NP, PTHREAD_MUTEX_PP_ERRORCHECK_NP,
2240         PTHREAD_MUTEX_PP_ADAPTIVE_NP): New enum values.
2241         * pthread_mutex_init.c (__pthread_mutex_init): Handle non-robust
2242         TPP mutexes.
2243         * pthread_mutex_lock.c (__pthread_mutex_lock): Handle TPP mutexes.
2244         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise.
2245         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
2246         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise.
2247         * tpp.c: New file.
2248         * pthread_setschedparam.c (__pthread_setschedparam): Handle priority
2249         boosted by TPP.
2250         * pthread_setschedprio.c (pthread_setschedprio): Likewise.
2251         * pthread_mutexattr_getprioceiling.c
2252         (pthread_mutexattr_getprioceiling): If ceiling is 0, ensure it is
2253         in the SCHED_FIFO priority range.
2254         * pthread_mutexattr_setprioceiling.c
2255         (pthread_mutexattr_setprioceiling): Fix prioceiling validation.
2256         * pthread_mutex_getprioceiling.c (pthread_mutex_getprioceiling): Fail
2257         if mutex is not TPP.  Ceiling is now in __data.__lock.
2258         * pthread_mutex_setprioceiling.c: Include stdbool.h.
2259         (pthread_mutex_setprioceiling): Fix prioceiling validation.  Ceiling
2260         is now in __data.__lock.  Add locking.
2261         * pthread_create.c (__free_tcb): Free pd->tpp structure.
2262         * Makefile (libpthread-routines): Add tpp.
2263         (xtests): Add tst-mutexpp1, tst-mutexpp6 and tst-mutexpp10.
2264         * tst-tpp.h: New file.
2265         * tst-mutexpp1.c: New file.
2266         * tst-mutexpp6.c: New file.
2267         * tst-mutexpp10.c: New file.
2268         * tst-mutex1.c (TEST_FUNCTION): Don't redefine if already defined.
2269         * tst-mutex6.c (TEST_FUNCTION): Likewise.
2271 2006-08-12  Ulrich Drepper  <drepper@redhat.com>
2273         [BZ #2843]
2274         * pthread_join.c (pthread_join): Account for self being canceled
2275         when checking for deadlocks.
2276         * tst-join5.c: Cleanups.  Allow to be used in tst-join6.
2277         (tf1): Don't print anything after pthread_join returns, this would be
2278         another cancellation point.
2279         (tf2): Likewise.
2280         * tst-join6.c: New file.
2281         * Makefile (tests): Add tst-join6.
2283 2006-08-03  Ulrich Drepper  <drepper@redhat.com>
2285         [BZ #2892]
2286         * pthread_setspecific.c (__pthread_setspecific): Check
2287         out-of-range index before checking for unused key.
2289         * sysdeps/pthread/gai_misc.h: New file.
2291 2006-08-01  Ulrich Drepper  <drepper@redhat.com>
2293         * sysdeps/unix/sysv/linux/i386/smp.h: New file.  Old Linux-specific
2294         file.  Don't use sysctl.
2295         * sysdeps/unix/sysv/linux/smp.h: Always assume SMP.  Archs can
2296         overwrite the file if this is likely not true.
2298 2006-07-31  Daniel Jacobowitz  <dan@codesourcery.com>
2300         * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
2301         * Makefile (tests): Add tst-getpid3.
2302         * tst-getpid3.c: New file.
2304 2006-07-30  Roland McGrath  <roland@redhat.com>
2306         * Makefile (libpthread-routines): Add ptw-sigsuspend.
2308         * sysdeps/unix/sysv/linux/i386/not-cancel.h
2309         (pause_not_cancel): New macro.
2310         (nanosleep_not_cancel): New macro.
2311         (sigsuspend_not_cancel): New macro.
2312         * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
2313         nanosleep_not_cancel macro from <not-cancel.h>.
2314         * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
2315         macro from <not-cancel.h>.
2317 2006-07-28  Ulrich Drepper  <drepper@redhat.com>
2318             Jakub Jelinek  <jakub@redhat.com>
2320         * descr.h: Change ENQUEUE_MUTEX and DEQUEUE_MUTEX for bit 0
2321         notification of PI mutex.  Add ENQUEUE_MUTEX_PI.
2322         * pthreadP.h: Define PTHREAD_MUTEX_PI_* macros for PI mutex types.
2323         * pthread_mutex_setprioceilining.c: Adjust for mutex type name change.
2324         * pthread_mutex_init.c: Add support for priority inheritance mutex.
2325         * pthread_mutex_lock.c: Likewise.
2326         * pthread_mutex_timedlock.c: Likewise.
2327         * pthread_mutex_trylock.c: Likewise.
2328         * pthread_mutex_unlock.c: Likewise.
2329         * sysdeps/pthread/pthread_cond_broadcast.c: For PI mutexes wake
2330         all mutexes.
2331         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.c: Likewise.
2332         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.c: Likewise.
2333         * sysdeps/unix/sysv/linux/pthread-pi-defines.sym: New file.
2334         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-header): Add
2335         pthread-pi-defines.sym.
2336         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_LOCK_PI,
2337         FUTEX_UNLOCK_PI, and FUTEX_TRYLOCK_PI.
2338         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2339         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
2340         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2341         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2342         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2343         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
2344         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
2345         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
2346         _POSIX_THREAD_PRIO_INHERIT to 200112L.
2347         * tst-mutex1.c: Adjust to allow use in PI mutex test.
2348         * tst-mutex2.c: Likewise.
2349         * tst-mutex3.c: Likewise.
2350         * tst-mutex4.c: Likewise.
2351         * tst-mutex5.c: Likewise.
2352         * tst-mutex6.c: Likewise.
2353         * tst-mutex7.c: Likewise.
2354         * tst-mutex7a.c: Likewise.
2355         * tst-mutex8.c: Likewise.
2356         * tst-mutex9.c: Likewise.
2357         * tst-robust1.c: Likewise.
2358         * tst-robust7.c: Likewise.
2359         * tst-robust8.c: Likewise.
2360         * tst-mutexpi1.c: New file.
2361         * tst-mutexpi2.c: New file.
2362         * tst-mutexpi3.c: New file.
2363         * tst-mutexpi4.c: New file.
2364         * tst-mutexpi5.c: New file.
2365         * tst-mutexpi6.c: New file.
2366         * tst-mutexpi7.c: New file.
2367         * tst-mutexpi7a.c: New file.
2368         * tst-mutexpi8.c: New file.
2369         * tst-mutexpi9.c: New file.
2370         * tst-robust1.c: New file.
2371         * tst-robust2.c: New file.
2372         * tst-robust3.c: New file.
2373         * tst-robust4.c: New file.
2374         * tst-robust5.c: New file.
2375         * tst-robust6.c: New file.
2376         * tst-robust7.c: New file.
2377         * tst-robust8.c: New file.
2378         * Makefile (tests): Add the new tests.
2380         * pthread_create.c (start_thread): Add some casts to avoid warnings.
2381         * pthread_mutex_destroy.c: Remove unneeded label.
2383 2006-07-01  Ulrich Drepper  <drepper@redhat.com>
2385         * pthread_mutex_init.c (__pthread_mutex_init): Move some
2386         computations to compile time.
2388 2006-06-04  Ulrich Drepper  <drepper@redhat.com>
2390         * sysdeps/pthread/pthread.h: Add pthread_equal inline version.
2392 2006-05-15  Ulrich Drepper  <drepper@redhat.com>
2394         * sysdeps/unix/sysv/linux/fork.h: Mark __fork_handlers as hidden.
2396 2006-05-11  Ulrich Drepper  <drepper@redhat.com>
2398         * pthread_key_create.c (__pthread_key_create): Do away with
2399         __pthread_keys_lock.
2401         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
2402         (__kernel_cpumask_size): Mark as hidden.
2403         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
2405         * sem_open.c (__sem_mappings_lock): Mark as hidden.
2406         * semaphoreP.h (__sem_mappings_lock): Likewise.
2408 2006-05-10  Ulrich Drepper  <drepper@redhat.com>
2410         * pthread_atfork.c: Mark __dso_handle as hidden.
2412 2006-05-09  Ulrich Drepper  <drepper@redhat.com>
2414         [BZ #2644]
2415         * sysdeps/pthread/unwind-forcedunwind.c: Different solution for
2416         the reload problem.  Change the one path in pthread_cancel_init
2417         which causes the problem.  Force gcc to reload.  Simplify callers.
2418         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c
2419         (_Unwind_GetBSP): Undo last patch.
2421 2006-05-07  Ulrich Drepper  <drepper@redhat.com>
2423         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: Make sure the
2424         function pointer is reloaded after pthread_cancel_init calls.
2426         [BZ #2644]
2427         * sysdeps/pthread/unwind-forcedunwind.c: Make sure functions
2428         pointers are reloaded after pthread_cancel_init calls.
2430 2006-05-01  Ulrich Drepper  <drepper@redhat.com>
2432         * sysdeps/pthread/allocalim.h (__libc_use_alloca): Mark with
2433         __always_inline.
2435 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
2437         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
2438         Allocate new object which is passed to timer_sigev_thread so that
2439         the timer can be deleted before the new thread is scheduled.
2441 2006-04-26  Roland McGrath  <roland@redhat.com>
2443         * sysdeps/x86_64/tls.h: Include <asm/prctl.h> inside [! __ASSEMBLER__].
2445 2006-04-08  Ulrich Drepper  <drepper@redhat.com>
2447         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove branch predicion
2448         suffix for conditional jumps.
2449         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
2450         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
2451         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
2452         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
2453         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
2454         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
2456         * init.c (sigcancel_handler): Compare with correct PID even if the
2457         thread is in the middle of a fork call.
2458         (sighandler_setxid): Likewise.
2459         Reported by Suzuki K P <suzuki@in.ibm.com> .
2461 2006-04-07  Jakub Jelinek  <jakub@redhat.com>
2463         * pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
2465 2006-04-06  Ulrich Drepper  <drepper@redhat.com>
2467         * pthread_getattr_np.c (pthread_getattr_np): Close fp if getrlimit
2468         fails [Coverity CID 105].
2470 2006-04-05  Ulrich Drepper  <drepper@redhat.com>
2472         * sysdeps/pthread/pthread.h: Add nonnull attributes.
2474 2006-04-03  Steven Munroe  <sjmunroe@us.ibm.com>
2476         [BZ #2505]
2477         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h [_ARCH_PWR4]:
2478         Define __lll_rel_instr using lwsync.
2480 2006-03-27  Ulrich Drepper  <drepper@redhat.com>
2482         * allocatestack.c (allocate_stack): Always initialize robust_head.
2483         * descr.h: Define struct robust_list_head.
2484         (struct pthread): Use robust_list_head in robust mutex list definition.
2485         Adjust ENQUEUE_MUTEX and DEQUEUE_MUTEX.
2486         * init.c [!__ASSUME_SET_ROBUST_LIST] (__set_robust_list_avail): Define.
2487         (__pthread_initialize_minimal_internal): Register robust_list with
2488         the kernel.
2489         * pthreadP.h: Remove PRIVATE_ from PTHREAD_MUTEX_ROBUST_* names.
2490         Declare __set_robust_list_avail.
2491         * pthread_create.c (start_thread): Register robust_list of new thread.
2492         [!__ASSUME_SET_ROBUST_LIST]: If robust_list is not empty wake up
2493         waiters.
2494         * pthread_mutex_destroy.c: For robust mutexes don't look at the
2495         number of users, it's unreliable.
2496         * pthread_mutex_init.c: Allow use of pshared robust mutexes if
2497         set_robust_list syscall is available.
2498         * pthread_mutex_consistent.c: Adjust for PTHREAD_MUTEX_ROBUST_* rename.
2499         * pthread_mutex_lock.c: Simplify robust mutex code a bit.
2500         Set robust_head.list_op_pending before trying to lock a robust mutex.
2501         * pthread_mutex_timedlock.c: Likewise.
2502         * pthread_mutex_trylock.c: Likewise.
2503         * pthread_mutex_unlock.c: Likewise for unlocking.
2504         * Makefile (tests): Add tst-robust8.
2505         * tst-robust8.c: New file.
2507 2006-03-08  Andreas Schwab  <schwab@suse.de>
2509         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
2510         (DL_SYSINFO_IMPLEMENTATION): Add missing newline.
2512 2006-03-05  Roland McGrath  <roland@redhat.com>
2514         * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
2515         and $config_os doesn't match *linux*.
2517 2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
2519         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
2520         Use __syscall_error.
2521         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
2522         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
2523         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
2524         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
2525         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
2526         * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
2528 2006-03-02  Ulrich Drepper  <drepper@redhat.com>
2530         * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
2532 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
2534         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
2535         (__lll_robust_lock_wait): Also set FUTEX_WAITERS bit if we got the
2536         mutex.
2537         (__lll_robust_timedlock_wait): Likewise.
2538         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S
2539         (__lll_robust_lock_wait): Likewise.
2540         (__lll_robust_timedlock_wait): Likewise.
2541         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c
2542         (__lll_robust_lock_wait): Likewise.
2543         (__lll_robust_timedlock_wait): Likewise.
2545 2006-03-01  Jakub Jelinek  <jakub@redhat.com>
2547         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_robust_mutex_dead,
2548         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2549         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2550         lll_robust_mutex_unlock): Define.
2551         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2553 2006-02-28  H.J. Lu  <hongjiu.lu@intel.com>
2555         * sysdeps/unix/sysv/linux/ia64/clone2.S: Include <clone2.S>
2556         instead of <clone.S>.
2558 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
2560         * Makefile (libpthread-routines): Add
2561         pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
2562         and pthread_mutex_[sg]etprioceiling.
2563         * Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
2564         pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
2565         pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
2566         pthread_mutex_setprioceiling.
2567         * sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
2568         PTHREAD_PRIO_PROTECT): New enum values.
2569         (pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
2570         pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
2571         pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
2572         prototypes.
2573         * pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
2574         PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
2575         (PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
2576         Define.
2577         (PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
2578         PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
2579         PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
2580         (PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
2581         and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
2582         * pthread_mutex_init.c (__pthread_mutex_init): For the time being
2583         return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
2584         protocol mutexes.
2585         * pthread_mutex_getprioceiling.c: New file.
2586         * pthread_mutex_setprioceiling.c: New file.
2587         * pthread_mutexattr_getprioceiling.c: New file.
2588         * pthread_mutexattr_setprioceiling.c: New file.
2589         * pthread_mutexattr_getprotocol.c: New file.
2590         * pthread_mutexattr_setprotocol.c: New file.
2592 2006-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
2594         * sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.
2596 2006-02-27  Roland McGrath  <roland@redhat.com>
2598         * sysdeps/pthread/Subdirs: List nptl here too.
2599         * configure (libc_add_on_canonical): New variable.
2601         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: Use #include_next.
2603         * sysdeps/unix/sysv/linux/sleep.c: Use #include_next after #include of
2604         self to get main source tree's file.
2605         * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
2606         * sysdeps/unix/sysv/linux/i386/clone.S: Likewise.
2607         * sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
2608         * sysdeps/unix/sysv/linux/ia64/clone2.S: Likewise.
2609         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
2610         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Likewise.
2611         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: Likewise.
2612         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: Likewise.
2613         * sysdeps/unix/sysv/linux/sh/clone.S: Likewise.
2614         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
2615         * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
2616         * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
2617         * sysdeps/unix/sysv/linux/x86_64/vfork.S: Likewise.
2619         * Makefile: Use $(sysdirs) in vpath directive.
2621         * sysdeps/pthread/Makefile (CFLAGS-libc-start.c): Variable removed.
2622         (CPPFLAGS-timer_routines.c): Likewise.
2624         * Makeconfig (includes): Variable removed.
2626 2006-02-26  Roland McGrath  <roland@redhat.com>
2628         * sysdeps/generic/pt-raise.c: Moved to ...
2629         * pt-raise.c: ... here.
2630         * sysdeps/generic/lowlevellock.h: Moved to ...
2631         * lowlevellock.h: ... here.
2633 2006-02-23  Roland McGrath  <roland@redhat.com>
2635         * descr.h (struct pthread): Add final member `end_padding'.
2636         (PTHREAD_STRUCT_END_PADDING): Use it.
2638 2006-02-20  Roland McGrath  <roland@redhat.com>
2640         * sysdeps/mips: Directory removed, saved in ports repository.
2641         * sysdeps/unix/sysv/linux/mips: Likewise.
2643 2006-02-18  Ulrich Drepper  <drepper@redhat.com>
2645         * tst-robust1.c: Add second mutex to check that the mutex list is
2646         handled correctly.
2648 2006-02-17  Jakub Jelinek  <jakub@redhat.com>
2650         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_robust_mutex_dead,
2651         lll_robust_mutex_trylock, lll_robust_mutex_lock,
2652         lll_robust_mutex_cond_lock, lll_robust_mutex_timedlock,
2653         lll_robust_mutex_unlock): New macros.
2654         (__lll_robust_lock_wait, __lll_robust_timedlock_wait): New prototypes.
2655         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
2656         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
2657         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
2658         * sysdeps/unix/sysv/linux/lowlevelrobustlock.c: New file.
2660 2006-02-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2662         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Add lll_robust_mutex_*
2663         definitions.
2664         * sysdeps/unix/sysv/linux/sh/lowlevelrobustlock.S: New file.
2666 2006-02-17  Ulrich Drepper  <drepper@redhat.com>
2668         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
2669         (lll_robust_mutex_unlock): Avoid unnecessary wakeups.
2670         * sysdeps/unix/sysv/linux/i386/lowlevellock.h
2671         (lll_robust_mutex_unlock): Likewise.
2673 2006-02-13  Jakub Jelinek  <jakub@redhat.com>
2675         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX):
2676         Set robust_list.__next rather than robust_list.
2677         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
2678         (__pthread_list_t): New typedef.
2679         (pthread_mutex_t): Replace __next and __prev fields with __list.
2680         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
2681         (__pthread_list_t): New typedef.
2682         (pthread_mutex_t): Replace __next and __prev fields with __list.
2683         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
2684         (__pthread_list_t, __pthread_slist_t): New typedefs.
2685         (pthread_mutex_t): Replace __next and __prev fields with __list.
2686         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
2687         (__pthread_list_t, __pthread_slist_t): New typedefs.
2688         (pthread_mutex_t): Replace __next and __prev fields with __list.
2689         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
2690         (__pthread_list_t, __pthread_slist_t): New typedefs.
2691         (pthread_mutex_t): Replace __next and __prev fields with __list.
2692         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h
2693         (__pthread_slist_t): New typedef.
2694         (pthread_mutex_t): Replace __next field with __list.
2696 2006-02-15  Ulrich Drepper  <drepper@redhat.com>
2698         * pthreadP.h: Define PTHREAD_MUTEX_INCONSISTENT instead of
2699         PTHREAD_MUTEX_OWNERDEAD.
2700         (PTHREAD_MUTEX_ROBUST_PRIVATE_NP): Define as 16, not 256.
2701         Define FUTEX_WAITERS, FUTEX_OWNER_DIED, FUTEX_TID_MASK.
2702         * Makefile (libpthread-routines): Add lowlevelrobustlock.
2703         * pthread_create.c (start_thread): Very much simplify robust_list loop.
2704         * pthread_mutex_consistent.c: Inconsistent mutex have __owner now set
2705         to PTHREAD_MUTEX_INCONSISTENT.
2706         * pthread_mutex_destroy.c: Allow destroying of inconsistent mutexes.
2707         * pthread_mutex_lock.c: Reimplement robust mutex handling.
2708         * pthread_mutex_trylock.c: Likewise.
2709         * pthread_mutex_timedlock.c: Likewise.
2710         * pthread_mutex_unlock.c: Likewise.
2711         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
2712         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
2713         lowlevelrobustlock.sym.
2714         * sysdeps/unix/sysv/linux/lowlevelrobustlock.sym: New file.
2715         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add lll_robust_mutex_*
2716         definitions.
2717         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2718         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: New file.
2719         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrobustlock.S: New file.
2720         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrobustlock.S: New file.
2721         * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: New file.
2723 2006-02-12  Ulrich Drepper  <drepper@redhat.com>
2725         * allocatestack.c (allocate_stack): Initialize robust_list.
2726         * init.c (__pthread_initialize_minimal_internal): Likewise.
2727         * descr.h (struct xid_command): Pretty printing.
2728         (struct pthread): Use __pthread_list_t or __pthread_slist_t for
2729         robust_list.  Adjust macros.
2730         * pthread_create.c (start_thread): Adjust robust_list handling.
2731         * phtread_mutex_unlock.c: Don't allow unlocking from any thread
2732         but the owner for all robust mutex types.
2733         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
2734         __pthread_list_t and __pthread_slist_t.  Use them in pthread_mutex_t.
2735         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2736         * sysdeps/pthread/pthread.h: Adjust mutex initializers.
2738         * sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
2739         openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
2741 2006-02-08  Jakub Jelinek  <jakub@redhat.com>
2743         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait,
2744         lll_futex_timedwait, lll_wait_tid): Add "memory" clobber.
2746 2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2748         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
2749         Return status.
2750         (lll_futex_timed_wait): Define.
2752 2006-01-19  Ulrich Drepper  <drepper@redhat.com>
2754         * tst-cancel4.c: Test ppoll.
2756 2006-01-18  Andreas Jaeger  <aj@suse.de>
2758         [BZ #2167]
2759         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
2760         (pthread_mutex_t): Follow changes for other archs.  Based on patch
2761         by Jim Gifford <patches@jg555.com>.
2763 2006-01-13  Richard Henderson  <rth@redhat.com>
2765         * sysdeps/alpha/tls.h (tcbhead_t): Rename member to __private.
2767 2006-01-10  Roland McGrath  <roland@redhat.com>
2769         * sysdeps/alpha/jmpbuf-unwind.h: File moved to main source tree.
2770         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
2771         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
2772         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
2773         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
2774         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
2775         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
2776         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
2777         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
2778         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
2780 2006-01-09  Roland McGrath  <roland@redhat.com>
2782         * tst-initializers1-c89.c: New file.
2783         * tst-initializers1-c99.c: New file.
2784         * tst-initializers1-gnu89.c: New file.
2785         * tst-initializers1-gnu99.c: New file.
2786         * Makefile (tests): Add them.
2787         (CFLAGS-tst-initializers1-c89.c): New variable.
2788         (CFLAGS-tst-initializers1-c99.c): New variable.
2789         (CFLAGS-tst-initializers1-gnu89.c): New variable.
2790         (CFLAGS-tst-initializers1-gnu99.c): New variable.
2792         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2793         Use __extension__ on anonymous union definition.
2794         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2795         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
2796         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2797         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2798         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2800 2006-01-08  Jakub Jelinek  <jakub@redhat.com>
2802         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
2803         Don't give the union a name because it changes the mangled name.
2804         Instead name the struct for __data.
2805         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_mutex_t):
2806         Likewise.
2807         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_mutex_t):
2808         Likewise.
2810 2006-01-09  Jakub Jelinek  <jakub@redhat.com>
2812         * sysdeps/sparc/sparc64/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Add
2813         stack bias to mc_ftp field.
2815 2006-01-07  Ulrich Drepper  <drepper@redhat.com>
2817         * sysdeps/pthread/aio_misc.h (AIO_MISC_WAIT): Work around gcc
2818         being too clever and reloading the futex value where it shouldn't.
2820 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
2822         * descr.h [!__PTHREAD_MUTEX_HAVE_PREV] (DEQUEUE_MUTEX): Use
2823         correct type.
2825 2006-01-06  Jakub Jelinek  <jakub@redhat.com>
2827         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
2828         Add cfi directives.
2830 2006-01-06  Ulrich Drepper  <drepper@redhat.com>
2832         * sysdeps/ia64/tls.h (tcbhead_t): Rename private member to __private.
2833         * sysdeps/ia64/tcb-offsets.sym: Adjust for private->__private
2834         rename in tcbhead_t.
2836         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
2837         Don't give the union a name because it changes the mangled name.
2838         Instead name the struct for __data.
2839         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2840         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2841         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2842         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2843         * pthread_create.c (start_thread): Adjust robust mutex free loop.
2844         * descr.h (ENQUEUE_MUTEX, DEQUEUE_MUTEX): Adjust.
2846 2006-01-05  Ulrich Drepper  <drepper@redhat.com>
2848         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
2849         Return status.
2850         (lll_futex_timed_wait): Define.
2851         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
2852         * sysdeps/pthread/aio_misc.h: New file.
2854 2006-01-03  Joseph S. Myers  <joseph@codesourcery.com>
2856         * Makefile ($(objpfx)$(multidir)): Use mkdir -p.
2858 2006-01-03  Steven Munroe  <sjmunroe@us.ibm.com>
2860         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
2861         (PSEUDO): Remove redundant cfi_startproc and cfi_endproc directives.
2862         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
2864 2006-01-04  Ulrich Drepper  <drepper@redhat.com>
2866         * tst-cancel24.cc: Use C headers instead of C++ headers.
2868 2006-01-03  Jakub Jelinek  <jakub@redhat.com>
2870         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Remove #error for
2871         sparc-linux configured glibc.
2872         (lll_futex_wake_unlock): Define to 1 for sparc-linux configured glibc.
2873         (__lll_mutex_trylock, __lll_mutex_cond_trylock, __lll_mutex_lock,
2874         __lll_mutex_cond_lock, __lll_mutex_timedlock): Use
2875         atomic_compare_and_exchange_val_24_acq instead of
2876         atomic_compare_and_exchange_val_acq.
2877         (lll_mutex_unlock, lll_mutex_unlock_force): Use atomic_exchange_24_rel
2878         instead of atomic_exchange_rel.
2879         * sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: New file.
2880         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_init.c: New
2881         file.
2882         * sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c: New
2883         file.
2884         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_init.c: New file.
2885         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: New file.
2886         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: New file.
2887         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: New file.
2888         * sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: New file.
2889         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_init.c:
2890         New file.
2891         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
2892         New file.
2893         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_init.c: New file.
2894         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c: New file.
2895         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c: New
2896         file.
2897         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c: New
2898         file.
2899         * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c: New file.
2901 2006-01-03  Ulrich Drepper  <drepper@redhat.com>
2903         * sysdeps/pthread/pthread.h [__WORDSIZE==64]: Don't use cast in
2904         mutex initializers.
2906 2006-01-02  Jakub Jelinek  <jakub@redhat.com>
2908         * sysdeps/sparc/tls.h (tcbhead_t): Add pointer_guard field.
2909         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
2910         THREAD_COPY_POINTER_GUARD): Define.
2911         * sysdeps/sparc/tcb-offsets.sym (POINTER_GUARD): Define.
2912         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Revert 2005-12-27 changes.
2914 2006-01-01  Ulrich Drepper  <drepper@redhat.com>
2916         * version.c: Update copyright year.
2918 2005-12-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2920         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Remove explicit
2921         .eh_frame section, use cfi_* directives.
2922         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Add cfi instrumentation.
2924 2005-12-30  Ulrich Drepper  <drepper@redhat.com>
2926         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Undo last change for
2927         now.
2929 2005-12-29  Ulrich Drepper  <drepper@redhat.com>
2931         * sysdeps/pthread/sigaction.c: Removed.
2932         * sigaction.c: New file.
2933         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-sigaction.c.
2935 2005-12-28  Ulrich Drepper  <drepper@redhat.com>
2937         * Makefile (tests): Add tst-signal7.
2938         * tst-signal7.c: New file.
2940 2005-12-27  Roland McGrath  <roland@redhat.com>
2942         * sysdeps/x86_64/jmpbuf-unwind.h (_jmpbuf_sp): New inline function.
2943         (_JMPBUF_UNWINDS_ADJ): Use it, to PTR_DEMANGLE before comparison.
2944         * sysdeps/alpha/jmpbuf-unwind.h: Likewise.
2945         * sysdeps/i386/jmpbuf-unwind.h: Likewise.
2946         * sysdeps/mips/jmpbuf-unwind.h: Likewise.
2947         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
2948         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
2949         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
2950         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
2951         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Likewise.
2952         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
2954 2005-12-27  Jakub Jelinek  <jakub@redhat.com>
2956         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Add __next
2957         and __prev field to pthread_mutex_t.
2958         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
2959         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
2960         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2961         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
2962         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Add __next field
2963         to pthread_mutex_t.
2965 2005-12-26  Ulrich Drepper  <drepper@redhat.com>
2967         * pthreadP.h: Define PTHREAD_MUTEX_ROBUST_PRIVATE_NP,
2968         PTHREAD_MUTEX_ROBUST_PRIVATE_RECURSIVE_NP,
2969         PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP,
2970         PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP,
2971         PTHREAD_MUTEXATTR_FLAG_ROBUST, PTHREAD_MUTEXATTR_FLAG_PSHARED,
2972         and PTHREAD_MUTEXATTR_FLAG_BITS.
2973         * descr.h (struct pthread): Add robust_list field and define
2974         ENQUEUE_MUTEX and DEQUEUE_MUTEX macros.
2975         * pthread_mutexattr_getrobust.c: New file.
2976         * pthread_mutexattr_setrobust.c: New file.
2977         * pthread_mutex_consistent.c: New file.
2978         * sysdeps/pthread/pthread.h: Declare pthread_mutexattr_getrobust,
2979         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
2980         Define PTHREAD_MUTEX_STALLED_NP and PTHREAD_MUTEX_ROBUST_NP.
2981         Adjust pthread_mutex_t initializers.
2982         * nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Add __next
2983         field to pthread_mutex_t.
2984         * nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Add __next
2985         and __prev field to pthread_mutex_t.
2986         * Versions [GLIBC_2.4]: Export pthread_mutexattr_getrobust_np,
2987         pthread_mutexattr_setrobust_np, and pthread_mutex_consistent_np.
2988         * pthread_mutexattr_getpshared.c: Use PTHREAD_MUTEXATTR_FLAG_PSHARED
2989         and PTHREAD_MUTEXATTR_FLAG_BITS macros instead of magic numbers.
2990         * pthread_mutexattr_gettype.c: Likewise.
2991         * pthread_mutexattr_setpshared.c: Likewise.
2992         * pthread_mutexattr_settype.c: Likewise.
2993         * pthread_mutex_init.c: Reject robust+pshared attribute for now.
2994         Initialize mutex kind according to robust flag.
2995         * pthread_mutex_lock.c: Implement local robust mutex.
2996         * pthread_mutex_timedlock.c: Likewise.
2997         * pthread_mutex_trylock.c: Likewise.
2998         * pthread_mutex_unlock.c: Likewise.
2999         * pthread_create.c (start_thread): Mark robust mutexes which remained
3000         locked as dead.
3001         * tst-robust1.c: New file.
3002         * tst-robust2.c: New file.
3003         * tst-robust3.c: New file.
3004         * tst-robust4.c: New file.
3005         * tst-robust5.c: New file.
3006         * tst-robust6.c: New file.
3007         * tst-robust7.c: New file.
3008         * Makefile (libpthread-routines): Add pthread_mutexattr_getrobust,
3009         pthread_mutexattr_setrobust, and pthread_mutex_consistent.
3010         (tests): Add tst-robust1, tst-robust2, tst-robust3, tst-robust4,
3011         tst-robust5, tst-robust6, and tst-robust7.
3013         * tst-typesizes.c: New file.
3014         * Makefile (tests): Add tst-typesizes.
3016         * tst-once3.c: More debug output.
3018 2005-12-24  Ulrich Drepper  <drepper@redhat.com>
3020         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Add break
3021         missing after last change.
3023         * version.c: Update copyright year.
3025 2005-12-23  Ulrich Drepper  <drepper@redhat.com>
3027         * pthread_mutex_destroy.c: Set mutex type to an invalid value.
3028         * pthread_mutex_lock.c: Return EINVAL for invalid mutex type.
3029         * pthread_mutex_trylock.c: Likewise.
3030         * pthread_mutex_timedlock.c: Likewise.
3031         * pthread_mutex_unlock.c: Likewise.
3033 2005-12-22  Roland McGrath  <roland@redhat.com>
3035         * sysdeps/pthread/sigaction.c: Use "" instead of <> to include self,
3036         so that #include_next's search location is not reset to the -I..
3037         directory where <nptl/...> can be found.
3039 2005-12-22  Ulrich Drepper  <drepper@redhat.com>
3041         [BZ #1913]
3042         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3043         Fix unwind info.  Remove useless branch prediction prefix.
3044         * tst-cancel24.cc: New file.
3045         * Makefile: Add rules to build and run tst-cancel24.
3047 2005-12-21  Roland McGrath  <roland@redhat.com>
3049         * libc-cancellation.c: Use <> rather than "" #includes.
3050         * pt-cleanup.c: Likewise.
3051         * pthread_create.c: Likewise.
3052         * pthread_join.c: Likewise.
3053         * pthread_timedjoin.c: Likewise.
3054         * pthread_tryjoin.c: Likewise.
3055         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Likewise.
3056         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
3057         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
3058         * unwind.c: Likewise.
3060 2005-12-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3062         * sysdeps/sh/tcb-offsets.sym: Add POINTER_GUARD.
3063         * sysdeps/sh/tls.h (tcbhead_t): Remove private and add pointer_guard.
3064         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3065         THREAD_COPY_POINTER_GUARD): Define.
3067 2005-12-19  Jakub Jelinek  <jakub@redhat.com>
3069         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): Make room for 2 uintptr_t's
3070         rather than one.
3071         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3072         THREAD_COPY_POINTER_GUARD): Define.
3073         * sysdeps/powerpc/tcb-offsets.sym (POINTER_GUARD): Add.
3074         * sysdeps/powerpc/tls.h (tcbhead_t): Add pointer_guard field.
3075         (THREAD_GET_POINTER_GUARD, THREAD_SET_POINTER_GUARD,
3076         THREAD_COPY_POINTER_GUARD): Define.
3077         * sysdeps/s390/tcb-offsets.sym (STACK_GUARD): Add.
3078         * sysdeps/s390/tls.h (THREAD_GET_POINTER_GUARD,
3079         THREAD_SET_POINTER_GUARD, THREAD_COPY_POINTER_GUARD): Define.
3080         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S (__ia64_longjmp):
3081         Use PTR_DEMANGLE for B0 if defined.
3083 2005-12-17  Ulrich Drepper  <drepper@redhat.com>
3085         * pthread_create.c (__pthread_create_2_1): Use
3086         THREAD_COPY_POINTER_GUARD if available.
3087         * sysdeps/i386/tcb-offsets.sym: Add POINTER_GUARD.
3088         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
3089         * sysdeps/i386/tls.h (tcbhead_t): Add pointer_guard.
3090         Define THREAD_SET_POINTER_GUARD and THREAD_COPY_POINTER_GUARD.
3091         * sysdeps/x86_64/tls.h: Likewise.
3093 2005-12-15  Roland McGrath  <roland@redhat.com>
3095         * sysdeps/unix/sysv/linux/mq_notify.c: Don't use sysdeps/generic.
3097 2005-12-13  Ulrich Drepper  <drepper@redhat.com>
3099         * sysdeps/pthread/sigfillset.c: Adjust for files moved out of
3100         sysdeps/generic.
3101         * errno-loc.c: New file.
3103 2005-12-12  Roland McGrath  <roland@redhat.com>
3105         * init.c (__pthread_initialize_minimal_internal): Do __static_tls_size
3106         adjustments before choosing stack size.  Update minimum stack size
3107         calculation to match allocate_stack change.
3109 2005-12-12  Ulrich Drepper  <drepper@redhat.com>
3111         * allocatestack.c (allocate_stack): Don't demand that there is an
3112         additional full page available on the stack beside guard, TLS, the
3113         minimum stack.
3115 2005-11-24  Ulrich Drepper  <drepper@redhat.com>
3117         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3118         (__cleanup_fct_attribute): Use __regparm__ not regparm.
3120         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: When
3121         compiling 32-bit code we must define __cleanup_fct_attribute.
3123 005-11-24  Jakub Jelinek  <jakub@redhat.com>
3125         [BZ #1920]
3126         * sysdeps/pthread/pthread.h (__pthread_unwind_next): Use
3127         __attribute__ instead of __attribute.
3128         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
3129         (__cleanup_fct_attribute): Likewise.
3131 2005-11-17  Jakub Jelinek  <jakub@redhat.com>
3133         * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
3134         a write barrier before writing libgcc_s_getcfa.
3136 2005-11-06  Ulrich Drepper  <drepper@redhat.com>
3138         * sysdeps/unix/sysv/linux/configure: Removed.
3140 2005-11-05  Ulrich Drepper  <drepper@redhat.com>
3142         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Remove trace of
3143         optional init_array/fini_array support.
3145 2005-10-24  Roland McGrath  <roland@redhat.com>
3147         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove unnecessary
3148         versioned_symbol use.
3150 2005-10-16  Roland McGrath  <roland@redhat.com>
3152         * init.c (__pthread_initialize_minimal_internal): Even when using a
3153         compile-time default stack size, apply the minimum that allocate_stack
3154         will require, and round up to page size.
3156 2005-10-10  Daniel Jacobowitz  <dan@codesourcery.com>
3158         * Makefile ($(test-modules)): Remove static pattern rule.
3160 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
3161             Ulrich Drepper  <drepper@redhat.com>
3163         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
3164         alignment in callback function.
3165         * Makefile: Add rules to build and run tst-align3.
3166         * tst-align3.c: New file.
3168 2005-10-03  Jakub Jelinek  <jakub@redhat.com>
3170         * allocatestack.c (setxid_signal_thread): Add
3171         INTERNAL_SYSCALL_DECL (err).
3173 2005-10-02  Jakub Jelinek  <jakub@redhat.com>
3175         * allocatestack.c (setxid_signal_thread): Need to use
3176         atomic_compare_and_exchange_bool_acq.
3178 2005-10-01  Ulrich Drepper  <drepper@redhat.com>
3179             Jakub Jelinek  <jakub@redhat.com>
3181         * descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
3182         CANCEL_RESTMASK.
3183         (struct pthread): Move specific_used field to avoid padding.
3184         Add setxid_futex field.
3185         * init.c (sighandler_setxid): Reset setxid flag and release the
3186         setxid futex.
3187         * allocatestack.c (setxid_signal_thread): New function.  Broken
3188         out of the bodies of the two loops in __nptl_setxid.  For undetached
3189         threads check whether they are exiting and if yes, don't send a signal.
3190         (__nptl_setxid): Simplify loops by using setxid_signal_thread.
3191         * pthread_create.c (start_thread): For undetached threads, check
3192         whether setxid bit is set.  If yes, wait until signal has been
3193         processed.
3195         * allocatestack.c (STACK_VARIABLES): Initialize them.
3196         * pthread_create.c (__pthread_create_2_1): Initialize pd.
3198 2004-09-02  Jakub Jelinek  <jakub@redhat.com>
3200         * pthread_cond_destroy.c (__pthread_cond_destroy): If there are
3201         waiters, awake all waiters on the associated mutex.
3203 2005-09-22  Roland McGrath  <roland@redhat.com>
3205         * perf.c [__x86_64__] (HP_TIMING_NOW): New macro (copied from
3206         ../sysdeps/x86_64/hp-timing.h).
3208 2005-08-29  Jakub Jelinek  <jakub@redhat.com>
3210         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_WAKE_OP,
3211         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3212         (lll_futex_wake_unlock): Define.
3213         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_WAKE_OP,
3214         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3215         (lll_futex_wake_unlock): Define.
3216         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_WAKE_OP,
3217         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3218         (lll_futex_wake_unlock): Define.
3219         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_WAKE_OP,
3220         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3221         (lll_futex_wake_unlock): Define.
3222         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_WAKE_OP,
3223         FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3224         (lll_futex_wake_unlock): Define.
3225         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal): Use
3226         lll_futex_wake_unlock.
3227         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
3228         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3229         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3230         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
3231         (FUTEX_WAKE_OP, FUTEX_OP_CLEAR_WAKE_IF_GT_ONE): Define.
3232         (__pthread_cond_signal): Use FUTEX_WAKE_OP.
3234 2005-09-05  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3236         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
3237         Fix typo in register name.
3239 2005-08-23  Ulrich Drepper  <drepper@redhat.com>
3241         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
3242         Use __sigfillset.  Document that sigfillset does the right thing wrt
3243         to SIGSETXID.
3245 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3247         [BZ #1102]
3248         * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
3249         PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
3250         PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
3251         PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
3252         PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
3253         PTHREAD_COND_INITIALIZER): Supply zeros for all fields
3254         in the structure.
3255         * Makefile (tests): Add tst-initializers1.
3256         (CFLAGS-tst-initializers1.c): Set.
3257         * tst-initializers1.c: New test.
3259 2005-07-11  Jakub Jelinek  <jakub@redhat.com>
3261         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_rwlock_t):
3262         Make sure __flags are located at offset 48 from the start of the
3263         structure.
3265 2005-07-02  Roland McGrath  <roland@redhat.com>
3267         * Makeconfig: Comment fix.
3269 2005-07-05  Jakub Jelinek  <jakub@redhat.com>
3271         * descr.h (PTHREAD_STRUCT_END_PADDING): Define.
3272         * sysdeps/ia64/tls.h (TLS_PRE_TCB_SIZE): If PTHREAD_STRUCT_END_PADDING
3273         is smaller than 8 bytes, increase TLS_PRE_TCB_SIZE by 16 bytes.
3274         (THREAD_SYSINFO, THREAD_SELF, DB_THREAD_SELF): Don't assume
3275         TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3276         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3277         * sysdeps/ia64/tcb-offsets.sym (PID, TID, MULTIPLE_THREADS_OFFSET):
3278         Use TLS_PRE_TCB_SIZE instead of sizeof (struct pthread).
3279         * sysdeps/unix/sysv/linux/ia64/createthread.c (TLS_VALUE): Don't
3280         assume TLS_PRE_TCB_SIZE is sizeof (struct pthread).
3282 2005-06-25  Jakub Jelinek  <jakub@redhat.com>
3284         * sysdeps/i386/tls.h (tcbhead_t): Add stack_guard field.
3285         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3286         * sysdeps/x86_64/tls.h (tcbhead_t): Add sysinfo and stack_guard
3287         fields.
3288         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3289         * sysdeps/s390/tls.h (tcbhead_t): Add stack_guard
3290         field.  Put in sysinfo field unconditionally.
3291         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3292         * sysdeps/powerpc/tls.h (tcbhead_t): Add stack_guard field.
3293         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3294         * sysdeps/sparc/tls.h (tcbhead_t): Add sysinfo and stack_guard
3295         fields.
3296         (THREAD_SET_STACK_GUARD, THREAD_COPY_STACK_GUARD): Define.
3297         * pthread_create.c (__pthread_create_2_1): Use
3298         THREAD_COPY_STACK_GUARD macro.
3299         * Makefile: Add rules to build and run tst-stackguard1{,-static}
3300         tests.
3301         * tst-stackguard1.c: New file.
3302         * tst-stackguard1-static.c: New file.
3304 2005-06-14  Alan Modra  <amodra@bigpond.net.au>
3306         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
3307         Invoke CGOTSETUP and CGOTRESTORE.
3308         (CGOTSETUP, CGOTRESTORE): Define.
3310 2005-05-29  Richard Henderson  <rth@redhat.com>
3312         * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
3313         (tf_write, tf_writev): Use it.
3314         (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
3315         the system minimum.
3317 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
3319         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
3320         [IS_IN_librt] (CENABLE, CDISABLE): Use JUMPTARGET instead of
3321         __librt_*_asynccancel@local.
3323 2005-05-17  Alan Modra  <amodra@bigpond.net.au>
3325         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Delete
3326         all occurrences of JUMPTARGET.  Instead append @local to labels.
3328 2005-05-20  Jakub Jelinek  <jakub@redhat.com>
3330         * sysdeps/i386/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN): Define to
3331         size/alignment of struct pthread rather than tcbhead_t.
3332         * sysdeps/x86_64/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3333         Likewise.
3334         * sysdeps/s390/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3335         Likewise.
3336         * sysdeps/sparc/tls.h (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN):
3337         Likewise.
3339 2005-05-19  Richard Henderson  <rth@redhat.com>
3341         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use
3342         __sync_val_compare_and_swap, not explicit _si variant.
3343         * sysdeps/ia64/pthread_spin_trylock.c (pthread_spin_trylock): Likewise.
3345 2005-05-03  Ulrich Drepper  <drepper@redhat.com>
3347         [BZ #915]
3348         * sysdeps/pthread/pthread.h: Avoid empty initializers.
3350 2005-05-03  Jakub Jelinek  <jakub@redhat.com>
3352         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Remove explicit
3353         .eh_frame section, use cfi_* directives.
3355 2005-04-27  Jakub Jelinek  <jakub@redhat.com>
3357         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Use <> instead
3358         of "" includes.
3360 2005-04-27  Ulrich Drepper  <drepper@redhat.com>
3362         [BZ #1075]
3363         * tst-cancel17.c (do_test): Add arbitrary factor to make sure
3364         aio_write blocks.
3366 2005-04-27  Roland McGrath  <roland@redhat.com>
3368         * Makefile (tests): Remove tst-clock2.
3370         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Handle
3371         CLOCK_PROCESS_CPUTIME_ID and CLOCK_PROCESS_THREAD_ID specially,
3372         translating to the kernel clockid_t for our own process/thread clock.
3374         * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: New file.
3376 2005-04-15  Jakub Jelinek  <jakub@redhat.com>
3378         * old_pthread_cond_init.c: Include <errno.h>.
3379         (__pthread_cond_init_2_0): Fail with EINVAL if COND_ATTR is
3380         process shared or uses clock other than CLOCK_REALTIME.
3381         * pthread_cond_init.c (__pthread_cond_init): Remove bogus comment.
3383 2005-04-13  David S. Miller  <davem@davemloft.net>
3385         * sysdeps/sparc/sparc64/jmpbuf-unwind.h: New file.
3386         * sysdeps/sparc/sparc64/clone.S: New file.
3388 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
3390         [BZ #1102]
3391         * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
3392         __inline instead of inline.
3393         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
3395 2005-03-31  Jakub Jelinek  <jakub@redhat.com>
3397         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Use
3398         functionally equivalent, but shorter instructions.
3399         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
3400         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
3401         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
3402         Likewise.
3403         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise.
3404         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
3405         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
3406         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
3407         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
3408         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
3409         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
3410         Likewise.
3411         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
3412         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
3413         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
3414         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
3415         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
3417 2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
3419         * sysdeps/mips/Makefile: New file.
3420         * sysdeps/mips/nptl-sysdep.S: New file.
3421         * sysdeps/mips/tcb-offsets.sym: New file.
3422         * sysdeps/mips/pthread_spin_lock.S: New file.
3423         * sysdeps/mips/pthread_spin_trylock.S: New file.
3424         * sysdeps/mips/pthreaddef.h: New file.
3425         * sysdeps/mips/tls.h: New file.
3426         * sysdeps/mips/jmpbuf-unwind.h: New file.
3427         * sysdeps/unix/sysv/linux/mips/lowlevellock.h: New file.
3428         * sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h: New file.
3429         * sysdeps/unix/sysv/linux/mips/bits/semaphore.h: New file.
3430         * sysdeps/unix/sysv/linux/mips/pthread_once.c: New file.
3431         * sysdeps/unix/sysv/linux/mips/fork.c: New file.
3432         * sysdeps/unix/sysv/linux/mips/pt-vfork.S: New file.
3433         * sysdeps/unix/sysv/linux/mips/vfork.S: New file.
3434         * sysdeps/unix/sysv/linux/mips/clone.S: New file.
3435         * sysdeps/unix/sysv/linux/mips/createthread.c: New file.
3436         * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: New file.
3438 2005-03-23  Ulrich Drepper  <drepper@redhat.com>
3440         [BZ #1112]
3441         * pthread_create.c (__pthread_create_2_1): Rename syscall error
3442         variable to scerr.
3444 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
3446         * tst-getpid1.c (do_test): Align stack passed to clone{2,}.
3448 2005-02-25  Roland McGrath  <roland@redhat.com>
3450         * alloca_cutoff.c: Correct license text.
3451         * tst-unload.c: Likewise.
3452         * sysdeps/pthread/allocalim.h: Likewise.
3453         * sysdeps/pthread/pt-initfini.c: Likewise.
3454         * sysdeps/pthread/bits/libc-lock.h: Likewise.
3455         * sysdeps/pthread/bits/sigthread.h: Likewise.
3456         * sysdeps/unix/sysv/linux/bits/local_lim.h: Likewise.
3457         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
3459 2005-02-16  Roland McGrath  <roland@redhat.com>
3461         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
3462         Use unsigned int * for ptr_nthreads.
3464 2005-02-14  Alan Modra  <amodra@bigpond.net.au>
3466         [BZ #721]
3467         * sysdeps/powerpc/tcb-offsets.sym (thread_offsetof): Redefine to suit
3468         gcc4.
3470 2005-02-07  Richard Henderson  <rth@redhat.com>
3472         [BZ #787]
3473         * sysdeps/pthread/pthread.h (__sigsetjmp): Use pointer as first
3474         argument.
3476 2004-11-03  Marcus Brinkmann  <marcus@gnu.org>
3478         * sysdeps/generic/lowlevellock.h (__generic_mutex_unlock): Fix
3479         order of arguments in invocation of atomic_add_zero.
3481 2005-01-26  Jakub Jelinek  <jakub@redhat.com>
3483         [BZ #737]
3484         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S (__new_sem_trywait):
3485         Use direct %gs segment access or, if NO_TLS_DIRECT_SEG_REFS,
3486         at least gotntpoff relocation and addition.
3487         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
3488         Likewise.
3489         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
3490         Likewise.
3491         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
3492         Likewise.
3494 2005-01-06  Ulrich Drepper  <drepper@redhat.com>
3496         * allocatestack.c (init_one_static_tls): Adjust initialization of DTV
3497         entry for static tls deallocation fix.
3498         * sysdeps/alpha/tls.h (dtv_t): Change pointer type to be struct which
3499         also contains information whether the memory pointed to is static
3500         TLS or not.
3501         * sysdeps/i386/tls.h: Likewise.
3502         * sysdeps/ia64/tls.h: Likewise.
3503         * sysdeps/powerpc/tls.h: Likewise.
3504         * sysdeps/s390/tls.h: Likewise.
3505         * sysdeps/sh/tls.h: Likewise.
3506         * sysdeps/sparc/tls.h: Likewise.
3507         * sysdeps/x86_64/tls.h: Likewise.
3509 2004-12-27  Ulrich Drepper  <drepper@redhat.com>
3511         * init.c (__pthread_initialize_minimal_internal): Use __sigemptyset.
3513 2004-12-21  Jakub Jelinek  <jakub@redhat.com>
3515         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Maintain 16 byte alignment of
3516         %esp.
3517         * Makefile (tests): Add tst-align2.
3518         * tst-align2.c: New test.
3519         * sysdeps/i386/Makefile (CFLAGS-tst-align{,2}.c): Add
3520         -mpreferred-stack-boundary=4.
3522 2004-12-18  Roland McGrath  <roland@redhat.com>
3524         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h:
3525         New file removed withdrawn for the moment.
3527 2004-12-17  Richard Henderson  <rth@redhat.com>
3529         * sysdeps/unix/sysv/linux/alpha/clone.S: New file.
3530         * sysdeps/alpha/tcb-offsets.sym (TID_OFFSET): New.
3532 2004-12-16  Ulrich Drepper  <drepper@redhat.com>
3534         * sysdeps/unix/sysv/linux/powerpc/powerpc64/bits/local_lim.h: New file.
3535         Increased PTHREAD_STACK_MIN.
3537         * tst-context1.c (stacks): Use bigger stack size.
3539 2004-12-16  Jakub Jelinek  <jakub@redhat.com>
3541         * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: New file.
3542         * sysdeps/sparc/tcb-offsets.sym: Add TID.
3544 2004-12-15  Jakub Jelinek  <jakub@redhat.com>
3546         * sysdeps/unix/sysv/linux/s390/s390-32/clone.S: New file.
3547         * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file.
3548         * sysdeps/s390/tcb-offsets.sym (TID): Add.
3550 2004-12-15  Ulrich Drepper  <drepper@redhat.com>
3552         * sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: New file.
3554 2004-12-14  Ulrich Drepper  <drepper@redhat.com>
3556         * sysdeps/powerpc/tcb-offsets.sym: Add TID.
3557         * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file.
3559         * tst-getpid1.c: If child crashes, report this first.  Print which
3560         signal.
3562 2004-12-09  Ulrich Drepper  <drepper@redhat.com>
3564         * init.c (__pthread_initialize_minimal_internal): Also unblock
3565         SIGSETXID.
3567 2004-12-01  Jakub Jelinek  <jakub@redhat.com>
3569         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME,
3570         _POSIX_THREAD_CPUTIME): Define to 0.
3571         * sysdeps/pthread/timer_create.c (timer_create): Remove unused code
3572         handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
3573         * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk,
3574         __timer_signal_thread_tclk): Remove.
3575         (init_module): Remove their initialization.
3576         (thread_cleanup): Remove their cleanup assertions.
3577         * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
3578         __timer_signal_thread_tclk): Remove.
3579         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
3580         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
3581         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
3583 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
3585         * sysdeps/ia64/tcb-offsets.sym (TID): Add.
3586         * sysdeps/unix/sysv/linux/ia64/clone2.S: New file.
3588         * Makefile (tests): Add tst-getpid2.
3589         * tst-getpid1.c (TEST_CLONE_FLAGS): Define.
3590         (do_test): Use it.  Use __clone2 instead of clone on ia64.
3591         * tst-getpid2.c: New test.
3593 2004-12-07  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3595         * sysdeps/unix/sysv/linux/sh/clone.S: New file.
3597 2004-12-04  Ulrich Drepper  <drepper@redhat.com>
3599         * Makefile (tests): Add tst-getpid1.
3600         * tst-getpid1.c: New file.
3601         * sysdeps/unix/sysv/linux/i386/clone.S: New file.
3602         * sysdeps/unix/sysv/linux/x86_64/clone.S: New file.
3604 2004-12-02  Roland McGrath  <roland@redhat.com>
3606         * Makefile (libpthread-nonshared): Variable removed.
3607         ($(objpfx)libpthread_nonshared.a): Target removed.
3608         ($(inst_libdir)/libpthread_nonshared.a): Likewise.
3609         These are now handled by generic magic from
3610         libpthread-static-only-routines being set.
3612 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
3614         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
3615         _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
3616         _POSIX_THREAD_PRIO_PROTECT): Define.
3617         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3618         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3619         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3621 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
3623         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
3624         _POSIX_SPORADIC_SERVER, _POSIX_THREAD_SPORADIC_SERVER, _POSIX_TRACE,
3625         _POSIX_TRACE_EVENT_FILTER, _POSIX_TRACE_INHERIT, _POSIX_TRACE_LOG,
3626         _POSIX_TYPED_MEMORY_OBJECTS, _POSIX_IPV6, _POSIX_RAW_SOCKETS): Define.
3627         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
3628         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3629         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
3631 2004-11-24  Ulrich Drepper  <drepper@redhat.com>
3633         * sysdeps/x86_64/Makefile [nptl]: Define CFLAGS-pthread_create.c.
3635         * Makefile (libpthread-routines): Add pthread_setschedprio.
3636         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setschedprio.
3637         * sysdeps/pthread/pthread.h: Declare pthread_setschedprio.
3638         * pthread_setschedprio.c: New file.
3640 2004-11-20  Jakub Jelinek  <jakub@redhat.com>
3642         * pthread_create.c (pthread_cancel): Add PTHREAD_STATIC_FN_REQUIRE.
3643         * pthread_cancel.c (pthread_create): Likewise.
3645         * Makefile (libpthread-routines): Add vars.
3646         * sysdeps/pthread/createthread.c (__pthread_multiple_threads): Remove.
3647         * init.c (__default_stacksize, __is_smp): Remove.
3648         * vars.c: New file.
3649         * pthreadP.h (__find_thread_by_id): If !SHARED, add weak_function
3650         and define a wrapper macro.
3651         (PTHREAD_STATIC_FN_REQUIRE): Define.
3652         * allocatestack.c (__find_thread_by_id): Undefine.
3653         * pthread_create (__pthread_keys): Remove.
3654         (pthread_mutex_lock, pthread_mutex_unlock, pthread_once,
3655         pthread_key_create, pthread_setspecific, pthread_getspecific): Add
3656         PTHREAD_STATIC_FN_REQUIRE.
3658 2004-11-18  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3660         * sysdeps/sh/tls.h (DB_THREAD_SELF): Set the correct bias
3661         parameter to REGISTER macro.
3663 2004-11-17  Roland McGrath  <roland@redhat.com>
3665         * sysdeps/unix/sysv/linux/timer_routines.c (__start_helper_thread):
3666         Make sure SIGCANCEL is blocked as well.
3668 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3670         * sysdeps/pthread/setxid.h: New file.
3671         * sysdeps/pthread/pthread-functions.h (HAVE_PTR__NPTL_SETXID): Remove.
3672         (struct xid_command): Add forward decl.
3673         (struct pthread_functions): Change return type of __nptl_setxid hook
3674         to int.
3675         * pthreadP.h (__nptl_setxid): Change return type to int.
3676         * allocatestack.c (__nptl_setxid): Call INTERNAL_SYSCALL_NCS in the
3677         calling thread, return its return value and set errno on failure.
3678         * descr.h (struct xid_command): Change id type to long array.
3680         * Makefile: Add rules to build and test tst-setuid1 and
3681         tst-setuid1-static.
3682         * tst-setuid1.c: New test.
3683         * tst-setuid1-static.c: New test.
3685 2004-11-10  Jakub Jelinek  <jakub@redhat.com>
3687         * Makefile (tests): Add tst-exit3.
3688         * tst-exit3.c: New test.
3690 2004-11-09  Ulrich Drepper  <drepper@redhat.com>
3692         * Makefile (tests): Add tst-exit2.
3693         * tst-exit2.c: New file.
3695 2004-11-09  Roland McGrath  <roland@redhat.com>
3697         [BZ #530]
3698         * sysdeps/pthread/createthread.c (do_clone): Increment __nptl_nthreads
3699         here, before calling clone.
3700         * pthread_create.c (start_thread): Don't do it here.
3702 2004-11-02  Jakub Jelinek  <jakub@redhat.com>
3704         * sysdeps/unix/sysv/linux/smp.h: Include <errno.h>.
3706 2004-10-29  Kaz  Kojima  <kkojima@rr.iij4u.or.jp>
3708         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
3709         Set ETIMEDOUT to errno when time is up.  Tweak to avoid
3710         assembler warning.
3712 2004-10-28  Jakub Jelinek  <jakub@redhat.com>
3714         * pthread_create.c (__pthread_create_2_1): Avoid leaking stacks
3715         if sched_priority is not between minprio and maxprio.
3717 2004-10-25  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3719         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
3720         (__pthread_cond_timedwait): Use clock_gettime syscall if exists.
3722         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3723         (__lll_mutex_timedlock_wait): Fix a bad branch condition.
3725 2004-10-24  Ulrich Drepper  <drepper@redhat.com>
3727         * sysdeps/unix/sysv/linux/smp.h (is_smp_system): Use
3728         not-cancelable I/O functions.
3730 2004-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
3732         * sysdeps/unix/sysv/linux/sh/lowlevellock.S
3733         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3734         make sure 2 is stored in the futex and we looked at the old value.
3735         Fix a few other problems to return the correct value.
3737 2004-10-14  Richard Henderson  <rth@redhat.com>
3739         * sysdeps/alpha/tcb-offsets.sym (thread_offsetof): Redefine to
3740         make gcc4 happy.
3742 2004-10-06  Jakub Jelinek  <jakub@redhat.com>
3744         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include pthreadP.h instead
3745         of pthread-functions.h and pthreaddef.h.
3746         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
3748         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
3749         Change __data.__nwaiters from int to unsigned int.
3751         * tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
3752         sysconf (_SC_THREAD_CPUTIME) returns negative value.
3754         * allocatestack.c (__find_thread_by_id): Move attribute_hidden
3755         before return type.
3757         * sysdeps/s390/jmpbuf-unwind.h: Include bits/wordsize.h.
3758         (JMPBUF_CFA_UNWINDS_ADJ): Subtract 96 resp. 160 bytes from CFA.
3760 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
3762         * tst-cancel4.c (tf_msgrcv): Check for failure in msgget.  If the
3763         test fails, remove message queue.
3764         (tf_msgsnd): Likewise.
3766 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3768         * tst-clock1.c: Change #ifdef to #if defined.
3769         * tst-clock2.c: Likewise.
3770         * tst-cond11.c: Likewise.
3772         * sysdeps/pthread/timer_create.c (timer_create): Use
3773         defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
3774         defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
3775         THREAD_CPUTIME.
3777 2004-10-05  Jakub Jelinek  <jakub@redhat.com>
3779         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
3780         _POSIX_THREAD_CPUTIME): Define to 0.
3782 2004-10-04  Ulrich Drepper  <drepper@redhat.com>
3784         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
3785         and _POSIX_THREAD_CPUTIME to zero.
3786         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
3787         * tst-barrier2.c: Fix testing for POSIX feature.
3788         * tst-clock1.c: Likewise.
3789         * tst-clock2.c: Likewise.
3790         * tst-cond11.c: Likewise.
3791         * tst-cond4.c: Likewise.
3792         * tst-cond6.c: Likewise.
3793         * tst-flock2.c: Likewise.
3794         * tst-mutex4.c: Likewise.
3795         * tst-mutex9.c: Likewise.
3796         * tst-rwlock12.c: Likewise.
3797         * tst-rwlock4.c: Likewise.
3798         * tst-signal1.c: Likewise.
3799         * tst-spin2.c: Likewise.
3800         * sysdeps/pthread/posix-timer.h: Likewise.
3801         * sysdeps/pthread/timer_create.c: Likewise.
3802         * sysdeps/pthread/timer_routines.c: Likewise.
3804 2004-10-01  Ulrich Drepper  <drepper@redhat.com>
3806         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3807         (__lll_mutex_timedlock_wait): Address futex correctly.
3809         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
3810         (__lll_mutex_timedlock_wait): If woken but cannot get the lock,
3811         make sure 2 is stored in the futex and we looked at the old value.
3812         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
3813         (__lll_mutex_timedlock_wait): Likewise.  Fix a few other problems
3814         which might very well made the code not working at all before.
3815         [BZ #417]
3817 2004-09-28  Ulrich Drepper  <drepper@redhat.com>
3819         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
3820         allow SIGSETXID to be sent.
3821         * sysdeps/pthread/sigaction.c (__sigaction): Don't allow action
3822         for SIGSETXID to be defined.
3823         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
3824         SIGSETXID cannot be blocked.
3826         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
3827         Add __extension__ to long long types.
3828         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3829         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3830         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3831         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3832         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
3833         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3834         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3836 2004-09-25  Ulrich Drepper  <drepper@redhat.com>
3838         * descr.h (struct pthread): Add stopped_start field.
3839         * sysdeps/pthread/createthread.c (create_thread): Set
3840         start_stopped flag in descriptor for new thread appropriately.
3841         * pthread_create.c (start_thread): Only take lock to be stopped on
3842         startup if stopped_start flag says so.
3844 2004-09-24  Ulrich Drepper  <drepper@redhat.com>
3846         * pthread_create.c (__pthread_create_2_1): Remember whether thread
3847         is created detached and if yes, do not try to free the stack in case
3848         the thread creation failed.
3849         * sysdeps/pthread/createthread.c (do_clone): Free stack here if clone
3850         call fails.  Don't depend on INTERNAL_SYSCALL_ERRNO return zero in
3851         case there has been no error.  [BZ #405]
3853         * pthread_create.c (start_thread): Don't wait for scheduler data
3854         etc to be set at the beginning of the function.  The cancellation
3855         infrastructure must have been set up.  And enable async
3856         cancellation before potentially going to sleep.  [BZ #401]
3858 2004-09-20  Ulrich Drepper  <drepper@redhat.com>
3860         * Versions: Remove exports for pthread_set*id_np functions.
3861         * sysdeps/pthread/pthread.h: Remove pthread_set*id_np prototypes
3862         for now.
3863         * Makefile: Don't build pthread_set*id code for now.
3865 2004-09-19  Ulrich Drepper  <drepper@redhat.com>
3867         * sysdeps/unix/sysv/linux/allocrtsig.c: Allocate second signal for
3868         internal use.
3869         * allocatestack.c (__nptl_setxid): New function.
3870         * descr.h (struct xid_command): Define type.
3871         * init.c (pthread_functions): Add ptr__nptl_setxid initialization.
3872         (sighandler_setxid): New function.
3873         (__pthread_initialize_minimal): Register sighandler_setxid for
3874         SIGCANCEL.
3875         * pt-allocrtsig.c: Update comment.
3876         * pthreadP.h: Define SIGSETXID.  Declare __xidcmd variable.
3877         Declare __nptl_setxid.
3878         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_setxid.
3879         * sysdeps/pthread/pthread.h: Declare pthread_setgid_np,
3880         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
3881         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
3882         and pthread_setresuid_np.
3883         * pthread_setgid_np.c: New file.
3884         * pthread_setuid_np.c: New file.
3885         * pthread_setegid_np.c: New file.
3886         * pthread_seteuid_np.c: New file.
3887         * pthread_setregid_np.c: New file.
3888         * pthread_setreuid_np.c: New file.
3889         * pthread_setresgid_np.c: New file.
3890         * pthread_setresuid_np.c: New file.
3891         * Versions [libpthread, GLIBC_2.3.4]: Add pthread_setgid_np,
3892         pthread_setuid_np, pthread_setegid_np, pthread_seteuid_np,
3893         pthread_setregid_np, pthread_setreuid_np, pthread_setresgid_np,
3894         and pthread_setresuid_np.
3895         * Makefile (libpthread-routines): Add pthread_setuid, pthread_seteuid,
3896         pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid,
3897         pthread_setregid, and pthread_setresgid.
3899 2004-09-18  Ulrich Drepper  <drepper@redhat.com>
3901         * allocatestack.c (allocate_stack): Return EAGAIN instead of
3902         ENOMEM when out of memory.
3904 2004-09-10  Roland McGrath  <roland@redhat.com>
3906         [BZ #379]
3907         * allocatestack.c (allocate_stack): Remove [__ASSUME_CLONE_STOPPED]
3908         code, since we don't try to use the broken CLONE_STOPPED any more.
3909         * pthread_create.c (start_thread): Likewise.
3911 2004-09-15  Richard Henderson  <rth@redhat.com>
3913         * sysdeps/unix/sysv/linux/alpha/vfork.S: Use libc_hidden_def.
3915 2004-09-01  David Mosberger  <davidm@hpl.hp.com>
3917         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h
3918         (__libc_unwind_longjmp): Delete macro and declare as function.
3919         * sysdeps/unix/sysv/linux/ia64/Makefile (sysdep_routines): Mention
3920         __ia64_longjmp, sigstack_longjmp, and __sigstack_longjmp for
3921         nptl directory.
3922         * sysdeps/unix/sysv/linux/ia64/__ia64_longjmp.S: New file.
3923         * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c: New file.
3924         * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c: New file.
3926 2004-09-12  Ulrich Drepper  <drepper@redhat.com>
3928         * sysdeps/pthread/pthread.h: Make rwlock prototypes available also
3929         for __USE_XOPEN2K.
3930         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define rwlock
3931         types also for __USE_XOPEN2K.
3932         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
3933         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
3934         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
3935         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
3936         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
3937         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
3938         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
3939         [BZ #320]
3941 2004-09-08  Ulrich Drepper  <drepper@redhat.com>
3943         * sysdeps/pthread/pthread.h
3944         (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
3945         (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
3946         (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
3947         (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
3948         [BZ #375]
3950 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
3952         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
3953         PSEUDO to be used with . prefix.
3955         * sysdeps/unix/sysv/linux/alpha/pthread_once.c (__pthread_once):
3956         Use atomic_increment instead of atomic_exchange_and_add.
3957         * sysdeps/unix/sysv/linux/sparc/pthread_once.c (__pthread_once):
3958         Likewise.
3959         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
3960         Likewise.
3961         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
3962         Likewise.
3964         * allocatestack.c (allocate_stack): Use atomic_increment_val
3965         instead of atomic_exchange_and_add.
3966         * sysdeps/unix/sysv/linux/sem_post.c (__new_sem_post): Likewise.
3967         * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__new_sem_post):
3968         Likewise.
3969         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
3970         Likewise.
3972         * sysdeps/pthread/pthread.h (pthread_once): Remove __THROW since
3973         the initialization function might throw.
3975 2005-09-05  Richard Henderson  <rth@redhat.com>
3977         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
3978         Move definition inside libpthread, libc, librt check.  Provide
3979         definition for rtld.
3981 2004-09-02  Ulrich Drepper  <drepper@redhat.com>
3983         * sysdeps/alpha/jmpbuf-unwind.h: Define __libc_unwind_longjmp.
3984         * sysdeps/i386/jmpbuf-unwind.h: Likewise
3985         * sysdeps/powerpc/jmpbuf-unwind.h: Likewise.
3986         * sysdeps/s390/jmpbuf-unwind.h: Likewise.
3987         * sysdeps/sh/jmpbuf-unwind.h: Likewise.
3988         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: Likewise.
3989         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Likewise.
3990         * sysdeps/x86_64/jmpbuf-unwind.h: Likewise.
3991         * unwind.c: Use it.
3993         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
3994         Rename __data.__clock to __data.__nwaiters, make it unsigned int.
3995         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
3996         Likewise.
3997         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
3998         Decrement __nwaiters.  If pthread_cond_destroy has been called and
3999         this is the last waiter, signal pthread_cond_destroy caller and
4000         avoid using the pthread_cond_t structure after unlock.
4001         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
4002         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4003         Read clock type from the least significant bits of __nwaiters instead
4004         of __clock.
4005         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4006         * sysdeps/unix/sysv/linux/internaltypes.h: Define COND_CLOCK_BITS.
4008 2004-08-31  Jakub Jelinek  <jakub@redhat.com>
4010         [BZ #342]
4011         * Makefile (tests): Add tst-cond20 and tst-cond21.
4012         * tst-cond20.c: New test.
4013         * tst-cond21.c: New test.
4014         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
4015         (pthread_cond_t): Rename __data.__clock to __data.__nwaiters, make
4016         it unsigned int.
4017         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4018         Likewise.
4019         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4020         (pthread_cond_t): Likewise.
4021         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4022         Likewise.
4023         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4024         Likewise.
4025         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4026         Likewise.
4027         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_clock): Remove.
4028         (cond_nwaiters): New.
4029         (clock_bits): New.
4030         * pthread_cond_destroy.c (__pthread_cond_destroy): Return EBUSY
4031         if there are waiters not signalled yet.
4032         Wait until all already signalled waiters wake up.
4033         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Decrement
4034         __nwaiters.  If pthread_cond_destroy has been called and this is the
4035         last waiter, signal pthread_cond_destroy caller and avoid using
4036         the pthread_cond_t structure after unlock.
4037         (__pthread_cond_wait): Increment __nwaiters in the beginning,
4038         decrement it when leaving.  If pthread_cond_destroy has been called
4039         and this is the last waiter, signal pthread_cond_destroy caller.
4040         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4041         Likewise.  Read clock type from the least significant bits of
4042         __nwaiters instead of __clock.
4043         * pthread_condattr_setclock.c (pthread_condattr_setclock): Check
4044         whether clock ID can be encoded in COND_CLOCK_BITS bits.
4045         * pthread_condattr_getclock.c (pthread_condattr_getclock): Decode
4046         clock type just from the last COND_CLOCK_BITS bits of value.
4047         * pthread_cond_init.c (__pthread_cond_init): Initialize __nwaiters
4048         instead of __clock, just from second bit of condattr's value.
4050 2004-08-30  Jakub Jelinek  <jakub@redhat.com>
4052         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Include
4053         bits/wordsize.h.  Make the header match i386 header when __WORDSIZE
4054         != 64.
4055         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4057 2004-08-15  Roland McGrath  <roland@frob.com>
4059         * pthread_atfork.c: Update copyright terms including special exception
4060         for these trivial files, which are statically linked into executables
4061         that use dynamic linking for the significant library code.
4063 2004-08-09  Jakub Jelinek  <jakub@redhat.com>
4065         * DESIGN-rwlock.txt: Add decreasing of nr_readers_queued to
4066         pthread_rwlock_rdlock.
4067         * sysdeps/pthread/pthread_rwlock_rdlock (__pthread_rwlock_rdlock):
4068         Decrease __nr_readers_queued after reacquiring lock.
4069         * sysdeps/pthread/pthread_rwlock_timedrdlock
4070         (pthread_rwlock_timedrdlock): Likewise.
4071         Reported by Bob Cook <bobcook47@hotmail.com>.
4073 2004-08-11  Jakub Jelinek  <jakub@redhat.com>
4075         * tst-rwlock14.c (tf): Read main thread handle from *ARG
4076         before pthread_barrier_wait.
4078 2004-08-07  Ulrich Drepper  <drepper@redhat.com>
4080         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
4081         Remove unnecessary exception handling data.
4083 2004-07-23  Jakub Jelinek  <jakub@redhat.com>
4085         [BZ #284]
4086         * sysdeps/pthread/pthread.h (pthread_getcpuclockid): Use __clockid_t
4087         instead of clockid_t.
4089 2004-07-21  Roland McGrath  <roland@redhat.com>
4091         * Makefile ($(objpfx)multidir.mk): Use $(make-target-directory).
4093 2004-07-19  Roland McGrath  <roland@redhat.com>
4095         * tst-cancel4.c (tf_waitid): Use WEXITED flag bit if available.
4097 2004-07-02  Roland McGrath  <roland@redhat.com>
4099         * configure: Don't exit.
4101 2004-07-14  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4103         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4104         (__pthread_cond_timedwait): Check for invalid nanosecond in
4105         timeout value.
4107 2004-07-07  Ulrich Drepper  <drepper@redhat.com>
4109         * Makefile: Add rules to build and run tst-fini1.
4110         * tst-fini1.c: New file.
4111         * tst-fini1mod.c: New file.
4113 2004-07-05  Ulrich Drepper  <drepper@redhat.com>
4115         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define NO_CANCELLATION
4116         if no cancellation support is needed.
4117         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
4118         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
4119         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
4120         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
4121         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
4122         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
4123         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
4124         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
4125         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
4127         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define __NR_futex
4128         only if not already defined.
4130 2004-07-05  Jakub Jelinek  <jakub@redhat.com>
4132         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_unlock): Use
4133         constraint "m" instead of "0" for futex.
4135         * shlib-versions: Add powerpc64-.*-linux.*.
4137 2004-07-04  Jakub Jelinek  <jakub@redhat.com>
4139         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
4140         (pthread_rwlock_timedrdlock): Use cmpq instead of cmpl to check
4141         for valid tv_nsec.
4142         * tst-rwlock14.c (do_test): Test for invalid tv_nsec equal to
4143         1 billion and 64-bit tv_nsec which is valid when truncated to 32
4144         bits.
4146 2004-06-29  Roland McGrath  <roland@redhat.com>
4148         * Banner: NPTL no longer has its own version number.
4149         * Makefile (nptl-version): Variable removed.
4150         * sysdeps/pthread/Makefile (CFLAGS-confstr.c): Set LIBPTHREAD_VERSION
4151         using $(version), the glibc version number.
4153 2004-06-29  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4155         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4156         Fix branch offset for a PLT entry.
4157         * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
4158         Likewise.
4159         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S (sem_timedwait):
4160         Likewise.
4161         * sysdeps/unix/sysv/linux/sh/sem_trywait.S (__new_sem_trywait):
4162         Likewise.
4163         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait):
4164         Likewise.
4166 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4168         * sysdeps/alpha/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define
4169         unconditionally.
4171 2004-06-28  Jakub Jelinek  <jakub@redhat.com>
4173         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
4174         (pthread_rwlock_timedwrlock): Return EINVAL if tv_nsec is negative,
4175         instead of tv_sec.
4176         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
4177         (pthread_rwlock_timedrdlock): Likewise.
4179 2004-06-22  Jakub Jelinek  <jakub@redhat.com>
4181         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4182         Set __r7 to val, not mutex.
4184 2004-06-27  Ulrich Drepper  <drepper@redhat.com>
4186         * Makefile: Add rules to build tst-rwlock14.
4187         * tst-rwlock14.c: New file.
4189 2004-06-24  Boris Hu  <boris.hu@intel.com>
4191         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Add timeout validation
4192         check.
4193         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
4195 2004-06-19  Andreas Jaeger  <aj@suse.de>
4197         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Fix
4198         assembler in last patch.
4200 2004-06-17  Ulrich Drepper  <drepper@redhat.com>
4202         * sysdeps/pthread/pthread_cond_timedwait.c
4203         (__pthread_cond_timedwait): Also check for negativ nanoseconds.
4204         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4205         (__pthread_cond_timedwait): Check for invalid nanosecond in
4206         timeout value.
4207         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
4208         * tst-cond19.c: New file.
4209         * Makefile: Add rules to build and run tst-cond19.
4211 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
4213         * tst-context1.c (GUARD_PATTERN): Defined.
4214         (tst_context_t): Define struct containing ucontext_t & guard words.
4215         (ctx): Declare as an array of tst_context_t.
4216         (fct): Verify uc_link & guard words are still valid.
4217         (tf): Initialize guard words in ctx.  Adjust ctx refs for new struct.
4219 2004-06-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4221         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4222         Add __data.__futex field, reshuffle __data.__clock.
4223         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
4224         (__pthread_cond_signal): Increment __futex at the same time as
4225         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4226         address of low 32-bits of __wakeup_seq to futex syscall.
4227         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4228         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4229         releasing internal lock to FUTEX_WAIT.
4230         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
4231         (__pthread_cond_timedwait): Likewise.
4232         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4233         (FUTEX_CMP_REQUEUE): Define.
4234         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4235         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4236         Pass __futex value from before the unlock and __futex address instead
4237         of address of low 32-bits of __wakeup_seq to futex syscall.
4238         Fallback to FUTEX_WAKE all on any errors.
4240 2004-06-08  Jakub Jelinek  <jakub@redhat.com>
4242         * pthread_mutexattr_getpshared.c (pthread_mutex_getpshared): Fix
4243         comment typo.
4244         * pthread_mutexattr_gettype.c (pthread_mutexattr_gettype): Likewise.
4245         * pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
4246         * pthread_mutexattr_settype.c (__pthread_mutexattr_settype): Likewise.
4247         * pthread_mutexattr_setpshared.c (pthread_mutexattr_setpshared):
4248         Likewise.  Reported by Bob Cook <bobcook47@hotmail.com>.
4250 2004-06-11  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4252         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_compare_and_swap):
4253         Add memory clobber to inline assembly.
4254         (__lll_mutex_trylock): Likewise.
4255         (__lll_mutex_cond_trylock): Likewise.
4257 2004-06-07  Martin Schwidefsky  <schwidefsky@de.ibm.com>
4259         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (lll_futex_requeue):
4260         Pass val argument as 6th system call argument in %r7.
4262 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4264         * Makefile (tests): Add tst-cond16.
4265         * sysdeps/unix/sysv/linux/lowlevelcond.sym (cond_futex): Add.
4266         * pthread_cond_init.c (__pthread_cond_init): Clear __data.__futex.
4267         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
4268         Add __data.__futex field, reshuffle __data.__clock.
4269         * sysdeps/unix/sysv/linux/i386/pthread_cond_signal.S
4270         (__pthread_cond_signal): Increment __futex at the same time as
4271         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4272         address of low 32-bits of __wakeup_seq to futex syscall.
4273         * sysdeps/unix/sysv/linux/i386/pthread_cond_wait.S
4274         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4275         releasing internal lock to FUTEX_WAIT.
4276         * sysdeps/unix/sysv/linux/i386/pthread_cond_timedwait.S
4277         (__pthread_cond_timedwait): Likewise.
4278         * sysdeps/unix/sysv/linux/i386/pthread_cond_broadcast.S
4279         (FUTEX_CMP_REQUEUE): Define.
4280         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4281         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4282         Pass __futex value from before the unlock and __futex address instead
4283         of address of low 32-bits of __wakeup_seq to futex syscall.
4284         Fallback to FUTEX_WAKE all on any errors.
4285         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_CMP_REQUEUE):
4286         Define.
4287         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4288         internally.  Return non-zero if error, zero if success.
4289         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4290         Add __data.__futex field, reshuffle __data.__clock.
4291         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_CMP_REQUEUE):
4292         Define.
4293         (lll_futex_requeue): Add val argument, return 1 unconditionally
4294         for the time being.
4295         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
4296         Add __data.__futex field, reshuffle __data.__clock.
4297         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4298         Define.
4299         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4300         internally.  Return non-zero if error, zero if success.
4301         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
4302         (pthread_cond_t): Add __data.__futex field, reshuffle __data.__clock.
4303         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_CMP_REQUEUE):
4304         Define.
4305         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4306         internally.  Return non-zero if error, zero if success.
4307         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h (pthread_cond_t):
4308         Add __data.__futex field, reshuffle __data.__clock.
4309         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_CMP_REQUEUE):
4310         Define.
4311         (lll_futex_requeue): Add val argument, use FUTEX_CMP_REQUEUE
4312         internally.  Return non-zero if error, zero if success.
4313         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h (pthread_cond_t):
4314         Add __data.__futex field, reshuffle __data.__clock.
4315         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
4316         Add __data.__futex field, reshuffle __data.__clock.
4317         * sysdeps/pthread/pthread_cond_signal.c (__pthread_cond_signal):
4318         Increment __futex at the same time as __wakeup_seq or __total_seq.
4319         Pass address of __futex instead of address of low 32-bits of
4320         __wakeup_seq to futex syscall.
4321         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4322         Pass __futex value from before releasing internal lock
4323         to FUTEX_WAIT.
4324         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4325         Likewise.  Avoid unnecessary shadowing of variables.
4326         * sysdeps/pthread/pthread_cond_broadcast.c (__pthread_cond_broadcast):
4327         Set __futex to 2 * __total_seq.  Pass __futex value from before the
4328         unlock and __futex address instead of address of low 32-bits of
4329         __wakeup_seq to futex_requeue macro, adjust for new return value
4330         meaning.
4331         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
4332         (__pthread_cond_signal): Increment __futex at the same time as
4333         __wakeup_seq or __total_seq.  Pass address of __futex instead of
4334         address of low 32-bits of __wakeup_seq to futex syscall.
4335         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
4336         (__pthread_cond_wait): Likewise.  Pass __futex value from before
4337         releasing internal lock to FUTEX_WAIT.
4338         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4339         (__pthread_cond_timedwait): Likewise.
4340         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4341         (FUTEX_CMP_REQUEUE): Define.
4342         (__pthread_cond_broadcast): Set __futex to 2 * __total_seq.
4343         Use FUTEX_CMP_REQUEUE operation instead of FUTEX_REQUEUE.
4344         Pass __futex value from before the unlock and __futex address instead
4345         of address of low 32-bits of __wakeup_seq to futex syscall.
4346         Fallback to FUTEX_WAKE all on any errors.
4348 2004-06-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4350         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_mutex_lock):
4351         Add nop to align the end of critical section.
4352         (lll_mutex_cond_lock, lll_mutex_timedlock): Likewise.
4354 2004-06-01  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4356         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
4357         Add __broadcast_seq field.
4358         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Mark
4359         all waiters as woken with woken_seq and bump broadcast counter.
4360         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use new
4361         __broadcast_seq.  Increment __woken_seq correctly when cleanuped.
4362         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4363         Comment typo fixes.  Avoid returning -ETIMEDOUT.
4365 2004-06-01  Ulrich Drepper  <drepper@redhat.com>
4367         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4368         (__condvar_tw_cleanup): Fix access to saved broadcast_seq value.
4369         Reported by Kaz Kojima.
4371 2004-05-25  Jakub Jelinek  <jakub@redhat.com>
4373         * sysdeps/unix/sysv/linux/aio_misc.h: New file.
4375 2004-05-21  Jakub Jelinek  <jakub@redhat.com>
4377         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Compare
4378         __broadcast_seq with bc_seq after acquiring internal lock instead of
4379         before it.
4381 2004-05-18  Jakub Jelinek  <jakub@redhat.com>
4383         * Makefile (.NOTPARALLEL): Only serialize make check/xcheck, not
4384         compilation.
4385         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4386         (__pthread_cond_timedwait): Avoid returning -ETIMEDOUT.
4387         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
4388         (pthread_cond_t): Add __data.__broadcast_seq field.
4389         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
4390         (FRAME_SIZE): Define.
4391         (__pthread_cond_timedwait): Use it.  Store/check broadcast_seq.
4392         Comment typo fixes.
4393         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (FRAME_SIZE):
4394         Define.
4395         (__pthread_cond_wait): Use it.  Store/check broadcast_seq.  Comment
4396         typo fixes.
4397         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
4398         (__pthread_cond_broadcast): Increment broadcast_seq.  Comment typo
4399         fixes.
4401 2004-05-18  Ulrich Drepper  <drepper@redhat.com>
4403         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add broadcast_seq entry.
4404         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_cond_t):
4405         Add __broadcast_seq field.
4406         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4407         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4408         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4409         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4410         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4411         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Mark
4412         all waiters as woken with woken_seq and bump broadcast counter.
4413         * sysdeps/pthread/pthread_cond_broadcast.c: Likewise.
4414         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use new
4415         __broadcast_seq field.
4416         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4417         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
4418         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
4419         * pthread_cond_init.c: Initialize __broadcast_seq field.
4420         * Makefile (tests): Add tst-cond17 and tst-cond18.
4421         Add .NOTPARALLEL goal.
4422         * tst-cond16.c: New file.  From Jakub.
4423         * tst-cond17.c: New file.  From Jakub.
4424         * tst-cond18.c: New file.  From Jakub.
4426 2004-05-16  Ulrich Drepper  <drepper@redhat.com>
4428         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Correct some
4429         unwind info.
4431         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S:
4432         Parametrize frame size.  Correct some unwind info.
4433         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
4435 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4437         * tst-stack3.c: Note testing functionality beyond POSIX.
4439 2004-05-04  Jakub Jelinek  <jakub@redhat.com>
4441         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (USE___THREAD):
4442         Change conditional from ifdef to if.
4444 2004-04-23  Jakub Jelinek  <jakub@redhat.com>
4446         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SYSDEP_CANCEL_ERRNO,
4447         SYSDEP_CANCEL_ERROR): Define.
4448         (PSEUDO): Use it.
4450 2004-05-01  Jakub Jelinek  <jakub@redhat.com>
4452         * Versions (libpthread): Remove __pthread_cleanup_upto@@GLIBC_PRIVATE.
4454 2004-04-20  Jakub Jelinek  <jakub@redhat.com>
4456         * sem_unlink.c (sem_unlink): Change EPERM into EACCES.
4458 2004-04-19  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4460         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Add frame info.
4461         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4462         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove unneeded frame
4463         info.  Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
4465 2004-04-19  Ulrich Drepper  <drepper@redhat.com>
4467         * sysdeps/unix/sysv/linux/timer_routines.c: Make sure helper
4468         thread has all signals blocked.
4470 2004-04-18  Andreas Jaeger  <aj@suse.de>
4472         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h
4473         (SEM_VALUE_MAX): Add missing brace.
4475 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4477         * sysdeps/pthread/Makefile (tests): Add tst-mqueue8x
4478         in rt subdir.
4479         (CFLAGS-tst-mqueue8x.c): Add -fexceptions.
4480         * sysdeps/pthread/tst-mqueue8x.c: New test.
4481         * tst-cancel4.c: Update comment about message queues.
4483         * sysdeps/pthread/timer_gettime.c (timer_gettime): For expired timer
4484         return it_value { 0, 0 }.
4485         * sysdeps/pthread/timer_create.c (timer_create): Handle SIGEV_NONE
4486         like SIGEV_SIGNAL.
4487         * sysdeps/pthread/timer_routines.c (thread_expire_timer): Remove
4488         assertion for SIGEV_NONE.
4489         (thread_attr_compare): Compare all attributes, not just a partial
4490         subset.
4492 2004-04-17  Jakub Jelinek  <jakub@redhat.com>
4494         * sysdeps/unix/sysv/linux/mq_notify.c: Include stdlib.h.
4496 2004-04-17  Ulrich Drepper  <drepper@redhat.com>
4498         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h (SEM_VALUE_MAX):
4499         Just use a plain number.
4500         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h: Likewise.
4501         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: Likewise.
4502         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: Likewise.
4503         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: Likewise.
4504         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: Likewise.
4505         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: Likewise.
4506         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: Likewise.
4508 2004-04-16  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4510         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Remove unneeded
4511         frame info.
4512         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4514 2004-04-15  Jakub Jelinek  <jakub@redhat.com>
4516         * sysdeps/unix/sysv/linux/timer_routines.c: Include errno.h.
4517         (timer_helper_thread): Use inline rt_sigtimedwait syscall instead
4518         of calling sigwaitinfo.
4520 2004-04-16  Ulrich Drepper  <drepper@redhat.com>
4522         * allocatestack.c (allocate_stack): Set reported_guardsize
4523         unconditionally.
4524         * pthread_getattr_np.c (pthread_getattr_np): Use
4525         reported_guardsize instead of guardsize.
4526         * descr.h (struct pthread): Add reported_guardsize field.
4528 2004-04-13  Jakub Jelinek  <jakub@redhat.com>
4530         * sysdeps/unix/sysv/linux/mq_notify.c: Shut up GCC warning.
4532 2004-04-12  Ulrich Drepper  <drepper@redhat.com>
4534         * sysdeps/unix/sysv/linux/mq-notify.c: New file.
4536 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
4538         * sysdeps/unix/sysv/linux/bits/local_lim.h (MQ_PRIO_MAX): Define.
4539         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h (MQ_PRIO_MAX): Define.
4540         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h (MQ_PRIO_MAX): Define.
4541         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h (MQ_PRIO_MAX): Define.
4542         * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_MESSAGE_PASSING):
4543         Define.
4544         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
4545         (_POSIX_MESSAGE_PASSING): Define.
4546         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
4547         (_POSIX_MESSAGE_PASSING): Define.
4548         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
4549         (_POSIX_MESSAGE_PASSING): Define.
4551 2004-04-04  Ulrich Drepper  <drepper@redhat.com>
4553         * tst-context1.c (fct): Check whether correct stack is used.
4555 2004-04-03  Ulrich Drepper  <drepper@redhat.com>
4557         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use
4558         matching constraints for asm mem parameters.
4560         * tst-clock2.c (tf): Don't define unless needed.
4562 2004-03-30  H.J. Lu  <hongjiu.lu@intel.com>
4564         * Makefile (link-libc-static): Use $(static-gnulib) instead of
4565         $(gnulib).
4567 2004-03-30  Ulrich Drepper  <drepper@redhat.com>
4569         * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
4570         * init.c (pthread_functions): Add ptr__nptl_deallocate_tsd.
4571         * pthreadP.h: Declare __nptl_deallocate_tsd.
4572         * pthread_create.c (deallocate_tsd): Remove to __nptl_deallocate_tsd.
4573         Adjust caller.
4575         * Makefile (tests): Add tst-tsd5.
4576         * tst-tsd5.c: New file.
4578 2004-03-29  Ulrich Drepper  <drepper@redhat.com>
4580         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4581         (__pthread_attr_setaffinity_old): Prepend GLIBC_ to version names
4582         is SHLIB_COMPAT check.
4583         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
4584         (__pthread_attr_getaffinity_old): Likewise.
4585         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4586         (__pthread_getaffinity_old): Likewise.
4587         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4588         (__pthread_setaffinity_old): Likewise.
4590 2004-03-26  Ulrich Drepper  <drepper@redhat.com>
4592         * allocatestack.c (_make_stacks_executable): Call
4593         _dl_make_stack_executable first.
4595 2004-03-24  Roland McGrath  <roland@redhat.com>
4597         * sysdeps/i386/pthread_spin_lock.c (pthread_spin_lock): Use "m"
4598         constraint instead of "0".
4600 2004-03-24  Ulrich Drepper  <drepper@redhat.com>
4602         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
4603         (lll_mutex_cond_trylock): Define as wrapper around __lll_cond_trylock.
4605         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Reorganize
4606         code to avoid warning.
4608 2004-03-24  Andreas Jaeger  <aj@suse.de>
4610         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
4611         (__pthread_attr_setaffinity_old): Remove const.
4613 2004-03-23  Ulrich Drepper  <drepper@redhat.com>
4615         * sysdeps/unix/sysv/linux/smp.h: New file.
4616         * sysdeps/unix/sysv/linux/sh/smp.h: New file.
4617         * init.c: Define __is_smp.
4618         (__pthread_initialize_minimal_internal): Call is_smp_system to
4619         initialize __is_smp.
4620         * pthreadP.h: Declare __is_smp.
4621         Define MAX_ADAPTIVE_COUNT is necessary.
4622         * pthread_mutex_init.c: Add comment regarding __spins field.
4623         * pthread_mutex_lock.c: Implement adaptive mutex type.
4624         * pthread_mutex_timedlock.c: Likewise.
4625         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise.
4626         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h (pthread_mutex_t):
4627         Add __spins field.
4628         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4629         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4630         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4631         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4632         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4633         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4634         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4635         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Define
4636         lll_mutex_cond_trylock.
4637         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
4638         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
4639         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
4640         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
4641         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
4642         Define BUSY_WAIT_NOP.
4643         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
4644         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
4646         * tst-mutex5.c: Add support for testing adaptive mutexes.
4647         * tst-mutex7.c: Likewise.
4648         * tst-mutex5a.c: New file.
4649         * tst-mutex7a.c: New file.
4650         * Makefile (tests): Add tst-mutex5a and tst-mutex7a.
4652         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4653         (__lll_mutex_timedlock_wait): Preserve r8 and r9 since the
4654         vgettimeofday call might destroy the content.
4656         * sysdeps/ia64/pthread_spin_lock.c (pthread_spin_lock): Use hint
4657         @pause in the loop.
4659         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4660         No need to restrict type of ret.  Make it int.  Add comment.
4662         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_mutex_trylock):
4663         Remove unnecessary setne instruction.
4665 2004-03-22  Jakub Jelinek  <jakub@redhat.com>
4667         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4668         (__pthread_getaffinity_new): Use INT_MAX instead of UINT_MAX.
4669         * pthread_getattr_np.c (pthread_getattr_np): Double size every cycle.
4670         If realloc fails, break out of the loop.
4672 2004-03-20  Andreas Jaeger  <aj@suse.de>
4674         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4675         (__pthread_setaffinity_old): Fix interface.
4676         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
4677         (__pthread_getaffinity_old): Likewise.
4679         * sysdeps/unix/sysv/linux/pthread_setaffinity.c
4680         (__pthread_setaffinity_new): Remove duplicate declaration.
4682 2004-03-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4684         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (CENABLE): Save
4685         the return value to a safe register.
4686         (CDISABLE): Set the function argument correctly.
4688 2004-03-17  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4690         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XCHG): Define.
4691         * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait):
4692         Rewrite so that only one locked memory operation per round is needed.
4693         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
4694         (pthread_barrier_wait): After wakeup, release lock only when the
4695         last thread stopped using the barrier object.
4696         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
4697         (__pthread_cond_wait): Don't store mutex address if the current
4698         value is ~0l.  Add correct cleanup support and unwind info.
4699         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
4700         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
4701         (__pthread_cond_broadcast): Don't use requeue for pshared condvars.
4702         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Update comment.
4703         * sysdeps/unix/sysv/linux/sh/pthread_once.S (__pthread_once):
4704         Add correct cleanup support and unwind info.
4705         * sysdeps/unix/sysv/linux/sh/sem_wait.S (__new_sem_wait): Likewise.
4706         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Add unwind
4707         information for syscall wrappers.
4709 2004-03-18  Ulrich Drepper  <drepper@redhat.com>
4711         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
4712         cpusetsize field, remove next.
4713         * sysdeps/pthread/pthread.h (pthread_getaffinity_np): Add new second
4714         parameter for size of the CPU set.
4715         (pthread_setaffinity_np): Likewise.
4716         (pthread_attr_getaffinity_np): Likewise.
4717         (pthread_attr_setaffinity_np): Likewise.
4718         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: Implement
4719         interface change, keep compatibility code.
4720         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise.
4721         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: Likewise.
4722         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: Likewise.
4723         * pthreadP.h: Remove hidden_proto for pthread_getaffinity_np.  Declare
4724         __pthread_getaffinity_np.
4725         * Versions: Add version for changed interfaces.
4726         * tst-attr3.c: Adjust test for interface change.
4727         * pthread_getattr_np.c: Query the kernel about the affinity mask with
4728         increasing buffer sizes.
4729         * pthread_attr_destroy.c: Remove unused list handling.
4730         * pthread_attr_init.c: Likewise.
4732 2004-03-17  Roland McGrath  <roland@redhat.com>
4734         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Pass missing
4735         first argument to clock_getres so we ever enable kernel timers.
4737 2004-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
4739         * init.c (nptl_version): Add __attribute_used__ to nptl_version.
4741 2004-03-12  Richard Henderson  <rth@redhat.com>
4743         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Propagate
4744         oldvalue from CENABLE to CDISABLE.
4746 2004-03-12  Ulrich Drepper  <drepper@redhat.com>
4748         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define HOST_NAME_MAX.
4749         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: Likewise.
4750         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: Likewise.
4751         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: Likewise.
4753 2004-03-11  Richard Henderson  <rth@redhat.com>
4755         * sysdeps/alpha/tcb-offsets.sym (PID_OFFSET): New.
4756         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: Save/restore PID.
4757         * sysdeps/unix/sysv/linux/alpha/vfork.S: New file.
4759 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4761         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Use jgnl
4762         instead of jnl instruction to jump to SYSCALL_ERROR_LABEL.
4763         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S (__vfork): Likewise.
4765 2004-03-11  Jakub Jelinek  <jakub@redhat.com>
4767         * forward.c (__pthread_cond_broadcast_2_0,
4768         __pthread_cond_destroy_2_0, __pthread_cond_init_2_0,
4769         __pthread_cond_signal_2_0, __pthread_cond_wait_2_0,
4770         __pthread_cond_timedwait_2_0): Use return 0 as defaction instead of 0.
4772 2004-03-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4774         * sysdeps/sh/tcb-offsets.sym: Add PID.
4775         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: Properly handle PID cache.
4776         * sysdeps/unix/sysv/linux/sh/vfork.S: New file.
4778 2004-03-10  Ulrich Drepper  <drepper@redhat.com>
4780         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: No need to
4781         include <sysdep-cancel.h>, vfork is no cancellation point.
4782         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
4783         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: Likewise.
4784         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: Likewise.
4786 2004-03-10  Jakub Jelinek  <jakub@redhat.com>
4788         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S (__vfork): Add
4789         libc_hidden_def.
4790         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S (__vfork): Likewise.
4791         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork):
4792         Likewise.
4793         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S (__vfork):
4794         Likewise.
4795         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S (__vfork): Likewise.
4796         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S (__vfork): Likewise.
4797         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Include tcb-offsets.h.
4798         * sysdeps/unix/sysv/linux/ia64/vfork.S (__vfork): Use DO_CALL instead
4799         of DO_CALL_VIA_BREAK.  Work around a gas problem.
4801         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: Remove.
4802         * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: New file.
4803         * sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S: New file.
4804         * sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: New file.
4805         * sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S: New file.
4806         * sysdeps/powerpc/tcb-offsets.sym: Add PID.
4808         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S (__vfork): Don't use
4809         a local register for saving old PID.  Negate PID in parent upon exit.
4811         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Include
4812         tcb-offsets.h.
4813         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
4814         before syscall, set to the old value in the parent afterwards.
4815         * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: New file.
4816         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Include
4817         tcb-offsets.h.
4818         (__vfork): Negate PID if non-zero and set to INT_MIN if zero
4819         before syscall, set to the old value in the parent afterwards.
4820         * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: New file.
4821         * sysdeps/s390/tcb-offsets.sym: Add PID.
4823         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: Remove.
4824         * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: New file.
4825         * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: New file.
4826         * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: New file.
4827         * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: New file.
4828         * sysdeps/sparc/tcb-offsets.sym: Add PID.
4830 2004-03-10  Andreas Schwab  <schwab@suse.de>
4832         * sysdeps/ia64/tcb-offsets.sym: Add PID.
4833         * sysdeps/unix/sysv/linux/ia64/vfork.S: New file.
4834         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Properly handle PID cache.
4836 2004-03-09  Jakub Jelinek  <jakub@redhat.com>
4838         * tst-cancel20.c (do_one_test): Clear in_sh_body first.
4839         * tst-cancel21.c (do_one_test): Likewise.
4840         Reported by Gordon Jin <gordon.jin@intel.com>.
4842 2004-02-09  Jakub Jelinek  <jakub@redhat.com>
4844         * sysdeps/unix/sysv/linux/i386/vfork.S (SAVE_PID): Negate PID
4845         if non-zero and set to INT_MIN if zero.
4846         * sysdeps/unix/sysv/linux/x86_64/vfork.S (SAVE_PID): Likewise.
4847         * sysdeps/unix/sysv/linux/i386/pt-vfork.S: Include tcb-offsets.h.
4848         (SAVE_PID, RESTORE_PID): Define.
4849         (__vfork): Use it.
4850         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: Include tcb-offsets.h.
4851         Use relative path to avoid including NPTL i386/vfork.S.
4852         (SAVE_PID, RESTORE_PID): Define.
4853         * sysdeps/unix/sysv/linux/raise.c: Include limits.h.
4854         (raise): Handle THREAD_SELF->pid INT_MIN the same as 0.
4855         * Makefile (tests): Add tst-vfork1, tst-vfork2, tst-vfork1x and
4856         tst-vfork2x.
4857         (tests-reverse): Add tst-vfork1x and tst-vfork2x.
4858         * tst-vfork1.c: New test.
4859         * tst-vfork2.c: New test.
4860         * tst-vfork1x.c: New test.
4861         * tst-vfork2x.c: New test.
4863 2004-03-08  Ulrich Drepper  <drepper@redhat.com>
4865         * sysdeps/i386/tcb-offsets.sym: Add PID.
4866         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
4867         * sysdeps/unix/sysv/linux/i386/vfork.S: New file.
4868         * sysdeps/unix/sysv/linux/x86_64/vfork.S: New file.
4870 2004-03-08  Steven Munroe  <sjmunroe@us.ibm.com>
4872         * sysdeps/unix/sysv/linux/powerpc/Versions: Remove leading tabs.
4874 2004-03-08  H.J. Lu  <hongjiu.lu@intel.com>
4876         * sysdeps/s390/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
4877         _rtld_global_ro.
4879 2004-03-07  Ulrich Drepper  <drepper@redhat.com>
4881         * sysdeps/ia64/tls.h (INIT_SYSINFO): _dl_sysinfo is now in
4882         _rtld_global_ro.
4884         * tst-once4.c: Remove unnecessary macro definition.
4886         * tst-mutex7.c (do_test): Limit thread stack size.
4887         * tst-once2.c (do_test): Likewise.
4888         * tst-tls3.c (do_test): Likewise.
4889         * tst-tls1.c (do_test): Likewise.
4890         * tst-signal3.c (do_test): Likewise.
4891         * tst-kill6.c (do_test): Likewise.
4892         * tst-key4.c (do_test): Likewise.
4893         * tst-join4.c (do_test): Likewise.
4894         * tst-fork1.c (do_test): Likewise.
4895         * tst-context1.c (do_test): Likewise.
4896         * tst-cond2.c (do_test): Likewise.
4897         * tst-cond10.c (do_test): Likewise.
4898         * tst-clock2.c (do_test): Likewise.
4899         * tst-cancel10.c (do_test): Likewise.
4900         * tst-basic2.c (do_test): Likewise.
4901         * tst-barrier4.c (do_test): Likewise.
4903 2004-03-05  Ulrich Drepper  <drepper@redhat.com>
4905         * sysdeps/i386/tls.h: Use GLRO instead of GL where appropriate.
4907 2004-03-01  Ulrich Drepper  <drepper@redhat.com>
4909         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
4910         (__pthread_cond_timedwait): Optimize wakeup test.
4911         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
4912         (__pthread_cond_wait): Likewise.
4913         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
4914         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
4915         Likewise.
4917 2004-02-29  Ulrich Drepper  <drepper@redhat.com>
4919         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4920         (__lll_mutex_lock_wait): Optimize a bit more.  Just one copy of
4921         the atomic instruction needed.
4922         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4923         (__lll_mutex_lock_wait): Likewise.
4925 2004-02-28  Ulrich Drepper  <drepper@redhat.com>
4927         * Makefile (tests): Add tst-cond14 and tst-cond15.
4928         * tst-cond14.c: New file.
4929         * tst-cond15.c: New file.
4931 2004-02-27  Ulrich Drepper  <drepper@redhat.com>
4933         * sysdeps/pthread/createthread.c (create_thread): Remove use of
4934         CLONE_STOPPED.  We cannot use SIGCONT which means CLONE_STOPPED
4935         needs to be implemented differently to be useful.
4937 2004-02-26  Ulrich Drepper  <drepper@redhat.com>
4939         * pthread_attr_setschedparam.c: Don't test priority against limits
4940         here.  Set ATTR_FLAG_SCHED_SET flag.
4941         * pthread_attr_setschedpolicy.c: Set ATTR_FLAG_POLICY_SET flag.
4942         * pthread_create.c (__pthread_create_2_1): Copy scheduling attributes
4943         from parent thread to child.  If attribute is used and scheduling
4944         parameters are not inherited, copy parameters from attribute or
4945         compute them.  Check priority value.
4946         * pthread_getschedparam.c: If the parameters aren't known yet get
4947         them from the kernel.
4948         * pthread_setschedparam.c: Set ATTR_FLAG_SCHED_SET and
4949         ATTR_FLAG_POLICY_SET flag for thread.
4950         * sysdeps/unix/sysv/linux/internaltypes.h: Define ATTR_FLAG_SCHED_SET
4951         and ATTR_FLAG_POLICY_SET.
4953         * sysdeps/pthread/createthread.c: Use tgkill if possible.
4955         * pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr): Don't
4956         fail if stack address hasn't been set.  Just return 0.
4958 2004-02-25  Ulrich Drepper  <drepper@redhat.com>
4960         * Makefile (tests-nolibpthread): Add tst-unload.  Don't link with
4961         libpthread for the files in this list.
4962         (CFLAGS-tst-unload): Removed.
4963         * tst-unload.c (do_test): Don't use complete path for
4964         LIBPHREAD_SO.
4966         * Makefile: Define sonames for tst-tls5mod, tst-_res1mod1, and
4967         tst-_res1mod2.
4969 2004-02-22  Ulrich Drepper  <drepper@redhat.com>
4971         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
4972         (__lll_mutex_lock_wait): Rewrite so that only one locked memory
4973         operation per round is needed.
4974         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
4975         (__lll_mutex_lock_wait): Likewise.
4977 2004-02-20  Ulrich Drepper  <drepper@redhat.com>
4979         * tst-cancel9.c (cleanup): Don't print to stderr.
4981 2004-02-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
4983         * sysdeps/sh/jmpbuf-unwind.h (_JMPBUF_UNWINDS_ADJ): Fix variable name.
4985 2004-02-20  Jakub Jelinek  <jakub@redhat.com>
4987         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
4988         (__syscall_error_handler2): Call CDISABLE.
4989         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
4990         (__syscall_error_handler2): Call CDISABLE.
4992         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
4993         Release lock before the loop, don't reacquire it.
4995         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h (DL_ARGV_NOT_RELRO): Define.
4997 2004-02-19  Andreas Schwab  <schwab@suse.de>
4999         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5000         Fix last change.
5002 2004-02-18  Ulrich Drepper  <drepper@redhat.com>
5004         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
5005         (pthread_barrier_wait): After wakeup, release lock only when the
5006         last thread stopped using the barrier object.
5007         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S
5008         (pthread_barrier_wait): Likewise.
5009         * sysdeps/pthread/pthread_barrier_wait.c (pthread_barrier_wait):
5010         Likewise.
5011         * Makefile (tests): Add tst-barrier4.
5012         * tst-barrier4.c: New file.
5014         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5015         (__pthread_cond_timedwait): Perform timeout test while holding
5016         internal lock to prevent wakeup race.
5017         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
5018         * sysdeps/pthread/pthread_cond_timedwait.c
5019         (__pthread_cond_timedwait): Likewise.
5020         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5021         (__pthread_cond_timedwait): Likewise.
5023 2004-02-18  Jakub Jelinek  <jakub@redhat.com>
5025         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
5026         (__pthread_rwlock_unlock): Access WRITER as 32-bit value.
5027         * Makefile (tests): Add tst-rwlock13.
5028         * tst-rwlock13.c: New test.
5030 2004-02-16  Ulrich Drepper  <drepper@redhat.com>
5032         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5033         (__condvar_tw_cleanup): Little optimization.
5034         Patch by Dinakar Guniguntala <dgunigun@in.ibm.com>.
5036 2004-02-16  Steven Munroe  <sjmunroe@us.ibm.com>
5038         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: Replace libc with
5039         libpthread as "lib" parameter to SHLIB_COMPAT.
5040         (__novmx_siglongjmp): Fix typo in function name.
5041         (__novmx_longjmp): Fix typo in function name.
5043 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
5045         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Add a
5046         __builtin_expect.
5048         * sysdeps/generic/pt-longjmp.c: Moved to...
5049         * sysdeps/pthread/pt-longjmp.c: ...here.  New file.
5051 2004-01-29  Steven Munroe  <sjmunroe@us.ibm.com>
5053         * Makefile (libpthread-routines): Add pt-cleanup.
5054         * pt-longjmp.c: Removed.
5055         * pt-cleanup.c: Copied __pthread_cleanup_upto to here. New file.
5056         * sysdeps/generic/pt-longjmp.c: Copied longjmp to here. New file.
5057         * sysdeps/unix/sysv/linux/powerpc/Versions: New file.
5058         Version longjmp, siglongjmp for GLIBC_2.3.4.
5059         * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c: New File.
5061 2004-02-13  Ulrich Drepper  <drepper@redhat.com>
5063         * sysdeps/pthread/pthread_cond_timedwait.c
5064         (__pthread_cond_timedwait): Optimize.  Drop internal lock earlier.
5065         Reuse code.  Add __builtin_expects.
5067         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5068         (__pthread_cond_timedwait): Get internal lock in case timeout has
5069         passed before the futex syscall.
5070         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5072 2004-01-20  Ulrich Drepper  <drepper@redhat.com>
5074         * allocatestack.c: Pretty printing.
5076         * sysdeps/pthread/createthread.c (create_thread): Don't add
5077         CLONE_DETACHED bit if it is not necessary.
5079 2004-01-16  Ulrich Drepper  <drepper@redhat.com>
5081         * pthread_getattr_np.c: Include ldsodefs.h.
5083 2004-01-16  Richard Henderson  <rth@redhat.com>
5085         * allocatestack.c: Don't declare __libc_stack_end.
5086         * init.c (__pthread_initialize_minimal_internal): Likewise.
5087         * pthread_getattr_np.c (pthread_getattr_np): Likewise.
5089 2004-01-15  Richard Henderson  <rth@redhat.com>
5091         * sysdeps/alpha/tls.h (tcbhead_t): Add private.
5092         (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN, TLS_TCB_SIZE,
5093         TLS_PRE_TCB_SIZE, TLS_TCB_ALIGN, INSTALL_DTV, INSTALL_NEW_DTV,
5094         GET_DTV, THREAD_DTV, THREAD_SELF, DB_THREAD_SELF): Match ia64.
5095         (TLS_TCB_OFFSET, THREAD_ID, NO_TLS_OFFSET): Remove.
5096         (THREAD_GETMEM, THREAD_GETMEM_NC): Simplify.
5097         (THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
5098         * sysdeps/unix/sysv/linux/alpha/createthread.c (TLS_VALUE): Match ia64.
5100 2004-01-14  Ulrich Drepper  <drepper@redhat.com>
5102         * init.c (pthread_functions): Make array const.
5104 2004-01-13  Ulrich Drepper  <drepper@redhat.com>
5106         * allocatestack.c (__make_stacks_executable): Change interface.
5107         Check parameters.  Pass parameter on to libc counterpart.
5108         * pthreadP.h: Change declaration.
5110 2004-01-13  Richard Henderson  <rth@redhat.com>
5112         * pthread_attr_setstack.c (__old_pthread_attr_setstack): Use
5113         prototype form.
5114         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize):
5115         Likewise.
5117         * sysdeps/alpha/Makefile: New file.
5118         * sysdeps/alpha/tcb-offsets.sym: New file.
5119         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (SINGLE_THREAD_P):
5120         Use MULTIPLE_THREADS_OFFSET to implement !libpthread !libc version.
5122         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Rewrite based
5123         on powerpc version.
5125 2004-01-08  Jakub Jelinek  <jakub@redhat.com>
5127         * Makefile (tests): Add tst-backtrace1.
5128         * tst-backtrace1.c: New test.
5130 2003-12-11  Ulrich Weigand  <uweigand@de.ibm.com>
5132         * sysdeps/alpha/tls.h (DB_THREAD_SELF): Pass bit size of thread
5133         register as second parameter to the REGISTER macro.
5134         * sysdeps/ia64/tls.h (DB_THREAD_SELF): Likewise.
5135         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): Likewise.
5136         * sysdeps/sh/tls.h (DB_THREAD_SELF): Likewise.
5137         * sysdeps/sparc/tls.h (DB_THREAD_SELF): Likewise.
5138         * sysdeps/s390/tls.h (DB_THREAD_SELF): Pass __WORDSIZE as bit size
5139         of thread register as second parameter to REGISTER macro in 64 case.
5141 2004-01-03  Ulrich Drepper  <drepper@redhat.com>
5143         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Removed.
5144         (CFLAGS-getpid.o): Defined.
5145         (CFLAGS-getpid.os): Defined.
5147 2003-12-31  Ulrich Drepper  <drepper@redhat.com>
5149         * pthread_getattr_np.c (pthread_getattr_np): Make sure stack info
5150         returned for main thread does not overlap with any other VMA.
5151         Patch by Jakub Jelinek.
5153 2003-12-29  Jakub Jelinek  <jakub@redhat.com>
5155         * tst-raise1.c: Include stdio.h.
5157 2003-12-23  Jakub Jelinek  <jakub@redhat.com>
5159         * sysdeps/unix/sysv/linux/raise.c (raise): Protect pid = selftid
5160         setting with __ASSUME_TGKILL || defined __NR_tgkill.
5161         If pid is 0, set it to selftid.
5162         * sysdeps/unix/sysv/linux/getpid.c (really_getpid): Make inline.
5163         Don't set self->pid but self->tid.  If self->pid == 0 and self->tid
5164         != 0, return self->tid without doing a syscall.
5165         * descr.h (struct pthread): Move pid field after tid.
5167         * Makefile (tests): Add tst-raise1.
5168         * tst-raise1.c: New file.
5170 2003-12-23  Roland McGrath  <roland@redhat.com>
5172         * tst-oddstacklimit.c: New file.
5173         * Makefile (tests): Add it.
5174         (tst-oddstacklimit-ENV): New variable.
5176         * init.c (__pthread_initialize_minimal_internal): Round stack rlimit
5177         value up to page size for __default_stacksize.
5179 2003-12-21  Ulrich Drepper  <drepper@redhat.com>
5181         * Makefile (tests): Add tst-eintr5.
5182         * tst-eintr5.c: New file.
5184         * eintr.c (eintr_source): Prevent sending signal to self.
5186         * tst-eintr2.c (tf1): Improve error message.
5188 2003-12-20  Ulrich Drepper  <drepper@redhat.com>
5190         * sysdeps/unix/sysv/linux/Makefile (CFLAGS-getpid.c): Define.
5191         * sysdeps/unix/sysv/linux/getpid.c: New file.
5192         * pthread_cancel.c: Add comment explaining use of PID field.
5193         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
5194         * pthread_getattr_np.c: Use abs() when comparing PID and TID fields.
5195         * sysdeps/unix/sysv/linux/fork.c: Negate PID field of parent
5196         temporarily to signal the field must not be relied on and updated
5197         by getpid().
5198         * sysdeps/unix/sysv/linux/pt-raise.c: Handle case where PID is
5199         temporarily negative.
5200         * sysdeps/unix/sysv/linux/raise.c: Likewise.
5202 2003-12-19  Ulrich Drepper  <drepper@redhat.com>
5204         * eintr.c (setup_eintr): Add new parameter.  Pass to thread function.
5205         (eintr_source): If ARG != NULL, use pthread_kill.
5206         * tst-eintr1.c: Adjust for this change.
5207         * tst-eintr2.c: Likewise.
5208         * Makefile (tests): Add tst-eintr3 and tst-eintr4.
5209         * tst-eintr3.c: New file.
5210         * tst-eintr4.c: New file.
5212 2003-12-19  Jakub Jelinek  <jakub@redhat.com>
5214         * libc-cancellation.c (__libc_enable_asynccancel): Don't cancel
5215         if CANCELSTATE_BITMASK is set.
5216         * sysdeps/pthread/librt-cancellation.c (__librt_enable_asynccancel):
5217         Likewise.
5219         * Makefile (tests): Add tst-cancel22 and tst-cancel23.
5220         (tests-reverse): Add tst-cancel23.
5221         * tst-cancel22.c: New test.
5222         * tst-cancel23.c: New test.
5224 2003-12-18  Ulrich Drepper  <drepper@redhat.com>
5226         * tst-eintr1.c: Better error messages.
5228         * Makefile (tests): Add tst-eintr2.
5229         * tst-eintr2.c: New file.
5231 2003-12-18  Jakub Jelinek  <jakub@redhat.com>
5233         * Makefile (tests): Add tst-cancel21 and tst-cancelx21.
5234         (CFLAGS-tst-cancelx21.c): Set.
5235         * tst-cancel21.c: New test.
5236         * tst-cancelx21.c: New test.
5238         * unwind.c (FRAME_LEFT): Add adj argument.  Subtract it from each
5239         comparison operand.
5240         (unwind_stop): Use _JMPBUF_CFA_UNWINDS_ADJ macro instead of
5241         _JMPBUF_CFA_UNWINDS.  Adjust FRAME_LEFT invocations.
5242         * pt-longjmp.c: Include jmpbuf-unwind.h.
5243         (__pthread_cleanup_upto): Use _JMPBUF_UNWINDS_ADJ macro instead of
5244         _JMPBUF_UNWINDS.  Adjust compared pointers.
5245         * init.c (__pthread_initialize_minimal_internal): Initialize
5246         pd->stackblock_size.
5247         * sysdeps/pthread/jmpbuf-unwind.h: Removed.
5248         * sysdeps/alpha/jmpbuf-unwind.h: New file.
5249         * sysdeps/i386/jmpbuf-unwind.h: New file.
5250         * sysdeps/powerpc/jmpbuf-unwind.h: New file.
5251         * sysdeps/s390/jmpbuf-unwind.h: New file.
5252         * sysdeps/sh/jmpbuf-unwind.h: New file.
5253         * sysdeps/sparc/sparc32/jmpbuf-unwind.h: New file.
5254         * sysdeps/x86_64/jmpbuf-unwind.h: New file.
5255         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: Include stdint.h.
5256         (_JMPBUF_CFA_UNWINDS): Remove.
5257         (_JMPBUF_CFA_UNWINDS_ADJ, _JMPBUF_UNWINDS_ADJ): Define.
5259 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
5261         * Makefile (tests): Add tst-cancel20 and tst-cancelx20.
5262         (CFLAGS-tst-cancelx20.c): Set.
5263         * tst-cancel20.c: New test.
5264         * tst-cancelx20.c: New test.
5266 2003-12-17  Ulrich Drepper  <drepper@redhat.com>
5268         * init.c (__pthread_initialize_minimal_internal): Don't treat
5269         architectures with separate register stack special here when
5270         computing default stack size.
5272 2003-12-17  Roland McGrath  <roland@redhat.com>
5274         * Makefile (tst-cancelx7-ARGS): New variable.
5275         Reportd by Greg Schafer <gschafer@zip.com.au>.
5277 2003-12-17  Jakub Jelinek  <jakub@redhat.com>
5279         * Makefile (tests): Add tst-stack3.  Depend on $(objpfx)tst-stack3-mem.
5280         (generated): Add tst-stack3.mtrace and tst-stack3-mem.
5281         (tst-stack3-ENV): Set.
5282         ($(objpfx)tst-stack3-mem): New.
5283         * tst-stack3.c: New test.
5285 2003-12-10  David Mosberger  <davidm@hpl.hp.com>
5287         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c (_init_EPILOG_BEGINS):
5288         Add unwind directives.  Drop unused .regstk directive.
5289         (_fini_EPILOG_BEGINS): Add unwind directives.
5291 2003-12-11  Ulrich Drepper  <drepper@redhat.com>
5293         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
5294         Assume parameter is a pointer.
5295         (lll_futex_wake): Likewise.
5296         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_futex_wait):
5297         Likewise.
5298         (lll_futex_wake): Likewise.
5299         Reported by Boris Hu.
5300         * sysdeps/unix/sysv/linux/unregister-atfork.c
5301         (__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
5303         * sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
5305 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
5307         * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
5308         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call
5309         __rtld_lock_initialize for ld.so lock.
5310         Patch in part by Adam Li <adam.li@intel.com>.
5312 2003-12-02  David Mosberger  <davidm@hpl.hp.com>
5314         * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned
5315         in $(gnulib).  Also, remove stale comment.
5317 2003-11-12  David Mosberger  <davidm@hpl.hp.com>
5319         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Take
5320         advantage of new syscall stub and optimize accordingly.
5322         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__NR_futex): Rename
5323         from SYS_futex, to match expectations of
5324         sysdep.h:DO_INLINE_SYSCALL.
5325         (lll_futex_clobbers): Remove.
5326         (lll_futex_timed_wait): Rewrite in terms of DO_INLINE_SYSCALL.
5327         (lll_futex_wake): Likewise.
5328         (lll_futex_requeue): Likewise.
5329         (__lll_mutex_trylock): Rewrite to a macro, so we can include this
5330         file before DO_INLINE_SYSCALL is defined (proposed by Jakub
5331         Jelinek).
5332         (__lll_mutex_lock): Likewise.
5333         (__lll_mutex_cond_lock): Likewise.
5334         (__lll_mutex_timed_lock): Likewise.
5335         (__lll_mutex_unlock): Likewise.
5336         (__lll_mutex_unlock_force): Likewise.
5338         * sysdeps/ia64/tls.h: Move declaration of __thread_self up so it
5339         comes before the include of <sysdep.h>.
5340         (THREAD_SELF_SYSINFO): New macro.
5341         (THREAD_SYSINFO): Likewise.
5342         (INIT_SYSINFO): New macro.
5343         (TLS_INIT_TP): Call INIT_SYSINFO.
5345         * sysdeps/ia64/tcb-offsets.sym: Add SYSINFO_OFFSET.
5347         * sysdeps/pthread/createthread.c (create_thread): Use
5348         THREAD_SELF_SYSINFO and THREAD_SYSINFO instead of open code.
5349         * allocatestack.c (allocate_stack): Use THREAD_SYSINFO and
5350         THREAD_SELF_SYSINFO instead of open code.
5351         * sysdeps/i386/tls.h (THREAD_SELF_SYSINFO): New macro.
5352         (THREAD_SYSINFO): Likewise.
5354         * sysdeps/unix/sysv/linux/ia64/dl-sysdep.h: New file.
5356         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: Work around gas problem.
5358 2003-12-06  Ulrich Drepper  <drepper@redhat.com>
5360         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
5361         instead of .init.  Patch by David Mosberger.
5363 2003-11-30  Thorsten Kukuk  <kukuk@suse.de>
5365         * sysdeps/pthread/configure.in: Remove broken declaration in C
5366         cleanup handling check.
5368 2003-11-30  Andreas Jaeger  <aj@suse.de>
5370         * Makefile (CFLAGS-pt-initfini.s): Add $(fno_unit_at_a_time).
5371         * sysdeps/unix/sysv/linux/x86_64/Makefile (CFLAGS-pt-initfini.s):
5372         Likewise.
5374 2003-11-27  Jakub Jelinek  <jakub@redhat.com>
5376         * sysdeps/unix/sysv/linux/internaltypes.h (ATTR_FLAG_OLDATTR): Define.
5377         * pthread_attr_destroy.c: Include shlib-compat.h.
5378         (__pthread_attr_destroy): Return immediately if ATTR_FLAG_OLDATTR
5379         is set in iattr->flags.
5380         * pthread_attr_init.c (__pthread_attr_init_2_0): Set ATTR_FLAG_OLDATTR.
5382 2003-11-21  Jakub Jelinek  <jakub@redhat.com>
5384         * Makefile (distribute): Add tst-cleanup4aux.c.
5386         * tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
5387         include.
5389 2003-11-21  Ulrich Drepper  <drepper@redhat.com>
5391         * tst-cond12.c (do_test): If USE_COND_SIGNAL is defined, use
5392         pthread_cond_signal.
5394         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Don't
5395         store mutex address if the current value is ~0l.
5396         * sysdeps/pthread/pthread_cond_timedwait.c
5397         (__pthread_cond_timedwait): Likewise.
5398         * sysdeps/pthread/pthread_cond_broadcast.c
5399         (__pthread_cond_broadcast): Don't use requeue for pshared
5400         condvars.
5402         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
5403         (__pthread_cond_wait): Don't store mutex address if the current
5404         value is ~0l.
5405         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
5406         (__pthread_cond_timedwait): Likewise.
5407         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
5408         (__pthread_cond_broadcast): Don't use requeue for pshared
5409         condvars.
5411         * pthread_cond_init.c (__pthread_cond_init): Initialize __mutex
5412         element with ~0l for pshared condvars, with NULL otherwise.
5414         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
5415         (__pthread_cond_wait): Don't store mutex address if the current
5416         value is ~0l.
5417         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
5418         (__pthread_cond_timedwait): Likewise.
5419         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
5420         (__pthread_cond_broadcast): Don't use requeue for pshared
5421         condvars.
5423         * Makefile: Add rules to build and run tst-cond12 and tst-cond13.
5424         * tst-cond12.c: New file.
5425         * tst-cond13.c: New file.
5427 2003-11-17  Ulrich Drepper  <drepper@redhat.com>
5429         * sysdeps/pthread/configure.in: Make missing forced unwind support
5430         fatal.
5432 2003-11-11  Ulrich Drepper  <drepper@redhat.com>
5434         * pthreadP.h: Don't declare __pthread_unwind as weak inside libpthread.
5436 2003-11-06  Ulrich Drepper  <drepper@redhat.com>
5438         * Makefile: Add magic to clean up correctly.
5440 2003-11-05  Jakub Jelinek  <jakub@redhat.com>
5442         * unwind.c (FRAME_LEFT): Define.
5443         (unwind_stop): Handle old style cleanups here.
5444         (__pthread_unwind): Handle old style cleanups only if
5445         !HAVE_FORCED_UNWIND.
5446         * Makefile (tests): Add tst-cleanup4 and tst-cleanupx4.
5447         (CFLAGS-tst-cleanupx4.c): Add -fexceptions.
5448         ($(objpfx)tst-cleanup4): Depend on $(objpfx)tst-cleanup4aux.o.
5449         ($(objpfx)tst-cleanupx4): Likewise.
5450         * tst-cleanup4.c: New test.
5451         * tst-cleanup4aux.c: New.
5452         * tst-cleanupx4.c: New test.
5454 2003-11-04  Ulrich Drepper  <drepper@redhat.com>
5456         * sysdeps/pthread/bits/stdio-lock.h: Use lll_*lock instead of
5457         lll_mutex_*lock macros to skip atomic operations on some archs.
5459 2003-11-03  Ulrich Drepper  <drepper@redhat.com>
5461         * sysdeps/pthread/tst-timer.c (main): Initialize
5462         sigev2.sigev_value as well.
5464 2003-10-15  Roland McGrath  <roland@redhat.com>
5466         * sysdeps/pthread/configure.in: Barf if visibility attribute support
5467         is missing.
5468         * sysdeps/pthread/configure: Regenerated.
5470 2003-10-09  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
5472         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Completely revamp the
5473         locking macros.  No distinction between normal and mutex locking
5474         anymore.
5475         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Rewrite mutex locking.
5476         Merge bits from lowlevelmutex.S we still need.
5477         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Remove.
5478         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
5479         * sysdeps/unix/sysv/linux/sh/not-cancel.h: New file.
5480         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Adjust for
5481         new mutex implementation.
5482         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Likewise.
5483         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
5484         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
5485         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
5486         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
5487         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
5488         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
5489         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
5490         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
5491         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Also defined
5492         symbol for entry point to avoid cancellation.
5494 2003-10-07  Jakub Jelinek  <jakub@redhat.com>
5496         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Backout 2003-10-02
5497         changes.
5498         (SAVE_OLDTYPE_0): Fix a typo.
5500 2003-10-03  Ulrich Drepper  <drepper@redhat.com>
5502         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
5503         Check __sigsetjmp return value.  Reported by Daniel Jacobowitz.
5505 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5507         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (DOCARGS_1): Use
5508         correct offset.
5510 2003-10-02  Jakub Jelinek  <jakub@redhat.com>
5512         * Makefile (tests): Add tst-cancel19.
5513         * tst-cancel19.c: New test.
5515 2003-10-02  Ulrich Drepper  <drepper@redhat.com>
5517         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Fix saving and
5518         restoring of the old cancellation type.
5520 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
5522         * sysdeps/pthread/malloc-machine.h: Remove misleading comment.
5524 2003-09-27  Wolfram Gloger  <wg@malloc.de>
5526         * sysdeps/pthread/malloc-machine.h: New file
5528 2003-09-24  Roland McGrath  <roland@redhat.com>
5530         * allocatestack.c (__make_stacks_executable): Don't ignore return
5531         value from _dl_make_stack_executable.
5533 2003-09-24  Ulrich Drepper  <drepper@redhat.com>
5535         * allocatestack.c (__make_stacks_executable): Also change
5536         permission of the currently unused stacks.
5538         * allocatestack.c (change_stack_perm): Split out from
5539         __make_stacks_executable.
5540         (allocate_stack): If the required permission changed between the time
5541         we started preparing the stack and queueing it, change the permission.
5542         (__make_stacks_executable): Call change_stack_perm.
5544         * Makefile: Build tst-execstack-mod locally.
5545         * tst-execstack-mod.c: New file.
5547 2003-09-23  Jakub Jelinek  <jakub@redhat.com>
5549         * Makefile (tests): Only add tst-execstack if have-z-execstack is yes.
5551 2003-09-23  Roland McGrath  <roland@redhat.com>
5553         * tst-execstack.c: New file.
5554         * Makefile (tests): Add it.
5555         ($(objpfx)tst-execstack, $(objpfx)tst-execstack.out): New targets.
5556         (LDFLAGS-tst-execstack): New variable.
5558         * allocatestack.c (allocate_stack): Use GL(dl_stack_flags) to decide
5559         whether to use PROT_EXEC for stack mmap.
5560         (__make_stacks_executable): New function.
5561         * pthreadP.h: Declare it.
5562         * init.c (__pthread_initialize_minimal_internal): Set
5563         GL(dl_make_stack_executable_hook) to that.
5565 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5567         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Adjust for latest
5568         recommendation from AMD re avoidance of lock prefix.
5570 2003-09-22  Jakub Jelinek  <jakub@redhat.com>
5572         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
5573         lll_futex_timed_wait instead of lll_futex_wait.
5574         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
5575         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
5576         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
5577         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
5578         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
5579         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
5580         * sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
5581         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
5582         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
5583         Completely revamp the locking macros.  No distinction between
5584         normal and mutex locking anymore.
5585         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
5586         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
5587         __lll_lock_timedwait): Fix prototypes.
5588         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
5589         __lll_lock_timedwait): Likewise.
5590         (lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
5591         macros, add __builtin_expect.
5592         (lll_mutex_timedlock): Likewise.  Fix return value.
5593         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
5594         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
5595         * sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
5596         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
5597         * sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
5598         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
5599         * sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
5600         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
5602 2003-09-22  Ulrich Drepper  <drepper@redhat.com>
5604         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
5605         (__lll_mutex_lock_wait): Minor optimization to avoid one atomic
5606         operation if possible.
5608         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't play tricks
5609         like jumping over the lock prefix.
5611 2003-09-21  Ulrich Drepper  <drepper@redhat.com>
5613         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
5614         locking macros.  No distinction between normal and mutex locking
5615         anymore.
5616         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
5617         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
5618         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
5619         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
5620         locking.  Merge bits from lowlevelmutex.S we still need.
5621         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
5622         * sysdeps/unix/sysv/linux/lowlevellock.c: Likewise.
5623         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
5624         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Removed.
5625         * Makefile (routines): Remove libc-lowlevelmutex.
5626         (libpthread-rountines): Remove lowlevelmutex.
5627         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Adjust
5628         for new mutex implementation.
5629         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
5630         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
5631         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
5632         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
5633         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
5634         Likewise.
5635         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
5636         Likewise.
5637         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
5638         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
5639         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: Likewise
5640         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
5641         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
5642         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
5643         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
5644         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
5645         Likewise.
5646         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
5647         Likewise.
5648         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
5649         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
5650         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
5651         Don't use requeue.
5652         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
5653         * sysdeps/pthread/pthread_cond_signal.c: Don't use requeue.
5655 2003-09-20  Ulrich Drepper  <drepper@redhat.com>
5657         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't match memory
5658         in parameters of asm with output parameters.
5660         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Change
5661         type of DECR parameter to int.
5662         * pthreadP.h: Adjust prototype of __pthread_mutex_unlock_usercnt.
5664 2003-09-18  Jakub Jelinek  <jakub@redhat.com>
5666         * tst-attr3.c (tf, do_test): Print stack start/end/size and
5667         guardsize for each thread.
5669 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5671         * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
5672         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
5673         (pthread_attr_setaffinity_np): Handle cpuset == NULL.
5675         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
5676         (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
5677         NULL.
5678         * pthread_getattr_np.c: Set cpuset using pthread_getaffinity_np.
5679         * pthreadP.h (pthread_getaffinity_np): Add hidden_proto.
5680         * sysdeps/unix/sysv/linux/pthread_getaffinity.c
5681         (pthread_getaffinity_np): Add hidden_def.
5683         * Makefile (tests): Add tst-attr3.
5684         * tst-attr3.c: New test.
5686         * sysdeps/i386/Makefile (CFLAGS-tst-align.c): Remove.
5688 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5690         * sysdeps/i386/Makefile (CFLAGS-pthread_create.c,
5691         CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
5693 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
5695         * Makefile (CFLAGS-tst-align.c): Add $(stack-align-test-flags).
5696         * tst-align.c: Include tst-stack-align.h.
5697         (tf, do_test): Use TEST_STACK_ALIGN macro.
5699 2003-09-17  Ulrich Drepper  <drepper@redhat.com>
5701         * pthread_attr_init.c (__pthread_attr_init_2_0): Remove unused
5702         variable.
5704 2003-09-16  Ulrich Drepper  <drepper@redhat.com>
5706         * pthread_getattr_np.c (pthread_getattr_np): Correctly fill in the
5707         stack-related values for the initial thread.
5709 2003-09-15  Jakub Jelinek  <jakub@redhat.com>
5711         * Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
5713 2003-09-11  Ulrich Drepper  <drepper@redhat.com>
5715         * pthread_mutex_lock.c: Minor code rearrangements.
5717 2003-09-05  Roland McGrath  <roland@redhat.com>
5719         * pthread_create.c (__pthread_pthread_sizeof_descr): Removed.
5720         Instead, include ../nptl_db/db_info.c to do its magic.
5721         * pthread_key_create.c (__pthread_pthread_keys_max): Removed.
5722         (__pthread_pthread_key_2ndlevel_size): Likewise.
5723         * sysdeps/alpha/tls.h (DB_THREAD_SELF): New macro.
5724         * sysdeps/i386/tls.h (DB_THREAD_SELF): New macro.
5725         * sysdeps/ia64/tls.h (DB_THREAD_SELF): New macro.
5726         * sysdeps/powerpc/tls.h (DB_THREAD_SELF): New macro.
5727         * sysdeps/s390/tls.h (DB_THREAD_SELF): New macro.
5728         * sysdeps/sh/tls.h (DB_THREAD_SELF): New macro.
5729         * sysdeps/sparc/tls.h (DB_THREAD_SELF): New macro.
5730         * sysdeps/x86_64/tls.h (DB_THREAD_SELF): New macro.
5731         * sysdeps/alpha/td_ta_map_lwp2thr.c: File removed.
5732         * sysdeps/generic/td_ta_map_lwp2thr.c: File removed.
5733         * sysdeps/i386/td_ta_map_lwp2thr.c: File removed.
5734         * sysdeps/ia64/td_ta_map_lwp2thr.c: File removed.
5735         * sysdeps/powerpc/td_ta_map_lwp2thr.c: File removed.
5736         * sysdeps/s390/td_ta_map_lwp2thr.c: File removed.
5737         * sysdeps/sh/td_ta_map_lwp2thr.c: File removed.
5738         * sysdeps/sparc/td_ta_map_lwp2thr.c: File removed.
5739         * sysdeps/x86_64/td_ta_map_lwp2thr.c: File removed.
5741 2003-09-08  Ulrich Drepper  <drepper@redhat.com>
5743         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Change type
5744         of pthread_t to be compatible with LT.
5745         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise.
5746         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
5747         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
5748         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
5749         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: Likewise.
5750         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
5751         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Likewise.
5753 2003-09-04  Ulrich Drepper  <drepper@redhat.com>
5755         * sysdeps/unix/sysv/linux/i386/not-cancel.h (fcntl_not_cancel): Define.
5757 2003-09-04  Jakub Jelinek  <jakub@redhat.com>
5759         * unwind-forcedunwind.c: Move to...
5760         * sysdeps/pthread/unwind-forcedunwind.c: ...here.
5761         (pthread_cancel_init): Use ARCH_CANCEL_INIT if defined.
5762         * sysdeps/pthread/jmpbuf-unwind.h: New file.
5763         * sysdeps/unix/sysv/linux/ia64/unwind-forcedunwind.c: New file.
5764         * sysdeps/unix/sysv/linux/ia64/jmpbuf-unwind.h: New file.
5765         * unwind.c: Include jmpbuf-unwind.h.
5766         (unwind_stop): Use _JMPBUF_CFA_UNWINDS macro.
5768 2003-09-02  Jakub Jelinek  <jakub@redhat.com>
5770         * sysdeps/unix/sysv/linux/ia64/bits/local_lim.h: New file.
5771         * sysdeps/unix/sysv/linux/ia64/Versions (libpthread): Export
5772         pthread_attr_setstack and pthread_attr_setstacksize @@GLIBC_2.3.3.
5773         * sysdeps/unix/sysv/linux/alpha/bits/local_lim.h: New file.
5774         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
5775         * sysdeps/unix/sysv/linux/sparc/bits/local_lim.h: New file.
5776         * sysdeps/unix/sysv/linux/sparc/Versions: New file.
5777         * pthread_attr_setstack.c (__old_pthread_attr_setstack): New function.
5778         (pthread_attr_setstack): If PTHREAD_STACK_MIN != 16384, export
5779         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.2.
5780         * pthread_attr_setstacksize.c (__old_pthread_attr_setstacksize): New
5781         function.
5782         (pthread_attr_setstacksize): If PTHREAD_STACK_MIN != 16384, export
5783         as @@GLIBC_2.3.2 and also export compatibility @GLIBC_2.1.
5784         * Makefile (tests): Add tst-stack2.
5785         * tst-stack2.c: New test.
5786         * tst-stack1.c: Include limits.h and sys/param.h.
5787         (do_test): Set size to MAX (4 * getpagesize (), PTHREAD_STACK_MIN).
5789         * pthread_condattr_setpshared.c: Include errno.h.
5790         (pthread_condattr_setpshared): Return EINVAL if pshared
5791         is neither PTHREAD_PROCESS_PRIVATE nor PTHREAD_PROCESS_SHARED.
5793         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Also
5794         defined symbol for entry point to avoid cancellation.
5795         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
5796         Likewise.
5797         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
5798         Likewise.
5799         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
5800         Likewise.
5801         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h (PSEUDO):
5802         Likewise.
5803         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h (PSEUDO):
5804         Likewise.
5805         * sysdeps/unix/sysv/linux/i386/not-cancel.h (__open_nocancel,
5806         __close_nocancel, __read_nocancel, __write_nocancel,
5807         __waitpid_nocancel): Add attribute_hidden.  If not in libc.so,
5808         libpthread.so or librt.so, define to corresponding function
5809         without _nocancel suffix.
5810         * sysdeps/unix/sysv/linux/s390/not-cancel.h: New file.
5811         * sysdeps/unix/sysv/linux/powerpc/not-cancel.h: New file.
5812         * sysdeps/unix/sysv/linux/sparc/not-cancel.h: New file.
5814         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: Fix a typo.
5816 2003-09-02  Ulrich Drepper  <drepper@redhat.com>
5818         * sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
5819         * sysdeps/unix/sysv/linux/x86_64/not-cancel.h: New file.
5821         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
5822         in subsections has a symbol associated with it.
5824         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
5825         defined symbol for entry point to avoid cancellation.
5826         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
5828 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
5830         * Makefile (tests): Add tst-tls5.
5831         (module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
5832         ($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
5833         ($(objpfx)tst-tls5): New.
5834         ($(objpfx)tst-tls6.out): Likewise.
5835         (tests): Depend on $(objpfx)tst-tls6.out.
5836         * tst-tls3.c: Include stdint.h and pthreaddef.h.
5837         (do_test): Check pthread_self () return value alignment.
5838         * tst-tls3mod.c: Include stdint.h and pthreaddef.h.
5839         (tf): Check pthread_self () return value alignment.
5840         * tst-tls5.c: New test.
5841         * tst-tls5.h: New.
5842         * tst-tls5mod.c: New.
5843         * tst-tls5moda.c: New.
5844         * tst-tls5modb.c: New.
5845         * tst-tls5modc.c: New.
5846         * tst-tls5modd.c: New.
5847         * tst-tls5mode.c: New.
5848         * tst-tls5modf.c: New.
5849         * tst-tls6.sh: New test.
5851         * sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
5852         ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
5853         * init.c (pthread_functions): Initialize them.
5854         * forward.c (pthread_cond_timedwait@GLIBC_2.0,
5855         pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
5856         * Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
5857         pthread_cond_timedwait@@GLIBC_2.3.2.
5859 2003-09-01  Jakub Jelinek  <jakub@redhat.com>
5861         * sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
5862         * sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
5863         * sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
5864         * sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
5865         * sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
5866         * sysdeps/unix/sysv/linux/alpha/Versions: New file.
5868         * sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
5870         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
5871         _POSIX_THREAD_PRIORITY_SCHEDULING.
5872         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
5874 2003-08-31  Ulrich Drepper  <drepper@redhat.com>
5876         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
5877         nested function, use static inline function from libio.h.
5878         Code by Richard Henderson.
5880         * sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
5881         weak.
5883 2003-08-30  Jakub Jelinek  <jakub@redhat.com>
5885         * sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
5886         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
5887         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
5888         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
5889         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
5890         * sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
5891         * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
5892         * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
5893         * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
5894         * sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
5895         * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
5896         * sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
5897         * sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
5898         * sysdeps/unix/sysv/linux/sparc/fork.c: New file.
5899         * sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
5900         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
5901         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
5902         * sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
5903         * sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
5904         * sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
5905         * sysdeps/sparc/sparc32/pthreaddef.h: New file.
5906         * sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
5907         * sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
5908         * sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
5909         * sysdeps/sparc/sparc64/pthreaddef.h: New file.
5910         * sysdeps/sparc/tls.h: New file.
5911         * sysdeps/sparc/tcb-offsets.sym: New file.
5912         * sysdeps/sparc/Makefile: New file.
5913         * sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
5914         * init.c [__sparc__] (__NR_set_tid_address): Define.
5916 2003-08-29  Jakub Jelinek  <jakub@redhat.com>
5918         * sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
5919         _IO_release_lock): Define.
5921 2003-08-29  Jakub Jelinek  <jakuB@redhat.com>
5923         * tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
5924         sigemptyset before sigaddset.  Reported by jreiser@BitWagon.com.
5926 2003-08-27  Ulrich Drepper  <drepper@redhat.com>
5928         * sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
5929         (__pthread_cleanup_class): Add missing return types of member
5930         functions.
5932 2003-08-26  Steven Munroe <sjmunroe@us.ibm.com>
5934         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
5935         (lll_mutex_unlock_force): Add memory barrier between store and futex
5936         syscall.
5938 2003-08-25  Ulrich Drepper  <drepper@redhat.com>
5940         * tst-cancel4.c (do_test): Also unlink tempfname and remove
5941         tempmsg in first loop.
5943 2003-08-18  Ulrich Drepper  <drepper@redhat.com>
5945         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
5946         _POSIX_THREAD_PRIORITY_SCHEDULING.
5947         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
5949 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
5951         * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
5952         (__rtld_lock_default_lock_recursive,
5953         __rtld_lock_default_unlock_recursive): Define.
5954         [_LIBC && SHARED] (__rtld_lock_lock_recursive,
5955         __rtld_lock_unlock_recursive): Define using
5956         GL(_dl_rtld_*lock_recursive).
5957         * init.c (__pthread_initialize_minimal_internal): Initialize
5958         _dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
5959         Lock GL(_dl_load_lock) the same number of times as
5960         GL(_dl_load_lock) using non-mt implementation was nested.
5962         * pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
5963         * pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
5965 2003-08-06  Jakub Jelinek  <jakub@redhat.com>
5967         * tst-cancel17.c (do_test): Make len2 maximum of page size and
5968         PIPE_BUF.
5970 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
5972         * pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
5974 2003-08-03  Jakub Jelinek  <jakub@redhat.com>
5976         * sysdeps/pthread/createthread.c (do_clone): Move error handling
5977         to first syscall error check.  Move syscall error check for tkill
5978         into __ASSUME_CLONE_STOPPED #ifdef.
5980 2003-08-02  Ulrich Drepper  <drepper@redhat.com>
5982         * sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
5983         is not defined, do explicit synchronization.
5984         (create_thread): Do not lock pd->lock here.  If __ASSUME_CLONE_STOPPED
5985         is not defined also unlock pd->lock for non-debugging case in case
5986         it is necessary.
5987         * pthread_create.c (start_thread): Always get and release pd->lock
5988         if __ASSUME_CLONE_STOPPED is not defined.
5989         (start_thread_debug): Removed.  Adjust users.
5990         * allocatestack.c (allocate_stack): Always initialize lock if
5991         __ASSUME_CLONE_STOPPED is not defined.
5992         * Makefile (tests): Add tst-sched1.
5993         * tst-sched1.c: New file.
5995         * sysdeps/pthread/createthread.c (do_clone): Only use
5996         sched_setschduler and pass correct parameters.
5998 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6000         * sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
6001         pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
6002         PTHREAD_STACK_MIN in comments.
6004 2003-07-31  Jakub Jelinek  <jakub@redhat.com>
6006         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
6007         Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
6008         argument.
6009         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
6010         * pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
6011         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
6012         (__pthread_cleanup_upto): Fix prototype.
6013         (_longjmp_unwind): Adjust caller.
6014         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
6015         Change second argument to const struct pointer.
6016         * tst-sem8.c (main): Remove unused s2 and s3 variables.
6017         * tst-sem9.c (main): Likewise.
6018         * unwind.c: Include string.h for strlen prototype.
6020 2003-07-31  Ulrich Drepper  <drepper@redhat.com>
6022         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
6023         (__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
6024         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
6025         Define HAVE_CMOV.
6026         Patch by Nicholas Miell <nmiell@attbi.com>.
6028 2003-07-30  Jakub Jelinek  <jakub@redhat.com>
6030         * init.c (__pthread_initialize_minimal_internal): Initialize
6031         GL(dl_init_static_tls).
6032         * pthreadP.h (__pthread_init_static_tls): New prototype.
6033         * allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
6034         New functions.
6035         * Makefile (tests): Add tst-tls4.
6036         (modules-names): Add tst-tls4moda and tst-tls4modb.
6037         ($(objpfx)tst-tls4): Link against libdl and libpthread.
6038         ($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
6039         tst-tls4modb.so.
6040         * tst-tls4.c: New file.
6041         * tst-tls4moda.c: New file.
6042         * tst-tls4modb.c: New file.
6044 2003-06-19  Daniel Jacobowitz  <drow@mvista.com>
6046         * sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
6047         before __timer_dealloc.
6048         * sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
6049         Don't call list_unlink.
6051 2003-07-29  Roland McGrath  <roland@redhat.com>
6053         * Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
6055 2003-07-25  Jakub Jelinek  <jakub@redhat.com>
6057         * tst-cancel17.c (do_test): Check if aio_cancel failed.
6058         Don't reuse struct aiocb A if it failed.
6059         Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
6060         not just one byte, as that does not block.
6062 2003-07-22  Jakub Jelinek  <jakub@redhat.com>
6064         * sysdeps/pthread/unwind-resume.c: New file.
6065         * sysdeps/pthread/Makefile (routines, shared-only-routines): Add
6066         unwind-resume in csu subdir.
6067         (CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
6068         exceptions.
6069         (librt-sysdep_routines, librt-shared-only-routines): Add
6070         rt-unwind-resume.
6071         * sysdeps/pthread/rt-unwind-resume.c: New file.
6072         * unwind-forcedunwind.c: New file.
6073         * Makefile (libpthread-routines): Add unwind-forcedunwind.
6074         (libpthread-shared-only-routines): Likewise.
6075         (CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
6076         * pthreadP.h (pthread_cancel_init): New prototype.
6077         * pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
6079         * sysdeps/pthread/createthread.c (do_thread, create_thread): Make
6080         attr argument const struct pthread_attr *.
6082         * res.c (__res_state): Return __resp.
6083         * descr.h: Include resolv.h.
6084         (struct pthread): Add res field.
6085         * pthread_create.c: Include resolv.h.
6086         (start_thread): Initialize __resp.
6087         * Makefile (tests): Add tst-_res1.
6088         (module-names): Add tst-_res1mod1, tst-_res1mod2.
6089         ($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
6090         ($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
6091         libpthread.
6092         * tst-_res1.c: New file.
6093         * tst-_res1mod1.c: New file.
6094         * tst-_res1mod2.c: New file.
6096 2003-07-21  Ulrich Drepper  <drepper@redhat.com>
6098         * sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
6100         * Makefile: Define various *-no-z-defs variables for test DSOs
6101         which has undefined symbols.
6103 2003-07-21  Steven Munroe  <sjmunroe@us.ibm.com>
6105         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
6106         Retry if the stwcx fails to store once_control.
6108 2003-07-20  Ulrich Drepper  <drepper@redhat.com>
6110         * Makefile (libpthread-routines): Add pthread_attr_getaffinity and
6111         pthread_attr_setaffinity.
6112         * Versions [libpthread] (GLIBC_2.3.3): Likewise.
6113         * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
6114         * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
6115         * pthread_attr_destroy.c: Free cpuset element if allocated.
6116         * pthread_create.c: Pass iattr as additional parameter to
6117         create_thread.
6118         * sysdeps/pthread/createthread.c: If attribute is provided and
6119         a new thread is created with affinity set or scheduling parameters,
6120         start thread with CLONE_STOPPED.
6121         * sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
6122         pthread_attr_setaffinity.
6123         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
6124         cpuset element.
6126 2003-07-15  Ulrich Drepper  <drepper@redhat.com>
6128         * tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
6130 2003-07-14  Ulrich Drepper  <drepper@redhat.com>
6132         * sysdeps/pthread/configure.in: Require CFI directives also for
6133         ppc and s390.
6135 2003-07-15  Jakub Jelinek  <jakub@redhat.com>
6137         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
6138         Add cfi directives.
6140 2003-07-12  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6142         * sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
6143         CLEANUP_JMP_BUF.
6144         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
6145         registers as variables.  Call __pthread_mutex_unlock_usercnt.
6146         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
6147         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
6148         not self pointer in __writer.  Compare with TID to determine
6149         deadlocks.
6150         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6151         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
6152         Likewise.
6153         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
6154         Likewise.
6155         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
6156         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
6157         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
6158         macros also when compiling librt.
6160 2003-07-11  Jakub Jelinek  <jakub@redhat.com>
6162         * Makefile (CFLAGS-pthread_once.c): Add -fexceptions
6163         -fasynchronous-unwind-tables.
6164         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
6165         (PSEUDO): Add cfi directives.
6166         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
6167         Likewise.
6168         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
6169         Likewise.
6171 2003-07-08  Jakub Jelinek  <jakub@redhat.com>
6173         * pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
6174         __pthread_unregister_cancel): Add prototypes and hidden_proto.
6175         * unwind.c (__pthread_unwind_next): Add hidden_def.
6176         * cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
6177         Likewise.
6178         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
6179         Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
6180         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
6181         Likewise.
6182         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
6183         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
6184         Likewise.
6185         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
6186         HIDDEN_JUMPTARGET to call __pthread_register_cancel,
6187         __pthread_unregister_cancel and __pthread_unwind_next.
6189 2003-07-04  Jakub Jelinek  <jakub@redhat.com>
6191         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
6192         different symbol for the cancellation syscall wrapper and
6193         non-cancellation syscall wrapper.
6194         (PSEUDO_END): Define.
6196 2003-07-05  Richard Henderson  <rth@redhat.com>
6198         * sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
6199         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
6200         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6201         return actual return value from the syscall, not 0.
6203 2003-07-07  Ulrich Drepper  <drepper@redhat.com>
6205         * descr.h (struct pthread): Add pid field.
6206         * allocatestack.c (allocate_stack): Initialize pid field in descriptor.
6207         (__reclaim_stacks): Likewise.
6208         * init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
6209         also check for PID of the signal source.
6210         (__pthread_initialize_minimal_internal): Also initialize pid field
6211         of initial thread's descriptor.
6212         * pthread_cancel.c: Use tgkill instead of tkill if possible.
6213         * sysdeps/unix/sysv/linux/fork.c: Likewise.
6214         * sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
6215         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
6216         * sysdeps/unix/sysv/linux/raise.c: Likewise.
6218 2003-07-05  Ulrich Drepper  <drepper@redhat.com>
6220         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
6221         Fix use of parameter.
6222         (__libc_cleanup_pop): Likewise.
6224 2003-07-04  Ulrich Drepper  <drepper@redhat.com>
6226         * init.c (sigcancel_handler): Change parameters to match handler
6227         for SA_SIGACTION.  Check signal number and code to recognize
6228         invalid invocations.
6230 2003-07-03  Roland McGrath  <roland@redhat.com>
6232         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
6233         Apply sizeof (struct pthread) bias to r13 value.
6235 2003-07-03  Ulrich Drepper  <drepper@redhat.com>
6237         * sysdeps/pthread/configure.in: Require CFI directives.
6239         * sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
6240         definition.
6241         * pthreadP.h (__pthread_unwind): Add hidden_proto if used in
6242         libpthread compilation.
6243         * unwind.c (__pthread_unwind): Add hidden_def.
6244         * Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
6246 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6248         * libc-cancellation.c (__libc_cleanup_routine): Define.
6249         * sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
6250         (__pthread_cleanup_pop): Define.
6252 2003-07-01  Richard Henderson  <rth@redhat.com>
6254         * sysdeps/alpha/elf/pt-initfini.c: New file.
6255         * sysdeps/alpha/pthread_spin_lock.S: New file.
6256         * sysdeps/alpha/pthread_spin_trylock.S: New file.
6257         * sysdeps/alpha/pthreaddef.h: New file.
6258         * sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
6259         * sysdeps/alpha/tls.h: New file.
6260         * sysdeps/unix/sysv/linux/alpha/Makefile: New file.
6261         * sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
6262         * sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
6263         * sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
6264         * sysdeps/unix/sysv/linux/alpha/fork.c: New file.
6265         * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
6266         * sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
6267         * sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
6268         * sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
6269         * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
6271 2003-07-01  Ulrich Drepper  <drepper@redhat.com>
6273         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
6274         cleanup support and unwind info.
6276 2003-06-30  Ulrich Drepper  <drepper@redhat.com>
6278         * sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
6279         Use correct cleanup handler registration.  Add unwind info.
6280         * sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
6281         * sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
6282         * tst-once3.c: Add cleanup handler and check it is called.
6283         * tst-once4.c: Likewise.
6284         * tst-oncex3.c: New file.
6285         * tst-oncex4.c: New file.
6286         * Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
6288 2003-06-29  Ulrich Drepper  <drepper@redhat.com>
6290         * sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
6292 2003-06-27  Ulrich Drepper  <drepper@redhat.com>
6294         * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
6295         (tf_msgsnd): Likewise.
6297         * tst-cancel4.c (tf_msgrcv): Strengthen test against valid
6298         premature returns a bit more.
6300 2003-06-26  Ulrich Drepper  <drepper@redhat.com>
6302         * sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
6303         definition to the front.
6305         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
6306         the cleanup functions to make the names unique.  Fix dwarf opcode
6307         un unwind table.
6308         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
6309         functions to make the names unique.  Fix CFA offset for two blocks.
6311 2003-06-25  Ulrich Drepper  <drepper@redhat.com>
6313         * sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
6314         missing closing braces.
6315         Patch by Christophe Saout <christophe@saout.de>.
6317 2003-06-24  Roland McGrath  <roland@redhat.com>
6319         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
6321 2003-06-24  Ulrich Drepper  <drepper@redhat.com>
6323         * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
6324         * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
6326         * pthreadP.h: Declare __find_thread_by_id.
6327         * allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
6328         * pthread_clock_gettime.c: Allow using other thread's clock.
6329         * pthread_clock_settime.c: Likewise.
6330         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
6331         * Makefile: Add rules to build and run tst-clock2.
6332         * tst-clock2.c: New file.
6334 2003-06-23  Ulrich Drepper  <drepper@redhat.com>
6336         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
6337         to use exception-based cleanup handler.
6338         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6340         * tst-cond8.c (ch): Announce that we are done.
6342         * pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
6344         * tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
6345         Also test aio_suspend with timeout value.
6347 2003-06-22  Ulrich Drepper  <drepper@redhat.com>
6349         * pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
6350         * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
6351         attribute_hidden.
6353         * pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
6354         (__pthread_mutex_lock_internal): Likewise.
6355         (__pthread_mutex_unlock_internal): Likewise.
6356         (__pthread_mutex_unlock_usercnt): Declare.
6357         * pthread_mutex_destroy.c: Always fail if used in any way.
6358         * pthread_mutex_init.c: Update comment.
6359         * pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
6360         * pthread_mutex_timedlock.c: Adjust __nusers.
6361         * pthread_mutex_trylock.c: Adjust __nusers.
6362         * pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
6363         and public interfaces are wrapper with pass additional parameter.
6364         __pthread_mutex_unlock_usercnt does not adjust __nusers if second
6365         parameter zero.
6366         * tst-mutex8.c: New file.
6367         * Makefile (tests): Add tst-mutex8.
6368         * sysdeps/pthread/pthread_cond_timedwait.c: Call
6369         __pthread_mutex_unlock_usercnt.
6370         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6371         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6372         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6373         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6374         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6375         * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
6376         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6377         Add __nusers.
6378         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6379         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6380         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6381         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6382         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6384         * pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
6385         * pthread_mutex_timedlock.c: Likewise.
6386         * pthread_mutex_trylock.c: Adjust __nusers.
6387         * pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
6388         * tst-mutex9.c: New file.
6389         * Makefile (tests): Add tst-mutex9.
6390         * sysdeps/i386/tls.h: Remove THREAD_ID definition.
6391         * sysdeps/ia64/tls.h: Likewise.
6392         * sysdeps/powerpc/tls.h: Likewise.
6393         * sysdeps/s390/tls.h: Likewise.
6394         * sysdeps/sh/tls.h: Likewise.
6395         * sysdeps/x86_64/tls.h: Likewise.
6396         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
6397         Change type of __owner.
6398         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6399         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6400         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6401         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
6402         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6404 2003-06-19  Jakub Jelinek  <jakub@redhat.com>
6406         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
6407         * sysdeps/unix/sysv/linux/sem_post.c: ...here.
6409         * sysdeps/unix/sysv/linux/sem_post.c: Move to...
6410         * sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here.  Pass nr + 1
6411         instead of nr to lll_futex_wake.  Only set errno and return -1
6412         if err < 0.
6414         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
6415         lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
6416         return actual return value from the syscall, not 0.
6418 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
6420         * tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
6421         find a random value.
6422         (tf_msgrcv): Likewise.  Also don't report msgrcv returns if
6423         errno==EIDRM.
6425         * sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
6426         compat_timer_settime.
6427         * sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
6428         compat_timer_gettime.
6429         * sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
6430         compat_timer_getoverrun.
6431         * sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
6432         compat_timer_delete.
6434         * pthread_mutex_destroy.c (__pthread_mutex_destroy): For
6435         error-checking mutex detect busy mutexes.
6437 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6439         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
6440         Add ax to clobber list.
6441         (lll_mutex_cond_lock): Likewise.
6442         (lll_mutex_unlock): Likewise.
6443         (lll_lock): Likewise.
6444         (lll_unlock): Likewise.
6446         * Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
6447         * tst-cancel18.c: New file.
6448         * tst-cancelx18.c: New file.
6450         * tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
6451         and tcdrain.
6453         * Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
6454         * tst-cancel17.c: New file.
6455         * tst-cancelx17.c: New file.
6457         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
6458         * sysdeps/unix/sysv/linux/sigwait.c: New file.
6459         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
6461         * tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
6463 2003-06-16  Jakub Jelinek  <jakub@redhat.com>
6465         * sysdeps/pthread/createthread.c (create_thread): Set
6466         header.multiple_threads unconditionally.
6467         * allocatestack.c (allocate_stack): Likewise.
6468         * descr.h (struct pthread): Add header.multiple_threads
6469         unconditionally.
6470         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
6471         Define for librt.  #error if neither libpthread, libc nor librt.
6472         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
6473         Likewise.
6474         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
6475         CDISABLE): Likewise.
6476         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
6477         CDISABLE): Likewise.
6478         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
6479         CDISABLE): Likewise.
6480         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
6481         CDISABLE): Likewise.  Access header.multiple_threads outside of
6482         libc and libpthread.
6483         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
6484         Likewise.
6485         * sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
6486         * sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
6488 2003-06-17  Ulrich Drepper  <drepper@redhat.com>
6490         * tst-cancel4.c: Add tests for the socket and signal functions, pause.
6491         Also test early cancellation before the thread reaches the cancellation
6492         point.
6494         * Makefile: Compile forward.c with exceptions.
6496         * sysdeps/unix/sysv/linux/sleep.c: New file.
6498 2003-06-16  Ulrich Drepper  <drepper@redhat.com>
6500         * Makefile: Add CFLAGS definition to compile function wrappers
6501         duplicated from libc with exceptions.
6502         * tst-cancel4.c: Also check cancellation handlers.
6504         * Makefile: Add rules to build and run tst-cancel16 and
6505         tst-cancelx16.  Add missing CFLAGS definitions.
6506         * tst-cancel16.c: New file.
6507         * tst-cancelx16.c: New file.
6509 2003-06-15  Ulrich Drepper  <drepper@redhat.com>
6511         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
6512         (DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
6513         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
6514         (DL_SYSINFO_IMPLEMENTATION): Likewise.
6516         * pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
6517         (LIBC_CANCEL_RESET): Likewise.
6518         Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
6519         * sysdeps/pthread/Makefile (librt-sysdep_routines): Add
6520         librt-cancellation.
6521         (CFLAGS-libcrt-cancellation.c): Define.
6522         * sysdeps/pthread/librt-cancellation.c: New file.
6523         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
6524         macros also when compiling librt.
6525         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
6526         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
6527         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
6528         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
6529         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
6530         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
6531         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
6533         * sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
6534         compat_timer_create.
6536 2003-06-14  Ulrich Drepper  <drepper@redhat.com>
6538         * sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
6540         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
6541         __register_atfork.
6542         * sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
6543         Add libc_hidden_def.
6545 2003-06-13  Roland McGrath  <roland@redhat.com>
6547         * sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
6548         constant from <sys/reg.h> to ps_get_thread_area, not register contents.
6550 2003-06-11  Ulrich Drepper  <drepper@redhat.com>
6552         * allocatestack.c (queue_stack): Always inline.
6553         * ptreadhP.h (__do_cancel): Likewise.
6555 2003-06-10  Jakub Jelinek  <jakub@redhat.com>
6557         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
6558         a typo.
6560 2003-06-10  Ulrich Drepper  <drepper@redhat.com>
6562         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6563         (__pthread_cond_signal): Remove incorrect second addition for
6564         cond_lock!=0.
6566 2003-06-09  Ulrich Drepper  <drepper@redhat.com>
6568         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6569         (__pthread_cond_signal): Use correct futex pointer in
6570         __lll_mutex_lock_wait call.
6572         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6573         (__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
6575 2003-06-08  Ulrich Drepper  <drepper@redhat.com>
6577         * sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
6578         cancelable.
6579         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6580         Likewise.
6582         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
6583         hand-written CFI generation code.  Since ENTRY/END also initiated
6584         CFI frames this caused two CFI sets to be generated.
6586 2003-06-07  Ulrich Drepper  <drepper@redhat.com>
6588         * cleanup_routine.c: New file.
6589         * Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
6590         * sysdeps/pthread/pthread.h: Add support for fully exception-based
6591         cleanup handling.
6592         * Makefile (libpthread-routines): Add cleanup_routine.
6593         Add more CFLAGS variables to compile with exceptions.  Add comments
6594         why which file needs unwind tables.
6595         (tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
6596         tests.
6597         * tst-cancelx1.c: New file.
6598         * tst-cancelx2.c: New file.
6599         * tst-cancelx3.c: New file.
6600         * tst-cancelx4.c: New file.
6601         * tst-cancelx5.c: New file.
6602         * tst-cancelx6.c: New file.
6603         * tst-cancelx7.c: New file.
6604         * tst-cancelx8.c: New file.
6605         * tst-cancelx9.c: New file.
6606         * tst-cancelx10.c: New file.
6607         * tst-cancelx11.c: New file.
6608         * tst-cancelx12.c: New file.
6609         * tst-cancelx13.c: New file.
6610         * tst-cancelx14.c: New file.
6611         * tst-cancelx15.c: New file.
6612         * tst-cleanupx0.c: New file.
6613         * tst-cleanupx0.expect: New file.
6614         * tst-cleanupx1.c: New file.
6615         * tst-cleanupx2.c: New file.
6616         * tst-cleanupx3.c: New file.
6618         * tst-cleanup0.c: Make standard compliant.
6619         * tst-cleanup1.c: Likewise.
6621         * sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
6622         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
6623         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
6624         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
6625         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
6626         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
6627         * sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
6628         CLEANUP_JMP_BUF.
6629         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6630         * tst-cancel12.c: New file.
6631         * tst-cancel13.c: New file.
6632         * tst-cancel14.c: New file.
6633         * tst-cancel15.c: New file.
6634         * Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
6635         and tst-cancel15.
6637         * tst-cancel1.c: Add some comments.
6639         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
6640         timeout correctly.
6642 2003-06-06  Ulrich Drepper  <drepper@redhat.com>
6644         * Makefile (CFLAGS-pthread_cancel.c): Define.
6646 2003-06-05  Ulrich Drepper  <drepper@redhat.com>
6648         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
6649         Change type of __writer element to int.
6650         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6651         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6652         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
6653         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
6654         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6655         * sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
6656         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6657         * pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
6658         Compare with TID to determine deadlocks.
6659         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
6660         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
6661         * sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
6662         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
6663         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
6664         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
6665         Likewise.
6666         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
6667         Likewise.
6668         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
6669         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
6670         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
6671         Likewise.
6672         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
6673         Likewise.
6674         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
6675         * Makefile (tests): Add tst-rwlock12.
6676         * tst-rwlock12.c: New file.
6678 2003-06-05  Jakub Jelinek  <jakub@redhat.com>
6680         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
6681         __lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
6682         Remove bogus hidden_proto.
6683         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
6684         Likewise.
6685         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
6686         lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
6687         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
6688         ___lll_mutex_timedlock): Likewise.
6690 2003-06-04  Ulrich Drepper  <drepper@redhat.com>
6692         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
6693         (__pthread_cond_signal): Add some code to eventually handle
6694         cond_lock!=0.
6696 2003-06-01  Ulrich Drepper  <drepper@redhat.com>
6698         * Makefile (tests): Add tst-exec4.
6699         (tst-exec4-ARGS): Define.
6700         * tst-exec4.c: New file.
6702 2003-05-31  Ulrich Drepper  <drepper@redhat.com>
6704         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
6705         Also fail if tv_nsec < 0.
6706         (__lll_timedwait_tid): Likewise.
6707         * sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
6708         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
6709         Likewise.
6710         * sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
6711         Likewise.
6712         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
6713         Likewise.
6714         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
6715         Likewise.
6716         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
6717         Likewise.
6718         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
6719         Likewise.
6721         * Makefile (tests): Add tst-sem8 and tst-sem9.
6722         * tst-sem8.c: New file.
6723         * tst-sem9.c: New file.
6724         * sem_open.c: Fix creation of in_use record if the file exists but
6725         no internal record.
6727         * posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
6728         definitions.
6730         * sysdeps/pthread/timer_create.c (timer_create): In case
6731         evp==NULL, assign timer ID to sival_ptr.
6733         * descr.h (struct pthread_unwind_buf): Change type of prev element to
6734         struct pthread_unwind_buf *.
6735         (struct pthread): Likewise for cleanup_jmp_buf element.
6737         * cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
6738         * cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
6739         * unwind.c (__pthread_unwind_next): Likewise.
6741 2003-05-30  Ulrich Drepper  <drepper@redhat.com>
6743         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6744         (lll_futex_timed_wait): Use int for futex value parameter.
6745         (lll_futex_wake): Likewise.
6746         (lll_futex_requeue): Likewise.
6748         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
6749         Replace one memory operation with one register operation.
6751         * tst-join4.c (do_test): Fix error message.
6753         * tst-rwlock6.c (do_test): Use correct format specifier.
6755         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
6756         (__lll_mutex_lock_wait): Replace one memory operation with one
6757         register operation.
6758         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
6759         (__lll_mutex_lock_wait): Likewise.
6761         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6762         (__lll_mutex_cond_lock): Add one to value parameter of
6763         __lll_lock_wait to reflect reality in the futex syscall.
6764         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6765         (lll_mutex_cond_lock): Likewise.
6767 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
6769         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
6770         New function.
6771         (lll_mutex_cond_lock): Define.
6773 2003-05-29  Ulrich Drepper  <drepper@redhat.com>
6775         * Makefile (tests): Add tst-signal6.
6776         * tst-signal6.c: New file.
6778         * sysdeps/unix/sysv/linux/s390/lowlevellock.h
6779         (__lll_mutex_unlock_force): New function
6780         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
6782         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
6783         (__lll_mutex_unlock_force): New function.
6784         (lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
6786         * tst-rwlock7.c (do_test): Use correct format specifier.
6788         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
6789         Find break parameter in correct asm argument.
6791 2003-05-27  Jakub Jelinek  <jakub@redhat.com>
6793         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
6794         Remove out4.
6795         (lll_futex_requeue): Fix __o3 constraint, return negative errno if
6796         error occured.
6797         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
6798         Add __mutex.
6799         * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
6800         lll_futex_requeue, lll_mutex_unlock_force): Define.
6802 2003-05-30  Jakub Jelinek  <jakub@redhat.com>
6804         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
6805         (pthread_cond_t): Add __mutex.
6806         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
6807         lll_futex_requeue, lll_mutex_unlock_force): Define.
6809 2003-05-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
6811         * sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
6812         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
6813         Add __mutex field.
6814         * sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
6815         Define.
6816         (lll_futex_wait, lll_futex_wake): Define.
6817         * sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
6818         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
6819         FUTEX_REQUEUE instead of FUTEX_WAIT.
6820         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
6821         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
6822         mutex which was used in condvar structure.  Call
6823         __pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
6824         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
6826         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
6827         include tcb-offsets.h.  Read wakeup value in locked region.
6828         Use the value of gbr register as THREAD_ID.
6829         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
6830         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
6831         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
6833         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
6834         macros.
6836 2003-05-28  Ulrich Drepper  <drepper@redhat.com>
6838         * sysdeps/pthread/pthread_cond_broadcast.c
6839         (__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
6841 2003-05-26  Ulrich Drepper  <drepper@redhat.com>
6843         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
6844         typo in register name.
6845         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
6846         correctly.  Actually use requeue.  Little optimization.
6847         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
6848         mutex address early.  Handle cancellation state as 32-bit value.
6849         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6850         Remove unnecessary label.
6852 2003-05-25  Ulrich Drepper  <drepper@redhat.com>
6854         * sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
6855         instead of FUTEX_WAIT.
6856         * sysdeps/pthread/pthread_cond_signal.c: Likewise.
6857         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
6858         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
6859         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
6860         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
6861         * sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
6862         used in condvar structure.  Call __pthread_mutex_cond_lock instead
6863         of __pthread_mutex_lock_internal.
6864         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6865         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6866         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6867         (__condvar_cleanup): Always call __pthread_mutex_cond_lock.
6868         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6869         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6870         * sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
6871         Add pthread_mutex_cond_lock.
6872         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
6873         * sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
6874         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
6875         lll_mutex_cond_lock.
6876         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
6877         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
6878         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
6879         Add __mutex field.
6880         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
6881         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
6883         * sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
6884         * sysdeps/x86_64/tcb-offsets.sym: Likewise.
6886         * pthreadP.h: Declare __pthread_mutex_cond_lock.
6887         * pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
6888         Use it instead of lll_mutex_lock.  If __pthread_mutex_lock is a
6889         macro don't define aliases.
6891         * cancellation.c: Remove __pthread_enable_asynccancel_2.
6892         * pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
6893         * sysdeps/pthread/pthread_cond_timedwait.c: Use
6894         __pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
6895         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
6896         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
6897         * sysdeps/pthread/pthread_cond_wait.c: Likewise.
6898         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
6899         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
6901 2003-05-17  Ulrich Drepper  <drepper@redhat.com>
6903         * sem_open.c: Fix one endless loop.  Implement correct semantics
6904         wrt opening the same semaphore more then once.
6905         * sem_close.c: Adjust for sem_open change.
6906         * semaphoreP.h: Include <semaphore.h>.  Define struct inuse_sem.
6907         Declare __sem_mappings, __sem_mappings_lock, __sem_search.
6908         * Makefile (tests): Add tst-sem7.
6909         * tst-sem7.c: New file.
6911 2003-05-16  Roland McGrath  <roland@redhat.com>
6913         * sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
6914         uninitialized variable braino.
6916 2003-05-16  Ulrich Drepper  <drepper@redhat.com>
6918         * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
6919         test for syscall availability.
6921         * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
6922         __no_posix_timers to -1 if the syscalls don't exist.
6924         * pthread_join.c (pthread_join): Set tid field of the joined
6925         thread to -1.  This isn't necessary but helps to recognize some
6926         error conditions with almost no cost.
6928         * allocatestack.c (FREE_P): Also negative values indicate an
6929         unused stack.
6931         * unwind.c: Include <unistd.h>.
6933 2003-05-14  Ulrich Drepper  <drepper@redhat.com>
6935         * Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
6937 2003-05-14  Jakub Jelinek  <jakub@redhat.com>
6939         * Makefile (crti-objs, crtn-objs): New variables.
6940         (omit-deps, extra-objs): Add crtn.
6941         ($(objpfx)libpthread.so): Depend on both crti and crtn
6942         and links to them in multidir.
6943         ($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
6945 2003-05-12  Steven Munroe  <sjmunroe@us.ibm.com>
6947         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
6948         (lll_mutex_unlock): Use atomic_exchange_rel.
6950 2003-05-11  Ulrich Drepper  <drepper@redhat.com>
6952         * cond-perf.c (cons): Add missing locking around setting of alldone.
6954 2003-05-10  Ulrich Drepper  <drepper@redhat.com>
6956         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
6957         related macros.
6958         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
6960 2003-05-09  Ulrich Drepper  <drepper@redhat.com>
6962         * tst-sem6.c: New file.
6963         * Makefile (tests): Add tst-sem6.
6965         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
6966         Use atomic_exchange_rel instead of atomic_exchange.
6967         * sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
6968         Likewise.
6970         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
6971         code for lll_futex_wait and lll_futex_wake in static apps.  Use
6972         vsyscall is possible.
6974         * sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
6975         * sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
6976         * sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
6977         pthread_setaffinity_np.
6978         * Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
6979         and pthread_setaffinity_np.
6980         * Makefile (libpthread-routines): Add pthread_getaffinity and
6981         pthread_setaffinity.
6983         * allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
6984         use it in case mmap to allocate the stack fails.
6985         * sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
6986         ARCH_MAP_FLAGS here.
6987         * sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
6988         ARCH_RETRY_MMAP.
6990 2003-05-08  Ulrich Drepper  <drepper@redhat.com>
6992         * sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
6993         handler implementation.  It is now lockless in fork().
6994         * sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
6995         * sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
6996         * sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>.  Don't
6997         declare the __fork_*_lists.
6998         (struct fork_handler): Include pointers to all three functions.
6999         Add next, refcntr and need_signal elements.
7000         (__fork_handlers): New declaration.
7001         (__register_atfork_malloc): Remove declaration.
7002         (HAVE_register_atfork_malloc): Remove definition.
7003         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
7004         __pthread_child_handler variable.
7005         (__libc_pthread_init): Use __register_atfork instead of explicitly
7006         adding to the list.
7007         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
7008         and lll_futex_wake.
7009         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
7011         * unwind.c (unwind_cleanup): Print error message and then abort.  This
7012         function must never be reached.
7014         * cond-perf.c: New file.
7016 2003-05-05  Ulrich Drepper  <drepper@redhat.com>
7018         * sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
7020 2003-05-04  Roland McGrath  <roland@redhat.com>
7022         * Makefile ($(objpfx)../libc.so): New target.
7024 2003-05-02  Ulrich Drepper  <drepper@redhat.com>
7026         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7027         (pthread_condattr_t): Size is only an int, don't use long for
7028         alignment.
7029         (pthread_mutexattr_t): Likewise.
7030         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7031         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
7032         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7034 2003-05-01  Ulrich Drepper  <drepper@redhat.com>
7036         * sysdeps/i386/tls.h: Define THREAD_ID.
7037         * sysdeps/ia64/tls.h: Likewise.
7038         * sysdeps/powerpc/tls.h: Likewise.
7039         * sysdeps/s390/tls.h: Likewise.
7040         * sysdeps/sh/tls.h: Likewise.
7041         * sysdeps/x86_64/tls.h: Likewise.
7042         * pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
7043         record ownership.
7044         * pthread_mutex_timedlock.c: Likewise.
7045         * pthread_mutex_trylock.c: Likewise.
7046         * pthread_mutex_unlock.c: Likewise.
7047         * pthread_rwlock_trywrlock.c: Likewise.
7048         * sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
7049         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
7050         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
7051         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
7053         * sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
7054         flag.
7056 2003-04-29  Jakub Jelinek  <jakub@redhat.com>
7058         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7059         (__SIZEOF_PTHREAD_COND_T): Define to 48.
7060         (pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
7061         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
7062         Make __align long long instead of long.
7063         (pthread_rwlock_t): Formatting.
7064         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
7065         (pthread_rwlock_t): Formatting.
7066         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
7067         (pthread_cond_t): Make __align long long instead of long.
7068         (pthread_rwlock_t): Move __flags field to the same position as in
7069         linuxthreads.
7071 2003-04-30  Ulrich Drepper  <drepper@redhat.com>
7073         * tst-rwlock6.c (do_test): Use correct printf format specifiers.
7074         * tst-rwlock7.c (do_test): Likewise.
7076 2003-04-26  Roland McGrath  <roland@redhat.com>
7078         * Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
7080 2003-04-22  Jakub Jelinek  <jakub@redhat.com>
7082         * allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
7083         sizeof (struct pthread).
7084         (allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
7085         1 struct pthread.
7086         * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
7087         to 0.
7088         (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
7089         struct pthread.
7090         (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
7091         to 32-bit bytes.
7092         (INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
7093         tcbp.
7094         (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
7095         unneccessarily.
7096         (NO_TLS_OFFSET): Define.
7097         * sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
7098         add TLS_TCB_SIZE unnecessarily.
7100 2003-04-22  Roland McGrath  <roland@redhat.com>
7102         * Makeconfig (shared-thread-library): Reverse link order to work
7103         around linker bug.
7105 2003-04-22  Ulrich Drepper  <drepper@redhat.com>
7107         * semaphore.h: Fix typo in comment.
7109 2003-04-21  Ulrich Drepper  <drepper@redhat.com>
7111         * sysdeps/pthread/sigfillset.c: New file.
7113         * init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
7114         * pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
7115         * sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
7116         * sysdeps/pthread/sigaction.c: Likewise.
7117         * sysdeps/pthread/sigprocmask.c: New file.
7118         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
7119         __SIGRTMIN+1.
7120         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7121         Block SIGTIMER.  Also handle SI_TKILL events and terminate thread
7122         in this case.
7124 2003-04-19  Ulrich Drepper  <drepper@redhat.com>
7126         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
7127         (DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
7129         * sysdeps/unix/sysv/linux/unregister-atfork.c
7130         (__unregister_atfork): Don't free memory not allocated dynamically.
7132         * semaphore.h: Remove __THROW marker from cancellation points.
7133         * nptl/sysdeps/pthread/pthread.h: Likewise.
7135 2003-04-18  Ulrich Drepper  <drepper@redhat.com>
7137         * sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
7138         pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
7139         __THROW.
7141 2003-04-16  Jakub Jelinek  <jakub@redhat.com>
7143         * tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
7145 2003-04-15  Roland McGrath  <roland@redhat.com>
7147         * forward.c (__pthread_unwind): Tweak to avoid warning.
7149 2003-04-15  Ulrich Drepper  <drepper@redhat.com>
7151         * pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
7153 2003-04-14  Ulrich Drepper  <drepper@redhat.com>
7155         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
7156         overflow CFA advance instructions.
7157         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7159 2003-04-14  Jakub Jelinek  <jakub@redhat.com>
7161         * sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
7162         * sysdeps/i386/pthread_spin_lock.c: Likewise.
7163         * sysdeps/x86_64/tls.h: Likewise.  Define LOCK_PREFIX if not already
7164         defined.
7166         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
7167         DW_CFA_advance_loc2 for .Laddl-.Lsubl.
7168         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
7169         DW_CFA_advance_loc for .Laddl-.Lsubl.
7171 2003-04-13  Ulrich Drepper  <drepper@redhat.com>
7173         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
7174         position-independent unwind data for static libraries.
7175         Add missing unwind info.  Add comments.
7177         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
7178         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7179         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7180         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7182 2003-04-12  Ulrich Drepper  <drepper@redhat.com>
7184         * Makefile: Make sure all cancellation points are compiled with
7185         exception and asynchronous unwind tables.
7187         * sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
7188         which mishandles loading of global object addresses in PIC.
7189         (THREAD_SETMEM_NC): Likewise.
7191 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7193         * pthread.h: Define new data structure for cleanup buffer.  Declare
7194         new cleanup handler interfaces.
7195         * descr.h: Include <unwind.h> if necessary.  Define pthread_unwind_buf.
7196         (struct pthread): Add cleanup_jmp_buf pointer.  Define
7197         HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
7198         * pthreadP.h: Declare __pthread_unwind.  Define __do_cancel to use
7199         it.  Declare old cleanup handler installation functions.
7200         * cleanup.c: Rewrite.  Install handler for unwind-based cleanup
7201         handling.
7202         * cleanup_defer.c: Likewise.
7203         * cleanup_compat.c: New file.  Old cleanup code.
7204         * cleanup_def_compat.c: New file.  Old cleanup code.
7205         * pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
7206         if own thread descriptor.
7207         * unwind.c: New file.
7208         * forward.c: Add __pthread_unwind.
7209         * init.c (pthread_functions): Add __pthread_unwind.
7210         * sysdeps/pthread/pthread-functions.s (struct pthread_functions):
7211         Add ptr___pthread_unwind.
7212         * Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
7213         and unwind function.
7214         * Makefile (libpthread-routines): Add cleanup_compat,
7215         cleanup_def_compat, and unwind.  Define CFLAGS to enable unwind
7216         table generation if necessary.
7217         * version.c: Record whether unwind support is compiled in.
7218         * sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
7219         * sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
7220         handler interfaces.
7221         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
7222         complication to generate unwind information for syscall wrappers.
7223         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
7224         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
7225         __cleanup_fct_attribute.
7227         * Makefile: Add rules to build and run tst-cleanup0.
7228         * tst-cleanup0.c: New file.
7229         * tst-cleanup0.expect: New file.
7231         * pthread_create.c (deallocate_tsd): Don't take parameter.  Adjust
7232         caller.  Optimize to avoid often unecessary local variable.
7234 2003-04-11  Roland McGrath  <roland@redhat.com>
7236         * Makefile ($(objpfx)multidir.mk): New target, generated makefile that
7237         sets variable `multidir'; include that.
7238         (generated): Add it.
7239         ($(objpfx)$(multidir)/crti.o): New target.
7240         [$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
7242 2003-04-11  Ulrich Drepper  <drepper@redhat.com>
7244         * tst-attr2.c (do_test): Add cast to avoid warning.
7245         * tst-mutex4.c (do_test): Likewise.
7247 2003-04-10  Ulrich Drepper  <drepper@redhat.com>
7249         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
7250         in child.
7252 2003-04-09  Ulrich Drepper  <drepper@redhat.com>
7254         * Makefile (tests): Add tst-detach1.
7255         * tst-detach1.c: New file.
7257 2003-04-08  Ulrich Drepper  <drepper@redhat.com>
7259         * sysdeps/pthread/pthread.h: Remove duplicate
7260         pthread_cleanup_{push,pop} definitions.
7262         * tst-barrier2.c: Eliminate warnings.
7263         * tst-cancel4.c: Likewise.
7264         * tst-cond4.c: Likewise.
7265         * tst-cond6.c: Likewise.
7266         * tst-detach1.c: Likewise.
7267         * tst-rwlock4.c: Likewise.
7268         * tst-rwlock6.c: Likewise.
7269         * tst-rwlock7.c: Likewise.
7270         * tst-sem3.c: Likewise.
7271         * tst-spin2.c: Likewise.
7272         * tst-umask1.c: Likewise.
7274 2003-04-07  Ulrich Drepper  <drepper@redhat.com>
7276         * pthread_detach.c (pthread_detach): Fix test for invalid TID.
7278 2003-04-06  Ulrich Drepper  <drepper@redhat.com>
7280         * descr.h (struct pthread): Move cancelhandling member to the front.
7282 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
7284         * sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
7285         malloc_parent, and malloc_child statically.
7286         (__register_atfork_malloc): New function.
7287         (free_mem): Don't free any of the malloc_* variables on the list.
7288         * sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
7289         Define HAVE_register_atfork_malloc.
7291 2003-04-04  Ulrich Drepper  <drepper@redhat.com>
7293         * sysdeps/pthread/createthread.c (create_thread): Add some more
7294         comments explaining when to set multiple_threads and when not.
7296         * pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7297         THREAD_ATOMIC_BIT_SET if not already defined.
7298         * sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
7299         THREAD_ATOMIC_BIT_SET:
7300         * sysdeps/x86_64/tls.h: Likewise.
7301         * cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
7302         THREAD_ATOMIC_CMPXCHG_VAL.
7303         (_pthread_cleanup_pop_restore): Likewise.
7304         * cancellation.c (__pthread_enable_asynccancel): Likewise.
7305         (__pthread_enable_asynccancel_2): Likewise.
7306         (__pthread_disable_asynccancel): Likewise.
7307         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7308         (__libc_disable_asynccancel): Likewise.
7309         * init.c (sigcancel_handler): Likewise.
7310         * pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
7311         * pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
7313 2003-04-03  Ulrich Drepper  <drepper@redhat.com>
7315         * init.c (sigcancel_handler): Don't set EXITING_BIT here.
7316         * libc-cancellation.c (__libc_enable_asynccancel): Likewise.
7317         * pthreadP.h (__do_cancel): Set EXITING_BIT here.
7318         * Makefile (tests): Add tst-cancel11.
7319         * tst-cancel11.c: New file.
7321 2003-04-01  Ulrich Drepper  <drepper@redhat.com>
7323         * pthread_create.c (deallocate_tsd): Clear/free memory after the last
7324         round, not the first.  Use specific_used flag instead of local
7325         found_nonzero variable.  Use THREAD_[SG]ETMEM where possible.
7326         (__free_tcb): Don't call deallocate_tsd here.
7327         (start_thread): Call deallocate_tsd here.
7328         * pthread_setspecific.c: Set specific_used flag really only when
7329         needed.
7330         * Makefile (tests): Add tst-tsd3.c and tst-tsd4.
7331         * tst-tsd3.c: New file.
7332         * tst-tsd4.c: New file.
7334 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7336         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
7337         Use atomic_exchange_and_add instead of __lll_add.
7338         (__lll_mutex_timedlock): Likewise.
7339         Patch by Ian Wienand.
7341 2003-03-24  Steven Munroe  <sjmunroe@us.ibm.com>
7343         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7344         (SINGLE_THREAD_P): Fix typo.
7345         * tst-cancel-wrappers.sh: Handle '.'ed symbols.
7347 2003-03-31  Ulrich Drepper  <drepper@redhat.com>
7349         * Makefile (tests): Add tst-align.
7350         * tst-align.c: New file.
7351         * sysdeps/i386/Makefile: Define CFLAGS-tst-align.
7353         * sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
7354         function correctly.
7356         * tst-tsd2.c: Add casts to avoid warnings.
7358 2003-03-30  Ulrich Drepper  <drepper@redhat.com>
7360         * descr.h (struct pthread): Move most often used elements to the front.
7362 2003-03-29  Ulrich Drepper  <drepper@redhat.com>
7364         * Makefile (libpthread-routines): Add pthread_atfork.
7365         (libpthread-static-only-routines): Add pthread_atfork.
7367 2003-03-28  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
7369         * sysdeps/sh/tls.h: Include nptl/descr.h after the definition
7370         of TLS_DTV_AT_TP.
7371         (INSTALL_DTV): Add parens.
7372         (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
7373         Use passed descr instead of THREAD_SELF.
7374         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
7375         (__lll_mutex_timedlock_wait): Correct expected value after
7376         spurious wakeup.
7377         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
7378         Release lock before waking up the waiters.
7379         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
7380         criteria.  Reorderstruct passed to cleanup handler.  Fix
7381         handling of cancellation and failung pthread_mutex_unlock call.
7382         Use __pthread_enable_asynccancel_2 instead of
7383         __pthread_enable_asynccancel.
7384         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7385         Return result of lock re-get if it fails.
7386         * sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
7387         for __pthread_cleanup_push.
7388         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
7389         completely broken rwlock implementation.
7390         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7391         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7392         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7393         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
7394         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7395         * sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value.  Use
7396         versioned_symbol macro.
7397         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
7398         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
7400 2003-03-27  Ulrich Drepper  <drepper@redhat.com>
7402         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
7403         __timer_helper_thread.  Declare __start_helper_thread, __helper_once,
7404         and __helper_tid.
7405         (struct timer): Remove th and bar field.
7406         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
7407         debugging code.  Create only one helper thread.
7408         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
7409         helper thread.
7410         * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
7411         Renamed.  Define statically.  Use thread info from siginfo.
7412         (__helper_once): New variable.
7413         (__helper_tid): New variable.
7414         (__reset_helper_control): New function.
7415         (__start_helper_thread): New function.
7417         * pthread_create.c (start_thread): Don't use setjmp inside
7418         __builtin_expect to work around gcc bug.
7420         * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
7421         timer_delete syscall fails, but not with ENOSYS, set
7422         __no_posix_timers.
7424         * sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
7425         (timer_settime): Fix typo.
7426         * sysdeps/unix/sysv/linux/timer_getoverr.c
7427         [!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
7429 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
7431         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
7432         offset of cleanupbuf.__prev.
7434 2003-03-26  Jakub Jelinek  <jakub@redhat.com>
7436         * sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
7437         of included file.
7439 2003-03-26  Ulrich Drepper  <drepper@redhat.com>
7441         * sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
7442         NULL provide default definition to syscall.
7444 2003-03-25  Roland McGrath  <roland@redhat.com>
7446         * sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
7447         (timer_id2ptr): Fix typo.
7449 2003-03-25  Ulrich Drepper  <drepper@redhat.com>
7451         * pthreadP.h: Define SIGCANCEL and SIGTIMER.
7452         * sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
7453         * sysdeps/ia64/pthreaddef.h: Likewise.
7454         * sysdeps/powerpc/pthreaddef.h: Likewise.
7455         * sysdeps/s390/pthreaddef.h: Likewise.
7456         * sysdeps/sh/pthreaddef.h: Likewise.
7457         * sysdeps/x86_64/pthreaddef.h: Likewise.
7458         * init.c (__pthread_initialize_minimal): Block SIGTIMER.
7459         * sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
7460         being changed.
7461         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
7462         SIGTIMER is not unblocked.
7463         * sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
7464         RT signal taken.
7465         * sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
7466         be send.
7467         * sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
7468         pass pointer through as ID.
7469         * sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
7470         * sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
7471         * sysdeps/unix/sysv/linux/timer_create.c: New file.
7472         * sysdeps/unix/sysv/linux/timer_delete.c: New file.
7473         * sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
7474         * sysdeps/unix/sysv/linux/timer_gettime.c: New file.
7475         * sysdeps/unix/sysv/linux/timer_routines.c: New file.
7476         * sysdeps/unix/sysv/linux/timer_settime.c: New file.
7477         * sysdeps/unix/sysv/linux/ia64/Versions: New file.
7478         * sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
7479         * sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
7480         * sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
7481         * sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
7482         * sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
7483         * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
7484         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
7485         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
7486         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
7487         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
7488         * sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
7489         * sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
7490         * sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
7491         * sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
7492         * sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
7493         * sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
7494         * sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
7495         * sysdeps/unix/sysv/linux/x86_64/Versions: New file.
7496         * sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
7497         * sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
7498         * sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
7499         * sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
7500         * sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
7501         * sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
7503         * pthreadP.h: Remove FRAME_LEFT definition.
7504         * cleanup.c (_pthread_cleanup_push): Don't check for reference to
7505         already left frame.  Programs which have this problem are not POSIX
7506         compliant.
7507         * cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
7509 2003-03-24  Ulrich Drepper  <drepper@redhat.com>
7511         * sysdeps/pthread/tst-timer.c: Check return values of the
7512         functions we test.
7514 2003-03-23  Roland McGrath  <roland@redhat.com>
7516         * tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
7517         * tst-tls3mod.c: Likewise.
7518         * tst-tls1.c: Likewise.
7519         * tst-tls2.c: Likewise.
7521         * tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
7522         undefined behavior.
7524         * tst-join5.c (tf1, tf2): Add a cast.
7526         * Makeconfig (includes): Append -I$(..)nptl to this variable.
7528         * tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
7529         Don't test anything.
7530         * tst-cond4.c: Likewise.
7531         * tst-cond6.c: Likewise.
7532         * tst-flock2.c: Likewise.
7533         * tst-mutex4.c: Likewise.
7534         * tst-rwlock4.c: Likewise.
7535         * tst-signal1.c: Likewise.
7536         * tst-spin2.c: Likewise.
7537         * tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
7539         * tst-mutex4.c: Use test-skeleton.c.
7540         * tst-spin2.c: Likewise.
7541         * tst-sysconf.c: Likewise.
7542         * tst-barrier2.c: Likewise.
7543         * tst-cond4.c: Likewise.
7544         * tst-cond6.c: Likewise.
7545         * tst-rwlock4.c: Likewise.
7546         * tst-unload.c: Likewise.
7547         * tst-flock2.c (do_test): Use return instead of exit.
7549 2003-03-22  Jakub Jelinek  <jakub@redhat.com>
7551         * sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
7553 2003-03-21  Ulrich Drepper  <drepper@redhat.com>
7555         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h
7556         (__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
7557         instead of __lll_compare_and_swap.
7558         * sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
7559         Likewise.
7560         Removed definition if __lll_compare_and_swap.
7562         * cancellation.c: Adjust for new form of compare&exchange macros.
7563         * cleanup_defer.c: Likewise.
7564         * init.c: Likewise.
7565         * libc-cancellation.c: Likewise.
7566         * old_pthread_cond_broadcast.c: Likewise.
7567         * old_pthread_cond_signal.c: Likewise.
7568         * old_pthread_cond_timedwait.c: Likewise.
7569         * old_pthread_cond_wait.c: Likewise.
7570         * pthread_cancel.c: Likewise.
7571         * pthread_create.c: Likewise.
7572         * pthread_detach.c: Likewise.
7573         * pthread_join.c: Likewise.
7574         * pthread_key_delete.c: Likewise.
7575         * pthread_setcancelstate.c: Likewise.
7576         * pthread_setcanceltype.c: Likewise.
7577         * pthread_timedjoin.c: Likewise.
7578         * pthread_tryjoin.c: Likewise.
7579         * sysdeps/pthread/createthread.c: Likewise.
7581 2003-03-20  Ulrich Drepper  <drepper@redhat.com>
7583         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
7584         Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
7585         definitions.  Replace uses with calls to atomic_* functions.
7586         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
7587         * sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
7588         __lll_test_and_set calls with atomic_exchange_and_add and
7589         atomic_exchange calls respectively.
7590         * sysdeps/unix/sysv/linux/sem_post.c: Likewise.
7591         * sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
7592         * sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
7593         * sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
7594         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
7595         * sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
7596         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
7598         * allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
7599         returns the old value.
7601 2003-03-20  Martin Schwidefsky  <sky@mschwid3.boeblingen.de.ibm.com>
7603         * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
7604         int for variable OLDVAL and correct inline assembler contraint.
7605         * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
7606         type int for variable OLD.
7608         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
7609         only for s390-32.
7610         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7611         (SINGLE_THREAD_P): Use global variable __local_multiple_threads
7612         instead of multiple_threads field in the TCB.
7614 2003-03-19  Ulrich Drepper  <drepper@redhat.com>
7616         * sysdeps/i386/i686/bits/atomic.h: Removed.
7617         * sysdeps/i386/i586/bits/atomic.h: Removed.
7618         * sysdeps/i386/i486/bits/atomic.h: Removed.  Moved to glibc.
7619         * sysdeps/x86_64/bits/atomic.h: Removed.  Moved to glibc.
7620         * sysdeps/s390/bits/atomic.h: Removed.  Moved to glibc.
7621         * sysdeps/sh/bits/atomic.h: Removed.  Moved to glibc.
7622         * sysdeps/ia64/bits/atomic.h: Removed.  Moved to glibc.
7623         * sysdeps/powerpc/bits/atomic.h: Removed.  Moved to glibc.
7624         * atomic.h: Removed.  Moved to glibc.
7626         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
7627         support for clock selection.
7629         * sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
7630         signalling waiters.
7632 2003-03-18  Roland McGrath  <roland@redhat.com>
7634         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7635         Add __lll_rel_instr first.  Add memory clobber.
7636         (lll_mutex_unlock): Use __lll_test_and_set.
7637         From Paul Mackerras <paulus@samba.org>.
7639         * sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
7640         unconditionally.
7641         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
7642         (SINGLE_THREAD_P):  Add `header.' prefix.
7643         From Paul Mackerras <paulus@samba.org>.
7645         * Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
7646         pthread_timedjoin_np to ...
7647         (libpthread: GLIBC_2.3.3): ... here.
7648         (libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
7650         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
7651         Avoid shadowing VAL variable.
7653         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
7654         New macro.
7656 2003-03-18  Ulrich Drepper  <drepper@redhat.com>
7658         * Makefile (tests): Add tst-cond11.
7659         * tst-cond11.c: New file.
7661         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
7662         struct passed to cleanup handler to eliminate one more
7663         instruction.
7664         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7666         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
7667         (pthrad_cond_t): Replace __unused field with __clock.
7669         * sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
7670         waken all waiters in cleanup handler.
7671         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
7672         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7674         * pthread_condattr_getclock.c: New file.
7675         * pthread_condattr_setclock.c: New file.
7676         * sysdeps/pthread/pthread.h: Declare these new functions.
7677         * Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
7678         * Makefile (libpthread-routines): Add the new functions.
7679         * sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
7680         Renamed field to value.  Document use of the bits.
7681         * pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
7682         change.
7683         * pthread_condattr_setpshared.c: Likewise.
7684         * pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
7685         * sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
7686         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
7687         Add __clock field.
7688         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
7689         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
7690         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
7691         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
7692         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
7693         Implement clock selection.
7694         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7695         * pthread-errnos.sym: Add ENOSYS.
7696         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
7697         _POSIX_CLOCK_SELECTION.
7698         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
7700         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
7701         invalid .size directive.
7703 2003-03-17  Roland McGrath  <roland@redhat.com>
7705         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
7706         Formatting tweaks.
7708 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7710         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
7711         Use __lll_add instead of spelling it out.  Use protected symbol names.
7712         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
7713         Use __lll_add.
7714         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
7715         Renamed from lll_compare_and_swap.  Use new name where necessary.
7716         (__lll_add): Defined.
7717         (__lll_dec_if_positive): Defined.
7718         (__lll_test_and_set): Defined.
7719         * sysdeps/ia64/pthread_spin_init.c: Removed.
7720         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
7721         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
7722         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
7723         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
7724         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
7725         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
7726         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
7727         * sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
7728         * sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
7729         __sync_lock_release_si.
7730         Patch by Jakub Jelinek.
7732         * sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
7733         Fix timeout handling.
7734         (__lll_timedwait_tid): Likewise.
7735         (lll_unlock_wake_cb): Wake up other waiters if necessary.
7736         Patch by Jakub Jelinek.
7738         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
7740 2003-03-17  Roland McGrath  <roland@redhat.com>
7742         PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
7743         * sysdeps/pthread/pthread_spin_init.c: New file.
7744         * sysdeps/pthread/pthread_spin_unlock.c: New file.
7745         * sysdeps/powerpc/Makefile: New file.
7746         * sysdeps/powerpc/pthread_spin_lock.c: New file.
7747         * sysdeps/powerpc/pthread_spin_trylock.c: New file.
7748         * sysdeps/powerpc/pthreaddef.h: New file.
7749         * sysdeps/powerpc/tcb-offsets.sym: New file.
7750         * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
7751         * sysdeps/powerpc/tls.h: New file.
7752         * sysdeps/powerpc/bits/atomic.h: New file.
7753         * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
7754         * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
7755         * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
7757         * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
7758         * sysdeps/unix/sysv/linux/sem_post.c: New file.
7759         * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
7760         * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
7761         * sysdeps/unix/sysv/linux/sem_wait.c: New file.
7762         * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
7763         * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
7764         * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
7765         * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
7766         * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
7767         * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
7768         * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
7769         * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
7770         * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
7771         * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
7773         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
7774         not gettimeofday.
7775         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
7776         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
7777         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
7778         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
7779         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
7781 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
7783         * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
7784         * sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
7785         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7786         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
7787         Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
7789 2003-03-16  Roland McGrath  <roland@redhat.com>
7791         * tst-fork4.c: Include <string.h>.
7792         * tst-signal2.c: Likewise.
7793         * tst-mutex5.c (do_test): exit -> return.
7794         * tst-mutex2.c: Include <stdlib.h>.
7796 2003-03-16  Ulrich Drepper  <drepper@redhat.com>
7798         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
7799         (__lll_mutex_timedlock_wait): Correct expected value after
7800         spurious wakeup.  Otherwise we would never wait again.
7802         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
7803         zone versus inline asm stupidity.  Use correct instructions.
7805         * tst-rwlock6.c: Add some more status output.
7807 2003-03-15  Roland McGrath  <roland@redhat.com>
7809         * sysdeps/pthread/configure.in: New file.
7810         * sysdeps/pthread/configure: New file (generated).
7812 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
7814         * allocatestack.c (allocate_stack): Store the exact stack size of
7815         user allocated stacks.
7817 2003-03-15  Jakub Jelinek  <jakub@redhat.com>
7819         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
7820         (SINGLE_THREAD): Use `header' prefix instead of `header.data'.
7821         * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
7822         * sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
7823         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
7824         Use `header.' prefix.
7825         * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
7827 2003-03-15  Ulrich Drepper  <drepper@redhat.com>
7829         * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
7830         __builtin_frame_address, use stack pointer.
7832         * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
7833         instead of __builtin_frame_pointer.
7835 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
7837         * tst-basic1.c (do_test): Add cast to avoid warning.
7838         * tst-basic2.c (do_test): Likewise.
7840         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
7841         amount of stack correction.
7843         * tst-fork4.c: Use test-skeleton.c.
7845 2003-03-14  Roland McGrath  <roland@redhat.com>
7847         * init.c: Fix typo "#eli" for "#else".
7849 2003-03-14  Steven Munroe  <sjmunroe@us.ibm.com>
7851         * allocatestack.c (__stack_user): Use hidden_data_def.
7852         * pthread_create.c (__pthread_keys): Likewise.
7854         * init.c [__powerpc__] (__NR_set_tid_address): Define it.
7856 2003-03-14  Roland McGrath  <roland@redhat.com>
7858         * tst-fork4.c: New file.
7859         * Makefile (tests): Add it.
7861         * descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
7862         we always define the padding space.
7863         [!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
7864         stopped supporting its own extensions fully.
7865         [TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
7866         struct also called `header', so `header.multiple_threads' is the field
7867         name to use on all machines.
7868         * allocatestack.c (allocate_stack): Use `header.' prefix.
7869         * sysdeps/pthread/createthread.c (create_thread): Likewise.
7870         * pthread_create.c (__pthread_create_2_1): Likewise.
7871         * sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
7872         (THREAD_SELF): Likewise.
7873         * sysdeps/x86_64/tls.h: Likewise.
7874         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
7875         (SINGLE_THREAD_P): Likewise.
7876         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
7877         (SINGLE_THREAD_P): Likewise.
7878         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
7879         (SINGLE_THREAD_P): Likewise.
7881         * sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
7882         value directly.
7884 2003-03-14  Ulrich Drepper  <drepper@redhat.com>
7886         * pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
7887         * sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
7889         * pthread_create.c (start_thread): setjmp is expected to return 0.
7891         * sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
7892         (THREAD_GETMEM_NC): Likewise.
7894 2003-03-13  Ulrich Drepper  <drepper@redhat.com>
7896         * allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
7897         and the size of the stack which must be allocated is a multiple,
7898         allocate one more page.
7899         * sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
7900         MULTI_PAGE_ALIASING.
7902 2003-03-13  Roland McGrath  <roland@redhat.com>
7904         * pthread_create.c (start_thread): Set EXITING_BIT after the
7905         event-reporting (and destructors), not before.
7907 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
7909         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
7910         lll_futex_wake): Declare register variables as long int instead of
7911         unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
7912         Make syscall arguments clobbered by the syscall.
7913         (lll_futex_wait): Define using lll_futex_timed_wait.
7915         * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
7916         to void *.
7918         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
7919         PPID if [! NDEBUG].
7921         * allocatestack.c (nptl_ncreated): Only declare if
7922         COLORING_INCREMENT != 0.
7924         * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
7925         (__libc_enable_asynccancel_2): Remove prototype.
7927         * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
7928         ctid to match kernel.
7930 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
7932         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
7933         libc_multiple_threads.
7934         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
7935         __libc_multiple_threads to...
7936         * sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here.  New file.
7938         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
7939         versioning.
7940         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7941         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7943         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S
7944         (__pthread_once_internal): Define.
7946         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
7947         macros instead of .symver directly.
7948         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
7949         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
7951         * sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
7952         * sysdeps/x86_64/tcb-offsets.sym: New file.
7953         * sysdeps/x86_64/Makefile: New file.
7955         * sysdeps/i386/tcb-offsets.sym: Add SELF.
7956         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
7957         to access own pthread_t in TCB.
7958         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7959         Likewise.
7960         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7961         Likewise.
7962         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7964 2003-03-12  Roland McGrath  <roland@redhat.com>
7966         * pthread-errnos.sym: New file.
7967         * Makefile (gen-as-const-headers): New variable, list that file.
7968         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
7969         header <pthread-errnos.h> instead of defining errno values here.
7970         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
7971         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
7972         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
7973         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
7974         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
7975         Likewise.
7976         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
7977         Likewise.
7978         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
7979         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
7980         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
7981         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
7982         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
7983         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
7984         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
7985         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
7986         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
7987         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
7988         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
7989         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
7990         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
7991         * sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
7992         * sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
7993         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
7994         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
7995         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
7996         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
7997         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
7998         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
7999         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
8000         * sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
8001         * sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
8002         * sysdeps/sh/pthread_spin_trylock.S: Likewise.
8003         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
8004         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
8006         * sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
8007         CLONE_CHILD_SETTID worked.
8009 2003-03-12  Ulrich Drepper  <drepper@redhat.com>
8011         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
8012         file.
8013         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
8014         file.
8016         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
8017         (pthread_cond_t): Add padding.
8019         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
8020         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
8021         * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
8023         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
8024         (__pthread_rwlock_timedwrlock): Add missing opcode suffix.
8025         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
8026         (__pthread_rwlock_timedrdlock): Likewise.
8027         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
8028         (__pthread_rwlock_wrlock): Likewise.
8029         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
8030         (__pthread_rwlock_rdlock): Likewise.
8032         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
8034         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
8035         result of lock re-get if it fails.
8037 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8039         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
8040         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
8041         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
8042         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
8043         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
8044         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
8045         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
8046         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
8047         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
8048         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
8050         * sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
8051         THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
8053         * allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
8054         Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
8055         * sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
8056         (create_thread): Likewise.
8057         Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
8058         * init.c (__pthread_initialize_minimal_internal): Initialize
8059         __libc_multiple_threads_ptr if necessary.
8060         * pthreadP.h: Adjust prototype for __libc_pthread_init.  Declare
8061         __pthread_multiple_threads and __libc_multiple_threads_ptr.
8062         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
8063         __libc_multiple_threads.
8064         (__libc_pthread_init): Return pointer to __libc_pthread_init if
8065         necessary.
8067         * sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
8068         (THREAD_SETMEM_NC): Likewise.
8070         * sysdeps/x86_64/pthread_spin_trylock.c: Removed.
8071         * sysdeps/x86_64/pthread_spin_trylock.S: New file.
8072         * sysdeps/x86_64/pthread_spin_unlock.c: Removed.
8073         * sysdeps/x86_64/pthread_spin_unlock.S: New file.
8075         * sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
8076         Eliminate one entire instruction.
8078         * cancellation.c (__pthread_enable_asynccancel_2): New function.
8079         * pthreadP.h: Declare __pthread_enable_asynccancel_2.
8080         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
8081         (__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
8082         instead of __pthread_enable_asynccancel.
8083         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8084         (__pthread_cond_wait): Likewise.
8085         * sysdeps/pthread/pthread_cond_timedwait.c
8086         (__pthread_cond_timedwait): Likewise.
8087         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
8089         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
8090         (__condvar_cleanup): Wake up all waiters in case we got signaled
8091         after being woken up but before disabling asynchronous
8092         cancellation.
8093         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8094         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
8095         (__condvar_cleanup): Likewise.
8097         * init.c (__NR_set_tid_address): If already defined, don't redefine.
8098         Make it an error if architecture has no #if case.  Add x86-64.
8100         * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
8101         pt-initfini.s generation.
8103         * sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
8104         (TLS_INIT_TP): Fix typo.
8106 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8108         * sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
8109         3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
8111         * sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
8112         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
8113         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
8114         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
8115         * sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
8116         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8117         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8118         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8120 2003-03-11  Ulrich Drepper  <drepper@redhat.com>
8122         * sysdeps/pthread/pthread_cond_timedwait.c
8123         (__pthread_cond_timedwait): Return the result of the final
8124         locking.  If it succeeds, the regular function return value.
8126         * sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
8127         Return result of the final locking.
8128         * version.c (__nptl_main): Work around problems with the strange
8129         INTERNAL_SYSCALL macro on ppc32.
8130         * init.c (__pthread_initialize_minimal_internal): Unblock
8131         SIGCANCEL in case the parent blocked it.
8132         Reported by Paul Mackerras <paulus@samba.org>.
8134         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
8135         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
8136         * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
8138 2003-03-11  Jakub Jelinek  <jakub@redhat.com>
8140         * sysdeps/pthread/pthread_cond_timedwait.c
8141         (__pthread_cond_timedwait): Unlock and fail if
8142         __pthread_mutex_unlock_internal failed.
8144         * sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
8145         (create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
8146         Use ARCH_CLONE.
8147         * allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
8148         [NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
8149         STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
8150         ALLOCATE_STACK): New macros.
8151         (TLS_TPADJ): New macro.
8152         (get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
8153         (allocate_stack): Handle TLS_DTV_AT_TP and
8154         NEED_SEPARATE_REGISTER_STACK.  Use TLS_TPADJ.
8155         * pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
8156         Don't set PD->self.
8157         * init.c [__ia64__] (__NR_set_tid_address): Define.
8159         * sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
8160         * sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
8161         * sysdeps/unix/sysv/linux/ia64/fork.c: New file.
8162         * sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
8163         * sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
8164         * sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
8165         * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
8166         * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
8167         * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
8168         * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
8169         * sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
8170         * sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
8171         * sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
8172         * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
8173         * sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
8174         * sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
8175         * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
8176         * sysdeps/ia64/bits/atomic.h: New file.
8177         * sysdeps/ia64/Makefile: New file.
8178         * sysdeps/ia64/pthread_spin_init.c: New file.
8179         * sysdeps/ia64/pthread_spin_lock.c: New file.
8180         * sysdeps/ia64/pthread_spin_trylock.c: New file.
8181         * sysdeps/ia64/pthread_spin_unlock.c: New file.
8182         * sysdeps/ia64/pthreaddef.h: New file.
8183         * sysdeps/ia64/tcb-offsets.sym: New file.
8184         * sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
8185         * sysdeps/ia64/tls.h: New file.
8187         * sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
8188         to syscall instead of no arguments.
8190 2003-03-10  Ulrich Drepper  <drepper@redhat.com>
8192         * sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
8193         * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
8194         * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
8195         * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
8197         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
8198         unused code.
8200         * sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
8202         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8203         lowlevelbarrier.sym.
8204         * sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
8205         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
8206         Include lowlevelbarrier.h and don't define offsets locally.
8207         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
8209         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
8210         (__lll_mutex_lock_wait): Reverse order of first two parameters.
8211         (__lll_mutex_timedlock_wait): Likewise.
8212         (lll_mutex_lock): Adjust asm for that.
8213         (lll_mutex_timedlock): Likewise.  Mark cx, cc, r10 as clobbered.
8214         (lll_lock): Adjust asm for operand order change.
8215         * sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
8216         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
8218         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
8219         Reverse order of parameters.
8220         (__lll_timedwait_tid): Remove regparms attribute.
8221         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
8222         * sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
8224         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8225         (__lll_timedwait_tid): Remove one unnecessary instruction.
8227         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
8228         __lll_mutex_timedlock_wait only for NOT_IN_libc.
8229         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
8230         lowlevelmutex.S.
8232         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
8233         lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
8234         for NOT_IN_libc.
8235         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
8236         lowlevellock.S.
8238         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
8239         LOCK is already defined.  Don't define __lll_mutex_timedlock_wait
8240         for libc.so.
8241         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
8242         define LOCK here (if UP is not defined).  The actual code is in
8243         lowlevelmutex.S.
8245         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
8246         LOCK is already defined.  Don't define lll_unlock_wake_cb and
8247         __lll_timedwait_tid for libc.so.
8248         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
8249         define LOCK here (if UP is not defined).  The actual code is in
8250         lowlevellock.S.
8252         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
8253         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
8254         * sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
8255         instead of lowlevelsem.h.
8256         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
8257         * sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
8258         * sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
8260         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
8261         lowlevelrwlock.sym.
8262         * sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
8263         * sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
8264         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
8266         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
8267         register loading.
8268         * sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
8269         last changed.  D'oh.
8271         * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
8273         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
8274         of __libc_locking_needed.
8275         (lll_trylock): Initialize %eax to zero.
8277         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
8278         pthread_cond_t definition.
8280 2003-03-10  Roland McGrath  <roland@redhat.com>
8282         * sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
8283         * sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
8284         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
8285         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
8286         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
8288         * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
8289         Instead of setting PD->multiple_threads, set globals
8290         __pthread_multiple_threads and __libc_multiple_threads.
8291         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8292         * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
8293         * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
8295         * descr.h (struct pthread): Conditionalize first member on
8296         [!TLS_DTV_AT_TP].  Replace the `header' member with an anonymous union
8297         containing an anonymous tcbhead_t.  Move `list' member out.
8298         [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
8299         * allocatestack.c: Remove use of `header.data.' prefix.
8300         * pthread_create.c: Likewise.
8301         * init.c (__pthread_initialize_minimal_internal): Likewise.
8302         * sysdeps/pthread/createthread.c (create_thread): Likewise.
8303         * sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
8304         (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
8305         * sysdeps/x86_64/tls.h: Likewise.
8306         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
8307         (SINGLE_THREAD_P): Likewise.
8308         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
8309         (SINGLE_THREAD_P): Likewise.
8310         * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
8311         * sysdeps/s390/tls.h (tcbhead_t): Likewise.
8313 2003-03-09  Ulrich Drepper  <drepper@redhat.com>
8315         * sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
8317         * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
8318         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8320         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
8321         leftovers from the ia32 code.
8323         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
8324         memory load.
8325         (clear_once_control): Don't load %esi.
8327         * sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
8328         handling.
8330         * sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
8332         * sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
8333         * sysdeps/unix/sysv/linux/createthread.c: ...here.
8335         * Makefile (tests): Add tst-cond10.
8336         * tst-cond10.c: New file.
8338 2003-03-08  Ulrich Drepper  <drepper@redhat.com>
8340         * tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
8341         * tst-signal3.c (do_test): Likewise.
8342         * tst-sem5.c (do_test): Likewise.
8343         * tst-kill6.c (do_test): Likewise.
8344         * tst-tls3.c (do_test): Likewise.  Include <errno.h>.
8346         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
8347         of inc/dec.
8348         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
8349         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
8350         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
8351         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
8352         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8353         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8354         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8355         Likewise.
8356         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8357         Likewise.
8358         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
8359         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
8360         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8361         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
8362         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
8363         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
8364         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
8365         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
8367         * allocatestack.c (allocate_stack): If mprotect() fails free the
8368         TLS memory.
8370 2003-03-07  Ulrich Drepper  <drepper@redhat.com>
8372         * sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
8374         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
8375         lll_wake_tid.  This was used only to work around kernel limits in
8376         the early days.
8377         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
8378         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
8379         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
8380         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
8382         * init.c (__static_tls_align_m1): Renamed from __static_tls_align.
8383         (__pthread_initialize_minimal_internal): Change initialization of
8384         __static_tls_align_m1 appropriately.
8385         * pthreadP.h (__static_tls_align_m1): Renamed from
8386         __static_tls_align.
8387         * allocatestack.c (allocate_stack): Use __static_tls_align_m1
8388         instead of __static_tls_align-1.
8390 2003-03-04  Ulrich Drepper  <drepper@redhat.com>
8392         * sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
8394         * pthread_create.c: Define __pthread_keys using nocommon
8395         attribute, not by placing it explicitly in bss.
8396         Remove DEFINE_DEALLOC definition.  Not needed anymore.
8398         * allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
8399         Use it in mmap call to allocate stacks.
8401         * sysdeps/pthread/createthread.c (create_thread): Fix comment.
8403         * pthread_create.c (start_thread): Use THREAD_SETMEM to store
8404         result of the thread function.
8406 2003-03-03  Ulrich Drepper  <drepper@redhat.com>
8408         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed.  The generic
8409         version is just fine.
8411         * sysdeps/unix/sysv/linux/libc_pthread_init.c
8412         (__pthread_child_handler): Renamed from pthread_child_handler,
8413         exported, and marked hidden.  Change all users.
8414         * sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
8415         free __pthread_child_handler from child list.
8417 2003-03-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8419         * atomic.h (atomic_exchange_and_add): Return newval, not oldval.
8421         * sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
8422         Fix handling of cancellation and failing pthread_mutex_unlock call.
8423         * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
8424         (__pthread_cond_wait): Likewise.
8426         * sysdeps/pthread/pthread_rwlock_timedrdlock.c
8427         (pthread_rwlock_timedrdlock): Fix clobber of result variable by
8428         lll_futex_timed_wait call.
8429         * sysdeps/pthread/pthread_rwlock_timedwrlock.c
8430         (pthread_rwlock_timedwrlock): Likewise.
8432         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
8433         Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
8434         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
8436         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
8437         check of lll_futex_wake return value.
8439 2003-03-03  Roland McGrath  <roland@redhat.com>
8441         * forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
8443         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8444         Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
8445         * sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
8447 2003-03-02  Ulrich Drepper  <drepper@redhat.com>
8449         * sysdeps/pthread/timer_create.c (timer_create): Return correct
8450         error for CPU clocks.
8452         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
8453         _POSIX_MONOTONIC_CLOCK.
8454         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
8456         * tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
8457         recent kernels.
8459 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8461         * descr.h (struct pthread): Move cleanup field to the front.
8463 2003-03-01  Roland McGrath  <roland@redhat.com>
8465         * sem_open.c (sem_open): Braino fix.
8467 2003-03-01  Ulrich Drepper  <drepper@redhat.com>
8469         * sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
8470         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
8471         __pthread_cleanup_pop functionality.
8472         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8474         * descr.h (struct pthread): Move tid field to the front now that
8475         it is often used.
8477         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
8478         (__lll_mutex_timedlock_wait): Remove.
8479         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8480         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
8481         (__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
8482         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
8483         (lll_unlock_wake_cb): Don't save and restore %esi.
8484         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8485         %esi.
8486         (__lll_timedwait_tid): Add alignment.
8487         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
8488         (__lll_unlock_wake): Add alignment.  Don't save, load, and restore
8489         %esi.
8490         (__lll_timedwait_tid): Removed.
8491         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
8492         (__pthread_cond_broadcast): Don't save, load, and restore %esi.
8493         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
8494         (pthread_barrier_wait): Don't save, load, and restore %esi for
8495         last thread.
8496         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
8497         (__pthread_cond_signal): Don't save, load, and restore %esi.
8498         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
8499         (__pthread_rwlock_unlock): Don't save, load, and restore %esi.
8500         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
8501         Don't save, load, and restore %esi.
8503 2003-02-27  Ulrich Drepper  <drepper@redhat.com>
8505         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
8506         Release lock before waking up the waiters.
8508         * tst-exit1.c (do_test): Don't start more than one thread in parallel.
8510         * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
8511         (reader_thread): Likewise.
8513         * sysdeps/pthread/pthread_rwlock_unlock.c
8514         (__pthread_rwlock_unlock): Release internal lock early.  Don't try
8515         to wake up readers if there are none.
8517         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
8518         Release internal lock before wake threads.
8520 2003-02-26  Ulrich Drepper  <drepper@redhat.com>
8522         * Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
8523         * tst-rwlock8.c: Initialize lock with INIT.  Allow INIT to be
8524         predefined.
8525         * tst-rwlock9.c: Likewise.
8526         * tst-rwlock10.c: New file.
8527         * tst-rwlock11.c: New file.
8529         * Makefile (tests): Add tst-dlsym1.
8530         * tst-dlsym1.c: New file.
8532         * init.c (__pthread_initialize_minimal_internal): Set
8533         GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
8534         * Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
8536 2003-02-24  Ulrich Drepper  <drepper@redhat.com>
8538         * sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
8540         * tst-cond2.c: Fix sychronization with child.
8542         * tst-rwlock8.c (reader_thread): Remove unused variable.
8544         * Makefile: Add rules to build and run tst-tls3.
8545         * tst-tls3.c: New file.
8546         * tst-tls3mod.c: New file.
8548         * Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
8549         * tst-rwlock8.c: New file.
8550         * tst-rwlock9.c: New file.
8551         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
8552         complete broken rwlock implementation.
8553         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8554         Likewise.
8555         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8556         Likewise.
8557         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
8558         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
8559         * sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
8560         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
8561         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
8562         * sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
8563         * sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
8565 2003-02-23  Roland McGrath  <roland@redhat.com>
8567         * Makefile (nptl-version): Change regexp so case sensitivity is ok.
8569 2003-02-23  Ulrich Drepper  <drepper@redhat.com>
8571         * Makefile (tests): Add tst-context1.
8572         * tst-context1.c: New file.
8574         * Makefile (tests): Add tst-tls1 and tst-tls2.
8575         * tst-tls1.c: New file.
8576         * tst-tls2.c: New file.
8578         * libc-cancellation.c (__libc_enable_asynccancel): Correct test
8579         for failed cmpxchg.
8581         * pthread_create.c (start_thread): Set EXITING_BIT early.
8583         * sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
8584         (THREAD_GETMEM_NC): Likewise.
8586 2003-02-22  Ulrich Drepper  <drepper@redhat.com>
8588         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
8589         off 3 more bytes by using offset-less instructions when possible.
8591         * Makefile: Add dependency for $(objpfx)version.d.
8593         * eintr.c (eintr_source): Add unnecessary return but the compiler
8594         insists.
8596         * tst-kill3.c: Include <unistd.h>.
8598 2003-02-21  Roland McGrath  <roland@redhat.com>
8600         * pthread_create.c (start_thread): Call __libc_thread_freeres.
8602 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8604         * Makefile (tests): Add tst-eintr1.
8605         (distribute): Add eintr.c.
8606         * tst-eintr1.c: New file.
8607         * eintr.c: New file.
8609         * pthread_cancel.c (pthread_cancel): Use tkill directly.
8611         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
8612         Disallow sending SIGCANCEL.
8614         * Makefile (tests): Remove tst-basic7.  Add tst-kill1, tst-kill2,
8615         tst-kill3, tst-kill4, tst-kill5, tst-kill6.
8616         * tst-kill1.c: New file.
8617         * tst-kill2.c: New file.
8618         * tst-kill3.c: New file.
8619         * tst-kill5.c: New file.
8620         * tst-kill6.c: New file.
8621         * tst-basic7.c: Renamed to...
8622         * tst-kill4.c: ...this.
8624 2003-02-21  Roland McGrath  <roland@redhat.com>
8626         * Makefile (install-lib-ldscripts): New variable.
8628 2003-02-21  Ulrich Drepper  <drepper@redhat.com>
8630         * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
8631         * pthread_cancel.c: Use INVALID_TD_P.
8632         * pthread_detach.c: Likewise.
8633         * pthread_getschedparam.c: Likewise.
8634         * pthread_setschedparam.c: Likewise.
8635         * sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
8636         * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
8637         * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
8638         * pthread_timedjoin.c: Likewise.
8640         * tst-basic7.c: Include <signal.h>.
8642         * pthread_join.c (pthread_join): Limited checking for invalid
8643         descriptors.
8644         * pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
8646 2003-02-20  Ulrich Drepper  <drepper@redhat.com>
8648         * pthread_create.c (deallocate_tsd): Reset found_nonzero at the
8649         beginning of the loop.  Clear the entire first block of TSD.
8650         * Makefile (tests): Add tst-key4.
8651         * tst-key4.c: New file.
8653 2003-02-18  Ulrich Drepper  <drepper@redhat.com>
8655         * Makefile (tests): Add tst-basic7.
8656         * tst-basic7.c: New file.
8658         * pthread_create.c (deallocate_tsd): Mark as internal_function.
8659         Add some more __builtin_expect.
8661         * pthreadP.h: Define dummy version of DEBUGGING_P.
8663 2003-02-17  Ulrich Drepper  <drepper@redhat.com>
8665         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
8666         _POSIX_THREAD_PRIORITY_SCHEDULING.
8667         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
8668         _XOPEN_REALTIME_THREADS.
8669         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
8671         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
8672         kernel returns EINVAL for PID <= 0, work around it.
8674         * Makefile (tests): Add tst-signal5.
8675         * tst-signal5.c: New file.
8677         * sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
8678         and LOGIN_NAME_MAX.
8680         * tst-cancel1.c (tf): Block all signals.
8682         * Makefile (tests): Add tst-basic6.
8683         * tst-basic6.c: New file.
8685         * tst-basic1.c: Add test for process ID.
8687         * Makefile (tests): Add tst-cancel10.
8688         * tst-cancel10.c: New file.
8690         * Makefile (tests): Add tst-signal4.
8691         * tst-signal4.c: New file.
8693         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
8694         __sigismember instead of sigismember.  Add __builtin_expect.
8696 2003-02-16  Ulrich Drepper  <drepper@redhat.com>
8698         * tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
8699         pthread_setcancelstate, and pthread_rwlock_setpshared.
8701         * tst-cancel7.c (do_test): Make sure the pid file exists before
8702         canceling the thread.
8704         * tst-rwlock6.c: More pthread_rwlock_timedwrlock and
8705         pthread_rwlock_timedrdlock tests.
8706         * tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
8707         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
8708         Check for invalid tv_nsec field.
8709         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
8710         Likewise.
8712         * pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
8713         recursive mutex of overflow.
8715         * tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
8717         * libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
8718         going into an endless loop.
8719         * Makefile (tests): Add tst-cancel9.
8720         * tst-cancel9.c: New file.
8722         * pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
8724 2003-02-15  Ulrich Drepper  <drepper@redhat.com>
8726         * tst-mutex5.c (do_test): Add more timedlock tests.
8728         * tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
8729         * tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
8731         * sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
8732         use INLINE_SYSCALL.  Error number is returned, not -1.
8734         * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
8735         and __deallocate_stack with internal_function.
8736         * pthread_create.c: Adjust definitions appropriately.
8737         * allocatestack.c: Likewise.
8739         * pthread_join.c: Add one more __builtin_expect.
8740         * pthread_timedjoin.c: Likewise.
8742         * pthread_getspecific.c (__pthread_getspecific): Clear data->data
8743         not data of sequence number does not match.
8744         Add one __builtin_expect.
8746         * Makefile (tests): Add tst-clock1.
8747         * tst-clock1.c: New file.
8749         * pthread_setconcurrency.c (pthread_setconcurrency): Fail for
8750         negative arguments.
8751         * Makefile (tests): Add tst-basic5.
8752         * tst-basic5.c: New file.
8754 2003-02-14  Ulrich Drepper  <drepper@redhat.com>
8756         * Makefile (tests): Add tst-basic4.
8757         * tst-basic4.c: New file.
8759         * pthreadP.h: Add declaraction for __nptl_nthreads.
8760         * pthread_create.c: Define __nptl_nthreads
8761         (start_thread): Increment __nptl_nthreads at beginning.  Decrement
8762         after thread is done.  If then zero, call exit(0).
8763         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
8764         Add ptr_nthreads.  Define HAVE_PTR_NTHREADS.
8765         * init.c (pthread_functions): Initialize ptr_nthreads.
8766         * allocatestack.c (nptl_nthreads): Remove definition and all uses.
8767         (__reclaim_stacks): Decrement __nptl_nthreads.
8768         * sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
8769         Define.
8770         * Makefile (tests): Add tst-basic3.
8771         * tst-basic3.c: New file.
8773         * descr.h: Define CANCELING_BIT and CANCELING_BITMASK.  Introduce
8774         after CANCELTYPE_BIT, move the other bits up.  Update CANCEL_RESTMASK.
8775         * init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
8776         * pthread_cancel.c (pthread_cancel): Likewise.  Also set CANCELING_BIT
8777         if asynchronous canceling is enabled.
8778         * pthread_join.c (pthread_join): When recognizing circular joins,
8779         take into account the other thread might be already canceled.
8780         * Makefile (tests): Add tst-join5.
8781         * tst-join5.c: New file.
8783         * Makefile (tests): Add tst-join4.
8784         * tst-join4.c: New file.
8786 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
8788         * tst-cond4.c (main): Add test of pthread_attr_getpshared.
8790 2003-02-13  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8792         * sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
8793         THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
8794         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
8795         warning.
8796         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
8797         to avoid warning.
8798         * sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
8799         error if lll_futex_wake failed.
8801 2003-02-13  Ulrich Drepper  <drepper@redhat.com>
8803         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
8804         handling of cancellation and failung pthread_mutex_unlock call.
8805         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8806         * Makefile (tests): Add tst-cond8 and tst-cond9.
8807         * tst-cond8.c: New file.
8808         * tst-cond9.c: New file.
8810         * tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
8812         * sysdeps/pthread/pthread.h: Add missing initializers.  Protect
8813         non-standard initializers with __USE_GNU.
8815         * Makefile (tests): Add tst-cleanup3.
8816         * tst-cleanup3.c: New file.
8818 2003-02-12  Ulrich Drepper  <drepper@redhat.com>
8820         * Makefile (tests): Add tst-attr1 and tst-attr2.
8821         * tst-attr1.c: New file.
8822         * tst-attr2.c: New file.
8824         * Makefile: Add rules to build and run tst-atfork2 test.
8825         * tst-atfork2.c: New file.
8826         * tst-atfork2mod.c: New file.
8828         * sysdeps/unix/sysv/linux/unregister-atfork.c
8829         (__unregister_atfork): Free the memory allocated for the handlers
8830         after removing them from the lists.
8832         * sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
8833         cleanup function.
8835         * tst-atfork1.c (do_test): Wait for the child we forked.
8836         Report error in child.
8838         * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
8840         * sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
8842 2003-02-10  Ulrich Drepper  <drepper@redhat.com>
8844         * Makefile (tests): Add tst-cancel8.
8845         * tst-cancel8.c: New file.
8847         * sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
8848         clearing of control variable.
8849         * Makefile (tests): Add tst-once3 and tst-once4.
8850         * tst-once3.c: New file.
8851         * tst-once4.c: New file.
8853 2003-02-08  kaz Kojima  <kkojima@rr.iij4u.or.jp>
8855         * sysdeps/sh/Makefile: New file.
8856         * sysdeps/sh/bits/atomic.h: New file.
8857         * sysdeps/sh/pthread_spin_init.c: New file.
8858         * sysdeps/sh/pthread_spin_lock.c: New file.
8859         * sysdeps/sh/pthread_spin_trylock.S: New file.
8860         * sysdeps/sh/pthread_spin_unlock.S: New file.
8861         * sysdeps/sh/pthreaddef.h: New file.
8862         * sysdeps/sh/tcb-offsets.sym: New file.
8863         * sysdeps/sh/td_ta_map_lwp2thr.c: New file.
8864         * sysdeps/sh/tls.h: New file.
8865         * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
8866         * sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
8867         * sysdeps/unix/sysv/linux/sh/createthread.c: New file.
8868         * sysdeps/unix/sysv/linux/sh/fork.c: New file.
8869         * sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
8870         * sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
8871         * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
8872         * sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
8873         * sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
8874         * sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
8875         * sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
8876         * sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
8877         * sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
8878         * sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
8879         * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
8880         * sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
8881         * sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
8882         * sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
8883         * sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
8884         * sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
8885         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
8886         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
8887         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
8888         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
8889         * sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
8890         * sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
8891         * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
8892         * sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
8893         * sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
8894         * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
8896 2003-02-08  Ulrich Drepper  <drepper@redhat.com>
8898         * tst-cond2.c: Rearrange code to not rely on behavior undefined
8899         according to POSIX.
8901         * tst-basic2.c (do_test): Lock mutex before creating the thread.
8903 2003-02-07  Ulrich Drepper  <drepper@redhat.com>
8905         * sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
8906         (TLS_GET_FS): New #define.
8907         (TLS_SET_FS): New #define.
8908         Correct value of __NR_set_thread_area.
8910         * sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
8912 2003-02-06  Ulrich Drepper  <drepper@redhat.com>
8914         * Makefile (tests): Add tst-popen1.
8915         * tst-popen1.c: New file.
8917         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
8918         but inactive generalization.
8919         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
8920         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
8921         Minor optimization, remove one instruction.
8922         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
8924 2003-02-04  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8926         * sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
8928 2003-01-31  Martin Schwidefsky  <schwidefsky@de.ibm.com>
8930         * init.c (__NR_set_tid_address): Add #ifdef for s390.
8931         * sysdeps/pthread/pthread_barrier_wait.c: New file.
8932         * sysdeps/pthread/pthread_cond_broadcast.c: New file.
8933         * sysdeps/pthread/pthread_cond_signal.c: New file.
8934         * sysdeps/pthread/pthread_cond_timedwait.c: New file.
8935         * sysdeps/pthread/pthread_cond_wait.c: New file.
8936         * sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
8937         * sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
8938         * sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
8939         * sysdeps/pthread/pthread_rwlock_unlock.c: New file.
8940         * sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
8941         * sysdeps/s390/Makefile: New file.
8942         * sysdeps/s390/bits/atomic.h: New file.
8943         * sysdeps/s390/pthread_spin_init.c: New file.
8944         * sysdeps/s390/pthread_spin_lock.c: New file.
8945         * sysdeps/s390/pthread_spin_trylock.c: New file.
8946         * sysdeps/s390/pthread_spin_unlock.c: New file.
8947         * sysdeps/s390/pthreaddef.h: New file.
8948         * sysdeps/s390/tcb-offsets.sym: New file.
8949         * sysdeps/s390/td_ta_map_lwp2thr.c: New file.
8950         * sysdeps/s390/tls.h: New file.
8951         * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
8952         * sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
8953         * sysdeps/unix/sysv/linux/s390/createthread.c: New file.
8954         * sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
8955         * sysdeps/unix/sysv/linux/s390/fork.c: New file.
8956         * sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
8957         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
8958         * sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
8959         * sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
8960         * sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
8961         * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
8962         * sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
8963         * sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
8964         * sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
8965         * sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
8966         * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
8967         * sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
8968         * sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
8969         * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
8970         * sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
8971         * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
8972         * sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
8973         * sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
8975 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
8977         * atomic.h: Add a couple more default implementations.
8978         (atomic_compare_and_exchange_acq): Use
8979         __arch_compare_and_exchange_32_acq in return value definition.  It
8980         always exists.
8981         (atomic_bit_set): Renamed from atomic_set_bit.
8982         Add missing atomic_ prefixes.
8984         * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
8985         thread library is available, use correct value to mark initialized
8986         once variable.
8988 2003-02-03  Ulrich Drepper  <drepper@redhat.com>
8990         * allocatestack.c (allocate_stack): Use __getpagesize instead of
8991         __sysconf to determine pagesize.
8993         * pthread_create.c: Include <atomic.h>.
8994         * allocatestack.c (allocate_stack): Implement coloring of the
8995         allocated stack memory.  Rename pagesize to pagesize_m1.  It's the
8996         size minus one.  Adjust users.
8997         * sysdeps/i386/i686/Makefile: New file.
8999 2003-02-02  Ulrich Drepper  <drepper@redhat.com>
9001         * allocatestack.c: Improve comment throughout the file.
9003         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
9004         (__lll_lock_wait): Add branch prediction.
9005         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
9006         (__lll_lock_wait): Likewise.
9007         (lll_unlock_wake_cb): Removed.
9009 2003-01-31  Ulrich Drepper  <drepper@redhat.com>
9011         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
9012         _POSIX_THREAD_PRIORITY_SCHEDULING.
9014 2003-01-30  Jakub Jelinek  <jakub@redhat.com>
9016         * sysdeps/pthread/pthread-functions.h (struct pthread_functions):
9017         Fix return type of ptr___pthread_getspecific.
9019 2003-01-29  Ulrich Drepper  <drepper@redhat.com>
9021         * Makefile (tests): Add tst-umask1.
9022         (tst-umask1-ARGS): Define.
9023         * tst-umask1.c: New file.
9025 2003-01-28  Ulrich Drepper  <drepper@redhat.com>
9027         * Makefile (libpthread-routines): Remove lowlevelrwlock.  Add
9028         pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
9029         pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
9030         pthread_rwlock_unlock.
9031         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
9032         * sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
9033         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
9034         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
9035         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
9036         New file.
9037         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
9038         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
9039         New file.
9040         * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
9041         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
9042         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
9043         New file.
9044         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
9045         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
9046         New file.
9047         * sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
9048         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
9049         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
9050         New file.
9051         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
9052         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
9053         New file.
9054         * sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
9056         * Makefile (libpthread-routines): Remove lowlevelcond and
9057         lowlevelsem.  Add sem_wait, sem_trywait, sem_timedwait, sem_post,
9058         pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
9059         and pthread_cond_broadcast.
9060         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
9061         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
9062         * sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
9063         * sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
9064         * sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
9065         * sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
9066         * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
9067         * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
9068         * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
9069         * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
9070         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
9071         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
9072         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
9073         * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
9074         * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
9075         * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
9076         * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
9077         * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
9078         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
9079         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
9080         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
9081         * sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
9082         * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
9083         * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
9084         * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
9085         * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
9086         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
9087         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
9088         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
9089         * sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
9090         * sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
9092         * sysdeps/unix/sysv/linux/i386/createthread.c: Define
9093         PREPARE_CREATE and TLS_VALUE with x86-specific bits.  All the rest
9094         of the code is moved to ...
9095         * sysdeps/pthread/createthread.c: ...here.  New file.
9097 2003-01-27  Ulrich Drepper  <drepper@redhat.com>
9099         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
9100         (__new_sem_post): Clear %eax before returning.
9101         Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
9103         * Makefile (tests): Add tst-cleanup2.
9104         * tst-cleanup2.c: New file.
9106         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
9107         Interpret first parameter correctly.
9109 2003-01-17  Ulrich Drepper  <drepper@redhat.com>
9111         * Makefile (headers): Add bits/semaphore.h.
9113 2003-01-16  Jakub Jelinek  <jakub@redhat.com>
9115         * sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
9116         if not SHARED.
9118 2003-01-14  Ulrich Drepper  <drepper@redhat.com>
9120         * sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
9121         must be used and mapping failed.
9122         Reported by Luke Elliott <luke.elliott@activfinancial.com>.
9124         * Makefile (CFLAGS-pthread_self.os): Define this, not
9125         CFLAGS-pthread_self.c.
9127 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9129         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
9130         lll_unlock_wake_cb.
9132         * Makefile (libpthread-routines): Add version.  Add rules to build
9133         version.os and banner.h.
9134         * version.c: New file.
9136 2003-01-13  Jakub Jelinek  <jakub@redhat.com>
9138         * pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
9139         the alias unconditional.
9140         * pthread_mutex_unlock.c  (__pthread_mutex_unlock_internal): Likewise.
9142 2003-01-13  Ulrich Drepper  <drepper@redhat.com>
9144         * Makefile (CFLAGS-pthread_self.c): New definition.
9146 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9148         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
9149         INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
9150         * sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
9151         * init.c (__pthread_initialize_minimal_internal): Likewise.
9153 2003-01-07  Jakub Jelinek  <jakub@redhat.com>
9155         * pthreadP.h (__pthread_cond_timedwait): Add prototype.
9157         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h
9158         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9159         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9160         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
9161         (RTLD_CORRECT_DYNAMIC_WEAK): Remove.
9162         (DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
9164 2003-01-06  Jakub Jelinek  <jakub@redhat.com>
9166         * pthreadP.h (LIBC_CANCEL_HANDLED): Define.
9167         * pt-system.c (LIBC_CANCEL_HANDLED): Add.
9168         * tst-cancel-wrappers.sh: Remove all exceptions.
9170 2003-01-05  Ulrich Drepper  <drepper@redhat.com>
9172         * tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
9173         features.  Reported by Marijn Ros <marijn@mad.scientist.com>.
9175         * sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
9176         Use __libc_pthread_functions array if SHARED.
9178         * pthreadP.h: Move pthread_cond_2_0_t definition to...
9179         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.
9181         * sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
9182         (__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
9183         __libc_key_create, __libc_getspecific, __libc_setspecific): Use
9184         __libc_ptf_call instead of __libc_maybe_call.
9185         (PTF): New #define.
9186         (__libc_cleanup_region_start): Wrap function name with PTF call.
9187         (__libc_cleanup_region_end): Likewise.
9188         (__libc_cleanup_end): Likewise.
9190         * pthread_getspecific.c: Add __pthread_getspecific_internal alias.
9191         * pthread_setspecific.c: Add __pthread_setspecific_internal alias.
9192         * pthread_key_create.c: Add __pthread_key_create_internal alias.
9193         * pthreadP.h: Add prototypes.
9195         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
9196         __pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
9197         __pthread_rwlock_unlock aliases.
9198         * pthreadP.h: Add prototypes for new aliases.
9200         * pthreadP.h (struct pthead_functions): Moved to...
9201         * sysdeps/pthread/pthread-functions.h: ...here.  New file.
9202         * init.c (pthread_functions): Add initializers for new elements.
9204         * cleanup_defer.c: Add __pthread_cleanup_push_defer and
9205         __pthread_cleanup_pop_restore aliases.
9206         * pthreadP.h: Add prototypes.
9208         * cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
9209         and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
9210         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
9211         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
9212         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
9213         * pthreadP.h: Adjust prototypes and callers.
9215 2003-01-04  Ulrich Drepper  <drepper@redhat.com>
9217         * Makefile (tests): Add tst-cancel7.
9218         (tst-cancel7-ARGS): New variable.
9219         * tst-cancel7.c: New file.
9221         * old_pthread_cond_broadcast.c: Optimize initialization a bit to work
9222         around gcc defficiencies.
9223         * old_pthread_cond_signal.c: Likewise.
9224         * old_pthread_cond_timedwait.c: Likewise.
9225         * old_pthread_cond_wait.c: Likewise.
9227         * pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
9229 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9231         * Makefile (tests): Add tst-cond7.
9232         * tst-cond7.c: New file.
9234         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9235         (condvar_cleanup): Get condvar address from the right place.
9237         * atomic.h: Correct definitions of atomic_full_barrier,
9238         atomic_read_barrier, atomic_write_barrier.
9240         * old_pthread_cond_broadcast.c: Make memory allocate and initialization
9241         race-free.
9242         * old_pthread_cond_signal.c: Likewise.
9243         * old_pthread_cond_timedwait.c: Likewise.
9244         * old_pthread_cond_wait.c: Likewise.
9246 2003-01-03  Jakub Jelinek  <jakub@redhat.com>
9248         * Makefile ($(objpfx)libpthread.so): Depend on ld.so.
9250 2003-01-03  Ulrich Drepper  <drepper@redhat.com>
9252         * pthreadP.h (pthread_cond_2_0_t): New type.
9253         (struct pthread_functions): Use new type for 2.0 condvar callbacks.
9254         Use new type for the 2.0 condvar function prototypes.
9255         * forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
9256         * old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
9257         parameter.
9258         * old_pthread_cond_destroy.c: Likewise.
9259         * old_pthread_cond_broadcast.c: Likewise.  Lock appropriately.
9260         * old_pthread_cond_signal.c: Likewise.
9261         * old_pthread_cond_timedwait.c: Likewise.
9262         * old_pthread_cond_wait.c: Likewise.
9264         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
9265         (__pthread_cond_wait): Don't save cancellation mode and seq value
9266         in same location.
9268         * herrno.c (__h_errno_location): Don't define as weak.
9270 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9272         * Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
9273         pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
9274         and pthread_cond_wait.
9275         * old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
9276         Renamed to...
9277         (__pthread_cond_broadcast_2_0): ... this.
9278         * old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
9279         Renamed to...
9280         (__pthread_cond_destroy_2_0): ... this.
9281         * old_pthread_cond_init.c (__old_pthread_cond_init):
9282         Renamed to...
9283         (__pthread_cond_init_2_0): ... this.
9284         * old_pthread_cond_signal.c (__old_pthread_cond_signal):
9285         Renamed to...
9286         (__pthread_cond_signal_2_0): ... this.
9287         * old_pthread_cond_wait.c (__old_pthread_cond_wait):
9288         Renamed to...
9289         (__pthread_cond_wait_2_0): ... this.
9290         * pthread_cond_destroy.c: Include shlib-compat.h.
9291         (pthread_cond_destroy): Change strong_alias into versioned_symbol.
9292         * pthread_cond_init.c: Include shlib-compat.h.
9293         (pthread_cond_init): Change strong_alias into versioned_symbol.
9294         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
9295         fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
9296         fields.
9297         (__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
9298         __pthread_cond_init_2_0, __pthread_cond_signal_2_0,
9299         __pthread_cond_wait_2_0): New prototypes.
9300         (__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
9301         __old_pthread_cond_init, __old_pthread_cond_signal,
9302         __old_pthread_cond_wait): Removed.
9303         * init.c: Include shlib-compat.h.
9304         (pthread_functions): Guard ptr___pthread_attr_init_2_0
9305         initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
9306         Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
9307         ptr___pthread_cond_*_2_0 fields.
9308         * forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
9309         pthread_cond_*@GLIBC_2.0 compatibility symbols.
9311         * sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
9312         LIBC_SIGACTION was not yet defined.
9313         [!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
9314         [!defined LIBC_SIGACTION] (__sigaction): New function and
9315         libc_hidden_weak.
9316         [!defined LIBC_SIGACTION] (sigaction): New weak_alias.
9317         [defined LIBC_SIGACTION]: #include_next <sigaction.c>.
9319 2003-01-02  Jakub Jelinek  <jakub@redhat.com>
9321         * Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
9323 2003-01-02  Ulrich Drepper  <drepper@redhat.com>
9325         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
9326         New, larger type definition.
9327         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
9328         implementation.
9329         * Versions [libpthread]: Add definitions for new pthread_cond_*
9330         interfaces for version GLIBC_2.3.2.
9331         * pthread_cond_init.c: Update initialization for new type definition.
9332         * Makefile (libpthread-routines): Remove pthread_cond_wait,
9333         pthread_cond_timedwait, pthread_cond_signal, and
9334         pthread_cond_broadcast.  Add old_pthread_cond_init,
9335         old_pthread_cond_destroy, old_pthread_cond_wait,
9336         old_pthread_cond_timedwait, old_pthread_cond_signal, and
9337         old_pthread_cond_broadcast.
9338         * old_pthread_cond_broadcast.c: New file.
9339         * old_pthread_cond_destroy.c: New file.
9340         * old_pthread_cond_init.c: New file.
9341         * old_pthread_cond_signal.c: New file.
9342         * old_pthread_cond_timedwait.c: New file.
9343         * old_pthread_cond_wait.c: New file.
9344         * pthreadP.h: Add prototypes for the compatibility interfaces.
9346         * pthread_cond_destroy.c: Don't include <errno.h>.
9348 2003-01-01  Ulrich Drepper  <drepper@redhat.com>
9350         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
9351         unnecessary zero offset when addressing MUTEX.
9353 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9355         * sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
9356         __register_atfork.
9357         * sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
9358         for __register_atfork.
9360 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9362         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
9363         instead of ASSEMBLER test macro.
9365         * sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
9366         __libc_current_sigrtmax): Add libc_hidden_def.
9368         * sysdeps/pthread/list.h: Remove assert.h include.
9370 2002-12-31  Ulrich Drepper  <drepper@redhat.com>
9372         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
9373         __pthread_initialize_minimal_internal not
9374         __pthread_initialize_minimal.
9376 2002-12-30  Ulrich Drepper  <drepper@redhat.com>
9378         * sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
9379         __pthread_initialize_minimal as hidden.
9381         * init.c (__pthread_initialize_minimal_internal): Don't mark as
9382         constructor.
9384 2002-12-31  Jakub Jelinek  <jakub@redhat.com>
9386         * Makefile ($(inst_libdir)/libpthread.so): Depend on
9387         $(common-objpfx)format.lds, include that into the output script.
9388         Fix comment.
9389         (extra-B-pthread.so): Change linuxthreads/ into nptl/.
9391 2002-12-28  Andreas Jaeger  <aj@suse.de>
9393         * sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
9394         nsec resolution changes.
9395         (xstat64_conv): Likewise.
9396         (xstat32_conv): Likewise.
9397         * sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
9398         struct kernel_stat.
9399         * sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
9400         structs stat and stat64.
9401         * time/time.h (__timespec_defined): Define for __USE_MISC.
9402         * io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
9404 2002-12-30  Jakub Jelinek  <jakub@redhat.com>
9406         * forward.c (FORWARD2): Renamed from FORWARD3.  Remove unused export
9407         argument.
9408         (pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
9409         (pthread_exit): Use strong_alias to avoid warnings.
9410         * pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
9411         and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
9412         ptr___pthread_attr_init_2_*.
9413         * init.c (pthread_functions): Adjust.
9415 2002-12-29  Ulrich Drepper  <drepper@redhat.com>
9417         * forward.c: Make all functions available by default again.  It
9418         caused too much trouble.
9420         * pt-siglongjmp.c: Removed.
9422 2002-12-28  Jakub Jelinek  <jakub@redhat.com>
9424         * sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
9425         (SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
9426         * sysdeps/i386/Makefile: New file.
9427         * sysdeps/i386/tcb-offsets.sym: New file.
9428         * sysdeps/pthread/tcb-offsets.h: New file.
9429         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9430         Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
9432         * sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
9433         __register_atfork...
9434         (GLIBC_2.3.2): ...here.
9436 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9438         * sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
9439         pthread_attr_setstackaddr with __attribute_deprecated__.
9441 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9443         * pt-system.c (system): Remove cancellation handling.
9444         * tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
9445         cancellation routines.
9447 2002-12-28  Ulrich Drepper  <drepper@redhat.com>
9449         * descr.h: Include <dl-sysdep.h>.
9450         (struct pthread): Move header.data.list to the back of the struct.
9451         * sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
9452         (MULTIPLE_THREADS_OFFSET): Adjust offset.
9453         (SYSINFO_OFFSEET): Likewise.
9455 2002-12-27  Jakub Jelinek  <jakub@redhat.com>
9457         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
9458         Define.
9459         (DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
9460         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
9461         DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
9462         (USE_DL_SYSINFO): Undef.
9464 2002-12-22  Jakub Jelinek  <jakub@redhat.com>
9466         * Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
9467         $(common-objpfx)libc.so.
9468         * tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
9469         it is bigger than pipe buffer size even on arches with bigger
9470         page size.
9471         (tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
9473 2002-12-25  Ulrich Drepper  <drepper@redhat.com>
9475         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
9476         correct errno access for case that USE___THREAD is not defined.
9478 2002-12-24  Ulrich Drepper  <drepper@redhat.com>
9480         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
9481         Patch by Marijn Ros <marijn@mad.scientist.com>.
9483 2002-12-22  Roland McGrath  <roland@redhat.com>
9485         * Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
9487 2002-12-20  Ulrich Drepper  <drepper@redhat.com>
9489         * sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
9491 2002-12-19  Ulrich Drepper  <drepper@redhat.com>
9493         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
9494         NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
9495         * sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
9497         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
9498         of int $0x80.
9499         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9500         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
9501         * sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
9502         * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
9503         * sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
9504         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
9505         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
9506         * sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
9508         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
9509         sysenter.
9510         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
9512         * sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
9514         * allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
9515         in new TCB.
9516         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
9517         that sysinfo is properly initialized.
9518         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
9519         to 1 only for ld.so.
9521         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
9522         RTLD_CORRECT_DYNAMIC_WEAK.
9524 2002-12-19  Jakub Jelinek  <jakub@redhat.com>
9526         * forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
9527         Use return 0 as 6th argument to FORWARD4.
9528         * pthread_equal.c: Include pthreadP.h instead of pthread.h.
9530 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9532         * descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
9533         * sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
9534         Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
9535         (INIT_SYSINFO): New #define.
9536         (TLS_TP_INIT): Use INIT_SYSINFO.
9537         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9538         At test to make sure SYSINFO_OFFSET value is correct.
9539         * sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
9541 2002-12-18  Jakub Jelinek  <jakub@redhat.com>
9543         * sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
9544         * sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
9545         * Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
9546         [libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
9547         __pthread_rwlock_destroy, __pthread_rwlock_rdlock,
9548         __pthread_rwlock_wrlock, __pthread_rwlock_unlock,
9549         __pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
9551 2002-12-18  Ulrich Drepper  <drepper@redhat.com>
9553         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
9554         macro instead of using int $0x80 directly.
9556         * sysdeps/pthread/bits/stdio-lock.h: New file.
9557         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
9558         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
9559         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
9560         * Makefile (routines): Add libc-lowlevelmutex.
9562         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
9563         __i686.get_pc_thunk.dx.
9565 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9567         * Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
9568         (tests): Depend on $(objpfx)tst-cancel-wrappers.out.
9569         ($(objpfx)tst-cancel-wrappers.out): New rule.
9570         * tst-cancel-wrappers.sh: New test.
9571         * tst-locale1.c: Include signal.h.
9572         (uselocale): Test static linking of __libc_current_sigrt*.
9574 2002-12-17  Ulrich Drepper  <drepper@redhat.com>
9576         * Makefile (tests): Add tst-cancel6.
9577         * tst-cancel6.c: New file
9579 2002-12-17  Jakub Jelinek  <jakub@redhat.com>
9581         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
9582         Define meaningfully for assembler as well.
9583         * pthreadP.h (struct pthread_functions): Remove
9584         ptr_pthread_attr_init field.  Add ptr_pthread_attr_init_2_0
9585         and ptr_pthread_attr_init_2_1 fields.
9586         * init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
9587         and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
9588         * forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
9589         (FORWARD3): Define using FORWARD4.
9590         (pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
9591         versions.
9592         * pt-system.c: Remove duplicate stdlib.h include.
9594 2002-12-16  Ulrich Drepper  <drepper@redhat.com>
9596         * sem_init.c: Define sem_init@GLIBC_2.0.
9597         * sem_destroy.c: Define sem_destroy@GLIBC_2.0.
9598         * sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
9600         * flockfile.c: Moved to...
9601         * sysdeps/pthread/flockfile.c: ...here.  New file.
9602         * funlockfile.c: Moved to...
9603         * sysdeps/pthread/funlockfile.c: ...here.  New file.
9604         * ftrylockfile.c: Moved to...
9605         * sysdeps/pthread/ftrylockfile.c: ...here.  New file.
9607 2002-12-16  Jakub Jelinek  <jakub@redhat.com>
9609         * libc-cancellation.c: Guard both function with
9610         #if !defined NOT_IN_libc.
9611         * Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
9612         automatically provided pthread wrappers.
9613         * pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
9614         CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
9615         nor in libpthread.
9616         * pt-open.c: Removed.
9617         * pt-fcntl.c: Removed.
9618         * pt-fsync.c: Removed.
9619         * pt-lseek.c: Removed.
9620         * pt-msgrcv.c: Removed.
9621         * pt-msgsnd.c: Removed.
9622         * pt-msync.c: Removed.
9623         * pt-nanosleep.c: Removed.
9624         * pt-open64.c: Removed.
9625         * pt-pause.c: Removed.
9626         * pt-pread.c: Removed.
9627         * pt-pread64.c: Removed.
9628         * pt-pwrite.c: Removed.
9629         * pt-pwrite64.c: Removed.
9630         * pt-read.c: Removed.
9631         * pt-recv.c: Removed.
9632         * pt-recvfrom.c: Removed.
9633         * pt-recvmsg.c: Removed.
9634         * pt-send.c: Removed.
9635         * pt-sendto.c: Removed.
9636         * pt-sigtimedwait.c: Removed.
9637         * pt-sigwait.c: Removed.
9638         * pt-wait.c: Removed.
9639         * pt-waitpid.c: Removed.
9640         * pt-write.c: Removed.
9641         * pt-accept.c: Removed.
9642         * pt-close.c: Removed.
9643         * pt-connect.c: Removed.
9644         * pt-lseek64.c: Removed.
9645         * pt-sendmsg.c: Removed.
9646         * pt-tcdrain.c: Removed.
9648 2002-12-15  Ulrich Drepper  <drepper@redhat.com>
9650         * init.c (__pthread_initialize_minimal_internal): Renamed from
9651         __pthread_initialize_minimal.  Make old name an alias.  This
9652         converts a normal relocation into a relative relocation.
9654         * pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
9656         * Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
9657         readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
9658         * Makefile (libpthread-routines): Remove pt-creat, pt-poll,
9659         pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
9660         pt-sigwaitinfo, pt-waitid, and pt-writev.
9661         * pt-creat.c: Removed.
9662         * pt-poll.c: Removed.
9663         * pt-pselect.c: Removed.
9664         * pt-readv.c: Removed.
9665         * pt-select.c: Removed.
9666         * pt-sigpause.c: Removed.
9667         * pt-sigsuspend.c: Removed.
9668         * pt-sigwaitinfo.c: Removed.
9669         * pt-waitid.c: Removed.
9670         * pt-writev.c: Removed.
9672         * init.c (pthread_functions): New variable.
9673         (__pthread_initialize_minimal): Pass pointer to pthread_functions
9674         (or NULL) to __libc_pthread_init.
9675         * forward.c: Rewrite to use __libc:pthread_functions array to get
9676         function addresses.
9677         * sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
9678         prototype.
9679         * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
9680         Take new parameter.  Copy content of variable pointed to by it
9681         to __libc_pthread_init.
9683         * pthreadP.h (struct pthread_functions): New type.
9684         (__libc_pthread_init): Declare.
9686         * pthread_attr_destroy.c: Add namespace protected alias.
9687         * pthread_attr_getdetachstate.c: Likewise.
9688         * pthread_attr_getinheritsched.c: Likewise.
9689         * pthread_attr_getschedparam.c: Likewise.
9690         * pthread_attr_getschedpolicy.c: Likewise.
9691         * pthread_attr_getscope.c: Likewise.
9692         * pthread_attr_setdetachstate.c: Likewise.
9693         * pthread_attr_setinheritsched.c: Likewise.
9694         * pthread_attr_setschedparam.c: Likewise.
9695         * pthread_attr_setschedpolicy.c: Likewise.
9696         * pthread_attr_setscope.c: Likewise.
9697         * pthread_cond_broadcast.c: Likewise.
9698         * pthread_cond_destroy.c: Likewise.
9699         * pthread_cond_init.c: Likewise.
9700         * pthread_cond_signal.c: Likewise.
9701         * pthread_cond_wait.c: Likewise.
9702         * pthread_condattr_destroy.c: Likewise.
9703         * pthread_condattr_init.c: Likewise.
9704         * pthread_equal.c: Likewise.
9705         * pthread_exit.c: Likewise.
9706         * pthread_getschedparam.c: Likewise.
9707         * pthread_self.c: Likewise.
9708         * pthread_setcancelstate.c: Likewise.
9709         * pthread_setschedparam.c: Likewise.
9710         * pthread_mutex_destroy.c: Likewise.
9711         * pthread_mutex_init.c: Likewise.
9712         * pthreadP.h: Add prototypes for the aliases.
9714         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
9715         multiple_threads member in correct TCB to 1.
9717         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
9718         SINGLE_THREAD_P.  If in libc or libpthread examine multiple_thread
9719         member of thread decriptor, otherwise return unconditionally 1.
9721 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9723         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
9724         regular Linux version.  Remove file.
9725         * sysdeps/unix/sysv/linux/connect.S: Likewise.  Remove file.
9726         * sysdeps/unix/sysv/linux/llseek.c: Likewise.  Remove file.
9727         * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.  Remove file.
9728         * sysdeps/unix/sysv/linux/msgsnd.c: Likewise.  Remove file.
9729         * sysdeps/unix/sysv/linux/open64.c: Likewise.  Remove file.
9730         * sysdeps/unix/sysv/linux/poll.c: Likewise.  Remove file.
9731         * sysdeps/unix/sysv/linux/pread.c: Likewise.  Remove file.
9732         * sysdeps/unix/sysv/linux/pread64.c: Likewise.  Remove file.
9733         * sysdeps/unix/sysv/linux/pselect.c: Likewise.  Remove file.
9734         * sysdeps/unix/sysv/linux/pwrite.c: Likewise.  Remove file.
9735         * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.  Remove file.
9736         * sysdeps/unix/sysv/linux/readv.c: Likewise.  Remove file.
9737         * sysdeps/unix/sysv/linux/recv.S: Likewise.  Remove file.
9738         * sysdeps/unix/sysv/linux/recvfrom.S: Likewise.  Remove file.
9739         * sysdeps/unix/sysv/linux/recvmsg.S: Likewise.  Remove file.
9740         * sysdeps/unix/sysv/linux/send.S: Likewise.  Remove file.
9741         * sysdeps/unix/sysv/linux/sendmsg.S: Likewise.  Remove file.
9742         * sysdeps/unix/sysv/linux/sendto.S: Likewise.  Remove file.
9743         * sysdeps/unix/sysv/linux/sigpause.c: Likewise.  Remove file.
9744         * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.  Remove file.
9745         * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.  Remove file.
9746         * sysdeps/unix/sysv/linux/sigwait.c: Likewise.  Remove file.
9747         * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.  Remove file.
9748         * sysdeps/unix/sysv/linux/system.c: Likewise.  Remove file.
9749         * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.  Remove file.
9750         * sysdeps/unix/sysv/linux/wait.c: Likewise.  Remove file.
9751         * sysdeps/unix/sysv/linux/waitid.c: Likewise.  Remove file.
9752         * sysdeps/unix/sysv/linux/waitpid.c: Likewise.  Remove file.
9753         * sysdeps/unix/sysv/linux/writev.c: Likewise.  Remove file.
9754         * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.  Remove file.
9756 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9758         * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
9759         * sysdeps/unix/sysv/linux/open.c: Removed.
9760         * sysdeps/unix/sysv/linux/fsync.c: Removed.
9761         * sysdeps/unix/sysv/linux/lseek.c: Removed.
9762         * sysdeps/unix/sysv/linux/msync.c: Removed.
9763         * sysdeps/unix/sysv/linux/read.c: Removed.
9764         * sysdeps/unix/sysv/linux/close.c: Removed.
9765         * sysdeps/unix/sysv/linux/creat.c: Removed.
9766         * sysdeps/unix/sysv/linux/nanosleep.c: Removed.
9767         * sysdeps/unix/sysv/linux/pause.c: Removed.
9768         * sysdeps/unix/sysv/linux/select.c: Removed.
9769         * sysdeps/unix/sysv/linux/write.c: Removed.
9771 2002-12-14  Ulrich Drepper  <drepper@redhat.com>
9773         * sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
9774         element in TCB to see whether locking is needed.
9776         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
9777         MULTIPLE_THREADS_OFFSET value is correct.
9779         * sysdeps/unix/sysv/linux/close.c: New file.
9780         * sysdeps/unix/sysv/linux/connect.S: New file.
9781         * sysdeps/unix/sysv/linux/creat.c: New file.
9782         * sysdeps/unix/sysv/linux/fsync.c: New file.
9783         * sysdeps/unix/sysv/linux/llseek.c: New file.
9784         * sysdeps/unix/sysv/linux/lseek.c: New file.
9785         * sysdeps/unix/sysv/linux/msgrcv.c: New file.
9786         * sysdeps/unix/sysv/linux/msgsnd.c: New file.
9787         * sysdeps/unix/sysv/linux/msync.c: New file.
9788         * sysdeps/unix/sysv/linux/nanosleep.c: New file.
9789         * sysdeps/unix/sysv/linux/open.c: New file.
9790         * sysdeps/unix/sysv/linux/open64.c: New file.
9791         * sysdeps/unix/sysv/linux/pause.c: New file.
9792         * sysdeps/unix/sysv/linux/poll.c: New file.
9793         * sysdeps/unix/sysv/linux/pread.c: New file.
9794         * sysdeps/unix/sysv/linux/pread64.c: New file.
9795         * sysdeps/unix/sysv/linux/pselect.c: New file.
9796         * sysdeps/unix/sysv/linux/pwrite.c: New file.
9797         * sysdeps/unix/sysv/linux/pwrite64.c: New file.
9798         * sysdeps/unix/sysv/linux/readv.c: New file.
9799         * sysdeps/unix/sysv/linux/recv.S: New file.
9800         * sysdeps/unix/sysv/linux/recvfrom.S: New file.
9801         * sysdeps/unix/sysv/linux/recvmsg.S: New file.
9802         * sysdeps/unix/sysv/linux/select.c: New file.
9803         * sysdeps/unix/sysv/linux/send.S: New file.
9804         * sysdeps/unix/sysv/linux/sendmsg.S: New file.
9805         * sysdeps/unix/sysv/linux/sendto.S: New file.
9806         * sysdeps/unix/sysv/linux/sigpause.c: New file.
9807         * sysdeps/unix/sysv/linux/sigsuspend.c: New file.
9808         * sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
9809         * sysdeps/unix/sysv/linux/sigwait.c: New file.
9810         * sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
9811         * sysdeps/unix/sysv/linux/system.c: New file.
9812         * sysdeps/unix/sysv/linux/tcdrain.c: New file.
9813         * sysdeps/unix/sysv/linux/wait.c: New file.
9814         * sysdeps/unix/sysv/linux/waitid.c: New file.
9815         * sysdeps/unix/sysv/linux/waitpid.c: New file.
9816         * sysdeps/unix/sysv/linux/writev.c: New file.
9817         * sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
9819         * pt-readv.c: Fix comment.
9821 2002-12-14  Jakub Jelinek  <jakub@redhat.com>
9823         * tst-cleanup1.c: Include stdlib.h.
9825         * tst-cancel5.c: New test.
9826         * Makefile (tests): Add tst-cancel5.
9827         (tst-cancel5): Link against libc.so libpthread.so in that order.
9829 2002-12-13  Ulrich Drepper  <drepper@redhat.com>
9831         * forward.c (test_loaded): Prevent recursive calls.
9833         * Makefile (routines): Add libc-cancellation.
9834         * libc-cancellation.c: New file.
9835         * descr.h (struct pthread): Add multiple_threads field.
9836         * allocatestack.c (allocate_stack): Initialize multiple_header field of
9837         new thread descriptor to 1.
9838         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
9839         Initialize multiple_thread field after successful thread creation.
9840         * cancellation.c (__do_cancel): Move to pthreadP.h.
9841         (__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
9842         (__pthread_disable_asynccancel): Add internal_function attribute.
9843         * init.c (sigcancel_handler): Remove parameter from __do_cancel call.
9844         * pthread_setcancelstate.c: Likewise.
9845         * pthread_setcanceltype.c: Likewise.
9846         * pthread_exit.c: Likewise.
9847         * pthreadP.h (CANCELLATION_P): Likewise.
9848         (__do_cancel): Define as static inline.
9849         (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
9850         (__libc_enable_asynccancel, __libc_disable_asynccancel): New
9851         declarations.
9852         * sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
9853         fields.  Define MULTIPLE_THREADS_OFFSET.
9854         * sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
9855         declaration.
9856         * sysdeps/unix/sysv/linux/accept.S: New file.
9857         * sysdeps/unix/sysv/linux/read.c: New file.
9858         * sysdeps/unix/sysv/linux/write.c: New file.
9859         * sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
9860         * sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
9861         initialization of __libc_locking_needed.
9862         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
9863         __libc_locking_needed, use multiple_threads field in TCB.
9864         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9866 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
9868         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
9869         version.
9870         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
9872         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
9873         access to __libc_locking_needed for PIC.
9875 2002-12-12  Jakub Jelinek  <jakub@redhat.com>
9877         * sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
9878         declare for libc.so.
9879         (__libc_lock_init, __libc_lock_init_recursive): Change into comma
9880         expression.
9881         (__libc_lock_lock): Put into statement expression.
9882         (__libc_lock_unlock): Remove trailing semicolon.
9883         * sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
9885 2002-12-12  Roland McGrath  <roland@redhat.com>
9887         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
9888         "m" constraint to refer to __libc_locking_needed.  Declare it here.
9890 2002-12-12  Ulrich Drepper  <drepper@redhat.com>
9892         * sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
9893         * sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
9894         Initialize __libc_locking_needed.
9895         * init.c (__pthread_initialize_minimal): Call __libc_pthread_init
9896         instead of __register_pthread_fork_handler.
9897         * sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
9898         * sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
9899         fork-gen with libc_pthread_init.
9900         * sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
9901         of __register_pthread_fork_handler.
9902         * sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
9903         of __register_pthread_fork_handler.
9904         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
9905         __libc_locking_needed to determine whether lock prefix can be avoided.
9906         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
9908 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
9910         * Makefile (tests): Add tst-cleanup1.
9911         * tst-cleanup1.c: New file.
9912         * cancellation.c (__cleanup_thread): Removed.
9913         (__do_cancel): Remove call to __cleanup_thread.
9914         * pthreadP.h: Remove __cleanup_thread prorotype.
9916         * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
9917         Remember function and argument even if cancellation handler
9918         function is not available.
9919         (__libc_cleanup_region_end): Execute registered function directly if
9920         pthread functions are not available.
9921         (__libc_cleanup_end): Likewise.
9923         * init.c (__pthread_initialize_minimal): Fix initialization in
9924         static lib by preventing gcc from being too clever.
9926 2002-12-10  Ulrich Drepper  <drepper@redhat.com>
9928         * init.c (__pthread_initialize_minimal): Remove unneccesary
9929         sigaddset call.
9931         * Makefile (tests): We can run tst-locale2 now.
9933 2002-12-09  Ulrich Drepper  <drepper@redhat.com>
9935         * Versions: Remove duplicated sigwait entry.
9937 2002-12-08  Ulrich Drepper  <drepper@redhat.com>
9939         * pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
9940         inside libpthread.
9942         * pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
9944         * pthreadP.h: Declare __pthread_enable_asynccancel and
9945         __pthread_disable_asynccancel.
9946         (CANCEL_ASYNC): Use __pthread_enable_asynccancel.
9947         (CANCEL_RESET): Use __pthread_disable_asynccancel.
9948         * cancellation.c (__pthread_enable_asynccancel): New function.
9949         (__pthread_disable_asynccancel): New function.
9950         * pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
9951         * pt-close.c: Likewise.
9952         * pt-connect.c: Likewise.
9953         * pt-creat.c: Likewise.
9954         * pt-fcntl.c: Likewise.
9955         * pt-fsync.c: Likewise.
9956         * pt-lseek.c: Likewise.
9957         * pt-lseek64.c: Likewise.
9958         * pt-msgrcv.c: Likewise.
9959         * pt-msgsnd.c: Likewise.
9960         * pt-msync.c: Likewise.
9961         * pt-nanosleep.c: Likewise.
9962         * pt-open.c: Likewise.
9963         * pt-open64.c: Likewise.
9964         * pt-pause.c: Likewise.
9965         * pt-poll.c: Likewise.
9966         * pt-pread.c: Likewise.
9967         * pt-pread64.c: Likewise.
9968         * pt-pselect.c: Likewise.
9969         * pt-pwrite.c: Likewise.
9970         * pt-pwrite64.c: Likewise.
9971         * pt-read.c: Likewise.
9972         * pt-readv.c: Likewise.
9973         * pt-recv.c: Likewise.
9974         * pt-recvfrom.c: Likewise.
9975         * pt-recvmsg.c: Likewise.
9976         * pt-select.c: Likewise.
9977         * pt-send.c: Likewise.
9978         * pt-sendmsg.c: Likewise.
9979         * pt-sendto.c: Likewise.
9980         * pt-sigpause.c: Likewise.
9981         * pt-sigsuspend.c: Likewise.
9982         * pt-sigtimedwait.c: Likewise.
9983         * pt-sigwait.c: Likewise.
9984         * pt-sigwaitinfo.c: Likewise.
9985         * pt-system.c: Likewise.
9986         * pt-tcdrain.c: Likewise.
9987         * pt-wait.c: Likewise.
9988         * pt-waitid.c: Likewise.
9989         * pt-waitpid.c: Likewise.
9990         * pt-write.c: Likewise.
9991         * pt-writev.c: Likewise.
9992         * pthread_join.c: Likewise.
9993         * pthread_timedjoin.c: Likewise.
9995         * pt-sigpause.c (sigsuspend): Call __sigsuspend.
9996         (__xpg_sigpause): New function.
9997         * Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
9999 2002-12-07  Ulrich Drepper  <drepper@redhat.com>
10001         * Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
10003         * cleanup.c: Move declarations of _GI_pthread_cleanup_push and
10004         _GI_pthread_cleanup_pop to pthreadP.h.
10006         * ftrylockfile.c: Use _IO_lock_trylock instead of
10007         pthread_mutex_trylock.
10009         * pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
10010         (CANCEL_RESET): Likewise.
10011         (__pthread_setcanceltype_): Declare.
10012         (__pthread_mutex_lock_internal): Declare.
10013         (__pthread_mutex_unlock_internal): Declare.
10014         (__pthread_once_internal): Declare.
10015         (pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
10016         (pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
10018         * pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
10019         and pthread_mutex_unlock.
10020         * pthread_cond_wait.c: Likewise.
10021         * pthread_mutex_lock.c: Use INTDEF to define alias if needed.
10022         * pthread_mutex_unlock.c: Likewise.
10024         * pthread_setcanceltype.c: Add additional alias
10025         __pthread_setcanceltype.
10027         * sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
10028         * sem_open.c (sem_open): Likewise.
10029         Use __libc_open, __libc_write, and __libc_close instead of
10030         open, write, and close respectively.
10032         * sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
10033         Rewrite as statement expression since it must return a value.
10035         * pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
10036         * sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
10037         __pthread_kill.
10039         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
10040         alias __pthread_once_internal.
10042         * sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
10044 2002-12-06  Ulrich Drepper  <drepper@redhat.com>
10046         * Makefile (tests): Add tst-stdio1 and tst-stdio2.
10047         * tst-stdio1.c: New file.
10048         * tst-stdio2.c: New file.
10050         * init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
10052         * Makefile (tests): Comment out tst-locale2 for now.
10053         (CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
10055         * sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
10056         -D_IO_MTSAFE_IO.
10057         * sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
10058         Use _IO_lock_init instead of explicit assignment.
10060         * sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
10061         Define __libc_lock_* and __libc_lock_recursive macros with
10062         lowlevellock macros, not pthread mutexes.
10064         * flockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_lock instead
10065         of pthread_mutex_lock.
10066         * funlockfile.c: Include <bits/stdio-lock.h>.  Use _IO_lock_unlock
10067         instead of pthread_mutex_unlock.
10069 2002-12-06  Roland McGrath  <roland@redhat.com>
10071         * allocatestack.c (__stack_user): Use uninitialized defn.
10072         * init.c (__pthread_initialize_minimal): Initialize it here.
10074 2002-12-05  Roland McGrath  <roland@redhat.com>
10076         * sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
10077         string.
10078         * sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
10080         * sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
10081         missing & here too.
10083 2002-12-05  Ulrich Drepper  <drepper@redhat.com>
10085         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10086         lowlevellock.
10087         * sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
10088         * sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
10089         * sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
10090         * sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
10091         for __libc_lock_* macros.
10092         * Makefile (routines): Add libc-lowlevellock.
10094 2002-10-09  Roland McGrath  <roland@redhat.com>
10096         * sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
10097         Under [__PIC__], call the function via the pointer fetched for
10098         comparison rather than a call by name that uses the PLT.
10099         (__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
10100         (__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
10101         (__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
10102         (__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
10103         (__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
10105 2002-12-04  Roland McGrath  <roland@redhat.com>
10107         * forward.c (pthread_self): Use FORWARD3 macro to correct return type.
10109         * sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
10110         * sysdeps/generic/td_ta_map_lwp2thr.c: New file.
10112         * pthread_create.c (start_thread): Add missing & on __nptl_last_event.
10114 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10116         * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
10117         a completely opaque, non-integer type.
10118         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
10120 2002-12-05  Jakub Jelinek  <jakub@redhat.com>
10122         * sysdeps/i386/tls.h: Include stdlib.h.
10123         * sysdeps/x86_64/tls.h: Likewise.
10125 2002-12-04  Ulrich Drepper  <drepper@redhat.com>
10127         * Makefile (tests): Add tst-locale2.
10128         (tests-static): Likewise.
10129         * tst-locale2.c: New file.
10131         * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
10132         volatile and add memory clobbers to lock operations.
10134 2002-12-03  Ulrich Drepper  <drepper@redhat.com>
10136         * sysdeps/i386/i686/bits/atomic.h: Use i486 version.
10137         * sysdeps/i386/i486/bits/atomic.h: New file.
10138         * sysdeps/i386/i586/bits/atomic.h: New file.
10139         * sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
10140         include i486 version.
10141         * sysdeps/i386/i486/pthread_spin_trylock.S: New file.
10142         * sysdeps/i386/i586/pthread_spin_trylock.S: New file.
10143         Patch by Marijn Ros <marijn@mad.scientist.com>.
10145         * allocatestack.c (get_cached_stack): Don't crash if we first
10146         found a stack with a larger size then needed.
10147         Reported by Hui Huang <hui.huang@sun.com>.
10149         * Makefile (tests): Add tst-sysconf.
10150         * tst-sysconf.c: New file.
10152         * sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
10153         PTHREAD_THREADS_MAX.
10155 2002-12-02  Roland McGrath  <roland@redhat.com>
10157         * pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
10158         Declare using hidden_proto instead of attribute_hidden, so there are
10159         non-.hidden static symbols for gdb to find.
10160         (__pthread_keys): Likewise.
10161         * events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
10162         * allocatestack.c (__stack_user): Likewise.
10163         * pthread_create.c (__pthread_keys): Likewise.
10164         (__nptl_threads_events, __nptl_last_event): Make these static instead
10165         of hidden.
10166         * pthread_key_create.c (__pthread_pthread_keys_max,
10167         __pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
10169 2002-12-02  Ulrich Drepper  <drepper@redhat.com>
10171         * Makefile (tests): Add tst-locale1.  If buid-static is yes link
10172         statically.
10173         * tst-locale1.c: New file.
10175         * pthread_cond_timedwait.c: Include <stdlib.h>.
10177         * Makefile (tests): Add tst-fork2 and tst-fork3.
10178         * tst-fork2.c: New file.
10179         * tst-fork3.c: New file.
10181 2002-11-28  Ulrich Drepper  <drepper@redhat.com>
10183         * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
10185         * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
10186         require it to 200112L.
10188         * sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
10189         instruction only if HAVE_CMOV is defined.
10190         * sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
10192         * sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
10194         * sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
10196         * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
10198         * sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
10200 2002-11-27  Ulrich Drepper  <drepper@redhat.com>
10202         * sysdeps/x86_64/bits/atomic.h: New file.
10204         * sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
10205         16-bit operations.
10207         * sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
10208         possible since gettid cannot fail.
10210         * sysdeps/x86_64/pthreaddef.h: New file.
10212         * sysdeps/i386/pthreaddef.h (gettid): Removed.
10214         * sysdeps/x86_64/pthread_spin_init.c: New file.
10215         * sysdeps/x86_64/pthread_spin_lock.c: New file.
10216         * sysdeps/x86_64/pthread_spin_trylock.c: New file.
10217         * sysdeps/x86_64/pthread_spin_unlock.c: New file.
10219         * sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
10220         Add missing lock prefix.  Minute optimization.
10222         * tst-spin2.c (main): Also check successful trylock call.
10224         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
10225         syscall.  Fix typo in case INTERNAL_SYSCALL is not used.
10227         * sysdeps/i386/pthread_spin_destroy.c: Moved to...
10228         * sysdeps/pthread/pthread_spin_destroy.c: ...here.  New file.
10230         * sysdeps/i386/pthread_sigmask.c: Removed.  Use the generic code.
10231         * sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
10232         value in case of an error.  Add support for INTERNAL_SYSCALL.
10234         * sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
10235         value in case of an error.
10237         * sysdeps/x86_64/tls.h: New file.
10239 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10241         * sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface.  It now
10242         takes the array member name and the index as parameters.
10243         (THREAD_SETMEM_NC): Likewise.
10244         * pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
10245         * pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
10246         interfaces.
10248         * sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
10249         to decide which code to use.
10250         (THREAD_SETMEM_NC): Likewise.
10252         * allocatestack.c (queue_stack): Don't remove stack from list here.
10253         Do it in the caller.  Correct condition to prematurely terminate
10254         loop to free stacks.
10255         (__deallocate_stack): Remove stack from list here.
10257 2002-11-26  Ulrich Drepper  <drepper@redhat.com>
10259         * Makefile (tests): Add tst-stack1.
10260         * tst-stack1.c: New file.
10262         * allocatestack.c (allocate_stack): Initialize the TCB on a user
10263         provided stack.
10265         * pthread_attr_getstack.c: Return bottom of the thread area.
10267 2002-11-25  Ulrich Drepper  <drepper@redhat.com>
10269         * Makefile (libpthread-routines): Add pt-allocrtsig and
10270         pthread_kill_other_threads.
10271         * pt-allocrtsig.c: New file.
10272         * pthread_kill_other_threads.c: New file.
10273         * sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
10274         all three functions.
10275         * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
10276         allocrtsig.
10277         * sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
10278         __libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
10279         and __libc_allocate_rtsig_private.
10280         * Versions (libpthread): Export pthread_kill_other_threads_np,
10281         __libc_current_sigrtmin, and __libc_current_sigrtmax.
10283 2002-11-24  Ulrich Drepper  <drepper@redhat.com>
10285         * allocatestack.c (allocate_stack): stackaddr in attribute points to
10286         the end of the stack.  Adjust computations.
10287         When mprotect call fails dequeue stack and free it.
10288         * pthread_attr_setstack.c: Store top of the stack in stackaddr
10289         attribute.
10290         * pthread_getattr_np.c: Likewise.
10292         * descr.h (IS_DETACHED): Add some more parenthesis to prevent
10293         surprises.
10295 2002-11-23  Ulrich Drepper  <drepper@redhat.com>
10297         * sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
10298         attribute definitions.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10300 2002-11-22  Ulrich Drepper  <drepper@redhat.com>
10302         * pthread_getspecific.c: Optimize access to first 2nd-level array.
10303         * pthread_setspecific.c: Likewise.
10305 2002-11-21  Ulrich Drepper  <drepper@redhat.com>
10307         * sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
10308         definitions.  Get them from the official place.
10309         * sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
10311         * sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
10312         Use new CLONE_ flags in clone() calls.
10314         * sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
10315         * sysdeps/unix/sysv/linux/i386/fork.c: New file.
10317         * Versions: Add pthread_* functions for libc.
10318         * forward.c: New file.
10320         * sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
10321         errno-loc.
10322         * herrno.c: New file.
10323         * res.c: New file.
10325         * Makefile (libpthread-routines): Remove sem_post, sem_wait,
10326         sem_trywait, and sem_timedwait.  Add herrno and res.
10327         * sem_init.c: Don't initialize lock and waiters members.
10328         * sem_open.c: Likewise.
10329         * sem_post.c: Removed.
10330         * sem_wait.c: Removed.
10331         * sem_trywait.c: Removed.
10332         * sem_timedwait.c: Removed.
10333         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
10334         Includes full implementations of sem_post, sem_wait, sem_trywait,
10335         and sem_timedwait.
10336         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
10337         for new implementation.
10338         * sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
10339         and waiters fields.
10341         * tst-sem3.c: Improve error message.
10342         * tst-signal3.c: Likewise.
10344         * init.c (__pthread_initialize_minimal): Use set_tid_address syscall
10345         to tell the kernel about the termination futex and to initialize tid
10346         member.  Don't initialize main_thread.
10347         * descr.h (struct pthread): Remove main_thread member.
10348         * cancelllation.c (__do_cancel): Remove code handling main thread.
10349         The main thread is not special anymore.
10351         * allocatestack.c (__reclaim_stacks): Mark stacks as unused.  Add
10352         size of the stacks to stack_cache_actsize.
10354         * pt-readv.c: Add missing "defined".
10355         * pt-sigwait.c: Likewise.
10356         * pt-writev.c: Likewise.
10358 2002-11-09  Ulrich Drepper  <drepper@redhat.com>
10360         * Versions: Export __connect from libpthread.
10361         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10363         * Makefile (libpthread-routines): Add pt-raise.
10364         * sysdeps/unix/sysv/linux/raise.c: New file.
10365         * sysdeps/unix/sysv/linux/pt-raise.c: New file.
10366         * sysdeps/generic/pt-raise.c: New file.
10368         * pthread_cond_init.c: Initialize all data elements of the condvar
10369         structure.  Patch by Luca Barbieri <ldb@ldb.ods.org>.
10371         * pthread_attr_init.c: Actually implement 2.0 compatibility version.
10372         * pthread_create.c: Likewise.
10374         * Makefile (tests): Add tst-key1, tst-key2, tst-key3.
10375         * tst-key1.c: New file.
10376         * tst-key2.c: New file.
10377         * tst-key3.c: New file.
10379         * Versions: Export pthread_detach for version GLIBC_2.0.
10380         Reported by Saurabh Desai <sdesai@austin.ibm.com>.
10382 2002-11-08  Ulrich Drepper  <drepper@redhat.com>
10384         * pthread_key_create.c: Terminate search after an unused key was found.
10385         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10387         * sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
10388         Patch by Luca Barbieri <ldb@ldb.ods.org>.
10390 2002-10-10  Ulrich Drepper  <drepper@redhat.com>
10392         * sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
10393         dynamic lookup for errno in PIC.
10395         * allocatestack.c (get_cached_stack): Rearrange code slightly to
10396         release the stack lock as soon as possible.
10397         Call _dl_allocate_tls_init for TCB from the cache to re-initialize
10398         the static TLS block.
10399         (allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
10401         * cancellation.c: Renamed from cancelation.c.
10402         * Makefile: Adjust accordingly.
10403         * pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
10404         * cleanup_defer.c: Use CANCELLATION_P.
10405         * pthread_testcancel.c: Likewise.
10406         * descr.h: Fix spelling in comments.
10407         * init.c: Likewise.
10408         * pthread_getattr_np.c: Likewise.
10409         * pthread_getschedparam.c: Likewise.
10410         * pthread_setschedparam.c: Likewise.
10411         * Versions: Likewise.
10413         * pt-pselect.c: New file.
10414         * Makefile (libpthread-routines): Add pt-pselect.
10415         * Versions: Add pselect.
10417         * tst-cancel4.c: New file.
10418         * Makefile (tests): Add tst-cancel4.
10420 2002-10-09  Ulrich Drepper  <drepper@redhat.com>
10422         * pthread_mutex_lock.c: Always record lock ownership.
10423         * pthread_mutex_timedlock.c: Likewise.
10424         * pthread_mutex_trylock.c: Likewise.
10426         * pt-readv.c: New file.
10427         * pt-writev.c: New file.
10428         * pt-creat.c: New file.
10429         * pt-msgrcv.c: New file.
10430         * pt-msgsnd.c: New file.
10431         * pt-poll.c: New file.
10432         * pt-select.c: New file.
10433         * pt-sigpause.c: New file.
10434         * pt-sigsuspend.c: New file.
10435         * pt-sigwait.c: New file.
10436         * pt-sigwaitinfo.c: New file.
10437         * pt-waitid.c: New file.
10438         * Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
10439         pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
10440         pt-sigwait, pt-sigwaitinfo, and pt-waitid.
10441         * Versions: Add all the new functions.
10443         * tst-exit1.c: New file.
10444         * Makefile (tests): Add tst-exit1.
10446         * sem_timedwait.c: Minor optimization for more optimal fastpath.
10448 2002-10-08  Ulrich Drepper  <drepper@redhat.com>
10450         * pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
10452         * pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
10453         call.  pthread_join is an official cancellation point.
10454         * pthread_timedjoin.c: Likewise.
10456         * pthread_cond_wait.c: Revert order in which internal lock are dropped
10457         and the condvar's mutex are retrieved.
10458         * pthread_cond_timedwait.c: Likewise.
10459         Reported by dice@saros.East.Sun.COM.
10461 2002-10-07  Ulrich Drepper  <drepper@redhat.com>
10463         * pthreadP.h: Cut out all type definitions and move them...
10464         * sysdeps/unix/sysv/linux/internaltypes.h: ...here.  New file.
10465         * pthreadP.h: Include <internaltypes.h>.
10467         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
10468         performance tweaks.
10470         * sem_trywait.c: Shuffle #includes around to get right order.
10471         * sem_timedwait.c: Likewise.
10472         * sem_post.c: Likewise.
10473         * sem_wait.c: Likewise.
10475         * nptl 0.3 released.
10477         * Makefile (tests): Add tst-signal3.
10478         * tst-signal3.c: New file.
10480 2002-10-05  Ulrich Drepper  <drepper@redhat.com>
10482         * sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
10483         the asms modify the sem object.
10484         (__lll_sem_timedwait): Now takes struct sem* as first parameter.
10486         * sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
10487         the actual members.
10488         * pthreadP.h (struct sem): New type.  Actual semaphore type.
10489         * semaphoreP.h: Include pthreadP.h.
10490         * sem_getvalue.c: Adjust to sem_t change.
10491         * sem_init.c: Likewise.
10492         * sem_open.c: Likewise.
10493         * sem_post.c: Likewise.
10494         * sem_timedwait.c: Likewise.
10495         * sem_trywait.c: Likewise.
10496         * sem_wait.c: Likewise.
10498 2002-10-04  Ulrich Drepper  <drepper@redhat.com>
10500         * Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
10501         * tst-basic2.c: New file.
10502         * tst-exec1.c: New file.
10503         * tst-exec2.c: New file.
10504         * tst-exec3.c: New file.
10506         * tst-fork1.c: Remove extra */.
10508         * nptl 0.2 released.  The API for IA-32 is complete.